I have been trying for hours to calculate and plot a simple indicator based on the concept of calculating the difference of the close value of the current and previous bar (i.e. Close[0] - Close[1]). After hours and hours I cannot get the following code to plot.
What I really want to do is the plot the formula which is commented but I cannot get even Close[3] to plot, anything in the past won't plot but Close[0] will. Everything compiles OK...
I must be doing something trivially wrong... please help me out! Thanks!
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
//Plot0.Set(VOL()[0] * (Close[0] - Close[1]));
if (CurrentBar < 1)
return;
double argum = Close[3];
DrawTextFixed("tag1", argum.ToString(), TextPosition.TopRight);
Plot0.Set(argum);
}
Comment