Zweig Trading System Example

Discussion in 'Strategy Building' started by Hook N. Sinker, Sep 5, 2006.

  1. I recall about year 1980 Martin Zweig publishing a trend following system. I find this system interesting because it is independent of time and has no lag. I am writing the rules into computer code and testing the method. These are the rules that I remember Martin Zweig describing:

    1) If price rallys x % from an extreme low price then buy.

    2) If price reacts y % from an extreme high price then sell.

    I add rule # 3 to handle position sizing:

    3) Position size is z % of account equity / 10 times average true range. Position size may decrease to remain within cash limit.

    Short term traders might like this example because it tests well at x = 1 % entry, y = 1 % exit and z = 10 % risk. 1 % is likely not an optimum value. I chose 1 % on a whim.

    The system trades with 50 % skid. "Fifty percent skid" means that if I purchase at the opening of the next session the price that my order is filled is 50 % between the opening price and high price for that session. Sells are also calculated with 50 % skid.

    I am interested in testing this system with intraday data. Could someone upload a file of intraday prices for any security that I may use for a test?

    Paris Hilton is so pretty that I choose to use Hilton Hotels stock symbol HLT in this example. The test uses daily price data (adjusted for splits and dividends) from 6 April 1983 to 14 July 2006. Following are test results for a Zweig trading system using 1 % entry, 1 % exit and 10 % risk:

    Number of trades 800
    Total profit $ 1159686
    Profit after subtracting $ 10.00 commission, slippage per transaction: $ 1143686
    Risk is 10.00 per cent of equity.
    Drawdown is 0.1248 (12.48 per cent).
    Cumulative Annual Growth Rate (CAGR) is 49.13 per cent.
    CAGR / Drawdown is 3.94
    Instanteously Compounding Annual Growth Rate (ICAGR) is 10.83 per cent.
    Annually Compounding Annual Growth Rate (ACAGR) is 11.44 per cent.
    Information Ratio is 0.10
    Initial capital is $ 100000
    Long trades only.
    Growth rates are calculated after subtracting commission & slippage.

    ===

    Growth is about 49 percent per year and greatest drawdown about 13 percent.

    A graph of the equity growth is attached.
     
  2. This is an example of trading HLT using a long term Zweig trading system. This test uses these rules:

    1) If price rallys 32 % from an extreme low price then buy.

    2) If price reacts 26 % from an extreme high price then sell.

    3) Position size is 10 % of account equity / 10 times average true range. Position size may decrease to remain within cash limit.

    I prefer to trade long term so I may manage about 20 securities without confusion. I can not predict which security is about to show a big trend, so I hold a portfolio of many securities. I do not believe I can manage many securities as a short term trader.

    The test uses HLT stock daily price data (adjusted for splits and dividends) from 6 April 1983 to 14 July 2006.

    Number of trades 9
    Total profit $ 537118
    Profit after subtracting $ 10.00 commission, slippage per transaction: $ 536938
    Risk is 10.00 per cent of equity.
    Drawdown is 0.0034 (0.34 per cent).
    Cumulative Annual Growth Rate (CAGR) is 23.06 per cent.
    CAGR / Drawdown is 66.89
    Instanteously Compounding Annual Growth Rate (ICAGR) is 7.95 per cent.
    Annually Compounding Annual Growth Rate (ACAGR) is 8.28 per cent.
    Information Ratio is 1.22
    Initial capital is $ 100000
    Long trades only.
    Growth rates are calculated after subtracting commission & slippage.

    ===

    Growth is about 23 percent per year and greatest drawdown about 0.34 percent.

    A graph of the equity growth is attached.
     
  3. AaronCapps

    AaronCapps Global Futures

    what would you base the exteme low off of. Lowest low of so many days, low of the last 52 weeks? Vice versa for the highs i imagine.
     
  4. Murray Ruggiero

    Murray Ruggiero Sponsor

    Here is the code for the system in TradersStudio basic.

    'Code For the Zwieg 4% rules with Input For percent
    ' TradersStudio(r) (c) 2006, all rights reserved.
    Sub ZwiegPercentSys(LongPct, ShrtPct)
    Dim Counter As BarArray
    Dim LongHi As BarArray
    Dim ShortLo As BarArray

    If BarNumber=FirstBar Then
    'LongPct = 4
    'ShrtPct = 4
    Counter = 0
    LongHi = C
    ShortLo = C
    End If

    Counter = Counter + 1
    If Counter = 1 Then
    LongHi = C
    ShortLo = C
    End If
    If MarketPosition <> 1 And C >= ShortLo * (1 + LongPct/100) Then
    Buy("", 1, 0, CloseEntry, Day)
    LongHi = C
    End If
    If MarketPosition <> -1 And C <= LongHi * (1 - ShrtPct/100) Then
    Sell("", 1, 0, CloseEntry, Day)
    ShortLo = Close
    End If
    If MarketPosition <> -1 And C > LongHi Then
    LongHi = C
    End If
    If MarketPosition <> 1 And C < ShortLo Then
    ShortLo = C
    End If
    End Sub
     
  5. This is how I calculate the "extreme high price".

    Assume the simulation begins on day zero, HighPrice[0]. I set the extreme high price = HighPrice[0]. The next day price rises. If HighPrice[1] > HighPrice[0] then extreme high price = HighPrice[1]. Each following session I repeat the test and if price keeps rising then extreme high price keeps rising also.

    The time comes when a purchase is made. Assume purchase is made on day 10. Immediately after the purchase I reset extreme high price = HighPrice[9]. I can not use HighPrice[10] because the system trades at the opening and I can not know what the high price of the session is until the close. So I use the prior day high price for the new extreme high price.

    The position is long. If the exit % is 5 % then I calculate 95 % of HighPrice[9] as a sell target price. If the security price declines to the sell target price then the position is sold. Immediately after selling the system resets a new pair of extreme prices, one high, and one low.

    Low extreme prices are calculated in an analogous way.

    Is that explanation understandable? I can make a drawing that might explain how I calculate expreme values.

    If anyone is interested in my programming services please send private mail. Thanks.
     
  6. How has this system performed so far?
     
  7. Regarding Hilton Hotels symbol HLT the system is still long and shows a profit:

    15-Nov-02 OHLC:[ 12.93 12.93 12.93 12.93 ] buy 12.85 size 14372
    Dollar Position Cost is 184726.20

    Unrealized gain on final position:
    5-Dec-06 OHLC:[ 33.86 33.86 33.86 33.86 ] SellTargetPrice 25.13
    Position Net Gain Or Loss is 176448
     
  8. Here are trading results for Disney symbol DIS.

    The rules are:

    1) Buy when price increases 10 %.

    2) Sell if price decreases 25 %.

    3) Position size = 7 % of equity / (10 x average true range).

    Simulation uses 30 years of price data from 24 November 1976 to 24 November 2006.

    ===

    Number of trades 16
    Total profit $ 626296
    Profit after subtracting $ 10.00 commission, slippage per transaction: $ 625976
    Heat is 7.00 per cent of equity.
    Drawdown is 0.1160 (11.60 per cent).
    Cumulative Annual Growth Rate (CAGR) is 20.87 per cent.
    CAGR / Drawdown is 1.80
    Instantaneously Compounding Annual Growth Rate (ICAGR) is 6.61 per cent.
    Annually Compounding Annual Growth Rate (ACAGR) is 6.83 per cent.
    Information Ratio is 0.43
    Initial capital is $ 100000
    Long trades only.

    ===

    Annual growth rate about 21 %, greatest drawdown about 12 %.
     
  9. lindq

    lindq

    My fear with this type of 'system' is that it is easily open to curve fitting.

    If, for example, you ran numerous backtests on HLT, then DIS, to determine the best parameters for your percentages for each instrument, then this is seriously curve fit to the data and useless going forward. And the fact that so few trades are generated over a long period of time leads me to believe this may be the case.

    And why are you buying one stock at 32% off a low, and the other at 10%? Again, sounds like curve fitting. Easy trap to fall into. Would you really have confidence buying DIS or HLT in the future based on this?

    However, if you were to run this on a portfolio of a few hundred instruments, and it showed positive results, then it would get interesting.

    But IMHO, not until then.

    Thanks for sharing in any event.
     
  10. Well put. If the system is robust, there should be no need for different parameters.

    That said, imo the underlying of the principle is sound and has been the basis of many systems, including Gary Smith's (not from the TS.COM)'s S&P daytrading systems. Nelson Freeburg had an issue of FORMULA RESEARCH devoted to the Zwieg system.
     
    #10     Dec 7, 2006