trade.ResultRetcode() is giving me zero
If your program compiles without any error but doesn't do what it should start the debugger and check the relevant variables:
https://www.metatrader5.com/en/metaeditor/help/development/debug // Code debugging
https://www.mql5.com/en/articles/2041 // Error Handling and Logging in MQL5
https://www.mql5.com/en/articles/272 // Tracing, Debugging and Structural Analysis of Source Code
https://www.mql5.com/en/articles/35 // scrol down to: "Launching and Debuggin"
- www.metatrader5.com
I Have insert a Flag to print the ticket number so we can see if the problem was in there, but number ticket is ok, so the problem comes from PositionClosePartial, any Idea??
You can not get the ticket until you first select a position https://www.mql5.com/en/docs/trading/positiongetinteger
MT5: first select a position via CPositionInfo, directly, or by 'MT4Orders' library (2016)
Goof day can anyone help me with these, I am trying to close partial my positions but I get error in the trade because it does not enter to the if() trade
I try to print error using trade.ResultRetcode() but it gives me " method failed. Return code=0. Code description: unknown retcode 0
I also ron my EA in Backtesting and this woks fine it does closePartial so I dont know why It does Not works running the EA normally
Can anyoe help me please