You're welcome.
Solved modify stop loss in percent calculation?
-
Hi
Basically I run a very simple EA on my prop accounts to ensure I always have a stop loss enabled, the issue is i want to calculate that in percent say 1% and set the stop there for each trade.
Would be great if someone had the time to assist me, i know we can set it when an order opens but is there an easy way to modify an existing pips distance SL into a %SL?
Kind regards
-
Links are not functional. Could you please share the link to the project?
-
ohh sorry, let me try again.
-
You are using pips instead of % in your project. On the other hand what you need is a bit confusing. If you are opening new trades while old ones are still open, that 1% max loss you want will change the SL of all of them, but then distances should be recalculated according to each individual lot size. You definitely need an overall loss calculation and then close all open trades. That will lead to the exact same result with far less effort.
- 10 days later
-
True I appreciate what you are saying, but hear my out. Some prop firms require a stop loss of a maximun size of say 2%. For every trade that opens I would want to set a max stop loss of 1.9% to comply with the rules (realistically it does not matter the total risk on the account)
Trade 1 = 0.01 lots so in theory 1.9% stop loss the distance in pips is 1000 to make things easy.
Trade 2 = 0.02 lots now the stop loss would be 500 pips away.
Trade 3 = 0.03 lots and stop loss is now 333 pips away.
trade 4 = 0.04 lots with a stop of 250 pips.My aim is not to change the stops for every trade as a basket, just have a stop distance of 1.9% in this example per trade so the bigger the lot size the shorter the stops. or an overall loss calculation but with hard stops rather than caclulated per tick based on a fraction of the account balance.
-
I understand. What you need is definitely complex. No fxDreema block can do that. You will definitely need some custom code to add to your current project. That goes beyond my capabilities.
-
@l-andorrà ahhh fair enough, thanks for the advice on this. I’ll park it and come back when I have more experience and knowledge.
-
-
You're welcome.