I think that error can happen for different reasons, but I can see from the small snippet you posted that "double closeprice" maybe an issue. Try OrderClosePrice() instead.
Also, i can not remember why, but I was taught to use an int where you have isSuccess and have "if(isSuccess<=0). I am sure that this was one of the things that could cause different erroneous errors too when the bool returned a false, when the OrderClose Function actually returned a negative number for whatever reason.
Please post an update after you have tried different things and report what fixed your issue. Most posters do not report that their issue is fixed; leaving their responders "in the lurch", not knowing if they helped or not.
OrderClosePrice() is used to get closing price of already closed order so I think is't not relevant here. I can only close those orders manually
Krzysztof
This is regarding mt4 code, correct? OrderClosePrice() is used to get the bid or ask price of the selected trade. It may not fix your error, however, I know that when i used it, instead of Ask/Bid, especially when using loops, I would get less orrurence of closing related errors. Please try it and see.
This is regarding mt4 code, correct? OrderClosePrice() is used to get the bid or ask price of the selected trade. It may not fix your error, however, I know that when i used it, instead of Ask/Bid, especially when using loops, I would get less orrurence of closing related errors. Please try it and see.
yes, MT4. OK will try, must wait for next signal and its on daily charts...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello traders,
I have following code which give me error 129 even all looks OK. Any idea ?
Krzysztof