How can OrderClose() close 12 orders in ~2740ms?

 

wondering... docs say that OrderClose() is trading operation.

seems ok, as client must talk to server.



what seems strange is that OrderClose() of 12 orders can take place with or without " while(!IsTradeAllowed()) ..."

the without was in a OrdersTotal()-1 for loop with OrderSelect(...) > switch(OrderType()) > OrderClose(...)

if this done with OrderSend() or OrderModify() would expect comms delays + server think time to cause an execution error of some sort eg, ERR_SERVER_BUSY or ERR_TOO_FREQUENT_REQUESTS or...



Or am I that slow here, that ~2740ms is indeed acceptable speed?

Can appreciate that client/server talk can be minimal as is command to close specific order, but server must ack the command result status back to client etc.



Basically IsTradeAllowed() should be used for send/modify otherwise issues appear...



So - c'mon then, please explain to me why can be done without IsTradeAllowed() and done what seems to me a fast time?

If normal/or? to expect this, please explain what you believe happens for an OrderClose() transaction and why, unlike send/modify, IsTradeAllowed() not needed.


time of tests 17:13..17:18 gmt

 

12 x 200ms = 2.4 seconds

Sounds reasonable.

 

Thanks phy but: "sounds reasonable". what does this mean?

can I open or modify 12 orders in average 200ms each without using IsTradeAllowed() ?


What is difference in client/server traffic regards close/open/modify ?


Would you place 12 open orders in a tight loop without using IsTradeAllowed() ?

;)

 

"Or am I that slow here, that ~2740ms is indeed acceptable speed?"

...

"sounds reasonable" means that amount of time for internet communication latency and trade

server order processing does not raise a flag in my mind as to being too slow or too fast, but, reasonable.

...

"What is difference in client/server traffic regards close/open/modify ?"

...

Since communication between the client and server is encrypted, I have not monitored that information.

...

"Would you place 12 open orders in a tight loop without using IsTradeAllowed() ?"

...

I don't remember ever using IsTradeAllowed. If an order results in an error I try it again.

...

...

...

A little test here, open and close 5 orders takes about 3 seconds, on demo.

.

