Conversion of strategy into code - NR7 strategy by Tony Crabbel

Buy Signal Setup:

  1. Identify NR7 day: This is the day on which price range of a security (HML value) is the least from 7 days. This is known as NR7 day.

  2. Buy on move above high of narrow range day high.

Sell Signal Setup:

  1. Identify NR7 day: Please refer to # 1 of Buy Signal Setup

  2. Sell on move below low of narrow range day low.

/////////////////////////////////////////////////////////
///**************NEOTRADE ANALYTICS*******************///
///**********www.neotradeanalytics.com****************///
/////////////////////////////////////////////////////////
_SECTION_BEGIN("NR7");
TimeFrameSet(inDaily);
//calculate the high - low difference
R = H - L;
NR7 = False;
m7 = 0;
Marker7 = shapeDigit7;
NR7Color = colorBrightGreen;
MarkerDist = L * 0.995;

//check the lowest low difference value for last 7days
for(i = 7; i < BarCount; i++)
{
if( R[i] < R[i - 1] AND R[i] < R[i -2] AND R[i] < R[i - 3] AND R[i] < R[i - 4] AND R[i] < R[i - 5] AND R[i] < R[i - 6])
{
NR7[i] = True;

}
}

Buy = (Close > Ref(H,-1)) AND Ref(NR7,-1);
Sell = (Close < Ref(L,-1)) AND Ref(NR7,-1);

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,L); 
        
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,H);

Plot(Close,"Close",colorGreen,styleCandle);

PlotShapes(IIf(NR7, Marker7, shapeNone), NR7Color, 0, MarkerDist);

TimeFrameRestore();

_SECTION_END();

Warm Regards,

Vivith

www.neotradeanalytics.com

(Authorized vendor of NSE supporting realtime data feeds for Amibroker, Metastock and Ninjatrader)

Buy Script:

HIGH>HML(7)

Sell Script:

LOW<HML(7)

We could mail you the list of stocks that satisfy your specified condition at the end of the day every day,also you would recieve alert on your mobile when ever Buy/Sell condition is met on any of the stock during market hours. 

www.squareoff.in

Karan - this is an open forum where ideas are discussed freely for the benefit of all. You have been positing links and attempting to cross sell your services. Please do refrain for such activities and participate in the discussions in the right spirit. I hope you understand.