idh:
Why do you need to worry about the ticket variable ? it will be overwritten when you do your next OrderSend() and if it's a local variable it will be re-initialised when the function that it is in is next called.
Hi there
When one uses the ordersend/orderclose command, I know that ordersend returns -1 if it fails, and some positive integer if it succeeds, we can store this in a variable called ticket.
when you use orderclose, that can return true or false to indicate whether the close command succeeded, but what happens with the ticket variable? does it just remain what it was last set to? and if it does, I assume that If I am going to use it in subsequent if else checks, I should reset it to something meaningless like zero?

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi there
When one uses the ordersend/orderclose command, I know that ordersend returns -1 if it fails, and some positive integer if it succeeds, we can store this in a variable called ticket.
when you use orderclose, that can return true or false to indicate whether the close command succeeded, but what happens with the ticket variable? does it just remain what it was last set to? and if it does, I assume that If I am going to use it in subsequent if else checks, I should reset it to something meaningless like zero?
thanks
Ian