Enivid

Administrator
Staff member
Nov 30, 2008
18,530
1,355
144
Odesa
www.earnforex.com
Hello, I'm new to the forum. I hope to write in the right section. I have been using the position sizer on a demo account for about 1 month and the autotrading works well. now I have started a challenge of a prop and with the new demo account (same broker) I do not open the operations. I always have to remove and reinsert the expert advisor. can you help me? thank you
The Experts tab of your MetaTrader platform should show some messages when you try to open a trade and it fails. If you could copy them here or show us the screenshot, we could probably help you. But most likely, it is either autotrading disabled in your platform (or for this EA) or autotrading disabled by the broker (prop firms often disable autotrading at around news release times).
 

Nicola Pinna

Newbie
Sep 28, 2022
5
0
1
30
The Experts tab of your MetaTrader platform should show some messages when you try to open a trade and it fails. If you could copy them here or show us the screenshot, we could probably help you. But most likely, it is either autotrading disabled in your platform (or for this EA) or autotrading disabled by the broker (prop firms often disable autotrading at around news release times).
OK thank you. I insert the screenshot here. the problem is that once I close the expert advisor and put it back in the card, I try to open a position again it works. I always have to remove and reinsert it before opening a position. thank youSchermata 2022-09-29 alle 09.03.51.png
 

EnrichWave

Master Trader
May 15, 2018
325
82
74
India
OK thank you. I insert the screenshot here. the problem is that once I close the expert advisor and put it back in the card, I try to open a position again it works. I always have to remove and reinsert it before opening a position. thank youView attachment 22707
Error 4109 is a common error when using expert advisors in MT4 and it means that "Trade is not allowed". Basically, the EA cannot submit orders or make any changes to orders.

To fix this error, you need to enable automated trading in the MT4 options and enable live trading in the EA's properties.

for more details
https://www.earnforex.com/guides/how-to-fix-error-4109-trade-is-not-allowed-in-mt4/
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,530
1,355
144
Odesa
www.earnforex.com
OK thank you. I insert the screenshot here. the problem is that once I close the expert advisor and put it back in the card, I try to open a position again it works. I always have to remove and reinsert it before opening a position. thank youView attachment 22707
How do you open a trade - via a hotkey or via a button on the Trading tab?
 

Isma82

Newbie
Sep 29, 2022
2
0
1
41
Hello,
does Position Sizer works on Macbook?
 

Attachments

  • Schermata 2022-09-29 alle 18.09.24 (2).png
    Schermata 2022-09-29 alle 18.09.24 (2).png
    801.7 KB · Views: 3

Enivid

Administrator
Staff member
Nov 30, 2008
18,530
1,355
144
Odesa
www.earnforex.com
i open a trade whit Trading tab
Then, the problem might be with account switching for example. If you switch an account, the autotrading gets disabled automatically. You need to re-enable it. Did you try instead of re-attaching the EA, just enable its live trading via the properties (F7)?
 

bkmen227

Trader
Sep 29, 2022
3
0
6
37
Thanks for another fantastic product. I have just started using it and had two questions.

1. Does position sizer still manage your trades if you do not use the order function but take the trades manually or with another EA?

2. Also with the maximum number of trades function, does it limit trades based on the chart the EA is placed on or does it limit the number of trades for the whole MT4. For example if I place it on USDJPY and limit trades to 4, will it only limit the trades on USDJPY to 4 or will it limits all the trades on all the other pairs to 4?
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,530
1,355
144
Odesa
www.earnforex.com
1. Does position sizer still manage your trades if you do not use the order function but take the trades manually or with another EA?
It will manage (you mean trailing stop and BE, right?) other trades if you set open them with the same Magic number as is set on the Trading tab of the Position Sizer.

2. Also with the maximum number of trades function, does it limit trades based on the chart the EA is placed on or does it limit the number of trades for the whole MT4. For example if I place it on USDJPY and limit trades to 4, will it only limit the trades on USDJPY to 4 or will it limits all the trades on all the other pairs to 4?
There is the All symbols checkbox for that. If it's not ticked, then the PS only counts the trades on the same currency pair. If it is ticked, it counts trades across all pairs.
 
  • 👍
Reactions: bkmen227

Enivid

Administrator
Staff member
Nov 30, 2008
18,530
1,355
144
Odesa
www.earnforex.com
Hi Enivid, Thank you for the EA, I am trying to use both Position sizer and account protector, however I am unable to use them at the same time, can you pls point me to EA which covers closing of postions as account protector with Position sizer
You cannot add both to the same chart, but you can open a second chart and add the Account Protector there.
 

Tylergibson

Newbie
Sep 17, 2022
15
2
4
41
You cannot add both to the same chart, but you can open a second chart and add the Account Protector there.
Thank you for your time and response Enivid, I am trying to add both EAs in data folder for MT4, but error pops-up..
 

Attachments

  • Screenshot 2022-10-03 233530.png
    Screenshot 2022-10-03 233530.png
    31 KB · Views: 4

EARNIST

Newbie
Oct 4, 2022
2
1
4
30
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?
 
  • 👍
Reactions: Enivid

Enivid

Administrator
Staff member
Nov 30, 2008
18,530
1,355
144
Odesa
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

Trader
Feb 9, 2022
11
15
14
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
18,530
1,355
144
Odesa
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.