##### New Member
I have daily EOD data of NSE in my Amibroker. I want to scan /explore stocks which meet my criteria. Please help me with the code.

Criteria:
Today's high should be 2-Month High and also today's range (high-low) should be largest out of previous 5 trading days.

*Note: I want this to happen on a Daily Chart. I tried with TimeFrameSet(inMonthly) command but i doesnt seem to get it work. Please help.

##### New Member
Im still waiting, please someone help me.

#### Ajax

##### Well-Known Member
x1 = Ref(HHV(H,5),-1);
x2 = Ref(LLV(L,5),-1);
x3 = abs(x1-x2);
x4 = (H-L) > x3 ;

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

#### Ajax

##### Well-Known Member
correction

x = Cross(H,Ref(HHV(H,50),-1));
x1 = Ref(HHV(H,5),-1);
x2 = Ref(LLV(L,5),-1);
x3 = abs(x1-x2);
x4 = (H-L) > x3 ;
Buy = x AND x4 ;

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Figure out

#### vishal.yagnik

##### New Member
correction

x = Cross(H,Ref(HHV(H,50),-1));
x1 = Ref(HHV(H,5),-1);
x2 = Ref(LLV(L,5),-1);
x3 = abs(x1-x2);
x4 = (H-L) > x3 ;
Buy = x AND x4 ;

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Figure out
Yup looks good

Sent from my SM-G900H using Tapatalk

##### New Member
Ajax, Thank you dear. I need to try it out and will let you know. Take care and be in touch ##### New Member
correction

x = Cross(H,Ref(HHV(H,50),-1));
x1 = Ref(HHV(H,5),-1);
x2 = Ref(LLV(L,5),-1);
x3 = abs(x1-x2);
x4 = (H-L) > x3 ;
Buy = x AND x4 ;

//;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Figure out
Dear Ajax,

Thank you so much for helping me out. I would like to point out on edoubt which is still bothering me, plz help:

x1 = Ref(HHV(H,5),-1); // This statement will tell us Highest High of some candle "A".

x2 = Ref(LLV(L,5),-1); // This statement will tell us Lowest Low of some candle either "A" OR it could be candle "B" also. I mean it will not give the lowest of the same candle "A".

#### manicminer

##### New Member
try this.
Code:
``````//requested by Trader_Sanky. 30/12/2017

period=Param("period",50,5,200,1);
dayhigh=hhv(h,period);
range=h-l;
analiz= h>=ref(dayhigh,-1) and range>Ref(hhv(range,5),-1);

Plot( c, "Price Chart", IIf( O < C, colorGreen, colorRed ), styleCandle );
Plot(Ref(dayhigh,-1),"hhv50",colorBlue);
PlotShapes(analiz*shapeCircle,colorGreen);

filter=analiz;