OrderSend() function / newbie question ...

 

Hello to everyone,

I live in Australia but want to use an MT4 FX broker in the USA. It normally takes about 500 milliseconds to send an order to USA broker's server and receive confirmation as to whether order was successful or failed. My question is as follows:

Within my EA when I use the OrderSend() function and then straight after this line call the GetLastError() function, will my EA program "pause" at the OrderSend() line and then "Wait" until my local computer receives order confirmation from the broker's server as to whether the order was successful or failed? Normally, it would take around 500 milliseconds for my local computer located in Australia to receive order confirmation from a USA FX broker, so does this mean that my EA program would wait for 500 ms at the OrderSend() line within my EA program until the status of the order is received ??? Then after my EA program gets order confirmation as to order success or failure, the rest of my EA program would then run. Is this how it would work in reality?

I just find it hard to imagine the EA program "pausing" for 500 ms at the OrderStatus() line of the EA program "waiting" for order status? Is this correct?

Thank you in advance, any help would be much appreciated.

Regards

Rod

 

so does this mean that my EA program would wait for 500 ms at the OrderSend() line within my EA program until the status of the order is received ??? Then after my EA program gets order confirmation as to order success or failure, the rest of my EA program would then run. Is this how it would work in reality?

Yes...

 

Thanks Matutin for you reply, I now understand how it works.

Also, if I send an order to my broker and wait 500 ms for order status confirmation, and then after 500ms get a "price changed" or "re-quote" error, if I then send another order straight away, will the broker disable my account or expert adviser due to "too frequent requests" to broker's server, in other words i might be sending an order every 500ms for say 10 seconds until it gets filled / executed / until order is successful? Will I see this problem in the real-world given that im only sending orders every 500 ms which is not that often, i hope ?

Thanks in advance for any help, much appreciated.

Regards

Rod

 
Rocket130713:

Thanks Matutin for you reply, I now understand how it works.

Also, if I send an order to my broker and wait 500 ms for order status confirmation, and then after 500ms get a "price changed" or "re-quote" error, if I then send another order straight away, will the broker disable my account or expert adviser due to "too frequent requests" to broker's server, in other words i might be sending an order every 500ms for say 10 seconds until it gets filled / executed / until order is successful? Will I see this problem in the real-world given that im only sending orders every 500 ms which is not that often, i hope ?

Thanks in advance for any help, much appreciated.

Regards

Rod


You can use slippage to avoid too many requote.
 

thanks Matutin for your reply and help, really appreciate this.

I wonder if say 10 requests each second for say 10 seconds would be classified by the broker as "too frequent requests" ?

Does anyone know how many server requests per second would be deemed as "too frequent requests" ?

Thanks in advance.

Regards

Rod

 

My broker says more than 15 per minute is too many and would constitute a breach of the terms of service, I'm glad you asked that question because it reminded me of a question I wanted to ask, what constitutes a server request ? Is it only Order requests or are there other functions in mql4 that also make requests to the brokers server for instance does the MarketInfo() function get information from the client terminal or does it request the information from the brokers server ?

 
Rocket130713:

thanks Matutin for your reply and help, really appreciate this.

I wonder if say 10 requests each second for say 10 seconds would be classified by the broker as "too frequent requests" ?

Does anyone know how many server requests per second would be deemed as "too frequent requests" ?

Thanks in advance.

Regards

Rod


I suppose it depends of the broker. Ask yours !
 

thanks Matutin and SDC, just hope my broker has this info handy and is prepared to tell me this info. but at least i have something to work with at the moment which is 15 times per minute is too frequent server request. suppose you can always go for a bit more and see what they say / see if you can get away with it without upsetting broker.

Reason: