Trevo_r

Trader
Aug 15, 2023
7
0
6
27
Not sure what you are trying to do. Why don't you download and install the Position Sizer?
I downloaded the Position Size Calculator together with PSC script and compiled it accordingly. So I was trying to test it by placing a trade. when I double click on the script to place the order. It makes that error sound and displays an error on the journal tab and on the expert tab. The error reads "Trading disabled". I placed an order manually to check if the problem is with the broker or the EURUSD pair but the order was executed when placed manually. I have also moved the Position Size indicator to the Expert Folder (please see navigator section on the previously attached picture) as advised on your initial response. The expert works really fine and I can input and edit all fields including the script tab, however it is just not allowing me to place the trade using the script. That's the only problem.

Sorry for such a long message, I am really appreciating your assistance.
 

Trevo_r

Trader
Aug 15, 2023
7
0
6
27
Not sure what you are trying to do. Why don't you download and install the Position Sizer?
On the previous version, there was a 'Trade' tab where I could execute the trade directly from the Expert's window but that tab has now been replaced with the 'scrpt' tab so I now I can only place the trade by pressing the script icon on the navigator which is what's not working.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,384
1,565
144
Odesa
www.earnforex.com
On the previous version, there was a 'Trade' tab where I could execute the trade directly from the Expert's window but that tab has now been replaced with the 'scrpt' tab so I now I can only place the trade by pressing the script icon on the navigator which is what's not working.
Please download and install the Position Sizer. It can be found here:
https://www.earnforex.com/metatrader-expert-advisors/Position-Sizer/
What you have installed is the Position Size Calculator, which is an indicator and is an older version of the same tool.
 
  • 👍
Reactions: Trevo_r

Trevo_r

Trader
Aug 15, 2023
7
0
6
27
Please download and install the Position Sizer. It can be found here:
https://www.earnforex.com/metatrader-expert-advisors/Position-Sizer/
What you have installed is the Position Size Calculator, which is an indicator and is an older version of the same tool.
Thanks for noting that, I did not realize I had downloaded a different application, however even the Position Sizer is showing the same error. Is it possible that the issue is with the platform/broker restrictions? I just tried the expert with my other trading mates and its working fine with with them, they use a different broker.
 

unical

Newbie
Aug 11, 2023
7
0
2
29
It looks like you installed the Position Sizer in the Indicators folder. The Position Sizer (unlike the older Position Size Calculator) is an expert advisor. It should be installed in the Experts folder of your MT5 data folder.
What is the difference between Position Sizer and Position Size Calculator in essence sir?
 

EnrichWave

Master Trader
May 15, 2018
384
100
89
India
What is the difference between Position Sizer and Position Size Calculator in essence sir?
Position Size Calculator is an Indicator which the PSC script need to execute the trade.
Position sizer is an EA which don't need script to execute the trades.

And Position Sizer is update version of PSC which has more features.

Thanks for noting that, I did not realize I had downloaded a different application, however even the Position Sizer is showing the same error. Is it possible that the issue is with the platform/broker restrictions? I just tried the expert with my other trading mates and its working fine with with them, they use a different broker.
Yes. Your broker may restrict the EA. May I know which broker are you using?.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,384
1,565
144
Odesa
www.earnforex.com
Thanks for noting that, I did not realize I had downloaded a different application, however even the Position Sizer is showing the same error. Is it possible that the issue is with the platform/broker restrictions? I just tried the expert with my other trading mates and its working fine with with them, they use a different broker.
If you enabled autotrading both for the platform and for the EA specifically and you are still getting that error, then yes, that's some sort of a broker restriction on EAs.
 

Trevo_r

Trader
Aug 15, 2023
7
0
6
27
Position Size Calculator is an Indicator which the PSC script need to execute the trade.
Position sizer is an EA which don't need script to execute the trades.

And Position Sizer is update version of PSC which has more features.


Yes. Your broker may restrict the EA. May I know which broker are you using?.
Thanks for your feedback, the platform is HotForex, I contacted the broker and they said the pair was disabled, I can only trade currency pairs with with a country Suffix at the end e.g 'EURUSD,Z' instead of 'EURUSD' so that is what generated this error, So indeed, the trade was disabled as the indicator said.

