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
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?