[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ENIGMA (no more :-)



PureBytes Links

Trading Reference Links

Since I don't speak english very well, I will try to explain my point of view, regarding OddBall, in a brief and concise manner.

First of all, if you look at the first 30 minutes of trading activity, you'll see that there is an inertia in the Advancing Issues (or Declining Issues) data. A phenomenon that resemble the transitory phase in a RC circuit (when you close the switch). There are two reason for this, IMHO:

1) (pretty obvious) the ADV data are resetted every new day to zero;
2) if you look at the Total # of Issues (quote.com: ACTV.NY) data, you'll see better this phenomenon, and since the ACTV = ADV + DECL + UNCH we can suppose the same "hidden trend" in the components (ADV e DECL).

We can speculate that the "transitory effect" is equal in the ADV and DECL data, so we can model the ADV (and DECL) data in this way:

ADV(t) = K * (1 - exp(-t/C)) + Signal(t)
DECL(t) = K * (1 - exp(-t/C)) - Signal(t)    (minus Signal because in the DECL data the "signal" is specular)

Signal(t) is what we are looking for: a timeseries not affected from the transitory phase.

Taking the difference we have the Net Advancing Issues (ADVDEC.NY in quote.com):

ADVDEC = K * (1 - exp(-t/C)) + Signal(t) - (K * (1 - exp(-t/C)) - Signal(t)) = 2 * Signal(t)

We have removed the "transitory phase", and the constant (2) is not a problem.
You can create a new time series diving the ADVDEC data by 2, for example, but all in all is not a matter of corcern: we are interested in the shape of the curve, not in the absolute values.

The next thing the ADVDEC badly need is a smooth. A low lag smooth, since we are looking for a system that catch top and bottom, not a trend following one.
Looking at the publicly available works from John Ehlers (www.mesasoftware.com/pub), I have found an Optimal Elliptic Filter. 
A minimal smooth but with approx. only 1-bar lag:

SmoothSignal = 0.13785 * (2*Signal    - Signal[1])  +
                         0.00070 * (2*Signal[1] - Signal[2]) + 
                         0.13785 * (2*Signal[2] - Signal[3]) + 
                         (1.2103 * SmoothSignal[1] - 0.4867 * SmoothSignal[2]);


But now we have a new "problem": using the ADVDEC (smoothed or not) data you have to discard the RateOfChange, since the output diverge when the data approach the zero:

                                        X - X[L]
RateOfChange(X, L) =     ---------
                                              X

So instead you can use the Momentum(X, L) alone:


Momentum(X, L) = X - X[L]


Generally speaking, I don't like "momentum" functions, since they do the inverse job of a smooth.

An integration (what an XAverage for example do) smooth the data, and derivative (a.k.a. "momentum") do the opposite, making the data more noisy ===> more "whipsaw".

I have found that using the filtered ADVDEC against a "zero line" can do a pretty good job, without making the things:

- more confused (read noisy) trying to anticipate the signals (with a momentum function) or 
- more curve-fitted adding other parameters (for example a range (a,b) like in OddBall).

This is the ELA code:

{*********************************************************************************
Description:   ENIGMA TRADING SYSTEM

     - Data1: the SP500 (or the NYSE); 
     - Data2: the Net Advancing Issues of the NYSE;

Data compression: - Data1: 60 min.
                             - Data2: 60 min.
Developed By:     
Cristian Stremiz
ITALY
e-mail: cristianDOTstremizATtinDOTit

*********************************************************************************}

Inputs: Signal(Close of Data2);

Vars: SmoothSignal(0);

SmoothSignal = 0.13785 * (2*Signal    - Signal[1])  +
                         0.00070 * (2*Signal[1] - Signal[2]) + 
                         0.13785 * (2*Signal[2] - Signal[3]) + 
                         (1.2103 * SmoothSignal[1] - 0.4867 * SmoothSignal[2]);

If SmoothSignal > 0 then Buy else Sell;

{********************************************************************************}

I tested the system with 60 min. bars, and the timeseries setted in order to have the Close data of the bars only at:
10:00 - 11:00 - 12:00 - 13:00 - 14:00 - 15:00 - 16:00

{----------------------------------------------------------------------}

TradeStation Strategy Performance Report - ENIGMA SPXX_30.CSV-60 min. (30/11/1998-17/01/2002)

Performance Summary:  All Trades

Total Net Profit    $433.725,00    
Open position P/L    $1.310,00
Gross Profit        $1.065.050,00    
Gross Loss    ($631.325,00)

Total # of trades    463    
Percent profitable    51,62%
Number winning trades    239    
Number losing trades    224

Largest winning trade    $22.407,50
Largest losing trade    ($14.172,50)
Average winning trade    $4.456,28
Average losing trade    ($2.818,42)
Ratio avg win/avg loss    1,58
Avg trade (win & loss)    $936,77

Max consec. Winners    8
Max consec. losers    7
Avg # bars in winners    16
Avg # bars in losers    8

Max intraday drawdown    ($71.777,50)
Profit Factor    1,69
Max # contracts held    1
Account size required    $71.777,50
Return on account    604,26%


Trading period   
     Years   3,13
     Months   37,62
     Weeks   163,00
     Days   1.144,12

Time in the market  1.144
Percent in the market  99,99%
Longest flat period  0,00
   
Avg. time in trades  2,47
Avg. time between trades 0,00
   
Avg. time in winning trades 3,25
Avg. time between winning trades 1,55
   
Avg. time in losing trades 1,64
Avg. time between losing trades 3,40

{----------------------------------------------------------------------}

If you look at the ENIGMA equity curve, you'll find that is "better" than the ODDBALL one, expecially in 1999 where ENIGMA perform much better. 

Beside this, I would like to express my gratitude to Mark for this great mailing-list and for OddBall, a marvelous gift for all of us!

Best regards, 
                  Cristian