What makes you think anything has changed ? I didn't notice it.
POSITION_COMMISSION is still compiling and undocumented. I didn't investigate to check if it works correctly or not.
You need to use DEAL_COMMISSION.

- www.mql5.com
What makes you think anything has changed ? I didn't notice it.
POSITION_COMMISSION is still compiling and undocumented. I didn't investigate to check if it works correctly or not.
PositionGetDouble(POSITION_COMMISSION) doesn't work (any longer). The first sign is that POSITION_COMMISSION is not offered by AutoComplete or highlighted in MetaEditor when typed manually and — most importantly — ...
Alert(PositionGetDouble(POSITION_COMMISSION));
...always returns 0, even if commission is charged according to MetaTrader 5 → Toolbox → History → "Commission" column.
PositionGetDouble(POSITION_COMMISSION) doesn't work (any longer). The first sign is that POSITION_COMMISSION is not offered by AutoComplete or highlighted in MetaEditor when typed manually and — most importantly — ...
Alert(PositionGetDouble(POSITION_COMMISSION));
...always returns 0, even if commission is charged according to MetaTrader 5 → Toolbox → History → "Commission" column.
I know. I just said you nothing has changed recently to my knowledge, it's like that for at least 3 years.
Ok, so PositionGetDouble(POSITION_COMMISSION) hasn't worked for 3 years. But shouldn't it finally be fixed? We need this function to accurately calculate the current profit. Could you ask MetaQuotes to fix it, please?
Are you reading what I write ?
Forum on trading, automated trading systems and testing trading strategies
POSITION_COMMISSION-property removed!?
Alain Verleyen, 2020.06.29 20:25
What makes you think anything has changed ? I didn't notice it.
POSITION_COMMISSION is still compiling and undocumented. I didn't investigate to check if it works correctly or not.
You need to use DEAL_COMMISSION.
Are you reading what I write ?
I know DEAL_COMMISSION, but it's a somewhat different approach and who knows whether it delivers exactly the same commission-value as POSITION_COMMISSION. DEAL_COMMISSION delivers only the half-turn commission and only for the past — and you have to explicitly define the past, too, and query all that past just to get that one, current value. Anyway, if MetaQuotes still use PositionGetDouble(POSITION_COMMISSION) themselves in their own Standard Library, then it follows that PositionGetDouble(POSITION_COMMISSION) should still work, too, or else it's a bug in their Standard Library and the Library needed to be fixed. I'd prefer PositionGetDouble(POSITION_COMMISSION) to work again because the more options they give to their clients the better, and PositionGetDouble(POSITION_COMMISSION) would be more straightforward than the other option. Don't you agree? ;-)

- www.mql5.com
Commission on forex is single trip, so exit commission is only known AFTER closing position.This means there can not exist a POSITION_COMISSION before the event. For exchange it may be number of ways commission is handled.
Like always there is no single "fix all" cheap way out. Deal with it.
I know DEAL_COMMISSION, but it's a somewhat different approach and who knows whether it delivers exactly the same commission-value as POSITION_COMMISSION. DEAL_COMMISSION delivers only the half-turn commission and only for the past — and you have to explicitly define the past, too, and query all that past just to get that one, current value. Anyway, if MetaQuotes still use PositionGetDouble(POSITION_COMMISSION) themselves in their own Standard Library, then it follows that PositionGetDouble(POSITION_COMMISSION) should still work, too, or else it's a bug in their Standard Library and the Library needed to be fixed. I'd prefer PositionGetDouble(POSITION_COMMISSION) to work again because the more options they give to their clients the better, and PositionGetDouble(POSITION_COMMISSION) would be more straightforward than the other option. Don't you agree? ;-)
No I don't agree, see Enrique answer. POSITION_COMMISSION is obsolete because it's not a workable solution to deal with commission on all markets managed by MT5, it's not universal.
There exist several cases where effectively the commission is not known before the position close.
Commission on forex is single trip, so exit commission is only known AFTER closing position.This means there can not exist a POSITION_COMISSION before the event. For exchange it may be number of ways commission is handled.
Like always there is no single "fix all" cheap way out. Deal with it.
Personally i do not use any of the standard libs so my answer was not with that in mind.
If it is used in the standard lib, then it needs to be fixed.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I just noticed that MetaQuotes' own Commission()-function no longer works, because its code is...
}
...and POSITION_COMMISSION seems to no longer be a member of ENUM_POSITION_PROPERTY_DOUBLE, which would be available to PositionGetDouble().
Since MetaQuotes did not update their own Commission()-function accordingly and since POSITION_COMMISSION still is an important piece of information I assume the loss of POSITION_COMMISSION is a mistake.
→ @MetaQuotes: Can you please add POSITION_COMMISSION to ENUM_POSITION_PROPERTY_DOUBLE again or how else should we get the commission of the current position??
Many thanks in advance!