I am trying to install it in my mac os, but im getting compilation errors. even though i have followed each step perfectly.
Below is the ss
View attachment 39567
Could you please scroll the list of errors up to the first error it prints? It's usually the most important one.
 
Could you please scroll the list of errors up to the first error it prints? It's usually the most important one.
below is the list of all errors and the screenshot of the top error:-


undeclared identifier 'MqlCommission' Position Sizer.mqh 9699 5
undeclared identifier 'commissions' Position Sizer.mqh 9699 19
'commissions' - some operator expected Position Sizer.mqh 9699 19
']' - unexpected token Position Sizer.mqh 9699 31
undeclared identifier 'SymbolInfoCommissions' Position Sizer.mqh 9700 17
',' - unexpected token Position Sizer.mqh 9700 55
'SymbolForTrading' - some operator expected Position Sizer.mqh 9700 39
semicolon expected Position Sizer.mqh 9700 57
undeclared identifier 'commissions' Position Sizer.mqh 9700 57
')' - unexpected token Position Sizer.mqh 9700 68
undeclared identifier 'commissions' Position Sizer.mqh 9735 37
'[' - array required Position Sizer.mqh 9735 48
';' - unexpected token Position Sizer.mqh 9735 58
';' - unexpected token Position Sizer.mqh 9735 58
'continue' - semicolon expected Position Sizer.mqh 9736 31
undeclared identifier 'commissions' Position Sizer.mqh 9740 13
'[' - array required Position Sizer.mqh 9740 24
undeclared identifier 'SYMBOL_COMMISSION_RANGE_VOLUME' Position Sizer.mqh 9740 42
undeclared identifier 'commissions' Position Sizer.mqh 9741 18
'[' - array required Position Sizer.mqh 9741 29
undeclared identifier 'SYMBOL_COMMISSION_RANGE_VALUE' Position Sizer.mqh 9741 47
undeclared identifier 'commissions' Position Sizer.mqh 9745 37
'[' - array required Position Sizer.mqh 9745 48
undeclared identifier 'commissions' Position Sizer.mqh 9745 96
'[' - array required Position Sizer.mqh 9745 107
undeclared identifier 'commissions' Position Sizer.mqh 9745 134
'[' - array required Position Sizer.mqh 9745 145
';' - unexpected token Position Sizer.mqh 9747 22
'{' - some operator expected Position Sizer.mqh 9746 13
';' - unexpected token Position Sizer.mqh 9748 22
'(' - unbalanced left parenthesis Position Sizer.mqh 9745 16
empty controlled statement found Position Sizer.mqh 9748 22
undeclared identifier 'commissions' Position Sizer.mqh 9752 13
'[' - array required Position Sizer.mqh 9752 24
undeclared identifier 'SYMBOL_COMMISSION_DISABLED' Position Sizer.mqh 9752 45
'continue' must be used within some loop only Position Sizer.mqh 9752 73
undeclared identifier 'commissions' Position Sizer.mqh 9756 13
'[' - array required Position Sizer.mqh 9756 24
undeclared identifier 'SYMBOL_COMMISSION_MONEY_SYMBOL_BASE' Position Sizer.mqh 9756 45
undeclared identifier 'commissions' Position Sizer.mqh 9757 18
'[' - array required Position Sizer.mqh 9757 29
undeclared identifier 'SYMBOL_COMMISSION_MONEY_SYMBOL_PROFIT' Position Sizer.mqh 9757 50
undeclared identifier 'commissions' Position Sizer.mqh 9758 18
'[' - array required Position Sizer.mqh 9758 29
undeclared identifier 'SYMBOL_COMMISSION_MONEY_SYMBOL_MARGIN' Position Sizer.mqh 9758 50
undeclared identifier 'commissions' Position Sizer.mqh 9759 18
'[' - array required Position Sizer.mqh 9759 29
undeclared identifier 'SYMBOL_COMMISSION_MONEY_SPECIFIED' Position Sizer.mqh 9759 50
undeclared identifier 'commissions' Position Sizer.mqh 9761 17
'[' - array required Position Sizer.mqh 9761 28
implicit conversion from 'unknown' to 'string' Position Sizer.mqh 9761 17
undeclared identifier 'commissions' Position Sizer.mqh 9761 63
'[' - array required Position Sizer.mqh 9761 74
implicit conversion from 'unknown' to 'string' Position Sizer.mqh 9761 63
undeclared identifier 'commissions' Position Sizer.mqh 9762 22
'[' - array required Position Sizer.mqh 9762 33
implicit conversion from 'unknown' to 'string' Position Sizer.mqh 9762 22
undeclared identifier 'commissions' Position Sizer.mqh 9762 59
'[' - array required Position Sizer.mqh 9762 70
implicit conversion from 'unknown' to 'string' Position Sizer.mqh 9762 59
undeclared identifier 'commissions' Position Sizer.mqh 9770 17
'[' - array required Position Sizer.mqh 9770 28
':' - unexpected token Position Sizer.mqh 9772 45
'commissions' - illegal switch expression type Position Sizer.mqh 9770 17
'case' - '{' beginning bracket expected Position Sizer.mqh 9773 9
illegal 'else' without matching 'if' Position Sizer.mqh 9778 13
'break' must be used within some loop or switch statement Position Sizer.mqh 9779 13
illegal 'case' or 'default' without matching 'switch' Position Sizer.mqh 9780 9
'break' must be used within some loop or switch statement Position Sizer.mqh 9782 13
illegal 'case' or 'default' without matching 'switch' Position Sizer.mqh 9783 9
'break' must be used within some loop or switch statement Position Sizer.mqh 9785 13
illegal 'case' or 'default' without matching 'switch' Position Sizer.mqh 9786 9
undeclared identifier 'commissions' Position Sizer.mqh 9788 61
'[' - array required Position Sizer.mqh 9788 72
'break' must be used within some loop or switch statement Position Sizer.mqh 9789 13
illegal 'case' or 'default' without matching 'switch' Position Sizer.mqh 9790 9
'}' - not all control paths return a value Position Sizer.mqh 9835 1
72 errors, 5 warnings 72 5


