Maybe somebody who develops indicators knows how to fix it?
My code for EMAclose based on Range is:
protected override void Initialize()
{
Add(new Plot(Color.Green, PlotStyle.Line, "Plot0"));
Add(PeriodType.Range, range);
Overlay = true;
PriceTypeSupported = true;
//AutoScale = false;
BarsRequired = 20;
}
protected override void OnBarUpdate()
{
Value.Set(CurrentBar == 0 ? Input[0] : Input[0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
if(CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired)
return;
Plot0.Set(Closes[1][0]);
}
Comment