Short Overnight In The S&P 500 (Amibroker And TradestationCode)

The strategy in plain English:

Profitable short strategies are always much more difficult than long strategies because of the long-term upward bias in the market. This strategy seems to perform worse now than before.

  1. The close must be higher for the third time in a row.
  2. The 5-day ADX must be higher than 35.
  3. The two-day RSI must be higher than 90,
  4. If 1-3 is true, then go short at the close.
  5. Exit/cover at tomorrow’s open.

Click here to see the original article.

Amibroker code:

setOption(“holdminbars”,1);

Short = C>Ref(C,-1) AND Ref(C,-1)>Ref(C,-2) AND Ref(C,-2)>Ref(C,-3) AND ADX(5)>35 AND RSI(2)>90 ;

shortPrice = Close;

Cover = Close > 0; //force close position

CoverPrice = Open;

Tradestation code:

{
Short Overnight In The S&P 500 (Strategy 62)
Profitable short strategies are always much more difficult than long strategies because of the long-term upward bias in the market. 
This strategy seems to perform worse now than before.
The close must be higher for the third time in a row.
The 5-day ADX must be higher than 35.
The two-day RSI must be higher than 90,
If 1-3 is true, then go short at the close.
Exit/cover at tomorrow's open.
}

Inputs:
	AdxLookback(5),
	AdxTreshold(35),
	RsiLookback(2),
	RsiTreshold(90);
	
if Close > Close[1] And
   Close[1] > Close[2] And
   Close[2] > Close[3] And
   ADX(AdxLookback) > AdxTreshold And
   RSI(Close, RsiLookback) > RsiTreshold Then
   Begin
      SellShort this bar on close;
      BuyToCover next bar on open;
   End;

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.