"
At incoming of new quotes, the start() function of the attached experts and custom indicators will be executed. If the start() function launched at the preceding quote was running when a new quote came, the new quote will be skipped by the expert. All new quotes income while the program was being executed are skipped by the program until the current execution of the start() function has been completed. After that, the start() function will be run only when a successive new quote incomes. For custom indicators, the start() function will be launched for recalculation after the current chart symbol or timeframe has been changed independently on new quotes incoming. The start() function will not be run when the expert properties window is open. The latter cannot be opened during the expert execution.
"
The question is how do you check to make sure that you are working with the latest tick ?
I came up with this little check but i cant tell if it works or not....
the first thing you do after start() is set the Bid and Ask
Then everytime you RefreshRates if there is a change you go back to start.
The goal is to not execute any orders if there is change in the price... I figured that with this you can avoid requotes and eliminate other strange errors.... Let me know your thoughts....
Also does anyone know how to figure out how long your EA takes to complete once it has been called..
At incoming of new quotes, the start() function of the attached experts and custom indicators will be executed. If the start() function launched at the preceding quote was running when a new quote came, the new quote will be skipped by the expert. All new quotes income while the program was being executed are skipped by the program until the current execution of the start() function has been completed. After that, the start() function will be run only when a successive new quote incomes. For custom indicators, the start() function will be launched for recalculation after the current chart symbol or timeframe has been changed independently on new quotes incoming. The start() function will not be run when the expert properties window is open. The latter cannot be opened during the expert execution.
"
The question is how do you check to make sure that you are working with the latest tick ?
I came up with this little check but i cant tell if it works or not....
the first thing you do after start() is set the Bid and Ask
PHP Code
int start() {
//Check to make sure our ticks match
double TickBid = Bid;
double TickAsk = Ask;
PHP Code
RefreshRates();if (Bid != TickBid || Ask != TickAsk)start();
Also does anyone know how to figure out how long your EA takes to complete once it has been called..
Keep it simple stoopid....