Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

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

Posted

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

Posted

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

a New Year 2011 has come, and the challenge has just started 8-)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...