protected override void Initialize()
{
Add(new Plot(Color.Green, PlotStyle.Line, "AD"));
Add(new Plot(Color.YellowGreen, PlotStyle.Line, "AdMa"));
//dsAD = new DataSeries(this);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
double dBuff = 0;
int i=0;
AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] : 0));
for (i = 0; i < period; i++)
{
dBuff = dBuff + AD[i]; // ISSUE!!!!
}
AdMa.Set(0, dBuff);
}
public DataSeries AD
{
get { return Values[0]; }
}
public DataSeries AdMa
{
get { return Values[1]; }
}

Comment