Previous Candle High.

Hi,

I'm trying to filter candles pattern I use the following code to do that but with this code it listed all stocks that have a hammer in previous day.
what I need is to filter only the one it has a hammer in previous day AND the current price is above the previous hammer High.

		LongLowerShadow = Min(O,C) - L > (H - L)*0.57;
		rng = abs((C-O)/O);
		DownTrend = (H < Ref(H,-1) AND L < Ref(L,-1));

		D_Hammer1 = LongLowerShadow > rng*4 AND rng > 0 AND DownTrend;

		D_Hammer = Ref(D_Hammer1,-1);


		Filter = D_Hammer;

		AddTextColumn( FullName(), "Full name", 77 , colorDefault, IIf( c > o , colorgreen, colorred ));
		AddColumn(IIf(D_Hammer,1,Null), " D Hammer", 1,colorBlack,IIf(D_Hammer,colorLightOrange,Null));

Please help.
thanks an advance.
Mohammed

@Savio, so when you set your Filter, you can add another condition.

So something (untested) like;

cond2 = H>Ref(H, -1);

Filter = D_Hammer AND cond2;

So you could add more than 2 conditions if you want...

1 Like