Why won't `trade.PositionClose(PositionGetSymbol(0)` close positions?
I have tried multiple approaches to this, based on the documentation and on information I've found in this forum, and I can't get anything to work.
Simple version:
Same thing but with a bunch of Print statements to try to track down the issues:
The Symbol printed out by the Print(PositionGetSymbol(0)) line is correct. The error message simply says "10006 Request rejected" and no positions ever close.
I understand closing positions is complex in MQL5, but this is the Standard Library function. It's pretty hard to get it wrong...? What could possibly be causing this to reject?
Thanks in advance for any help.
I have tried multiple approaches to this, based on the documentation and on information I've found in this forum, and I can't get anything to work.
Simple version:
Same thing but with a bunch of Print statements to try to track down the issues:
The Symbol printed out by the Print(PositionGetSymbol(0)) line is correct. The error message simply says "10006 Request rejected" and no positions ever close.
I understand closing positions is complex in MQL5, but this is the Standard Library function. It's pretty hard to get it wrong...? What could possibly be causing this to reject?
Thanks in advance for any help.