Enivid

Administrator
Staff member
Nov 30, 2008
17,135
1,046
144
Odessa
www.earnforex.com
Hello,
I've been using the position size calculator and it works great! I was wondering if you could add a feature where you can stack max position sizes. With some prop firms like MFF's they have a max position size per trade of 50 lots but you can open as many trades as you want. Could you make it so the EA can stack positions? For instance, if you have a 200k account and want to open a position with a lot size of 60 could you allow a max lot size of let's say 25, but it opens two 25 lot positions and a 10 lot position to add up to 60 lots?
I'll look into it. Thanks for the idea!
 
  • 🚀
Reactions: EnrichWave

yoovie

Newbie
Feb 9, 2022
6
5
4
Some issues and a suggestion:

1) I tried the latest version 3.02 in MT4, I found same issue that happened with One-Click Trade Pro EA when the EA and Symbol Changer indicator are on same chart. If you try to switch to another symbol with the symbol changer while the EA is still on chart, the MT4 app will freeze for several seconds.

The solution is you have to exit the OnDeinit method immediately when the reason is REASON_CHARTCHANGE (which is triggered by the symbol changing), so the code would look like:

MQL4:
void OnDeinit(const int reason)
{
    if (reason == REASON_CHARTCHANGE) return;    // Add this code
 
    ObjectDelete(0, ObjectPrefix + "StopLossLabel");
    ObjectDelete(0, ObjectPrefix + "TakeProfitLabel");
    ObjectDelete(0, ObjectPrefix + "TPAdditionalLabel");
    ObjectDelete(0, ObjectPrefix + "SLAdditionalLabel");
 
    ...
}

I had shown this solution before in One-Click Trade Pro thread: https://www.earnforex.com/forum/threads/one-click-trade-pro.45419/page-2#post-207430

I don't know the technical details of the cause, but it looks like the object and chart methods like ObjectDelete and ChartGetInteger will cause temporary hang on the MT4 app when they are called in OnDeinit method when the deinit reason is REASON_CHARTCHANGE.

However, with this solution, you can't call the "GlobalVariableSet("PS_ChartChange_" + Symbol(), (double)ChartGetInteger(ChartID(), CHART_WIDTH_IN_PIXELS));" code that you put inside the "if (reason == REASON_CHARTCHANGE)" block at line 374 as it involves ChartGetInteger method call that would hang the MT4 app. So you have to find a workaround on how to save the chart width into global variable when the symbol is changed.

2) For MT5 version, when I clicked the Take-Profit button, the created TP line isn't in selected mode automatically, so I have to double-click the line if I want to move the line. The MT4 version already has correct TP line behavior where the created TP line is in selected mode automatically.

3) A little suggestion, could you add buttons to close all opened orders and delete all pending orders on current chart in the EA? I have a separate EA for these operations, but it will be nice if these functions exist in the Position Sizer EA too, so everything can be done in just one EA which will be convenient in scalping situation.
 
Last edited:
  • 👍
Reactions: Enivid

Enivid

Administrator
Staff member
Nov 30, 2008
17,135
1,046
144
Odessa
www.earnforex.com
Some issues and a suggestion:

1) I tried the latest version 3.02 in MT4, I found same issue that happened with One-Click Trade Pro EA when the EA and Symbol Changer indicator are on same chart. If you try to switch to another symbol with the symbol changer while the EA is still on chart, the MT4 app will freeze for several seconds.

The solution is you have to exit the OnDeinit method immediately when the reason is REASON_CHARTCHANGE (which is triggered by the symbol changing), so the code would look like:

MQL4:
void OnDeinit(const int reason)
{
    if (reason == REASON_CHARTCHANGE) return;    // Add this code
 
    ObjectDelete(0, ObjectPrefix + "StopLossLabel");
    ObjectDelete(0, ObjectPrefix + "TakeProfitLabel");
    ObjectDelete(0, ObjectPrefix + "TPAdditionalLabel");
    ObjectDelete(0, ObjectPrefix + "SLAdditionalLabel");
 
    ...
}

I had shown this solution before in One-Click Trade Pro thread: https://www.earnforex.com/forum/threads/one-click-trade-pro.45419/page-2#post-207430

I don't know the technical details of the cause, but it looks like the object and chart methods like ObjectDelete and ChartGetInteger will cause temporary hang on the MT4 app when they are called in OnDeinit method when the deinit reason is REASON_CHARTCHANGE.

However, with this solution, you can't call the "GlobalVariableSet("PS_ChartChange_" + Symbol(), (double)ChartGetInteger(ChartID(), CHART_WIDTH_IN_PIXELS));" code that you put inside the "if (reason == REASON_CHARTCHANGE)" block at line 374 as it involves ChartGetInteger method call that would hang the MT4 app. So you have to find a workaround on how to save the chart width into global variable when the symbol is changed.

