can you help me with the syntax of AddBar()
Suppose I want to develop an Indicator which is composed of 4 values, something like this.
--
x[0] = SMA(Close, 5)
y[0] = SMA(Close, 4)
Values[0][0] = (y[0] * 4 + Open[0])/5;
Values[1][0] = (y[0] * 4 + High[0])/5;
Values[2][0] = (y[0] * 4 + Low[0])/5;
Values[3][0] = x[0];
----
Now I want to plot a new Bar plot in a new panel, with Values[0] as the Open of the new plot, Values[1] as the High, Values[2] as the Low, Values[3] as the Close of the new bar plot.
The syntax of AddBar from NT 8's language reference is:
AddBar(Bars bars, double open, double high, double low, double close, DateTime time, long volume)
1. What do I write in the State == State.Defaults section (within OnStateChange()) ?
(a) do I define a blank panel in State == State.Defaults, and later add each new Bar in my OnBarUpdate() logic ?
(b) How would I call AddBar() in the OnBarUpdate() logic ?
I can write AddBar(Bar bars, Value[0], Value[1], Value[2], Value[3], DateTime time, 0) - but what should I replace for bars and time ?
Thanks
Comment