I come from the land of Tradestation (I know YUCK!), and I'm used to all variables that you declare automatically being declared for you as having series history.
Am I correct in assuming that the DataSeries object is just an ever-expanding array of a data series so that you can reference any (double) calculation historically?
TS:
var: myDouble(0);
myDouble = High - Low;
NinjaTrader:
//does not change with bar history--- not an array
double myDouble = 0;
//changes with series history so you can reference a calc historically?
DataSeries myDataSeries;
protected override void Intialize()
{
myDataSeries = new DataSeries(this)
}
protected override void OnBarUpdate()
{
myDataSeries.Set(High[0] - Low[0]);
if (myDataSeries[5] > 2.0) //CAN REFERENCE HISTORICALLY NOW!
{
//do something
}
}
In the above example and in the user guide it says I can reference the myDataSeries DataSeries object with the [] brackets. However, the user guide says something about Value and Values properties / collections. When and/or how would I use those in code?
Thank you!
Comment