Screenshot 2026-08-26 at 9.01.01 PM.png
 
below is the list of all errors and the screenshot of the top error:-


undeclared identifier 'MqlCommission' Position Sizer.mqh 9699 5
undeclared identifier 'commissions' Position Sizer.mqh 9699 19
'commissions' - some operator expected Position Sizer.mqh 9699 19
']' - unexpected token Position Sizer.mqh 9699 31
undeclared identifier 'SymbolInfoCommissions' Position Sizer.mqh 9700 17
',' - unexpected token Position Sizer.mqh 9700 55
'SymbolForTrading' - some operator expected Position Sizer.mqh 9700 39
semicolon expected Position Sizer.mqh 9700 57
undeclared identifier 'commissions' Position Sizer.mqh 9700 57
')' - unexpected token Position Sizer.mqh 9700 68
undeclared identifier 'commissions' Position Sizer.mqh 9735 37
'[' - array required Position Sizer.mqh 9735 48
';' - unexpected token Position Sizer.mqh 9735 58
';' - unexpected token Position Sizer.mqh 9735 58
'continue' - semicolon expected Position Sizer.mqh 9736 31
undeclared identifier 'commissions' Position Sizer.mqh 9740 13
'[' - array required Position Sizer.mqh 9740 24
undeclared identifier 'SYMBOL_COMMISSION_RANGE_VOLUME' Position Sizer.mqh 9740 42
undeclared identifier 'commissions' Position Sizer.mqh 9741 18
'[' - array required Position Sizer.mqh 9741 29
undeclared identifier 'SYMBOL_COMMISSION_RANGE_VALUE' Position Sizer.mqh 9741 47
undeclared identifier 'commissions' Position Sizer.mqh 9745 37
'[' - array required Position Sizer.mqh 9745 48
undeclared identifier 'commissions' Position Sizer.mqh 9745 96
'[' - array required Position Sizer.mqh 9745 107
undeclared identifier 'commissions' Position Sizer.mqh 9745 134
'[' - array required Position Sizer.mqh 9745 145
';' - unexpected token Position Sizer.mqh 9747 22
'{' - some operator expected Position Sizer.mqh 9746 13
';' - unexpected token Position Sizer.mqh 9748 22
'(' - unbalanced left parenthesis Position Sizer.mqh 9745 16
empty controlled statement found Position Sizer.mqh 9748 22
undeclared identifier 'commissions' Position Sizer.mqh 9752 13
'[' - array required Position Sizer.mqh 9752 24
undeclared identifier 'SYMBOL_COMMISSION_DISABLED' Position Sizer.mqh 9752 45
'continue' must be used within some loop only Position Sizer.mqh 9752 73
undeclared identifier 'commissions' Position Sizer.mqh 9756 13
'[' - array required Position Sizer.mqh 9756 24
undeclared identifier 'SYMBOL_COMMISSION_MONEY_SYMBOL_BASE' Position Sizer.mqh 9756 45
undeclared identifier 'commissions' Position Sizer.mqh 9757 18
'[' - array required Position Sizer.mqh 9757 29
undeclared identifier 'SYMBOL_COMMISSION_MONEY_SYMBOL_PROFIT' Position Sizer.mqh 9757 50
undeclared identifier 'commissions' Position Sizer.mqh 9758 18
'[' - array required Position Sizer.mqh 9758 29
undeclared identifier 'SYMBOL_COMMISSION_MONEY_SYMBOL_MARGIN' Position Sizer.mqh 9758 50
undeclared identifier 'commissions' Position Sizer.mqh 9759 18
'[' - array required Position Sizer.mqh 9759 29
undeclared identifier 'SYMBOL_COMMISSION_MONEY_SPECIFIED' Position Sizer.mqh 9759 50
undeclared identifier 'commissions' Position Sizer.mqh 9761 17
'[' - array required Position Sizer.mqh 9761 28
implicit conversion from 'unknown' to 'string' Position Sizer.mqh 9761 17
undeclared identifier 'commissions' Position Sizer.mqh 9761 63
'[' - array required Position Sizer.mqh 9761 74
implicit conversion from 'unknown' to 'string' Position Sizer.mqh 9761 63
undeclared identifier 'commissions' Position Sizer.mqh 9762 22
'[' - array required Position Sizer.mqh 9762 33
implicit conversion from 'unknown' to 'string' Position Sizer.mqh 9762 22
undeclared identifier 'commissions' Position Sizer.mqh 9762 59
'[' - array required Position Sizer.mqh 9762 70
implicit conversion from 'unknown' to 'string' Position Sizer.mqh 9762 59
undeclared identifier 'commissions' Position Sizer.mqh 9770 17
'[' - array required Position Sizer.mqh 9770 28
':' - unexpected token Position Sizer.mqh 9772 45
'commissions' - illegal switch expression type Position Sizer.mqh 9770 17
'case' - '{' beginning bracket expected Position Sizer.mqh 9773 9
illegal 'else' without matching 'if' Position Sizer.mqh 9778 13
'break' must be used within some loop or switch statement Position Sizer.mqh 9779 13
illegal 'case' or 'default' without matching 'switch' Position Sizer.mqh 9780 9
'break' must be used within some loop or switch statement Position Sizer.mqh 9782 13
illegal 'case' or 'default' without matching 'switch' Position Sizer.mqh 9783 9
'break' must be used within some loop or switch statement Position Sizer.mqh 9785 13
illegal 'case' or 'default' without matching 'switch' Position Sizer.mqh 9786 9
undeclared identifier 'commissions' Position Sizer.mqh 9788 61
'[' - array required Position Sizer.mqh 9788 72
'break' must be used within some loop or switch statement Position Sizer.mqh 9789 13
illegal 'case' or 'default' without matching 'switch' Position Sizer.mqh 9790 9
'}' - not all control paths return a value Position Sizer.mqh 9835 1
72 errors, 5 warnings 72 5


