MCPcopy Create free account
hub / github.com/kernc/backtesting.py / _data_period

Function _data_period

backtesting/_util.py:75–78  ·  view source on GitHub ↗

Return data index period as pd.Timedelta

(index)

Source from the content-addressed store, hash-verified

73
74
75def _data_period(index) -> Union[pd.Timedelta, Number]:
76 """Return data index period as pd.Timedelta"""
77 values = pd.Series(index[-100:])
78 return values.diff().dropna().median()
79
80
81def _strategy_indicators(strategy):

Callers 3

_plot_superimposed_ohlcFunction · 0.90
_round_timedeltaFunction · 0.85
compute_statsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected