Skip to main content

Narrow Range Explorer for Amibroker (AFL)

AMI1004 almost 10 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 3)
  • Tags:
    amibroker, exploration

For identifying Narrow ranges of Prices.
Identifies following with explorer:
1. NR 4
2. NR 7
3. NR 14
4. NR 21
5. Tweezer Top
6. Tweezer Bottom
More the price is Narrower, the more the possibility of Price range expanding in the subsequent sessions.
Use the AFL in Day Time Frame

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("NARROW RANGES");
//Written by: Vijay Karanam
//==================================================================================
//NR 4, 7 & 21 RANGES 
TimeFrameMode(0);
//switch Timeframe 
TimeFrameSet( inDaily ); 

//==================================================================================
//NR4 RANGE IDENTIFICATION

range = H-L;
Condition = range<Ref(range,-1) AND range<Ref(range,-2) AND range<Ref(range,-3);
NR4 = IIf(Condition,True, False);


//==================================================================================
//NR7 RANGE IDENTIFICATION

range = H-L;
Condition0 = range<Ref(range,-1) AND range<Ref(range,-2) AND range<Ref(range,-3)AND range<Ref(range,-4)AND range<Ref(range,-5)AND range<Ref(range,-6);
NR7 = IIf(Condition0,True, False);

//==================================================================================

//NR14 RANGE IDENTIFICATION

range = H-L;
Condition1 = range<Ref(range,-1) AND range<Ref(range,-2) AND range<Ref(range,-3)AND range<Ref(range,-4)AND range<Ref(range,-5)AND range<Ref(range,-6)AND range<Ref(range,-7)AND range<Ref(range,-8)AND range<Ref(range,-9)AND range<Ref(range,-10);
Condition2 = range<Ref(range,-11) AND range<Ref(range,-12) AND range<Ref(range,-13);

NR14 = IIf(Condition1 AND Condition2,True, False);

//==================================================================================

//NR21 RANGE IDENTIFICATION

range = H-L;
Condition3 = range<Ref(range,-1) AND range<Ref(range,-2) AND range<Ref(range,-3)AND range<Ref(range,-4)AND range<Ref(range,-5)AND range<Ref(range,-6)AND range<Ref(range,-7)AND range<Ref(range,-8)AND range<Ref(range,-9)AND range<Ref(range,-10);
Condition4 = range<Ref(range,-11) AND range<Ref(range,-12) AND range<Ref(range,-13)AND range<Ref(range,-14)AND range<Ref(range,-15)AND range<Ref(range,-16)AND range<Ref(range,-17)AND range<Ref(range,-18)AND range<Ref(range,-19)AND range<Ref(range,-20);

NR21 = IIf(Condition3 AND Condition4,True, False);

//============================================================================
//TWEEZER TOP & BOTTOM

TT = (H == Ref(H,-1)) OR (H == Ref(H,-2) AND H > Ref(H,-1)) OR (H == Ref(H,-3) AND H >= HHV(H,-2)) OR (H == Ref(H,-4) AND H >= HHV(H,-3));
TB = (L == Ref(L,-1)) OR (L == Ref(L,-2) AND L < Ref(L,-1)) OR (L == Ref(L,-3) AND L <= LLV(L,-2)) OR (L == Ref(L,-4) AND L <= LLV(L,-3));

//=======================================================================================================
NRSTATUS =
WriteIf(TT,"TWEEZER TOP",
WriteIf(TB,"TWEEZER BOTTOM",
WriteIf(NR21,"NR21",
WriteIf(NR14,"NR21",
WriteIf(NR7,"NR7",
WriteIf(NR4,"NR4"," "))))));
NRCOLOR = IIf( TT, colorOrange,
IIf( TB , colorBrightGreen, 
IIf( NR4 OR NR7 OR NR21 OR NR14, colorLime, colorGold)));

//===============================================================================
Filter = NR4 OR NR7 OR NR21 OR NR14 OR TT OR TB ;

AddTextColumn(NRstatus, "DLY NR/TWEEZER", 1,colorDarkRed, NRcolor,120);

TimeFrameRestore();

_SECTION_END();

1 comments

1. s.sndp
about 9 years ago

Dear Sir,
Can u please explain

1. NR 4
2. NR 7
3. NR 14
4. NR 21
5. Tweezer Top
6. Tweezer Bottom

OR any website where i can get the information about the same
and do we have to run this for EOD or can we explore this on a 5min chart

Thank you

Leave Comment

Please login here to leave a comment.