I think this is a bug in MQL5. Maybe but I'll search more.
Please, provide the logs.
Stanislav Korotky:
Please, provide the logs.
Please, provide the logs.
Hi
Do you mean the logs of trades ?
trader77330:
That's a bug in Ctrade class, please report it to ServiceDesk.
Hi
Do you mean the logs of trades ?
Ok thanks for the clue.
I should say that in order to check the profit after a trade I use the following technique :
double balanceAfterTrade = getAccountBalance();
double balanceDiff = balanceAfterTrade - balanceBeforeTrade;
double getAccountBalance()
{
CAccountInfo ca;
return ca.Balance();
}

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
Hello all
I'm learning MQL5, and in my code CheckResultProfit always return 0.
What I do is :
then after some ticks :
int tradeResultRetcode = trade.ResultRetcode();
Print("tradeResultRetcode=" + tradeResultRetcode);
if (tradeResultRetcode == TRADE_RETCODE_DONE)
{
Print("tradeResultRetcode = TRADE_RETCODE_DONE <=> OK");
}
After that (and the problem is even if I do it before the sell call) :
double tradeResultProfit = trade.CheckResultProfit();
Print("Profit = ", tradeResultProfit);
And the output is always 0.0
Please any help welcome :)
Have a nice day