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

Function 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. Phantom trading is automatically activated for the current algo/asset component when its short-term filtered equity curve is below its long-term equity curve, and both are falling.

Parameters:

Dir 1 for long trades, -1 for short trades, 0 for both.
FastPeriod Lowpass period for filtering the equity curve.
SlowPeriod Lowpass period for further filtering the fast-term filtered equity curve.

Returns

3 when phantom trading is active for the current component, 2 when it was just activated, 1 when it was just deativated, otherwise 0.

Remarks:

Example:

switch(phantom(0,5,10)) { // short and long phantom trading
  case 2: printf("#\n%s %s phantom trading activated",Asset,Algo);
  case 1: printf("#\n%s %s phantom trading deactivated",Asset,Algo);
}

See also:

predict, Phantom Trading, TR_PHANTOM

► latest version online