kernc / backtesting.py

:mag_right: :chart_with_upwards_trend: :snake: :moneybag: Backtest trading strategies in Python.
https://kernc.github.io/backtesting.py/
GNU Affero General Public License v3.0
5.06k stars 990 forks source link

Question - multi-timeframe example code, 15min bar crossover 1D bar #1031

Open kaustv-datta opened 11 months ago

kaustv-datta commented 11 months ago

Could I get a code snippet for the following case please?

My data 1 min candles (OHLCV).

My strategy Go Long: 15min candle close crosses over pervious day's high Go Short: 15min candle close crosses below pervious day's low

I want to know what the most efficient way would be to upsample from 1min to 15min and daily data and then generate signals based on two higher timeframes. I have seen the multi-timeframe example on the website, but it showed how to work with an indicator, but not ohlcv.

Thanks!