Download MetaTrader 5

Is there a code to measure the candle's body?

To add comments, please log in or register
What are the latest MQL5.community news? The Wall section will tell you!
Cuong Truong
4245
Cuong Truong 2016.06.20 12:23 

Is there a code to measure the candle's body similar to iHighest() or iLowest()?

 iBody() ? 

iBuy() - Code to place buy orders

iSell()  - Code to place sell orders

Osama Shaban
1446
Osama Shaban 2016.06.20 18:38  

You may use such a code or do the variation that suits you ...

if(Open[1] > Close[1])
   Body = Open[1] - Close[1];
else
   Body = Close[1] - Open[1];

 Of course, this code is the simplest ... You need to change the result from x.xxxxx representation to Pips or Points by multiplying the result by  1/Point value.

Laszlo Tormasi
2713
Laszlo Tormasi 2016.06.20 20:52  
Osama Shaban:

You may use such a code or do the variation that suits you ...

 Of course, this code is the simplest ... You need to change the result from x.xxxxx representation to Pips or Points by multiplying the result by  1/Point value.

Simplest code would be:

double Body=fabs(Close[1]-Open[1]);
To add comments, please log in or register