Identification of strong body and weak body candle

Hi Buddy,

I want make code of identification of strong body candle and weak body candles, i tried to made code of it but every time error comes.

Definition of Strong body and weak body candle are as follows

Strong body Candle = Abs(Open-Close) > (high-low) * 0.5

Weak body candle = Abs(Open-Close) < (high-low) * 0.5

Plz help me to generate code for finding Strong body candle & Weak body candle in any time frame chart.

Thx in Advance

hElLO tRaDeR,

On which Pi TOOL are you trying to use these codes ?

The codes are correct.

I tested both your codes on the backtest engine and trades were identified.

Actually i want to code to identify strong body and weak body candles (as per above formulas) combinations in last 3 candles. It should be Strong body candle (last candle) then weak body candle (previous candle) and Strong body candle (previous to previous candle) .
Plz help me to code this in Pi.
Thx

(ABS(OPEN-CLOSE) > (HIGH-LOW) * 0.5) AND
(ABS(REF(OPEN,1)-(REF(CLOSE,1)) < (REF(HIGH,1)-REF(LOW,1)) * 0.5 AND
(ABS(REF(OPEN,2)-REF(CLOSE,2)) > (REF(HIGH,2)-REF(LOW,2)) * 0.5