You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
Could you Implement ResultRetcode() CTrade function in MT5?
For example, if trade.PositionClose(ticket, deviation) returns false I need to know exact error was occurred. In my case it was NO_MONEY and ResultRetcode() returned the code: 10019.
From PositionClose article:
Note
Successful completion of the PositionClose(...) method does not always mean successful execution of the trade operation. It is necessary to check the result of trade request (trade server return code) using ResultRetcode().
The text was updated successfully, but these errors were encountered:
Function ResultRetcode can't be implemented because it can work with CTrade structure only. But this structure is not stored after call function PositionClose.
I have added out parameter to function PositionClose (same to PositionOpen):
public bool PositionClose(ulong ticket, ulong deviation, out MqlTradeResult result)
public bool PositionClose(ulong ticket, out MqlTradeResult result)
MqlTradeResult structure has all needed information about trade function.
Please confirm, is this implementation correct for you?
Hi!
Could you Implement ResultRetcode() CTrade function in MT5?
For example, if trade.PositionClose(ticket, deviation) returns false I need to know exact error was occurred. In my case it was NO_MONEY and ResultRetcode() returned the code: 10019.
From PositionClose article:
The text was updated successfully, but these errors were encountered: