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.
-
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.
-
@Ipod tengo el mismo problema. lo pudiste resolver?
-
¿Te refieres a tener diversas operaciones abiertas a la vez y que la suma de ellas no supere un riesgo de capital concreto?
-
@l-andorrà bueno, mi caso es diferente pero pensaba que tendría la misma solución.
en mi caso, estoy buscando un SL porcentual respecto a mi capital.
siempre uso el mismo lotaje de 0.01, y quisiera usar un SL porcentual..
he estado buscando, pero solo aparece en pips, monetario o % pero respecto al precio del activo -
@salek You mean you just simply want a working % lot calculation? If so there is a solution but it requires custom code.
-
@Ipod no se que responderte, no entendi bien lo de el calculo del lotaje.
te pongo un ejemplo: digamos que tengo un capital de 1000€ en broker y hago una operación en el nasdaq con un lotaje de 0.01. quisiera poner un stop loss a 0.5% de mi capital, ósea que en este caso estoy dispuesto arriesgar 5€.
ya se que esto se puede hacer con un sl monetario, pero quiero hacer un backtesting arriesgando siempre el mismo porcentaje según va variando mi capital. -
@salek Lo que dice Ipod es cierto. No hay ningún bloque en fxDreema que haga eso exactamente. Para ello necesitas un pedazo de código programado con ese propósito explícitamente. Necesitarás que un programador (yo no lo soy, lo siento) lo prepare y entonces podrás añadirlo a tu proyecto de fxDreema.
-
@l-andorrà AGRADEZCO MUCHO VUESTRO TIEMPO Y AYUDA
-
@l-andorrà @salek i actually have custom code for fxdreema to fix this problem, which requires running a script at the exported mql5 which then replaces the incorrect code within the ea. You then compile within mt5 directly.
I made a post a long time ago about the correction using custom code but I could share what I use here if you wanted.
Stop loss in percent, equity percent etc then work correctly on all forex pairs, index’s and also commodities like gold.