View Full Version : how to let strategy calculate again on a new day in back test?
leontancfa
07-29-2009, 05:44 PM
file:///C:/Users/b/AppData/Local/Temp/moz-screenshot.jpgHi. I am trying to backtest the sample moving average system. as in the picture, the moving avgs cross because the bars on the left and the right are on different days. How can I set up so that the backtest doesn't enter trades based on different day's data?
Baruch
07-30-2009, 03:03 AM
You can restrict the first entry from certain hour, you can make a 24H session and more. Some methods require programming. I don't know what is your MA's lengths and what time frame you have, but for example if you have 80 period MA and 5Min chart and you want the MA to relay on the current day price, you will have only one last bar to count on. (Each pit session has 81 bars and 80 period MA needs 80 bars!).
Baruch
NinjaTrader_Bertrand
07-30-2009, 05:25 AM
Please check into this sample for a time filter to limit the trading hours of your strategy - http://www.ninjatrader-support2.com/vb/showthread.php?t=3226
The same could be done in the Strategy Wizard -
http://www.ninjatrader-support.com/HelpGuideV6/ConditionBuilder-TimeComparisons.html