Download MetaTrader 5

Need help on bull or bear candle

To add comments, please log in or register
webks
9
webks  

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..

Stuart Browne
6103
Stuart Browne  

Bullish

 

Open[x]<Close[x]

Bearish 

Open[x]>Close[x]
webks
9
webks  
Thank you stuart
Stuart Browne
6103
Stuart Browne  
webks:
Thank you stuart
Welcome :)
BUDLogic v1.0
48
BUDLogic v1.0  

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

To add comments, please log in or register