A Significant Down Day In The S&P 500 (Amibroker And Tradestation Code)

The strategy in plain English:

 

  1. Calculate the average H-L range over the last 100 days.
  2. If the ETF or futures contract falls more than 1.25 times this average, enter at the close.
  3. Exit at the close when the close is higher than yesterday’s high.

 

Click here to see the original article.

 

Amibroker code:

 

range=MA((H-L),100);

Buy= Ref(C,-1)-C > (Ref(range,-1)*1.25) ;
buyPrice=Close;
Sell= C>Ref(H,-1);
sellPrice=Close ;

 

Tradestation code:

 

If c < (c[1]-1.25*average(range,100))
then buy this bar at close;
If c>h[1] 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.