Wma200 = average[200,2] //Replace 200,2 with 200,0 to use a Simple Moving Average
Cond = 0
//--------------------------------------------------------------------------------------------------------------------
Body = abs(close - open)
UpperShadow = high - max(open,close)
LowerShadow = min(open,close) - low
//--------------------------------------------------------------------------------------------------------------------
// Hammer
//
Ha1 = LowerShadow >= (Body * 3) //Lower Shadow 3 times longer than the body
Ha2 = close >= (high-(range * 0.25))//must close in the upper 25% of its range
Ha3 = low = lowest[20](low) //its Low must be the lowest one of the last 20 candles (1=disabled)
Hammer = Ha1 AND Ha2 AND Ha3
//--------------------------------------------------------------------------------------------------------------------
// Shooting Star
//
Ss1 = UpperShadow >= (Body * 3) //Upper Shadow 3 times longer than the body
Ss2 = LowerShadow <= Body //Lower Shadow must be max as large as the body
Ss3 = close <= (low+(range * 0.25)) //must close in the lower 25% of its range
Ss4 = high = highest[20](high) //its High must be the highest one of the last 20 candles (1=disabled)
ShootingStar = Ss1 AND Ss2 AND Ss3 AND Ss4
//--------------------------------------------------------------------------------------------------------------------
IF Hammer THEN
IF (low = lowest[7](low)) AND (close > Wma200) THEN
Cond = 1
ENDIF
ELSIF ShootingStar THEN
IF high = highest[7](high) AND (close < Wma200) THEN
Cond = 2
ENDIF
ENDIF
//
SCREENER[Cond](Cond AS "1=Ham,2=Shoot")