How do I make position sizer ea use the max position size per symbol if the calculated position size is bigger than it?

TheUs30Trader

Trader
Oct 18, 2024
4
0
7
40
Hi,
I inspected the ea position sizer code
and there is a loop in positionsizertrading.mqh:
-----------------------------------------
in line 220, there seems to be a comparison function for it
if ((sets.MaxPositionSizeTotal > 0) || (sets.MaxPositionSizePerSymbol > 0))
{
// some code here
}

I modified the contents of this function to this:
if (PositionSize > sets.MaxPositionSizePerSymbol)
{
PositionSize = sets.MaxPositionSizePerSymbol
}

But it didn't work..
 
It's difficult to tell without even knowing which version you are trying to edit - MT4 or MT5. But this feature will be added in the next release of the Position Sizer.
hi, thanks for your reply, the one im using is for MT4. when is the next update please?
 
hi, thanks for your reply, the one im using is for MT4. when is the next update please?
This year, I hope.
You should also add the following line after your PositionSize = sets.MaxPositionSizePerSymbol; :
MQL4:
PositionSizeToArray(PositionSize);
I guess it will work then.
 
  • 👍
Reactions: TheUs30Trader