IG Demo …Not to go too far down the array rabbit hole, the
‘defined or access an invalid index in an array’
error, does stop the proOrder algo if:
- An array is accessed and the array has not been defined.
- An array is defined but the array element is not defined.
The meaning of ‘define’ I think refers to, NO actual code, defining the array[element] = something, or, the defining definition is within a logic block that has not been executed before using.
Those appears to be different to, defining the array and, UNdefining the element, array[element] = UNDEFINED, which appears allowed.
The latter doesn’t appear to stop the algo even if it is accessed and used in a logic path, since UNDEFINED is probably taken as FALSE possibly.
In a calculation, it may be a different story, making the result n/a, and depending on where its used, maybe gives erroneous data and/or throws a different error.
Additionally, if a call’ed file RETURNS a not-defined array/element then you get the same error message.
Sending and/or/then RETURN’ing a UNDEFINED variable or array element from a called file gives the error:
‘server.strategy.probacktest.error.missing_data.call’
Also it appears that the array index works when zero.
Further, I couldn’t trigger an error for a FOR/LOOP or ARRAY INDEX being too big.
Maybe that’s a breeding ground for some bugs, I wonder what’s happening there!
Not yet seen any other array error’s, but not been deep down rabbit hole with complex code example, I keep #Peter’s advisory’s/warnings always in mind though.
#Vivien can you verify that array(s) ARE used in the Indicator, did early version come out before array’s in v11.
I also noticed that the contract size could be an issue in proOrder, re: your modification, but it didn’t get that far.
Still early days but Indicator and back-test work ok, had a good indication on DAX 15m today, reach 2nd target within 1 stop.
Only other thing that bugged me was with the y-axis auto scale, having to resize because some variables initially at zero or low values.
Not so bad when setup, but never fun.
Its a pity that it won’t run with proOrder, I second Peter suggestion to change that if possible.
Regards All