The indicator in question is a simple one...EMA(20)..... that plots "barsinprogress" and draws a 5 min EMA on a 1 min chart...
(see attached 1min chart grab NinjaChart ....)
It works very well on Ninja charts and plots a line on the 1 min that is almost exactly tick for tick the same as the EMA(20) plotted on a 5min chart.
However...when I add this same indicator to a Strategy, it plots "weird".
(see attached 1min Strategy chart grab Ninja Strat)
The short 'pink lines' on the Strategy chart were drawn by me to show where the same indicator plotted values on a standard 1 min Ninja chart.....but the plotted values on the Strategy Analyzer 1 min chart are way off.
- Both use the same instrument and the same Default 24/7 session
- Both use 1 min....
- Both use the same Instrument and day range.
- Price action matches EXACTLY between both charts.
I can't figure out what is going wrong....it almost looks like the Strategy Analyzer shuts off calculations from 14:00 until 7:20in the morning... (see chart grab zNinjaStrat2)
but the Strategy is using Default 24/7....
Strategy Code is basic.... {
#region Variables
private int myInput0 = 1; // Default setting for MyInput0
#endregion
//**********************************************
protected override void Initialize()
{
Add(xcEMA15(20));
CalculateOnBarClose = true;
}
//*****************************************
protected override void OnBarUpdate()
{
// do nothing....
myInput0 = 2;
}
#region Properties
[Description("")]
[GridCategory("Parameters")]
public int MyInput0
{
get { return myInput0; }
set { myInput0 = Math.Max(1, value); }
}
#endregion
}

Comment