POSITION_COMMISION at MQL5 ,,

 
how to take commission value on an active position on mql5?...

previously this message was not there, but when I recompile, a message like this appears, is this new?..


Commision1 Commision2

 
Ridwan Salahudin:
how to take commission value on an active position on mql5?...

previously this message was not there, but when I recompile, a message like this appears, is this new?..



you have to go through the deals of the position , and collect fees and commisions from the deals of that position.

 
Ridwan Salahudinhow to take commission value on an active position on mql5?... previously this message was not there, but when I recompile, a message like this appears, is this new?..

This is not new - there are quite old discussions about this difference, in particular, between MQL4 and MQL5:

 
Vinicius Pereira De Oliveira #:

This is not new - there are quite old discussions about this difference, in particular, between MQL4 and MQL5:


thanks , so A position never have commission, only deals have, but the problem is , "Deals" just in history , but if i wanna close position when my profit is $10 with calculation Profit + Swap + Commision from Activate Position , how can program get Value Commision from History order ?.. 

 
Ridwan Salahudin #:


thanks , so A position never have commission, only deals have, but the problem is , "Deals" just in history , but if i wanna close position when my profit is $10 with calculation Profit + Swap + Commision from Activate Position , how can program get Value Commision from History order ?.. 

try this , although i have not tested it for commisions that come after the closure and i bet it does not include the calculation, 

but try it nontheless and let us know if it includes commisions

OrderCalcProfit - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5

Documentation on MQL5: Trade Functions / OrderCalcProfit
Documentation on MQL5: Trade Functions / OrderCalcProfit
  • www.mql5.com
The function calculates the profit for the current account, in the current market conditions, based on the parameters passed. The function is used...