View attachment 39568
Version 3.16 of the Position Sizer requires MT5 build 6140. Please update your MT5 via menu Help->Check For Updates->Latest Release Version.
 
Hey! I have a feature request for Position Sizer.

Could you add a “Commission Adjustment for Stop Loss / Maximum Risk” option?

For example:

  • Maximum risk = $1,000
  • Commission = $100
  • Maximum actual loss from the SL = $900
  • Total loss including commission = $1,000
The idea would be that when the option is enabled, Position Sizer automatically subtracts the estimated commission from the maximum allowed risk before calculating the position size.

Something like:

Max Risk − Commission = Maximum SL Loss

Example:
$1,000 − $100 = $900 available SL risk

This would make the risk calculation much more accurate for traders who want their total loss, including commission, to stay within a strict risk limit.

A simple toggle such as:

Include Commission in Maximum Risk: ON/OFF

would be extremely useful.

Thanks for considering it!
 
Added automatic commission retrieval from the broker's server in MetaTrader 5 version. It is now a default method. Set AutoCommission to false to disable.
Now.. There is no need to enter the commission manually?.. It will calculate commission from the broker?.

Changed margin utilization to ignore pending orders' margin.
Kindly do not ignore margin utilization for the pending orders.. Because If suppose trader having pending orders and it triggered the margin utilization will jump and he may loose the account.... Kindly have option for it to set true/false..
 
