No , there is exist more properly way - compare Time of current bar. For example:
bool NewBar=false; .... if (currOpenTime!=Time[0]) { currOpenTime=Time[0]; NewBar=true; } if (NewBar) { /// check conditions for opening new position and OrderSend() if it needed }
You're welcome.
Yes, you are right. See documentation https://docs.mql4.com/series/iTime
Yes, you are right. See documentation https://docs.mql4.com/series/iTime
lalilo:
Thanks a lot. this seems very good.
what is the difference between Time[] and iTime() ?
as I understood from the doc, Time[0] = iTime(NULL,0,0), am I right?
Thanks a lot. this seems very good.
what is the difference between Time[] and iTime() ?
as I understood from the doc, Time[0] = iTime(NULL,0,0), am I right?
I need some help with the iTime function. I am very new to this but need to collaborate
with someone on getting some code done....any takers?
D
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
if(iTime(NULL,PERIOD_H1,0) == iTime(NULL,PERIOD_M1,0))
then send the order.
any other accurate way to this? (also, the Tester cannot work with this method, so a method that the Tester can understand woudl be helpful).