When I add a self developed indicator to a strategy, it displays on the Strategy Analyzer Chart Display correctly at the right edge of the chart. However, as I scroll back in time, the indicator reports incorrect values. I manually add a second copy of the indicator to the Strategy Analyzer Chart Display it displays correctly over the complete time-span of the chart visually. While the visual appears incorrect, if I debug into the code, the values returned in the strategy appear to be correct.
Please fine attached two screen captures illustrating this. The indicator in question is TradeSafe3UberTrend. The upper TradeSafe3UberTrend indicator is generated by the strategy and the lower TradeSafe3UberTrend indicator was manually added to the Strategy Analyzer Chart Display manually.
Why should these displays diverge over time?
Here is how I add the indicator to the chart in the OnStateChange handler:
else if (State == State.DataLoaded)
{
AddChartIndicator(Swing(PullbackHelper.PullBackSwi ngStrength));
AddChartIndicator(Stochastics(STOCHASTICSPERIODD, STOCHASTICSPERIODK, STOCHASTICSSMOOTHING));
AddChartIndicator(ema = EMA(21));
AddChartIndicator(uberTrend = TradeSafe3UberTrend());
}
Please Advise.
Comment