Need help on bull or bear candle

 

hello everyone...

I'm newbie and need help on probably very simple logic...

how do you describe bullish and bearish candle in mql4 language?

UpBarr = bullish candle;

DwBarr = bearish candle;

Thank you..

 

Bullish

 

Open[x]<Close[x]

Bearish 

Open[x]>Close[x]
 
Thank you stuart
 
webks:
Thank you stuart
Welcome :)
 

You could try this:

Low[0]>Low[1]  &&  High[0]>High[1] && Close[0]>Close[1]   // bullish

High[0]<High[1] && Low[0]<Low[1] && Close[0]<Close[1]  // bearish

0 is the current bar and 1 is the previous bar, a 2 will be the .... bar. Go back from 0.  This is how I decide what is bullish or bearish. I want to see lower lows and lower highs(bearish). Some authors use the close only (lower or higher than the previous close). You will need to decide which is best for your program. I'm not a coder, but I hope this helps you. Chris

Reason: