Download MetaTrader 5
To add comments, please log in or register
Did you like the article? Share it with your friends!
jose
71
jose 2016.05.09 11:00 
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 

Carl Schreiber
5938
Carl Schreiber 2016.05.09 11:33  
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); 
whroeder1
13602
whroeder1 2016.05.09 11:51  
jose
71
jose 2016.05.09 11:56  
gooly:

"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:

Thank you very much!!! i will try your logic
jose
71
jose 2016.05.09 11:58  
WHRoeder:
Don't mix apples and oranges

Sorry, i dont understand your post. You refer to mql4 programming or trading??.

I like hear your point of view.

 

Thank you very much 

Fernando Carreiro
1439
Fernando Carreiro 2016.05.09 13:17  

You seem to me missing the obvious.

  1. 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.
  2. 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.

/
To add comments, please log in or register