1) I have a strategy that calls one indicator that has two different time frames. Within the indicator, I "return" if "CurrentBars[0] < BarsRequired || Current[1] < BarsRequired." When using the backtest on strategy analyzer there is a field called "minimum bars required." Does this number only ensure the minimum bars required for the default/main timeframe? So for instance, if I am using 1-second intervals but my second timeframe is 1-hour, but I am calling the function to compute the 50-period simple moving average for the 1-hour bars, do I need to enter 50 for the minimum bars required or 50 * 60 * 60 = 180000 (so that 180,000 seconds would be 50 hours)?
I know this has been asked before (for instance, see http://www.ninjatrader.com/support/f...ad.php?t=62161, but the answer was not clear to me).
2) If I pick the dates to run the backtest on Strategy Analyzer in the time frame subsection, will the only bars that load come from within this time frame? For instance, if I am testing from 1/1/2014 to 1/10/2014 but my strategy needs to compute the 50 1-hour-period simple moving average, will any trades/computation done on 1/1/2014 not be accurate because it will not load 50 hours prior to 1/1/2014? So if I wanted to do an accurate test on 1/1/2014, would I have to push back the start date to sometime in December to ensure that it's calculating the 50 1-hour-period correctly starting for 1/1/2014?
3) How come when I change the minimum bars required this DRASTICALLY changes the results? I understand if I am not loading enough bars, but I thought that adding the "if(CurrentBars[0]< BarsRequired..." statement in my indicator would catch this, so it wouldn't matter. Even from 50 to 51 bars required the results from the back test are extremely different. Moreover, after some point (like 60 bars), I end up getting no trades, whereas 59 bars will show me trades. I use kinetick for my data feed. Also, when I changed the 1-hour data to 1-day data, all of a sudden the only way backtesting would work is if I put a minimum of 1 bar required. I don't believe I am going outside of the 120 days of backtesting data with Kinetick.
By the way, I have tested my strategy in market analyzer, and it seems to work. When the backtesting results give me trades (when I use 59 instead of 60 minimum required bars), I don't see any false-positives, so the code seems to be working.
Comment