Enivid

Administrator
Staff member
Nov 30, 2008
19,397
1,566
144
Odesa
www.earnforex.com
Hello,

I'm trying to use position sizer on Mac (macOS Monterey) with Metatrader 5.

I'm encountering a problem in the settings:

- when I click on a color (lines or fonts) to change it, nothing happens!

I can modify the other settings without any problem.

Thanks for your help
MetaTrader's color palette inputs don't work under macOS. You can still modify the colors by editing the inputs in the source code. They are all near the top of the Position Sizer.mq5 file.
 
  • 👍
Reactions: Harry MAN

CARPARK

Trader
Mar 29, 2021
69
23
24
47
Tallinn
Hi Enivid

A couple of strange issues here. When I change an object on the chart, in this instance: I change rectangle shape...I am holding (still dragging, but not moving) the rectangle corner control points, and price is moving up/down, the price TPs don't follow (but they are set in the panel).

See video below at 3:35


Another instance, around 4:21, same video, where I switch the SL to bottom of current candle and this messes with my SL/TPs. In this instance I have to actively change the number in the panel to get it back to what I want.

This happens many times a day to me, is it something I'm doing?

In case it's relevant, I switch the SLs by using a script that looks for PSC_StopLossLine and places it at current candle (0) low. If it's already at candle 0 low, it moves SL to previous candle (1) low.
 
  • ℹ️
Reactions: Enivid

wfujay

Trader
Jul 20, 2023
2
-1
6
43
Apologies if this has been answered before, but is there a way to set a default RR ratio for quick market buys?

For instance, have a button for a 1.5 RR and another button for 2 RR, and then both buttons execute market buys/sells with those ratios.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,397
1,566
144
Odesa
www.earnforex.com
Apologies if this has been answered before, but is there a way to set a default RR ratio for quick market buys?

For instance, have a button for a 1.5 RR and another button for 2 RR, and then both buttons execute market buys/sells with those ratios.
No, there is no way to do that.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,397
1,566
144
Odesa
www.earnforex.com
The Position Sizer EA has been updated to version 3.04 with most of the changes being bug fixes but also with some notable new features (e.g., dark mode and interface translations):
  • Added a dark theme mode, which can be set via the DarkMode input parameter. (Via email)
  • Added an option to display breakeven lines at levels where the Position Sizer will apply breakeven to existing positions. (@CARPARK)
  • Added the Entry line label to display the distance from the current price to the Entry level for pending orders. (@goldpath)
  • Added input parameters (ShowMaxParametersOnTrading, ShowFusesOnTrading, and ShowCheckboxesOnTrading) to make the Trading tab more compact.
  • Added separate total and per-symbol fields to control volume, risk, and number of trades on the Trading tab. (@EnrichWave)
  • Added an input parameter (SettingsFile) to let users load their own custom settings file with panel fields configured according to their needs. The EA won't delete custom settings files.
  • Added two new hotkeys — to set a stop-loss (SetStopLossHotKey) and a take-profit (SetTakeProfitHotKey) to the price level at the mouse pointer's current position. (@mygrow)
  • Added an option to change the translation of the panel's interface in MetaTrader 5. Language files are currently only available for Ukrainian and Russian. Users can create and use their own translation files. (Via email)
  • Changed the breakeven mechanism to take into account the size of the commission if UseCommissionToSetTPDistance is set to true. (Via Github)
  • Changed the additional TP fields to appear with some non-zero values if the main TP is non-zero. (@yoovie)
  • Fixed a bug when switching the chart's symbol could result in line labels disappearing if SymbolChange was set to Keep panel as is. (@EnrichWave)
  • Fixed a bug in the MT5 version that resulted in the trade type not resetting properly when SymbolChange was set to Reset to defaults on symbol change. (@EnrichWave)
  • Fixed a bug that resulted in false warnings and incorrect position size calculation when the EA failed to get the symbol information at the first attempt. (@DuyPC)
  • Fixed a bug that resulted in some of the +/- buttons to remain on the chart when the panel was minimized. (Via Github)
  • Fixed a bug that resulted in the stop-loss not keeping its correct distance when SLDistanceInPoints was set to true. (Via Github)
  • Fixed a bug when the additional funds asterisk remained visible even when the panel was minimized. (Via Github)
  • Fixed a bug in the MT5 version that resulted in the risk field resetting to default when the user clicked on the position size field after setting it to a custom value. (@EnrichWave)
  • Fixed a bug that resulted in the stop-loss line sometimes disappearing on a symbol change. (@EnrichWave)
  • Fixed a bug in the MT5 version that resulted in the Stop Price line appearing after switching from Stop Limit to Instant and setting the DisableStopLimit input parameter to true. (@EnrichWave)
  • Fixed a bug that would result in wrong value appearing in the account size field after clicking on it and then clicking outside if the value contained a thousands separator. (@yoovie)
  • Fixed a bug in the MT5 version that caused a critical 'array out of range' error when clicking on the +/- buttons for a single take-profit field. (Via Github)
  • Fixed a bug in the MT4 version that caused a critical 'array out of range' error when switching the chart symbol to a one with more additional TPs saved in a settings file.
  • Fixed a bug that caused the risk to be calculated based on the percentage value instead of the money value when Custom Balance was updated even if the MoneyRisk parameter was greater than 0. (@Viksagar)
  • Fixed a bug with ATR timeframe button not working.
  • Fixed a bug with incorrect volume share allocation when adding a new TP.
  • Fixed a bug in the MT5 version that caused a critical 'stack overflow' error when the EA failed to convert a symbol's profit or margin currency. (Via email)
  • Fixed a bug that would cause TP values set in points to shift when dragging doing some unrelated chart manipulations. (@CARPARK)
