I am trying to load a custom dataseries with a series of 'Close' values but when I debug it the values do not appear to have been loaded. I have a couple of questions about this.
Firstly: is it ok to specify which bar's data you want to load into the series?
By this I mean can I ask it to load the series like this:
myDataSeries.Set(Closes[2][1])
having set
'private DataSeries myDataSeries;' in vars
and
in Initialize:
'myDataSeries = new DataSeries(this);'
( where BarsArray[2] = 60min bars, strategy running on a 1min chart )
In the help guide for NT7 it gives an example as:
myDataSeries.Set(High - Low); ie without specifying which bars the High/Low data will be taken from (from CurrentBar always therefore).
whereas in the NT6 help guide it gave this example:
myDataSeries.Set(High[0] - Low[0]);
Per my own attempt above I would like to load the previous bar's value ([2][1]) in the current bar of my series, due to the fact that I am running it in realtime and using 'FirstTickOfBar' to perform actions on the open of the next bar, thus requiring that my data comes from the prior bar ([1]).
The second related point I would like to clarify is whether I have to use the 'myDataSeries.Set' in OnBarUpdate when BarsInProgress = 0?
I am currently trying to update the series via .Set when BiP=2 (ie on 60min events).
Is it ok to load via '.Set' when BiP=2? Or would that affect the way the data loads to the series? many thanks
Comment