Too many orders sent!
Hello,
In OnTick() function of my EA I have if statement to check an entry condition such as
This condition deals with closed candles therefore as soon as a candle expiries and the entry condition is valid an order has to be sent. However, not only one order is sent I have punch of orders sent around 10 orders!! Why is that?
Sometimes few orders are sent then few seconds another punch are sent again
There is nothing in your code to suggest that it only checks conditions once per bar.
Please study the following in the CodeBase. It caters for that exact situation.
Detecting the start of a new bar or candle
Fernando Carreiro, 2022.04.24 00:46
Detecting the start of a new bar or candle, in the OnTick() event handler of an expert advisor.
Hello,
In OnTick() function of my EA I have if statement to check an entry condition such as
This condition deals with closed candles therefore as soon as a candle expiries and the entry condition is valid an order has to be sent. However, not only one order is sent I have punch of orders sent around 10 orders!! Why is that?
Sometimes few orders are sent then few seconds another punch are sent again