Regarding the original error message, and just for future reference, I think this is what’s happening.
In a INDICATOR, if you just return a variable like, a[1], via the return line, you get the ‘Variable is Undefined’ error message.
Alternatively, if in the main code you have a=a[1], and Return a, the code will run, but the line for ‘a’ doesn’t display in the chart.
I believe this is because, on the first bar, Barindex = 0, the value of a[1] is undefined still, so there’s no value to display from the bar before bar zero.
This means that the equation evaluates to undefined, and maybe on the following bars the prior value is always undefined because of the prior attempted calculation.
In back-test, the a=a[1] does the same, the code runs, however, if you graph ‘a’, again no line is drawn for the variable, because it’s undefined, similar to above.
One way to check if variables are defined in the back-test code is to Graph them and look if their line displays/appears.
It’s worth noting that, if you don’t assign a value/variable to a variable, then you get the red ‘~’ line in the editor and the ‘Unknown Command’ error message if you try to ‘ADD’.
But you don’t get it is you assign a variable with a undefined variable, like here to the bar before zero.
Now in ProOrder, apart from only a couple of options, there’s no user/ext interaction with the strategy, any error will ‘Stop’ the strategy.
However, since the code is only run once a bar, it’s not until the end of the bar the strategy was started on, the Strategy is ‘Stopped’.
On small timeframes, that would be quite quick, but on long timeframe it will be slow, both could get impression that they worked for a while, before they don’t.
In fact the the strategy is not tried till the start next new bar.
In this case, the above called indicator must have return an undefined value, which triggered the strategy to STOP.
So the ‘ server.strategy.probacktest.error.missing_data.call’ must mean, an undefined value was returned from the call’ed file.
If this undefined variable scenario happens with out a call file, you get the error message,
‘The Trading system was stopped because the historical data loaded was insufficient to
calculate at least one indicator during the evaluation of the last candlestick.’
Leading you to a problem with PRELOADBARS.
If you cannot retrieve a value from before bar zero, no amount of PLB’s will cure problem.
The simple explanation is just a undefined variable, trying to retrieve a value from the previous bar to bar zero.
In the original TV code, the variables were parameters of the called ‘nv()’ function.
This function defaulted the variable to zero, I believe, if it was undefined or NAN, this zero value allowed the equation to derive a proper result value.
In proOrder, you get a ‘Stopped’ system, and the usual cryptic message, unless your lucky.
Regards all
Nicolas, Can you explain the numerator logic – e.g. Line 35 is (sTR[1] – sTR[1]) which would appear to be either null or zero.