Messi86:
Hi all,
i want to ask one question. I still cant solve my problem and i saw much code but nothing like what i try, or i did not see correct the codes.
The problem is that i want to do calculations of other timeframe when bar of current timeframe close. For example, text with close bar of first H1 bar on chart H4 when bar of H4 end.
what function must i use for write close of H1 bar at the end of H4 bar?
Thank you very much
"use for write close of H1 bar at the end of H4 bar"
The close of H1 at the end of H4 is the same:
//at e.g. 16:59:59 bool isCorrect = iClose(NULL,PERIOD_H1,0) == iClose(NULL,PERIOD_H4,0);
Don't mix apples and oranges
gooly:
Thank you very much!!! i will try your logic
"use for write close of H1 bar at the end of H4 bar"
The close if H1 at the end of H4 is the same:
Sorry, i dont understand your post. You refer to mql4 programming or trading??.
I like hear your point of view.
Thank you very much
You seem to me missing the obvious.
- With regard to the Bar Shift "0" (the current bar), the current Close Price at ALL time-frames (not just H4 and H1, but all of them) will have the same Close Price which is the current Bid price.
- With regards to the Bar Shift "1" (the previous bar), during the 1st minute of opening the current bar (shift "0") on the Higher time-frame, it will have the same close price as the lower time-frames. So during this 1st minute (not inclusive), the Close[1] for H4 will be the same as Close[1] for H1, M30, M15, M5 and M1.
This may seem obvious after seeing it written down, but sometimes in our haste to do things we sometimes forget the obvious.

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
what function must i use for write close of H1 bar at the end of H4 bar?
Thank you very much