Thanks again.
 
  • 🚀
Reactions: Enivid

Trevo_r

Trader
Aug 15, 2023
7
0
6
27
If you enabled autotrading both for the platform and for the EA specifically and you are still getting that error, then yes, that's some sort of a broker restriction on EAs.
Thanks again for your help, I contacted the broker and they said the pair was disabled, I can only trade currency pairs with with a country Suffix at the end e.g 'EURUSD,Z' instead of 'EURUSD' so that is what generated this error, So indeed, the trade was disabled as the indicator said.

I have tested both the PSC and the Position Sizer , both are working fine but however I will stick to the latest update 'Position Sizer' since it has more features and much more simpler to use.

Thanks again for your time and assistance. I really appreciate it.
 

EnrichWave

Master Trader
May 15, 2018
384
100
89
India
Hi, In settings if "TheLineSelected= true", and "Default TP val in points=0", While we click on TP button it's not show TP line as selected(But it become selected after we click again (TPlock mode)). It should be in reverse mode. which if the TP line is in lock mode it should not be selected(I hope there is syntex to make the line unselectable), But If it is unlock mode the line should be selected while the TheLineSeleted=True. May I know where we can alter the code that will become selected while we change the symbol?.

BR
 
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
19,384
1,565
144
Odesa
www.earnforex.com
Hi, In settings if "TheLineSelected= true", and "Default TP val in points=0", While we click on TP button it's not show TP line as selected(But it become selected after we click again (TPlock mode)). It should be in reverse mode. which if the TP line is in lock mode it should not be selected(I hope there is syntex to make the line unselectable), But If it is unlock mode the line should be selected while the TheLineSeleted=True. May I know where we can alter the code that will become selected while we change the symbol?.
I'd like to know that to. It's some kind of a glitch in the MT5 version that I cannot solve for quite some time now. Judging by the code, the line gets selected when you first click the TP button and the line appears, but for some reason, it's not the case in the platform. The problem only exists in MT5. The same code in MT4 works exactly as intended.
 
  • ℹ️
Reactions: EnrichWave

Wangda

Trader
Aug 18, 2023
1
0
6
21
Hello,
I just got introduced to the software. Overall, it is great. But, I was wondering if we can set our default TP not in points but, with Risk-Reward. Same with BE. If my trade moves 1:1. Move SL to BE. I am new and maybe this feature is already there and I don't know.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,384
1,565
144
Odesa
www.earnforex.com
Hello,
I just got introduced to the software. Overall, it is great. But, I was wondering if we can set our default TP not in points but, with Risk-Reward. Same with BE. If my trade moves 1:1. Move SL to BE. I am new and maybe this feature is already there and I don't know.
You can set TP using RR by setting the TPMultiplier input parameter. By default it's 1. If you click the TP button it sets the TP distance to the SL distance x Multiplier, which is the same as RR. If you set the TPDistanceInPoints to true, you will see that distance in points. You can then set that value in the Breakeven field. This will result in the BE applied to your trade when the TP is reached. However, for this to make any sense, you need to have at least two trades - one with that TP and the other with no TP or with a higher TP.
 

ivvnnn

Trader
Aug 20, 2023
2
0
6
34
Hello, first of all I would like to say a big thank you for creating this tool!
A suggestion/request:
add possibility to commission consideration in stop loss calculation like:
UseCommissionToSetTPDistance (default = false) — if true, the take-profit button will take into account the commission field when calculating the appropriate TP level.

And a question that confuses me:
what is the calculation principle for taking into account the commission to draw the TP levels?

I'd like to demonstrate with an example:
2.png
4.png
Let's say we have a 100k account and the commission is 5$ per 1 lot.
EUR/USD pair, potential long position.
Entry - 1.08578
SL - 1.08520
TP @ 3RR by Position Sizer - 1.08792
1% risk (1000$)Position Sizer calculets 14.7 lots.
14.7 lots * 5$ = 73.5$ real commission at SL or TP.
What Position Sizer count:
0$ commission at SL and 690.85$ at TP.
Therefore, at SL the actual loss will be 1073.5$ instead of 1000$, which is 1.07% instead of 1%. (That's why I'm asking to add commission accounting in SL)
At TP the actual profit will be 3616.15$ (3689.65$-73.5$) instead of 3000$ (3073.5$-73.5$), which is 3.61% instead of clean 3%, which is not bad, BUT by increasing the length of TP we also increase the duration of the position, which entails additional risks.

