Return the Value of TP and SL

To add comments, please log in or register
Guilherme Mendonca
193
Guilherme Mendonca  

Is there any MQL5 code to return the finance value (money) of TP and SL position?

Marco vd Heijden
Moderator
11763
Marco vd Heijden  
Yes.
Guilherme Mendonca
193
Guilherme Mendonca  
Marco vd Heijden:
Yes.

Ok, but is there a formule or I need to write a code?

lippmaje
747
lippmaje  
double profit;
if(!OrderCalcProfit(ORDER_TYPE_BUY,_Symbol,lots,price_open,price_close,profit) Print("error: ",GetLastError());
Returns the profit/loss in account's currency. And price_close should be your take profit or stop loss price.
To add comments, please log in or register