Thanks to all who helped with this release! I wouldn't be able to deliver this without you! And here is a sneak peek at the dark mode theme:
BTCUSDDaily.png

Please download and report any bugs you find. Thank you once again!
 
  • 🎉
  • 👍
Reactions: yoovie, CARPARK and EnrichWave

bbwrldhlspc

Trader
Jul 20, 2023
3
0
6
28
Hello, I can't adjust TP. If I move the line with coursour I can't edit it later. Sizer just freezes and doesn't react to any modifications.

Error message: 2023.07.20 17:43:21.783 Position Sizer (BTCUSD,M5) array out of range in 'Position Sizer.mqh' (3094,28)

Latest MT5 for Windows is used. Eightcap and FTMO brokers.

EDIT: It happens on all of the pairs I tried - EURUSD, USDCHF, BTCUSD, USDJPY
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,397
1,566
144
Odesa
www.earnforex.com
Hello, I can't adjust TP. If I move the line with coursour I can't edit it later. Sizer just freezes and doesn't react to any modifications.

Error message: 2023.07.20 17:43:21.783 Position Sizer (BTCUSD,M5) array out of range in 'Position Sizer.mqh' (3094,28)

Latest MT5 for Windows is used. Eightcap and FTMO brokers.

EDIT: It happens on all of the pairs I tried - EURUSD, USDCHF, BTCUSD, USDJPY
Is it in version 3.04?
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,397
1,566
144
Odesa
www.earnforex.com
If you updated from 3.03 to 3.04, you might need to remove the PS EA from the chart and attach it again because there might be some incompatibility issues with the settings file. However, I've just checked and the line 3094 of the Position Sizer.mqh, which is mentioned in the error report, doesn't mention any arrays, while that same line in 3.03 did mention arrays. Please make sure you upgrade to 3.04. Thank you!
 

bbwrldhlspc

Trader
Jul 20, 2023
3
0
6
28
If you updated from 3.03 to 3.04, you might need to remove the PS EA from the chart and attach it again because there might be some incompatibility issues with the settings file. However, I've just checked and the line 3094 of the Position Sizer.mqh, which is mentioned in the error report, doesn't mention any arrays, while that same line in 3.03 did mention arrays. Please make sure you upgrade to 3.04. Thank you!
That is exactly what I did. I removed old files completly from old folder and dowloaded new version. Removed all experts and stuck objects from chart, restarted MT5 and reattached latest version and I still receive same error. Maybe there are some cache files somewhere I can remove? My friend is also having exactly the same problem aswell...

