Double Seven
A system by Larry Connors and Cesar Alvarez
The “Double Seven” strategy was described in 2008 in the book “Short Term Trading Strategies that Work”.
The name “double seven” is also almost the whole description of the strategy:
Go long when today’s close is lower than the lowest low of the last seven days. Sell the long position again if today’s close is greater than the highest high of the last seven days. A moving average over 200 daily periods serves as a trend filter.
The prorealtimecode for double seven would be this?
// double seven
// buy larry conners and cesar alvarez
// timeframe daily
If close < lowest [7] (low) then
If close > average [200] (close) then
buy at market
Endif
Endif
If close > highest [7] (high) then
sell at market
Endif
kind
maik
Your code is not quite correct as it includes the current days low in the condition test and it is impossible for today’s close to be less than today’s low – and the same for the highest test.
Change the code to this:
defparam cumulateorders = false
// double seven
// buy larry conners and cesar alvarez
// timeframe daily
If close < lowest [7] (low[1]) then
If close > average [200] (close) then
buy at market
Endif
Endif
If close > highest [7] (high[1]) then
sell at market
Endif
Or it could reference CLOSE, instead of HIGH & LOW:
// double seven
// buy larry conners and cesar alvarez
// timeframe daily
If close = lowest[7](close) then
If close > average[200](close) then
buy at market
Endif
Endif
If close = highest[7](close) then
sell at market
Endif
It is not a very good strategy as if the market keeps falling and fails to make new seven day highs then you will hold into a massive market drop and have massive draw down.
Image shows the strategy compared to buy and hold on DJI with no spread:
Can this be coded as a 7-line break in imitation of a 3-line break? What would that look like?
3 Line Break, Kagi, Renko, Ticks and all other non-time based charts cannot be used for automated trading.