Larry Connors’ Double Seven Strategy (Amibroker And Tradestation Code)

The strategy in plain English:

 

  1. The close must be above the 200-day moving average.
  2. The close must be at a seven-day low.
  3. If 1 and 2 are true, then go long at the close.
  4. Sell when the close is at a seven-day high (sell at the close).

 

Click here for the original article.

 

Amibroker code:

 

Buy = C > MA(C,200) AND C < Ref(LLV(L,7),-1) ;
buyPrice = Close;
Sell = Close > Ref(HHV(H,7),-1);
sellPrice = Close;

Tradestation code:

 

Input: Daysbuy(7),Dayssell(7);
Condition1 = C < Lowest(c,Daysbuy)[1] ;
Condition2 = C > Highest(c,Dayssell)[1] ;
Condition3 = C >= average(c,200);
if Condition1 and condition3 then Buy this bar at close;
if Condition2 then sell this bar at close;

 

Disclosure: We are not financial advisors. Please do your own due diligence and investment research or consult a financial professional. All articles are our opinions – they are not suggestions to buy or sell any securities.