Download MetaTrader 5
To add comments, please log in or register
Sign up for MQL5.community to post your Forum topic
SteelAce
171
SteelAce 2015.01.18 08:34 
Can anyone give me formula how MetaTrader 5 calculates profit? Probably somehow it depends on price, volume and maybe more arguments. Thanks!
SteelAce
171
SteelAce 2015.01.19 20:08  
I have found answer to my question. It is


bool  OrderCalcProfit(

   ENUM_ORDER_TYPE       action,           // type of the order (ORDER_TYPE_BUY or ORDER_TYPE_SELL)
   string                symbol,           // symbol name
   double                volume,           // volume
   double                price_open,       // open price
   double                price_close,      // close price
   double&               profit            // variable for obtaining the profit value

   );

Thank you anyway!

Alain Verleyen
Moderator
29411
Alain Verleyen 2015.01.19 21:06  
aknetmma
44
aknetmma 2016.06.14 14:05  
Is there any equivalent function of OrderCalcProfit for MQL4?
Alain Verleyen
Moderator
29411
Alain Verleyen 2016.06.14 15:49  
https://docs.mql4.com/
MQL4 Reference
MQL4 Reference
  • docs.mql4.com
MQL4 Reference
/
To add comments, please log in or register