The Narrow Range Day NR7 Trading Strategy (Amibroker And Tradestation Code)

The original article can be found here.


The strategy in plain English:

  1. Calculate the High minus Low each day. This is the daily range.
  2. If today has the lowest daily range of the last seven days, then go long at the close.
  3. Exit at the close when the close is higher than yesterday’s close.


Amibroker code:




range1<Ref(LLV(range1,6),-1) ;
Sell=Close>Ref(High,-1) ;


Tradestation code:

If range<lowest(range,6)[1]

then buy this bar at close;

If c>h[1] then Sell this bar at close;



Disclaimer: 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.