- CTrade::FillingCheck - possible bug introduced since Jan 2013
- Get in touch with developers using Service Desk!
- Poblem with SymbolInfoInteger( )
I don't believe it will be possible, because commission depends on both the entry price AND the exit price. Part of the commission is calculated when you enter the market and the other part when you exit the market.
Here is an old post of mine with some relevant information. Please note the paragraph marked as "EDIT2":
Forum on trading, automated trading systems and testing trading strategies
Question about Tester Commisions and Swaps
Fernando Carreiro, 2017.01.12 23:25
Commissions can be represented as an equivalent value in pips yes, but not swaps as that is dependent on how long the order remains open and if it is hit by the triple swap day or not.
Here is an example (but will differ depending on some factors, for which you will have to change depending on your case):
The number of Pips that your commission ($ per million) represents in the case of GBP/USD and a USD Account Balance can be calculated as follows:
Pip Equivalent = Currency Price * Commission Rate * 2 Operations / 100
For example, if your GBP/USD Price is 1.62012 and your commission is $35 per million, then
Pip Equivalent = 1.62012 * 35 * 2 / 100 = 1.134084 ~ 1.2 pips (after ceiling adjustment)
If your average spread is 0.94 pips and commission is 1.2 pips, then total cost is 2.14 pips average.
EDIT: More details:
The "100" has nothing to do with percentage but rather the resultant value after factoring Contract Size and Pip Value for a Standard Lot of volume.
Here is the correct calculation in detail:
Contract Size = 100000 (Standard Lot Contract Size)
Pip Value = $10.00 (for Standard Lot of ???/USD and USD Account Balance)
Currency Price = 1.62012 (example for GBP/USD)
Value = Currency Price x Contract Size = $162012.00
Turnover = Value x 2 (open & close) = $324024.00
Commission Value = $35.00
Commission Scale = $1000000.00 (Million $)
Commission Rate = Commission Value / Commission Scale = 0.000035
Commission per Trade = Turnover x Commission Rate = $11.34084
Commission in Pips = Commission per Trade / Pip Value = 1.134084 pips
Thus the resultant simplified calculation is as follows:
Commission in Pips = Currency Price * Commission Value * 2 / 100
Commission in Pips = Currency Price * Commission Value / 50
EDIT2: However, please note that this is an approximation, as we are using the same Currency Price for both the Open and Close of the Trade. To be exact, we would have to calculate separate commissions for the opening price and closing price, but the resulting difference from the above calculation is negligible. But if you wish, just use the average price between the opening and closing prices, in the calculation, for a better approximation.Please note that this is only an example and depends on how commission is defined by your broker and in what currency it is expressed.
EDIT: Do a search as well. I found the following:
I don't believe it will be possible, because commission depends on both the entry price AND the exit price. Part of the commission is calculated when you enter the market and the other part when you exit the market.
Here is an old post of mine with some relevant information. Please note the paragraph marked as "EDIT2":
Thanks Fernando,
That did not convince me :-)
The terminal has the information already presented (and updated per symbol) in the GUI.
I just want to grab it from inside MQL5.
I'm talking about brokers charging commission per lot (zero-spread).
For the fixed spread, it is easy:
just the difference between ask and bid price X amount traded then convert to the account currency based on the instant rate.
Even if it did not convince you, the fact is that neither MetaTrader nor MQL provide any way of obtaining the commission value BEFORE the order is placed.
It is only able to provide partial commission values while the position is open, and the final value once it is closed.
Some brokers however, don't even support that and list the commission as a transaction value on your trade history report.
Even if it did not convince you, the fact is that neither MetaTrader nor MQL provide any way of obtaining the commission value BEFORE the order is placed.
It is only able to provide partial commission values while the position is open, and the final value once it is closed.
Some brokers however, don't even support that and list the commission as a transaction value on your trade history report.
Is there a programagic way (like SymbolInfoDouble, or AccountInfoDouble) to get the broker's commission per lot.
other logic, maybe can do with manual,
the mean input manual as comission, with calculation 1 lot = xx comission..?
and yes, this is no auto detection..because different symbol can different number comission.
other logic, maybe can do with manual,
the mean input manual as comission, with calculation 1 lot = xx comission..?
and yes, this is no auto detection..because different symbol can different number comission.
Thanks Fernando,
That did not convince me :-)
The terminal has the information already presented (and updated per symbol) in the GUI.
I just want to grab it from inside MQL5.
I'm talking about brokers charging commission per lot (zero-spread).
For the fixed spread, it is easy:
just the difference between ask and bid price X amount traded then convert to the account currency based on the instant rate.
What do you mean ? I have never seen that in the GUI, what I missed ?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use