2) For MT5 version, when I clicked the Take-Profit button, the created TP line isn't in selected mode automatically, so I have to double-click the line if I want to move the line. The MT4 version already has correct TP line behavior where the created TP line is in selected mode automatically.

3) A little suggestion, could you add buttons to close all opened orders and delete all pending orders on current chart in the EA? I have a separate EA for these operations, but it will be nice if these functions exist in the Position Sizer EA too, so everything can be done in just one EA which will be convenient in scalping situation.
1) I'll see what can be done here. Perhaps, it isn't necessary to do a full deinitialization on charge change event, but it is likely that there is nothing to be done here.

2) There is a bug in MT5 that interferes with selecting the lines sometimes. It looks like a circumvention that I used before stopped working. I will have to look into it once more.

3) I don't think it's a good idea. It's best solved with a script set to a hotkey.
 

kef01

Newbie
Oct 9, 2022
2
0
1
29
Hi,
I am looking for a feature in Position Sizer that I can't find after using the EA. I am using another EA called MT5 Trade Assistant which is available in the MQL5 Marketplace.
In MT5TA, you can enable "Lot Calc". This enables you to drag your stop loss to level you choose while keeping the percentage of account balance risked the same. It does this by dynamically changing the lot size as you move the stop loss line.

So I tried to do this in Position Sizer. After I put in my preferred risk percentage, I could not move the Stop Loss line. It seemed that the risk percentage dictates where the stop loss line will go, and that the only way to move the stop loss line is to adjust my risk percentage.

Is there any way to move the stop loss line in Position Sizer, while keeping my risk percentage the same?

Sorry if I missed the feature, I hope this is an easy fix. Appreciate your support.
 

ayu1

Newbie
Oct 10, 2022
5
0
1
26
hey
i tired to install the psc and i keep getting error around 101 i dont know what to do can i get a link for a video for the new psc
 

Enivid

Administrator
Staff member
Nov 30, 2008
17,135
1,046
144
Odessa
www.earnforex.com

ayu1

Newbie
Oct 10, 2022
5
0
1
26

ayu1

Newbie
Oct 10, 2022
5
0
1
26
Yeh sure here
 

Attachments

  • IMG_20221010_125934.jpg
    IMG_20221010_125934.jpg
    283.2 KB · Views: 3
  • IMG_20221010_125950.jpg
    IMG_20221010_125950.jpg
    285.5 KB · Views: 3
  • IMG_20221010_130016.jpg
    IMG_20221010_130016.jpg
    410.3 KB · Views: 3

05071991R

Newbie
Oct 12, 2022
3
1
3
42
hello if i save the ea on the chart with all my settings as a template and load it on another pair, ea doesnt work correct, cant move the sl/tp lines. if i load the ea to a new chart and load the settings inside the ea its ok. would be great to save it as template.
 

Enivid

Administrator
Staff member
Nov 30, 2008
17,135
1,046
144
Odessa
www.earnforex.com
hello if i save the ea on the chart with all my settings as a template and load it on another pair, ea doesnt work correct, cant move the sl/tp lines. if i load the ea to a new chart and load the settings inside the ea its ok. would be great to save it as template.
Is it on MT4 or MT5? How exactly are the SL/TP lines unmovable? Are they selected? Can you still set SL/TP levels via the panel? What's the output in the Experts tab when you load the template on another pair?
 

Enivid

Administrator
Staff member
Nov 30, 2008
17,135
1,046
144
Odessa
www.earnforex.com
Hi,
I am looking for a feature in Position Sizer that I can't find after using the EA. I am using another EA called MT5 Trade Assistant which is available in the MQL5 Marketplace.
In MT5TA, you can enable "Lot Calc". This enables you to drag your stop loss to level you choose while keeping the percentage of account balance risked the same. It does this by dynamically changing the lot size as you move the stop loss line.

So I tried to do this in Position Sizer. After I put in my preferred risk percentage, I could not move the Stop Loss line. It seemed that the risk percentage dictates where the stop loss line will go, and that the only way to move the stop loss line is to adjust my risk percentage.

Is there any way to move the stop loss line in Position Sizer, while keeping my risk percentage the same?

Sorry if I missed the feature, I hope this is an easy fix. Appreciate your support.
Actually, you should be able to move the stop-loss line no matter what. Perhaps, the line itself got deselected for some reason? You can double-click it to select it again.
 

Enivid

Administrator
Staff member
Nov 30, 2008
17,135
1,046
144
Odessa
www.earnforex.com

05071991R

Newbie
Oct 12, 2022
3
1
3
42
Loading a template deselects all objects, but the PS EA should have selected them automatically for you unless you had the Lines Selected input parameter set to false.
i have this parameter at true. the same happens in the youtube video at 6:30. the setting is at true, after loading the template, line is deselected :)
 
  • 👍
Reactions: Enivid