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?
- Questions from Beginners MQL5 MT5 MetaTrader 5
- Fetching prices from a different timeframe
- Current price incorrect when using Tester
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
WHRoeder:
thanks I'll give it a try
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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register