Download MetaTrader 5
To add comments, please log in or register
Publish your task in Freelance service and developers will execute your order.
Sneck55
100
Sneck55 2016.08.02 11:30 
Hello, I am running an EA on the daily chart and I need to find out whether or not the current price is above or below the last H1 high or low (depending on whether the entry will be long or short) in order to make the decision whether or not to enter.  However using iHigh(NULL,PERIOD_H1,1) or iLow(NULL,PERIOD_H1,1) does not give the last H1 high/low but gives a high/low several bars back (maybe as many as 20 bars, different each time it runs). The number of bars back it goes is not consistent. I did not use iHigh(NULL,PERIOD_H1,0) because I need the high of the last H1 bar, not the current one. What should I do please?
Carl Schreiber
5932
Carl Schreiber 2016.08.02 12:15  
Well check the open time of the H1-bars: iTime(NULL,PERIOD_H1,1) and try High[1] and Low[1] and Time[1] on the H1-Chart.
whroeder1
13597
whroeder1 2016.08.02 13:39  

If you haven't looked at the different timeframe in the last ten minutes it will be out of sync.

Either grab something (like iHigh) each tick to keep it updated, or check for the errors 4066 and 4073 and retry

Sneck55
100
Sneck55 2016.08.02 13:56  
WHRoeder:

If you haven't looked at the different timeframe in the last ten minutes it will be out of sync.

Either grab something (like iHigh) each tick to keep it updated, or check for the errors 4066 and 4073 and retry

thanks I'll give it a try
/
To add comments, please log in or register