Hi there, the title says it all…In my EA (MT5) when the robot is closing position I want to check the profit of current position properly. I know there is a function “PositionGetDouble” but am not sure about how to use it properly. On my ECN account I pay commisions for each position opening cca. $2/lot + each position closing, totaling $4/lot. Besides that there may be positive or negative swap calculated.
So my question is how can I calculate my net profit for a certain position?
double x = PositionGetDouble(POSITION_PROFIT);
double y = PositionGetDouble(POSITION_SWAP);
Is variable “x” my net profit, or should I subtract variable “y” and commission which I don’t yet know where to get from.
Please suggest, much thanks in advance for your help.