Profit formula?

 
Can anyone give me formula how MetaTrader 5 calculates profit? Probably somehow it depends on price, volume and maybe more arguments. Thanks!
 
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!

 
 
Is there any equivalent function of OrderCalcProfit for MQL4?
 
https://docs.mql4.com/
MQL4 Reference
MQL4 Reference
  • docs.mql4.com
MQL4 Reference
 
Alain Verleyen #:
https://docs.mql4.com/

mql4 does not have equivalent function for   OrderCalcProfit()

 
Balachandran Chandrasekar #:

mql4 does not have equivalent function for   OrderCalcProfit()

Well, MT4 is outmoded and there is and will be no further development. You have to write your own function for that.
Reason: