MQL4 Coding Questions

TomDominic

Trader
Apr 30, 2023
40
1
14
26
Kenya
thanks,,,,and what does this line means ...

if(OrderType()<=OP_SELL,
Post automatically merged:

same case to this line ,,,,,

Comment(DoubleToString(Bid - Open[0], _Digits));
iam trying to understand but.......
 

hayseed

Master Trader
Jul 27, 2010
1,046
262
149
usa
thanks,,,,and what does this line means ...

if(OrderType()<=OP_SELL,
Post automatically merged:

same case to this line ,,,,,

Comment(DoubleToString(Bid - Open[0], _Digits));
iam trying to understand but.......
//-------

orders are assigned a numerical value..... OP_SELL is equal to 1..... the only order less than 1 is 0, which is a OP_BUY.......

you can see the listed values of order properties here..... the mql4 docs is helpful in understanding the code......
//-----

the comment function will put the actual amount the bid is above or below the opening price......

mql4 book......h
 
  • 👍
Reactions: Enivid