pmorissette / ffn

ffn - a financial function library for Python
pmorissette.github.io/ffn
MIT License
2.03k stars 300 forks source link

Data frequency checking for _stats #62

Closed ViktorMalesevic closed 6 years ago

ViktorMalesevic commented 6 years ago

Hello,

Here is my proposition for checking that the data has the right frequency before calculating the corresponding stats. For example, if the minimal difference between two consecutive points is less or equal than 1 day (or strictly less than 2 days) this avoids to get misleading daily statistics. Same for monthly and yearly figures being calculated only if the minimal difference between two consecutive points is 32 days and 367 days respectively.

JordanPlatts commented 6 years ago

I like this a lot. Thanks for contributing.