Predict Method

Top  Previous  Next

Syntax:

 

value=object.Predict(numrows, inarray, outarray, [pricearray])

 

Part

Description

value

A variant type variable in the user program which receives the value returned after Predict executes. The return value is always zero.

object

The name of an object (or object expression) that evaluates to an object of ChaosHunter_Runtime.DLL class.

numrows

Number of rows of data in the input array.

inarray

A two-dimensional double-precision (8-byte) or variant array of input data. Dimensions are: inarray(1..numrows, 1..NumInputs).

outarray

A two-dimensional double-precision (8-byte) or variant array which will take model predictions. Dimensions are: outarray(1..numrows, 1..3).

pricearray

An optional one-dimensional double-precision (8-byte) or variant array of price data. Dimensions are: pricearray(1..numrows).

 

Fires the model with supplied input data and places formula outcomes into the output array.

 

Note 1.

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.

 

Note 2.

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

 

Note 3.

Trading signals are issued on the bar where:

formula output >= buy threshold, or

formula output < sell threshold

 

Note 4.

Trading signals persist from the bar where they are issued until the bar where another trading signal is generated.

 

Note 5.

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.

 

Note 6.

You can regulate how missing input data are treated by the Predict method. Please see the SkipMissingInputData property for more details.