phantom (int Dir, int FastPeriod, int SlowPeriod) : int

Indicator for 'equity curve trading'. Detects from the equity curve if the market is in an unprofitable state and trading with the current asset/algo combination is not advised. Can be used to switch from live trading to phantom trading by setting the TR_PHANTOM flag.

Parameters:

Dir 1 for long trading, -1 for short trading, 0 for both.
FastPeriod Lowpass period for the short-term component equity curve.
SlowPeriod Lowpass period for the long-term component equity curve.

Returns

1 when the short-term component equity is falling and below its long-term curve, otherwise 0.

Remarks:

Example:

if(phantom(0,5,50)) setf(TradeMode,TR_PHANTOM);
else resf(TradeMode,TR_PHANTOM);

See also:

predict, Phantom Trading

► latest version online