Is RefreshRates() a must?

 

I'm at the stage now where I am in essence dotting the i's and crossing the t's - Been forward testing for over a month now and its performed pretty good, as well as give me opportunities to flatten out a few mishaps.

Where I am now is thinking about orders not going through or being rejected by the server (and plenty of other scenario's). In an event such as this, would it just take a RefreshRates() and continue; (loop) on an error, like OrderSend failing, to get it right?

I guess I am asking for some little tips (from some of you experienced guys!) of things I may not be foreseeing yet, due to lack of experience in terms of server end issues with the broker, terminal crashes etc... ways in which I could technically tighten up my EA for random scenarios or things I may want to consider?

 
You only need rr after sleep and between server calls (send/modify/close) as those take time.
 
DomGilberto:

I'm at the stage now where I am in essence dotting the i's and crossing the t's - Been forward testing for over a month now and its performed pretty good, as well as give me opportunities to flatten out a few mishaps.

Where I am now is thinking about orders not going through or being rejected by the server (and plenty of other scenario's). In an event such as this, would it just take a RefreshRates() and continue; (loop) on an error, like OrderSend failing, to get it right?

I guess I am asking for some little tips (from some of you experienced guys!) of things I may not be foreseeing yet, due to lack of experience in terms of server end issues with the broker, terminal crashes etc... ways in which I could technically tighten up my EA for random scenarios or things I may want to consider?

There is guidance that tells you what you should do in the event of various errors . . . for example: error 130 "Stops are too close, or prices are ill-calculated or unnormalized (or in the open price of a pending order). The attempt can be repeated only if the error occurred due to the price obsolescense. After 5-second (or more) delay, it is necessary to refresh datausing the RefreshRates function and make a retry. If the error does not disappear, all attempts to trade must be stopped, the program logic must be changed."

Execution errors

 

Ok cool thanks chaps!

Reason: