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 but can be used for other asset classes such as forex and stocks, the rules can be summarized by:
- Cover short positions and buy long whenever the price exceeds the highs of the previous 4 calendar weeks
- 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 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));
}
}
-
This topic was modified 7 years, 7 months ago by
jez.
-
This topic was modified 7 years, 7 months ago by
Seer.
-
This topic was modified 7 years, 7 months ago by
Seer.
-
This topic was modified 7 years, 7 months ago by
Seer.
-
This topic was modified 7 years, 5 months ago by
Seer.
-
This topic was modified 7 years, 5 months ago by
Seer.