Download MetaTrader 5

Profit formula?

To add comments, please log in or register
SteelAce
203
SteelAce  
Can anyone give me formula how MetaTrader 5 calculates profit? Probably somehow it depends on price, volume and maybe more arguments. Thanks!
SteelAce
203
SteelAce  
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
33506
Alain Verleyen  
aknetmma
57
aknetmma  
Is there any equivalent function of OrderCalcProfit for MQL4?
Alain Verleyen
Moderator
33506
Alain Verleyen  
https://docs.mql4.com/
MQL4 Reference
MQL4 Reference
  • docs.mql4.com
MQL4 Reference
To add comments, please log in or register