As soon as the next tick comes in, it will return to the beginning of OnInit() anyway.
If you wish to process something between ticks, you're best to use OnTimer().
No, it can't.
As soon as the next tick comes in, it will return to the beginning of OnInit() anyway.
If you wish to process something between ticks, you're best to use OnTimer().
Thank you.
Still have question. I'm a beginner.
Ontick() and OnInit() are same thing ?
OnTimer()? OnTicks() ? OnInit ? zzzzzzzz…
I'll check in MetaEditor…but maybe I can not fully understand those things haha.
Thank you a lot!
This should hopefully help explain https://docs.mql4.com/basis/function/events
But the basics:
OnInit runs once when the EA/indicator starts.
OnTick (EAs) and OnCalculate (indicators) run whenever a new tick comes in
OnTimer runs on a time delay
OnDeinit runs once when the EA/indicator stops
This should hopefully help explain https://docs.mql4.com/basis/function/events
But the basics:
OnInit runs once when the EA/indicator starts.
OnTick (EAs) and OnCalculate (indicators) run whenever a new tick comes in
// What if when sometimes, the ticks just keep coming in and non-stop ? Everytime, when there is a new tick, EA go back to the start of Ontick() ? Thank you a lot !
// Or the EA go through from the beginning to the end, and then check another new tick? Thanks again!
OnTimer runs on a time delay
OnDeinit runs once when the EA/indicator stops
OnTick will run whenever a new tick comes in.
New tick... OnTick runs
Another new tick... OnTick runs
Another new tick... OnTick runs
If your EA hasn't finished processing OnTick before the next tick comes in, it will queue OnTick to run again immediately after it finishes.
But it will only queue 1 tick. So if 5 ticks come through before OnTick finishes, it will run OnTick once more (not 5 times more).
The other events OnInit or OnDeinit are designed to run once... at the start and at the end. This also happens if you change chart timeframes. Don't put code here that you want to run every tick.
OnTick will run whenever a new tick comes in.
New tick... OnTick runs
Another new tick... OnTick runs
Another new tick... OnTick runs
If your EA hasn't finished processing OnTick before the next tick comes in, it will queue OnTick to run again immediately after it finishes.
But it will only queue 1 tick. So if 5 ticks come through before OnTick finishes, it will run OnTick once more (not 5 times more). // If there is 5 ticks like you said, so it run according the lastest tick after OnTick finishes right ?
The other events OnInit or OnDeinit are designed to run once... at the start and at the end. This also happens if you change chart timeframes. Don't put code here that you want to run every tick.
Thank you very much for all you info. Really helpful to me. Thank you!
maaf master tolong saya buatkan code sebagai filter supaya ea saya setelah terkena TP jangan open lagi contoh open posisi SELL ketika RSI> 70 .. TP =10 ; jika RSI masih di area 70 jangan open lagi ketika sudah TP tetapi menunggu sinyal berikutnya
terima kasih
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use