Here's a Start: https://book.mql4.com/variables/arrays
...
EX: bar_number=iHighest(a,b,c,d etc..)
result = Close[bar_number]
Not sure how you are using iHighest() but it returns a shift from the current bar to the highest bar between two points
https://docs.mql4.com/series/iHighest
So if you are using iHighest correctly, your result should be fine.
V
Not sure how you are using iHighest() but it returns a shift from the current bar to the highest bar between two points
https://docs.mql4.com/series/iHighest
So if you are using iHighest correctly, your result should be fine.
V
Hi Viffer,
As you say, iHighest returns to me the Bar number of the highest bar in that range, but in my "bar_number" variable.
What I want to know, is how to get that value in Close[].
IE: Close[bar_number]
but MQL wont allow a variable as an index, How can I get the value of bar_number transferred into the index of Close?
Thanks
Thanks UBZen for your link, very informative, but could not find an answer to my problem.
EX: bar_number=iHighest(a,b,c,d etc..)
double result = Close[bar_number]Lets say bar_number = 5, I need to enter this value "5" into the index of CLOSE.
??
Micky
...
but MQL wont allow a variable as an index, How can I get the value of bar_number transferred into the index of Close?
Yes it does... do it just as you have shown... but make sure your variable is declared as an int.
or do it like this (highest of last 20 bars)
result =iClose(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_HIGH,20,0));
If it still doesn't work, post the code and we can take a look.
V
Hi everyone, sorry for the delay,
Here's what I came up with, and it works...
double result=High[iHighest(0,x,x,x...)];
This way I get the Highest value of a range.
High is of double type
iHighest is of Int type.
Thanks to you all for your help and support.
Micky
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm trying to locate the value in a specific Bar and I dont really understand how to work with Arrays.
When I try to read a "Bars[bar_number]" value, it returns that it needs an integer value as index.
My "bar_number" in this example is a value that I get from the iHighest function.
How can I get the value contained in "bar_number" into the Bars Array index?
EX: bar_number=iHighest(a,b,c,d etc..)
result = Close[bar_number]
Can anyone explain to me how to get that value?
and I would appreciate a Link to where I could read about "Arrays How-To".
Thank You .