Is your ticket a static or global variable? Otherwise the ticket will be forgotten on the next tick (when the start function has been left and start is called again for a new tick).
Markus
i didnt even think of that, yes it is being forgotten on the next tick...
Thankyou Markus
You're welcome.
Good luck with your trading!
Markus
Good luck with your trading!
Markus
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
Basically i buy when a bar is higher than the previous high and close the position when the bar is lower than the previous low.
i can get the buy to work, but i cant close it and i keep getting this error : " invalid ticket for OrderClose function "
I dont understand what i am doing wrong.
Can someone please post some basic code on how you close an open position.
This is what i am using at the moment :
To Open:
and to Close (this is the problem) :