Found my mistake... My mistake was that I didn't pass a majik to the position close function, but to the open function, and as a result the deal could not be selected by the majik...
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Then debug it. Print transaction tickets and see in the tester what is actually selected there. Add a filter for deal type, though.
The lot is displayed correctly, so the ticket is selected correctly.
the lot is correct, so the ticket is correct.
No. Both trades, In and Out, have the same lot. But the profit is not.
Here's my code. It works.
No. Both trades, In and Out, have the same lot. The profit is not.
Here's my code. It works.
tried it, your code gives 0.0 too)))
The account is hedged, if anything.tried it, your code gives 0.0 too)))
The account is hedged, if anything.Just checked everything on 2009 build. My code gives out what it should. If it gives 0, it means you have 0 there.
Just checked everything on the 2009 build. My code gives out what it is supposed to give out. If it gives 0, it means that you have 0 there.
How come, in the history there are closed trades with a non-zero result, and it gives 0
There is a possibility that the problem could be on the DC side.
There is a possibility that the problem may be on the DC side.
Tried it on Metaquotes and Robo, in the tester.
If you use CSymbolInfo in multicurrency, which is called by Name method at the moment of initialization:
During testing USDCAD symbol errors will occur:
no prices for symbolIf you use CSymbolInfo in multicurrency, which is called by Name method at the moment of initialization:
There will be errors for USDCAD symbol during testing:
Does anyone even understand what we're talking about?