I think there's some kind of bug in the commission calculation, would appreciate you fixing it or explaining to me how to use it correctly

For ease of calculation, I've put in round numbers, and the result is absolutely insane.
10 lots and 10$ per comission:
3415.86$-2339.99$=1075.87$ instead 100$

1.png
 
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
19,384
1,565
144
Odesa
www.earnforex.com
I'd like to demonstrate with an example:
2.png
4.png
Let's say we have a 100k account and the commission is 5$ per 1 lot.
EUR/USD pair, potential long position.
Entry - 1.08578
SL - 1.08520
TP @ 3RR by Position Sizer - 1.08792
1% risk (1000$)Position Sizer calculets 14.7 lots.
14.7 lots * 5$ = 73.5$ real commission at SL or TP.
What Position Sizer count:
0$ commission at SL and 690.85$ at TP.
Therefore, at SL the actual loss will be 1073.5$ instead of 1000$, which is 1.07% instead of 1%. (That's why I'm asking to add commission accounting in SL)
At TP the actual profit will be 3616.15$ (3689.65$-73.5$) instead of 3000$ (3073.5$-73.5$), which is 3.61% instead of clean 3%, which is not bad, BUT by increasing the length of TP we also increase the duration of the position, which entails additional risks.

I think there's some kind of bug in the commission calculation, would appreciate you fixing it or explaining to me how to use it correctly
Actually, everything seems to be correct. I cannot speak for the TV calculator and I don't know how it works, but the Position Sizer calculates this as following:

Your SL distance is 58 points, which at 14.7 lots size is $852.60.
The total commission for 14.7 lots is 14.7 x 2 * 5 = $147.00.
$852.60 + $147.00 = $999.60, which is the closest the Position Sizer could get given the lot size step.

The potential reward is also calculated correctly:
Your TP distance is 214, which at 14.7 lot size is $3,145.80.
Subtracting the total commission, we get: $3,145.80 - $147.00 = $2,998.80.
For ease of calculation, I've put in round numbers, and the result is absolutely insane.
10 lots and 10$ per comission:
3415.86$-2339.99$=1075.87$ instead 100$
Sorry, I have no idea what you are calculating by subtracting $2,339.99 from $3,415.86, but the PS works out this correctly as well:

Your SL distance is 58 points, which at 10 lots size is $580.00.
The total commission for 10 lots is 10 x 2 * 10 = $200.00.
$580.00 + $200.00 = $780.00.

The potential reward is also calculated correctly:
Your TP distance is 254, which at 10 lot size is $2,540.00.
Subtracting the total commission, we get: $2,540.00 - $200.00 = $2,340.00, which displays as $2,399.99 due to rounding issues.

Your main issues seems to be that you missed the point that the commission you input is one-way, so is charged twice throughout the trade's lifetime, and that you think that the Position Sizer calculates zero commission for SL and some very high commission for TP, which isn't true as it calculates the same commission size irrespective of exit type.
 
  • 👍
Reactions: ivvnnn

ivvnnn

Trader
Aug 20, 2023
2
0
6
34
Your main issues seems to be that you missed the point that the commission you input is one-way, so is charged twice throughout the trade's lifetime, and that you think that the Position Sizer calculates zero commission for SL and some very high commission for TP, which isn't true as it calculates the same commission size irrespective of exit type.
Thanks for the extensive reply, I think I understand.
I've come to the conclusion that I need to enter half of my commission in the field for the correct calculation, right? On the example of a particular trade it works correctly.
But the value in the "Reward, USD" field in the "Input" section still misleads me, I still think it should be "1593.96". Guess it's too difficult for me to understand - I just won't look there next time :)
Thanks again for your detailed answer.
1-1.png