Questions from Beginners MQL5 MT5 MetaTrader 5 - page 667
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
Unfortunately, it doesn't work.
init();
if(IsTradeAllowed()) Print("Trade is allowed");
if(!IsTradeAllowed()) Print("Trade is NOT allowed");
It says: "Trading authorised"
There's got to be another way. How?
Try it like this:
if(TimeCurrent()>starttime) {
...
}
I think the principle is clear, and as long as there is no tick,TimeCurrent will not change
Try it this way:
if(TimeCurrent()>starttime) {
...
}
I think the principle is clear, and as long as there is no tick,TimeCurrent will not change
Yes, for forex it's good because the ticks come often. What if it's not for Forex ?
The point is that during initialisation the "starttime" variable time will be a few seconds longer than the server time.
It isn't. Check it now, if you don't mind). But, that's not the point. I need to process the information now, before the first tick arrives, so that when the new (first) tick arrives, everything is ready to go.
I've been using this for a few years, but I don't need to process anything as long as there are no ticks. You need another solution, and from the link you gave it should be
The link I gave there says only TimeLocal() but I wanted to avoid it.
You are right, "starttime=(int)TimeCurrent()+sec; // for example, +5 seconds", of course, is larger than TimeCurrent(). I overreacted, my brain seems to be completely melted ))
The link leads only to TimeLocal() and I wanted to avoid it.
Depending on the task, you can try to use a combination ofTimeCurrent()+OnTimer(), or TimeCurrent()+TimeGMT()+TimeGMTOffset()
You can do all the conditions by timer and trade byTimeCurrent() There are many solutions, but the choice is up to you for your individual task.
Depending on the task, you can try to use a combination ofTimeCurrent()+OnTimer(), or TimeCurrent()+TimeGMT()+TimeGMTOffset()
You can execute all the conditions by timer and trade byTimeCurrent() There are many solutions, but the choice is up to you for your individual task.
And how, in my question, can OnTimer() be applied ?
Hold the no-work flag until everything has been calculated, for example...