Closed robin2008 closed 8 months ago
Hi @robin2008,
This is the intended behavior. By default, you should compute indicators on the same data that you execute with your strategy.
If you want to compute indicators on unfiltered data, then you can omit the between_time
filter and instead filter using ctx.dt in your execution function.
@edtechre
Thanks for the information, good to know it's intended behavior.
The
backtest
method supportsbetween_time
anddays
to filter dataAnd when
walkforward
, then data sources seems to be filtered first and then computing indicators: https://github.com/edtechre/pybroker/blob/6b659b555edaf6f2c1f195a5b19fe3c62eb9555f/src/pybroker/strategy.py#L1204-L1222It means that the indicator calculation is based on the filtered discrete BAR data, although this could reduce the caculation, but I guess this is not an expected behavior as most of the indicators are senstive to the continuity of time series data.