![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Question - how do I know the commission of a position in MQL5?
I did it in MQL4 like this
There is no commission in MQL5.
I looked in the order properties, and there is no commission as well. What should I do?
Question - how do I know the commission of a position in MQL5?
I did it in MQL4 like this
There is no commission in MQL5.
I looked in the order properties, and there is no commission as well. What should I do?
Question - how do I know the commission of a position in MQL5?
I did it in MQL4 like this
There is no commission in MQL5.
I looked in the order properties, and there is no commission as well. What should I do?
The library will return the correct value when calling
OrderCommission()
The source code shows the following
How about this... There is no POSITION_COMISSION property in the documentation, only DEAL_COMISSION in the transaction properties.
Thanks, I'll know another inaccuracy in the documentation.
Then how is the commission taken into account? It is not added to the profit of the position? Immediately after a trade to open a position, does it affect the balance?
The library will return the correct value when called
In the source code it's like this
Do you have the defines commented out at the end there, is that how it should be? One more thing. I will be making a video reel on my blog at YouTube translating from MQL4 to MQL5. Do you mind if I translate your library too? The link to kodobase, of course.
/* #define OrderClose MT4ORDERS::MT4OrderClose #define OrderModify MT4ORDERS::MT4OrderModify // нельзя, например: CTrade::OrderModify #define OrderDelete MT4ORDERS::MT4OrderDelete // нельзя, например: CTrade::OrderDelete #define OrdersHistoryTotal MT4ORDERS::MT4OrdersHistoryTotal #define OrderTicket MT4ORDERS::MT4OrderTicket #define OrderType MT4ORDERS::MT4OrderType // нельзя, например: CHistoryOrderInfo::OrderType #define OrderLots MT4ORDERS::MT4OrderLots #define OrderSymbol MT4ORDERS::MT4OrderSymbol #define OrderComment MT4ORDERS::MT4OrderComment #define OrderOpenPrice MT4ORDERS::MT4OrderOpenPrice #define OrderOpenTime MT4ORDERS::MT4OrderOpenTime #define OrderStopLoss MT4ORDERS::MT4OrderStopLoss #define OrderTakeProfit MT4ORDERS::MT4OrderTakeProfit #define OrderClosePrice MT4ORDERS::MT4OrderClosePrice #define OrderCloseTime MT4ORDERS::MT4OrderCloseTime #define OrderExpiration MT4ORDERS::MT4OrderExpiration #define OrderMagicNumber MT4ORDERS::MT4OrderMagicNumber #define OrderProfit MT4ORDERS::MT4OrderProfit #define OrderCommission MT4ORDERS::MT4OrderCommission #define OrderSwap MT4ORDERS::MT4OrderSwap #define OrderPrint MT4ORDERS::MT4OrderPrint */
How about this... There is no POSITION_COMISSION property in documentation, only in DEAL_COMISSION transaction properties.
Thanks, I'll know another inaccuracy in the documentation.
And there is no such property in documentation, but it compiles ) Here is everything that is in the terminal's help.
POSITION_VOLUME
Position volume
double
POSITION_PRICE_OPEN
Position price
double
POSITION_SL
Stop loss level for open position
double
POSITION_TP
Take Profit level for open position
double
POSITION_PRICE_CURRENT
Current price for the symbol
double
POSITION_SWAP
Accumulated swap
double
POSITION_PROFIT
Current profit
double
Look in the properties of the transaction. HistoryDealGetDouble(ticket, DEAL_COMMISSION);