2008.06.16 16:19:15 Phy__BuySell EURUSD,H1: Elapsed Time = 2937
2008.06.16 16:19:15 Phy__BuySell EURUSD,H1: close #5712298 buy 0.01 EURUSD at 1.5482 at price 1.5480
2008.06.16 16:19:15 Phy__BuySell EURUSD,H1: open #5712298 buy 0.01 EURUSD at 1.5482 ok
2008.06.16 16:19:15 Phy__BuySell EURUSD,H1: close #5712297 buy 0.01 EURUSD at 1.5482 at price 1.5480
2008.06.16 16:19:14 Phy__BuySell EURUSD,H1: open #5712297 buy 0.01 EURUSD at 1.5482 ok
2008.06.16 16:19:14 Phy__BuySell EURUSD,H1: close #5712296 buy 0.01 EURUSD at 1.5483 at price 1.5480
2008.06.16 16:19:14 Phy__BuySell EURUSD,H1: open #5712296 buy 0.01 EURUSD at 1.5483 ok
2008.06.16 16:19:14 Phy__BuySell EURUSD,H1: close #5712295 buy 0.01 EURUSD at 1.5483 at price 1.5481
2008.06.16 16:19:13 Phy__BuySell EURUSD,H1: open #5712295 buy 0.01 EURUSD at 1.5483 ok
2008.06.16 16:19:13 Phy__BuySell EURUSD,H1: close #5712294 buy 0.01 EURUSD at 1.5483 at price 1.5481
2008.06.16 16:19:13 Phy__BuySell EURUSD,H1: open #5712294 buy 0.01 EURUSD at 1.5483 ok
2008.06.16 16:19:01 Phy__BuySell EURUSD,H1: Elapsed Time = 2844
2008.06.16 16:19:01 Phy__BuySell EURUSD,H1: close #5712293 buy 0.01 EURUSD at 1.5481 at price 1.5479
2008.06.16 16:19:01 Phy__BuySell EURUSD,H1: open #5712293 buy 0.01 EURUSD at 1.5481 ok
2008.06.16 16:19:01 Phy__BuySell EURUSD,H1: close #5712292 buy 0.01 EURUSD at 1.5481 at price 1.5479
2008.06.16 16:19:01 Phy__BuySell EURUSD,H1: open #5712292 buy 0.01 EURUSD at 1.5481 ok
2008.06.16 16:19:00 Phy__BuySell EURUSD,H1: close #5712291 buy 0.01 EURUSD at 1.5481 at price 1.5479
2008.06.16 16:19:00 Phy__BuySell EURUSD,H1: open #5712291 buy 0.01 EURUSD at 1.5481 ok
2008.06.16 16:19:00 Phy__BuySell EURUSD,H1: close #5712290 buy 0.01 EURUSD at 1.5481 at price 1.5479
2008.06.16 16:19:00 Phy__BuySell EURUSD,H1: open #5712290 buy 0.01 EURUSD at 1.5481 ok
2008.06.16 16:18:59 Phy__BuySell EURUSD,H1: close #5712289 buy 0.01 EURUSD at 1.5481 at price 1.5479
2008.06.16 16:18:59 Phy__BuySell EURUSD,H1: open #5712289 buy 0.01 EURUSD at 1.5481 ok
2008.06.16 16:18:43 Phy__BuySell EURUSD,H1: Elapsed Time = 3031
2008.06.16 16:18:43 Phy__BuySell EURUSD,H1: close #5712286 buy 0.01 EURUSD at 1.5480 at price 1.5478
2008.06.16 16:18:42 Phy__BuySell EURUSD,H1: open #5712286 buy 0.01 EURUSD at 1.5480 ok
2008.06.16 16:18:42 Phy__BuySell EURUSD,H1: close #5712285 buy 0.01 EURUSD at 1.5479 at price 1.5478
2008.06.16 16:18:42 Phy__BuySell EURUSD,H1: open #5712285 buy 0.01 EURUSD at 1.5479 ok
2008.06.16 16:18:42 Phy__BuySell EURUSD,H1: close #5712284 buy 0.01 EURUSD at 1.5479 at price 1.5477
2008.06.16 16:18:41 Phy__BuySell EURUSD,H1: open #5712284 buy 0.01 EURUSD at 1.5479 ok
2008.06.16 16:18:41 Phy__BuySell EURUSD,H1: close #5712283 buy 0.01 EURUSD at 1.5479 at price 1.5477
2008.06.16 16:18:41 Phy__BuySell EURUSD,H1: open #5712283 buy 0.01 EURUSD at 1.5479 ok
2008.06.16 16:18:40 Phy__BuySell EURUSD,H1: close #5712282 buy 0.01 EURUSD at 1.5479 at price 1.5477
2008.06.16 16:18:40 Phy__BuySell EURUSD,H1: open #5712282 buy 0.01 EURUSD at 1.5479 ok
2008.06.16 16:18:33 Phy__BuySell EURUSD,H1: Elapsed Time = 2937
2008.06.16 16:18:33 Phy__BuySell EURUSD,H1: close #5712281 buy 0.01 EURUSD at 1.5479 at price 1.5477
2008.06.16 16:18:33 Phy__BuySell EURUSD,H1: open #5712281 buy 0.01 EURUSD at 1.5479 ok
2008.06.16 16:18:33 Phy__BuySell EURUSD,H1: close #5712280 buy 0.01 EURUSD at 1.5479 at price 1.5477
2008.06.16 16:18:33 Phy__BuySell EURUSD,H1: open #5712280 buy 0.01 EURUSD at 1.5479 ok
2008.06.16 16:18:32 Phy__BuySell EURUSD,H1: close #5712279 buy 0.01 EURUSD at 1.5479 at price 1.5477
2008.06.16 16:18:32 Phy__BuySell EURUSD,H1: open #5712279 buy 0.01 EURUSD at 1.5479 ok
2008.06.16 16:18:32 Phy__BuySell EURUSD,H1: close #5712278 buy 0.01 EURUSD at 1.5480 at price 1.5478
2008.06.16 16:18:31 Phy__BuySell EURUSD,H1: open #5712278 buy 0.01 EURUSD at 1.5480 ok
2008.06.16 16:18:31 Phy__BuySell EURUSD,H1: close #5712277 buy 0.01 EURUSD at 1.5480 at price 1.5478
2008.06.16 16:18:31 Phy__BuySell EURUSD,H1: open #5712277 buy 0.01 EURUSD at 1.5480 ok

 

right, ok - thanks for input... I'll still do the checks anyway.

 

Hai im a newbie. I had 3 script that works in 14pairs cause i plan to using basket trading. The scripts is:

1. Buy All

2. Sell All

3. Closed All

The problem is can you make the buy or sell script had an magic number so when i closed all trades that opened by my buy or sell scripts

it didn't affecting my other trades that is opened by my EA. It's just closed the 14 pairs that i opened by the scripts (buy or sell). And also can you make the scripts open more faster?

Can you help me?

And also i attached the files of my scripts ok...

Files:
mynscripts.rar  11 kb
mymscripts.rar  11 kb
Reason: