Seer logo - advanced backtesting for stock, futures and forex trading systems using using technical analysis indicators, charts, money management and position sizing
screenshot
screenshot
screenshot
screenshot

Donchian breakout trading system example (4 week rule)

example trading system

The 4 week rule was developed by Richard Donchian and has been proven to be an effective base for many profitable trading systems. The original rules were used for trading commodities and can be summarized by:
    1) Cover short positions and buy long whenever the price exceeds the highs of the previous 4 calendar weeks
    2) Liquidate long positions and sell short whenever the price falls below the lows of the previous 4 calendar weeks
As Seer is able to use multiple time frames the above rules would be expressed as:

  BuyOpen  if ClosePrice > Today(Highest(Weekly->High,4));
  SellOpen if ClosePrice < Today(Lowest(Weekly->Low,4));

If run with a SAR (stop and reverse) money management strategy, the above system will always maintain a position in the market (either long or short).

When the market is not trending the above system will produce lots of whipsaws which can drastically effect the performance of the system. A common solution to this problem is to enter on the 4 week rule (the breakout), and to exit on a shorter time frame such as 1 or 2 weeks. The following system implements this approach. The example also uses the more familiar use of 20 daily bars rather than 4 calendar weeks.

This trading system is included in the example trading systems that come with the free 30 day trial EOD version of Seer. Once you have filled out this form simply download Seer to try this trading system.

#This system is based upon the 4 week rule by Richard Donchian

#Rules:
#Enter long when the close exceeds the high of the previous 20 bars
#Exit long when the close falls below the low of the previous 10 bars
#Enter short when close falls below the low of the previous 20 bars
#Exit short when the close exceeds the high of the previous 10 bars

unless (Position) {
  #we have no position, perform entry logic
  BuyOpen if ClosePrice>Yesterday(Highest(High,20));
  SellOpen if ClosePrice<Yesterday(Lowest(Low,20));
}
else {
  #We have a position
  if (LongPosition) {
    #We have a long Position, perform exit logic
    SellOpen if ClosePrice<Yesterday(Lowest(Low,10));
  }
  else {
    #We have a short Position, perform exit logic
    BuyOpen if ClosePrice>Yesterday(Highest(High,10));
  }
}
© 2008 seer trading systems ltd
feedback FAQ legal privacy