I have a couple questions about the high() function...
I'm wanting to backtest a breakout futures trading strategy against 2 daily charts simultaneously.
For instance, I want to go long when the closing price exceeds the high of the previous bar for *both* ZSN9 and QBSN9.
I'm guessing the condition would be:
close() >= math.max( high(-1, sym("ZSN9,D")), high(-1, sym("QBSN9,D")))
1) Would this work?
2) Is there a way to code this for 2 unspecified charts, so I can just select 2 charts and backtest, rather than having to rewrite the strategy for each specific pair of symbols?
I'm wanting to backtest a breakout futures trading strategy against 2 daily charts simultaneously.
For instance, I want to go long when the closing price exceeds the high of the previous bar for *both* ZSN9 and QBSN9.
I'm guessing the condition would be:
close() >= math.max( high(-1, sym("ZSN9,D")), high(-1, sym("QBSN9,D")))
1) Would this work?
2) Is there a way to code this for 2 unspecified charts, so I can just select 2 charts and backtest, rather than having to rewrite the strategy for each specific pair of symbols?
Comment