Please any one can help with this:
-I want to know what is the reference symbol closed price used on the MT4 profit and loss calculation.
(I always find some differences between my calculations and the MT4 calculations when it comes to the indirect currencies closed trades.)
-Where can i find the MT4 API documentation?
Show your calculation.
There is no MT4 API, just mql4.
thank you for the reply.
this is the formula:
for example AUDCAD: buy 1.0 lot AUDCAD at 2.00000 and close at 2.00001 , profit = 1.00 /USDCAD
I always get a different result (small fracture) when i close the order on the indirect crosses symbols, when the order is open the floating profit and loss is always the same, but when i close the order i get a different result than the one i have on the MT4 system, so my difference should be connected to the profit and loss formula (i think so). so if possible to get the formula directly from the Meta support so i can use the same formula in my calculations also
I`m using this formula for profit and loss calculation:
According to my calculation using this formula is -16.41
According to the MT4 calculation the profit is -16.58
I think I misusing the reference number for closing !
Please check the attached screenshot , the numbers are highlighted in RED.
Show your true code for the calculations, not just your assumption of what the formula should be, because there might be bugs in your code or misinterpretations of the formula.
Also, you have to consider using either the Bid or Ask price for the conversion depending on whether it is a Buy or a Sell (in other words, consider the spread of the conversion).
By the way, if all you want to do is calculate the Profit in terms of the Deposit/Balance currency, you can just use the OrderProfit() function.
1 lot at (1.01412-1.01434) = -22 CAD
Now you need to convert this to USD but you don't say what was the USDCAD rate at this time. (We can see a lot of things on your screenshot but not USDCAD quotation !).
In our side we are using the following numbers:
contract size 100000
ref close 1.34029
100000 * (1.01412 - 1.01434) *1/1.34029 =
IN MT SYSTEM we need to know what was the ref close for ticket 356650 to calculate the PL
ref close ????