Hello, this is my conundrum:
I created an EA in MQL5 which involved checking for a certain amount of profit before closing. The EA is able to close exactly at the specified amount when testing in the demo account, yet when I use the EA in a live account, it seems to be reaching that certain amount of profit, then closing not exactly on such (usually less). I have a hypothesis to why this is happening:
The execution of onTick() is slower than a new incoming tick, therefore the EA is calculating on older rates.
Aside from optimizing the code itself, is there a way I can interrupt the current EA's older onTick execution in favor for the most recent tick?
If your EA is using Market orders to close then it will almost certainly be down to the live price having changed by the time the order is executed with your broker.
If your EA is using Market orders to close then it will almost certainly be down to the live price having changed by the time the order is executed with your broker.
- 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, this is my conundrum:
I created an EA in MQL5 which involved checking for a certain amount of profit before closing. The EA is able to close exactly at the specified amount when testing in the demo account, yet when I use the EA in a live account, it seems to be reaching that certain amount of profit, then closing not exactly on such (usually less). I have a hypothesis to why this is happening:
The execution of onTick() is slower than a new incoming tick, therefore the EA is calculating on older rates.
Aside from optimizing the code itself, is there a way I can interrupt the current EA's older onTick execution in favor for the most recent tick?