if(close[1]>iMA[0]) {}
if(close[1]>iMA[0]) {}
I think this is Simple close[1] of last bar. How would I know that is Heiken Ashi Body is closing above/below MA
I think this is Simple close[1] of last bar. How would I know that is Heiken Ashi Body is closing above/below MA
I have deleted your post in another topic that has been dormant for over 6 years. The topic starter is no longer active, so will not reply to you.
The reason for deleting it is so that there are not replies to the same question in different topics.
double HA0=iCustom(_Symbol,0,"Heiken Ashi",2,x); double HA1=iCustom(_Symbol,0,"Heiken Ashi",3,x);
The above get the 2 values for buffers 2 and 3 for bar x, so if both are above the Ma, you will know that the body is above the MA.
The above get the 2 values for buffers 2 and 3 for bar x, so if both are above the Ma, you will know that the body is above the MA.
Thank you for the information you provided me. I have an understanding issue with iCustom function i.e: the 2nd last parameter is Mode what is mode I am not able to understand mode explained in documentation.
- docs.mql4.com
It's the (line)buffer you want to read it's value from.
It's the (line)buffer you want to read it's value from.
double HA0=iCustom(_Symbol,0,"Heiken Ashi",2,x);
This will provide me HAOpen of current bar which is currently active?
This will provide me HAOpen of current bar which is currently active?
Not necessarily. It is in the documentation..
shift
[in] Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Not necessarily. It is in the documentation..
shift
[in] Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Okay. But in the documentation:
mode
[in] Line index. Can be from 0 to 7 and must correspond with the index, specified in call of the SetIndexBuffer() function.
According to documentation. I can use only 0 till 7 values 0 is for current candle and 7 is for 7th last candle and what if I want to access info older then 7th last candle?
for HAOpen I have to use 2?
for HALowI have to use 3?
and what if I want to HAHigh, HAClose?
- docs.mql4.com
[in] Line index. Can be from 0 to 7 and must correspond with the index, specified in call of the SetIndexBuffer() function.
According to documentation. I can use only 0 till 7 values 0 is for current candle and 7 is for 7th last candle and what if I want to access info older then 7th last candle?
Line index can be much higher than 7 nowadays, documentation has not been updated.
Line index has nothing to do with candles. It is the buffer used in the indicator - Marco has already told you this.
for HAOpen I have to use 2?
for HALowI have to use 3?
and what if I want to HAHigh, HAClose?
Write a simple indicator, get the values and find out.
Put some effort in yourself. You will never learn anything if you don't study and try things.
- docs.mql4.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I am newbie in MQL4. I would like to know how I could detected that Heiken Ashi Body close above/below MA?