0

I have a strategy that calculates entry/exit criteria based on Daily timeframe, but I use 15min timeframe to actually trade against those daily values. It works fine, EXCEPT when I try to go farther back in time to backtest than the current 15min chart will show.

As a simple example, is there a way in Pinescript to:

  • Calculate EMA 20 cross above EMA 200 on a DAILY timeframe
  • Backtest trades that on a 15min timeframe go long when this occurs or short during the opposite.
  • I can make that work, but I cannot for example go back to Jan 1, 2014 to June 1, 2014 15-min historical data and backtest the same criteria as Tradingview just resets the timeframe to Weekly to be able to show that far back.

Any ideas are greatly appreciated as I currently do things in excel and it takes a while per symbol.

Thanks

Geewhiz
  • 3
  • 2
  • It sounds like you need to find a data source for the 15 minute data. One thing you can do is generate the entry/exit points with the daily data, then run the backtest using the pre-generated signals, just line-up the timestamps. Overall though, this will only give you more insight into the equity curve, because the overall P/L is the same as just doing the whole thing on daily data since you are waiting for the daily close to take action on the signals. – Jared Marks Sep 16 '21 at 09:38
  • Please provide enough code so others can better understand or reproduce the problem. – Community Sep 22 '21 at 05:39

0 Answers0