Last edited:
Hey! I have a feature request for Position Sizer.

Could you add a “Commission Adjustment for Stop Loss / Maximum Risk” option?

For example:

  • Maximum risk = $1,000
  • Commission = $100
  • Maximum actual loss from the SL = $900
  • Total loss including commission = $1,000
The idea would be that when the option is enabled, Position Sizer automatically subtracts the estimated commission from the maximum allowed risk before calculating the position size.

Something like:

Max Risk − Commission = Maximum SL Loss

Example:
$1,000 − $100 = $900 available SL risk

This would make the risk calculation much more accurate for traders who want their total loss, including commission, to stay within a strict risk limit.

A simple toggle such as:

Include Commission in Maximum Risk: ON/OFF

would be extremely useful.

Thanks for considering it!
That's how it already works. If you set the risk to $1,000 and there is some commission, it will calculate the position size such as that the total loss is $1,000 (both from SL and from commission).
Now.. There is no need to enter the commission manually?.. It will calculate commission from the broker?.
Yes. Provided your broker has it configured correctly.
Kindly do not ignore margin utilization for the pending orders.. Because If suppose trader having pending orders and it triggered the margin utilization will jump and he may loose the account.... Kindly have option for it to set true/false..
There is a huge problem with this. There needs to be a way model which pending orders can trigger simultaneously and which cannot. A similar task is performed by our Risk Calculator indicator, but it is very resource-consuming and will slow the Position Sizer down significantly. The other solution is to print max utilization possible, but this would be largely misleading.
 
Yes. Provided your broker has it configured correctly.
That is great feature. Thank you so much

There is a huge problem with this. There needs to be a way model which pending orders can trigger simultaneously and which cannot. A similar task is performed by our Risk Calculator indicator, but it is very resource-consuming and will slow the Position Sizer down significantly. The other solution is to print max utilization possible, but this would be largely misleading.
Kindly write the issues in the MQL community so they may take step on this.

The risk concept on Margin in the trading tab will work for the pending orders?..
if there is margin % in the margin tab that will be helpful

PS: I checked the margin related thing.. It seems the margin % doesn't work correctly... There is always a better way Enivid. You can definitely find it and provide a better solution.
 
Last edited: