Closed alexander-gr closed 3 years ago
@alexander-gr Yes true. How could we improve that? Pandas has a function to infer the granularity of the data pd.infer_freq(data.index)
. Output would be "D"
. So we could do a bunch of conditions. If "D" then 365, if "H" then 365 * 24. But that only works if the entered time series has a datetime index...
Any better ideas?
Should we count the number of intervals for an year and use that? So take self.strategy_returns
and see how many data points per year it contains.
But in that case we might run into problems if we use less than a years worth of data for the backtest.
Backtest will be refactored soon. Closing the issue
365 days are hardcoded here and here