EDIT: Just noticed that it still says Version 3.03 on header. Even tho I've just downloaded and reinstalled again from this link in your post https://www.earnforex.com/metatrader-expert-advisors/Position-Sizer/ .

EDIT2: Downloaded from GitHub and it now works flowlessly again. Thank you for you time!
 
Last edited:

EnrichWave

Master Trader
May 15, 2018
384
100
89
India
If I have "SymbolChange=Reset to Defaults on Symbol Change"
On the Trading tab "Max # of trades, Total& persymbol not resets while we change another symbol, Also the Max risk % total , per symbol not resets while we change another symbol

And another bug. If changed the Trading panel value like following
2023-07-21_01h39_20.png

If I place 1st order with 0.3% risk it takes order.
2023-07-21_01h43_53.png

But if I place another order with 0.2% risk. nothing happens Its being completely silent.
2023-07-21_01h37_54.png
 
  • ℹ️
Reactions: Enivid

EnrichWave

Master Trader
May 15, 2018
384
100
89
India
And with the volume settings.. It take More order than given volume
2023-07-21_07h09_57.png


And another bug. If we have Input values like this. It takes only 2 orders in the same price.. It's not taking another order. Nothing happens It's being completely silent.
2023-07-21_07h16_38.png


But If I move the price line below current price It takes orders.
2023-07-21_07h17_52.png
 
Last edited:
  • ℹ️
Reactions: Enivid

CARPARK

Trader
Mar 29, 2021
69
23
24
47
Tallinn
I Think I found a bug Enivid:

If you click 'Hide lines' button and you have manually input values then your 1st TP stays locked (as expected) but the 2nd/3rd/4th TP all move with price. See from around 0:38 here:


If you then 'show' lines, then other TPs become locked again and no longer follow price. New TPs for values other than 1st TP must be manually input into boxes.

Expected behaviour would be that any manually entered price stays fixed as per TP1 before and after Show/hide lines is clicked.
 
  • ℹ️
Reactions: Enivid

Enivid

Administrator
Staff member
Nov 30, 2008
19,397
1,566
144
Odesa
www.earnforex.com
If I have "SymbolChange=Reset to Defaults on Symbol Change"
On the Trading tab "Max # of trades, Total& persymbol not resets while we change another symbol, Also the Max risk % total , per symbol not resets while we change another symbol

And another bug. If changed the Trading panel value like following
View attachment 24450

If I place 1st order with 0.3% risk it takes order.
View attachment 24451

But if I place another order with 0.2% risk. nothing happens Its being completely silent.
View attachment 24452
It is normal that it isn't taking a second order in that situation because if it subtracts the existing order's volume from your new calculated volume, it gets below zero, so the execution is terminated. It says about this in the Experts tab, but it is a bug that it doesn't give a more noticeable alert abut this.

The bug with the symbol reset not working is noted.
 
  • ℹ️
Reactions: EnrichWave

Enivid

Administrator
Staff member
Nov 30, 2008
19,397
1,566
144
Odesa
www.earnforex.com
And with the volume settings.. It take More order than given volume
View attachment 24453


And another bug. If we have Input values like this. It takes only 2 orders in the same price.. It's not taking another order. Nothing happens It's being completely silent.
View attachment 24454


But If I move the price line below current price It takes orders.
View attachment 24455
The case with the second order being taken even when it surpasses the maximum is a bug.

The case when it silently refuses to take the 3rd order and then takes it when you move the SL line isn't a bug. The calculated position volume after subtraction is less than zero, so it doesn't take it. When you move the SL line, the volume gets larger, so there is now some non-zero result of the subtraction that passes the check.

There is another bug there though that ignores that subtraction further in the code and opens a pre-subtraction position size.
 
  • ℹ️
Reactions: EnrichWave