Hi Folks,
It seems like sometimes my EA is taking a little more time to send an order. As I'm trading in a very short of time (Scalping), I'm loosing money sometimes.
So I'm trying to figure out if is there any part of my code is wasting time.
The part below was extracted form OnTick.
My first guess is because maybe my broker is spending some seconds to give the informations of orders history (HistorySelect).
What do you guys think about it?
The purpose of this code is to receive the time of the last trade and wait some minutes to begin a new trade.
I don't know a better way (code) to "sleep" the EA some minutes after close a position.
Is there a way to run these part of the code immediately when a position was closed instead of every tick? I would like to make sure this part is not delaying an order execution.
Get a $million, buy a co-located server.
Or stop trying scalp.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Folks,
It seems like sometimes my EA is taking a little more time to send an order. As I'm trading in a very short of time (Scalping), I'm loosing money sometimes.
So I'm trying to figure out if is there any part of my code is wasting time.
The part below was extracted form OnTick.
My first guess is because maybe my broker is spending some seconds to give the informations of orders history (HistorySelect).
What do you guys think about it?
The purpose of this code is to receive the time of the last trade and wait some minutes to begin a new trade.
I don't know a better way (code) to "sleep" the EA some minutes after close a position.