hello guys i am trying to understand the time function for a while now but still having some complications
actually i am working on an indicator that show a line 10 pips above and below the candle open price
it will show the line when the price open is below or above the exponential moving average.
what i want is the line to be visible only when the sever time is at 3 am , means the indicator only show these line when the mt4 terminal time is 3 am
here is the code
Hi,
I give you my clock I have coded afew days ago, you will find some usefull clues to get what you want.
look at iTime() /iOpen()/iClose()
put it in Oncalculate() and check with if(.......==....)
ask more if you need
laurent
here is the code
- You don't want to draw or not when server time is at 3 am. You want to draw when the candle time is 3 am.
- So where in that code do you check and not draw?
for(int i = limit-1; i >= 0; i--) { datetime now = Time[i]; if(TimeHour(now) != 3) continue;
Or:
for(int i = limit-1; i >= 0; i--) { #define HR0300 10800 // 3600*3 #define HR0400 14400 datetime now = Time[i]; if(time(now) >= HR0300 && < HR0400){...}
Find bar of the same time one day ago - Simple Trading Strategies - MQL4 and MetaTrader 4 - MQL4 programming forum

- 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 guys i am trying to understand the time function for a while now but still having some complications
actually i am working on an indicator that show a line 10 pips above and below the candle open price
it will show the line when the price open is below or above the exponential moving average.
what i want is the line to be visible only when the sever time is at 3 am , means the indicator only show these line when the mt4 terminal time is 3 am
here is the code