|Top Previous Next|
value=object.Predict(numrows, inarray, outarray, [pricearray])
Fires the model with supplied input data and places formula outcomes into the output array.
If loaded model is not a trading strategy, only column #1 of the output array is used and filled with formula predictions. In this situation the output array can be dimensioned as outarray(1..numrows, 1..1) to minimize memory usage.
If loaded model is a trading strategy, column #1 of the output array receives formula predictions, column #2 - trading signals, and column #3 - system equity curve (if the optional price array is supplied). If price array is not supplied when calling the Predict method, the system equity is not calculated.
Trading signals have the following interpretation:
1: long entry from neutral position OR reverse from short to long position if true reversal
-1: short entry from neutral position OR reverse from long to short position if true reversal
Trading signals are issued on the bar where:
formula output >= buy threshold, or
formula output < sell threshold
Trading signals persist from the bar where they are issued until the bar where another trading signal is generated.
If formula cannot be calculated for a given row, its output (column #1 in the output array) is marked with a MissingValue constant. This may happen on initial rows if the model is a trading strategy with technical indicators that require a certain number of rows to start calculating. For example, if the formula contains a MovAvg(Close,5) indicator, first 5 rows will produce MissingValue output because the Moving Average indicator cannot be calculated.
You can regulate how missing input data are treated by the Predict method. Please see the SkipMissingInputData property for more details.