Problem with execution of orders......

 
Hello,

Why do we have to wait until price changes before the start() function is executued?

The program should be running all the time. I mean the start() function should be executing from start to finish all the time and not wait until price changes.

I have tried using the RefreshRates() function as you recommended last time, but this does not fix the problem.

Is the requirement that orders will only be sent once the start function is called due to a change in price, due to MetaQuotes or broker rules?

If the price stays constant for 20 seconds, I should be able to place 2 orders in this time, and not have to wait until price changes (as you know when the price changes this causes the program to run / 1 iteration / start () function to execute. Why is MT4 set-up this way, and how can I fix this problem (such that I can place an order each 10 seconds, and not have to wait until price changes which may take 20-30 seconds in quite market activity times)?

Thank you in advance

RJF
 
Hello,

Why do we have to wait until price changes before the start() function is executued?

The program should be running all the time. I mean the start() function should be executing from start to finish all the time and not wait until price changes.

I have tried using the RefreshRates() function as you recommended last time, but this does not fix the problem.

Is the requirement that orders will only be sent once the start function is called due to a change in price, due to MetaQuotes or broker rules?

If the price stays constant for 20 seconds, I should be able to place 2 orders in this time, and not have to wait until price changes (as you know when the price changes this causes the program to run / 1 iteration / start () function to execute. Why is MT4 set-up this way, and how can I fix this problem (such that I can place an order each 10 seconds, and not have to wait until price changes which may take 20-30 seconds in quite market activity times)?

Thank you in advance

RJF

That is not really true!
It is my understanding that once the start() is activated you can send as many orders as you want until you execute "return"
The point is that if the market price will change during that period, the following orders will not get accepted see (slippage).
You really need current Close() value in order to send valid order.
So you can only send as many orders as you can until a new tick occurs and if that will take one (1) minute you can keep sending orders for one (1) minute or more.
No other platform can do that differently. The MT4 is not exception.

Of course, if you monitor Close() value in your loop you can send unlimited amount of the orders during only one start().