you need to use iHighest() and iLowest()
This is the easy way:
High = iHigh(NULL, 0, iHighest(NULL,0,MODE_HIGH,PERIOD,0) );
Low = iLow(NULL, 0, iLowest(NULL,0, MODE_LOW,PERIOD,0) );
bye
I tried looking up at the code base and the book but the Period ends in MN1, which is based on current bar or before. I needed something a bit more specific for the month and year. What's the best way to find the highest high/lowest low of a specific month or group of months in mql4?
High = iHigh(NULL, 0, iHighest(NULL,0,MODE_HIGH,PERIOD,0) ); Low = iLow(NULL, 0, iLowest(NULL,0, MODE_LOW,PERIOD,0) );
This will return H/L on the current chart for PERIOD bars back.
You need find the first and last bars in the period your interested in, either by counting or iBarsShift a specific date.
datetime fromDT = ..., toDT = ...; int fromBar = iBarShift(NULL, 0, fromDT), toBar = iBarShift(NULL, 0, toDT), length = fromBar - toBar + 1, HHbar = iHighest(NULL,0, MODE_HIGH, length, toBar), LLbar = iLowest(NULL,0, MODE_LOW, length, toBar); double HH = High[HHbar], // iHigh(NULL,0, HHbar) LL = Low[LLbar]; // iLow(NULL,0, LLbar)If you are looking back beyond the number of bars on the chart (i.e, months back but on a M1 chart) then you'll have to use a higher TF to get the data, E.G. replace NULL,0 with NULL, PERIOD_W1
http://www.forexfactory.com/showthread.php?p=2351580#post2351580
ii = iBarShift(NULL, TargetPeriod, iTime(NULL,0,i))+1;
bHIGH =(iHigh(NULL,TargetPeriod,ii));
This will return H/L on the current chart for PERIOD bars back.
You need find the first and last bars in the period your interested in, either by counting or iBarsShift a specific date.
If you are looking back beyond the number of bars on the chart (i.e, months back but on a M1 chart) then you'll have to use a higher TF to get the data, E.G. replace NULL,0 with NULL, PERIOD_W1Thank you.
I am trying to make a simple asia session code, which is get for me every day the asia session high and low. How should I do that? like server time 0h-8h highest and lowest points.
Hi Everyone!
I am trying to make a simple asia session code, which is get for me every day the asia session high and low. How should I do that? like server time 0h-8h highest and lowest points.
thank you Dominik!

- 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 all,
I'm new to coding and I'm really not finding a way to get what I'm looking for. Maybe one cool/savior programmer out there can help.
I'm trying to find out the high/low for a certain period. The period is fixed. Let me explain a bit better. I'm trying to find out the highest high and the lowest low of 3 months, for example, January, February and March of 2010 (or whatever year I need). I'm not looking for 3 highs/lows, I'm looking for the highest high and lowest low of the "group" of months. So if I want to find out the highest high and lowest low of July, August, and September, the indicator will comment on chart this, "Highest high for those months is xxx and the lowest low is yyy"
I tried looking up at the code base and the book but the Period ends in MN1, which is based on current bar or before. I needed something a bit more specific for the month and year. What's the best way to find the highest high/lowest low of a specific month or group of months in mql4?
Please help!! :)