It looks like my Print lines in the output window during backtesting don't match my chart values for the same indicator. The configuration for the backtest/chart is ^Tick 1 min on 7/29/2011. In the strat, I'm printing the values of EMA(320) and in the chart I'm showing the line for EMA(320) in panel 2.
The strat excerpt showing the Print statements is:
protected override void OnStartUp() { slowTickMA = EMA(320); } #endregion #region Events /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate () { if (CurrentBar < 20) return; //1 minute Tick if (BarsInProgress == 0) { currentBarDateTime = Time [0].ToString ("yyyy-MM-dd HH:mm:ss"); Print ( currentBarDateTime + " slowTickMA[0]: " + slowTickMA[0] ); } }
2011-07-29 06:51:00 slowTickMA[0]: -547.097103583402
When I show the data box for the chart on 7/29/2011 6:51am, the value for the EMA is: -150.
I've attached:
1. Document with screenshots of the backtest setup and chart setup/output
2. Code for sample strat
3. 1 minute data files for 7/28, 7/29 for that I assume the backtest and chart are using
4. File showing the lines printed by the strat during the backtest from output window
Can you tell me why there's a difference?
Thanks!
Comment