This should be a very simple question to answer, but I need to confirm it in order to continue a debugging of my script's logic.
I need to create a simple one-dimension array that keeps its values by its own index, totally independent of the instrument bars-object dataseries index, I mean, regardless changes in the instrument data, I want that my array keeps its values according to its own index.
I'm not sure yet, but I think, some how, the instrument dataseries index changes affect the independent array values.
So, if the instrument dataseries index doesn't affect a single array, should this work?
#region Variables
double[] vv = new double[initial];
#endregion
protected override void OnStartUp()
{
vv = new double[initial+variation];
}
protected override void OnBarUpdate()
{
// use array, for example this loop
for (int i = 1; i <= max; i++)
{
vv[i]=Close[i-1];
}
}
So my question is: Will that loop work properly assigning those values to the array and keeping them ?

Comment