Im having an issue with live testing a system that uses multiple timeframes. The system trades using m1 bars. However, I use a filter based on daily bars that has a lookback period of 100 bars. The trouble seems to be that even when I use
1
DEFPARAMPreloadBars=10000
the system trades when it shouldn’t. This is evident from the fact that the backtest did not enter a trade today when I have 200,000 bars loaded. However if I adjust the number of bars in the chart it modifies my daily filter indicator.
Does any one know how to resolve this issue and ensure that system has sufficient historical data to run the appropriate lookback on the daily timeframe.
I can’t post the whole strategy sadly as I plan on trading this live once ive ironed out this glitch. Its essentially a intraday swing system. I use the below regime filter to only trade on days when SQN is above and below a certain level. Trades are on m1 timeframe but the filter references daily bars.
1
2
3
4
5
6
7
8
9
sqnLB=100
// Regime Filer
timeframe(daily,updateonclose)
cldiff=close/close[1]-1
sdcldiff=STD[sqnLB](cldiff)
avcldiff=Average[sqnLB](cldiff)
SQN=((avcldiff*sqrt(100))/sdcldiff)
timeframe(default)
The weird thing is that this indicator changes when I change the number of bars in the chart and graphonprice in the strategy backtest. This suggests that the PreloadBars=10000 isn’t fixing the max number bars passed to the function.