junglist00 Posted October 27, 2010 Report Share Posted October 27, 2010 Hi. I would like to know code used in ea to retry after a requote. Basically ea tries to enter trade once, if there is a request it stops. Would like to have it keep trying (5-10) attempts before stopping Thanks Quote Link to comment Share on other sites More sharing options...
fxeasy5 Posted October 28, 2010 Report Share Posted October 28, 2010 You could use code from OrderReliable. http://sharebee.com/07e01566 scarface 1 Quote Link to comment Share on other sites More sharing options...
⭐ fscrp Posted October 28, 2010 Report Share Posted October 28, 2010 After previously reading up on the subject (I am sure I looked at OrderReliable at some point too), this is what I use. extern int Order_Retries = 7; extern int Order_Retries_Sleep = 5000; bool fnCheckOrderAllowed() { int tries = 1; while(tries < Order_Retries && !IsTradeAllowed()) { tries++; Sleep(Order_Retries_Sleep); } RefreshRates(); return(true); } I call the function looking for a true result to allow the order send fxeasy5 and scarface 2 Quote Link to comment Share on other sites More sharing options...
junglist00 Posted October 29, 2010 Author Report Share Posted October 29, 2010 Thanks, guys ... will looking into this. Quote Link to comment Share on other sites More sharing options...
scarface Posted October 29, 2010 Report Share Posted October 29, 2010 other ways ... Hi, Good day, Thanks for our members for helping out, and that was a great way on how to use a re-try entry. There are some other ways like: place this code above your Sendorder() function// while(Retry<5 && !IsTradeAllowed()) {Retry++; Sleep(2000); You can see that the last limit is 5 so you can change it to any number, but you need to know how many tries you need. and this little code has to be set under the Sendorder() function// Sleep (2000); And this code you can choose to set it up at the beginning of your code at Start() function, or on top of your main code: int Retry=0; you can make it: extern int Retry=0; if you like. remember that the distance between the number of tries and the fixed number has to meet your needs. I hope this point is clear. There is another way using while function, but it would be a little hard for you to set it up so for now try this one. Good luck, SF t2g 1 Quote a New Year 2011 has come, and the challenge has just started 8-) Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.