This code is not optimal. How many orders do you have in your history ?
I test it with 70 orders on history data, it took 328 ms.
2014.07.28 19:45:06.422 '9538975': order was opened : #1369570736 sell 0.10 EURUSD at 1.34389 sl: 0.00000 tp: 0.00000
2014.07.28 19:45:06.203 '9538975': order sell market 0.10 EURUSD sl: 0.00000 tp: 0.00000
2014.07.28 19:45:06.094 '9538975': order #1369570620 buy 0.10 EURUSD at 1.34413 closed due stop-loss at price 1.34392
Limit your trade history to a shorter period.
When the open time delay is still 3 to 4 seconds instead of 0.3 measured by Angevoyegeur, then there is high probability the broker is interfering. Your coder did not make any major mistake that would involve such delay.
It's not necessarily the broker. From the posted code, you can see it uses a loop (several in facts) on all history (on each tick), so with my 70 orders it's not a problem. But I asked how many orders fartfx has in his history, as with 7000, 70000, etc...it can become a serious problem for performance.
- 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 there,
I'm building my ea with a mql programmer. I'm a programmer also, but I know vanilla javascript, not mql. Things are not going the way i expected, the ea was made but it works in a certain way, that according with the mql programmer, is an issue with the mql4 language itself, how the API works. I will describe what i wanted the ea to do, the problem that is happening and the full code i have from the EA, and if you folks could share some light i would really appreciate that
ea specs:
opening(the first order) and closing orders are manual
-ea should initialise and listen/wait for/idle (not sure the best term) an order to get closed.
-once an order get closed, ea should open a new BUY or SELL with the same lot size. if a sell was closed, ea should place a buy and the other way around too.
The problem that is happening, is that EA is taking too long to open a new order once 1 gets closed, sometimes even 3 or 4 seconds! It should open a new order immediately after one gets closed. The developer says the EA is working on a tick basis and the code is the best he could do. What you say?