How to control (X) percentage of the account balance in risk with various trades open.
-
Hello everyone, I'm wondering how I can limit my robot to only have certain percentage in risk by trades open... Example, I only want to risk 2% of my account by trades open, and also if it losses 2% in that day, that don't open more trades that day. I have it set to 0.4% risk per trade open. I want it to be allowed to open 4 to 5 trades at the time by the 2% that I willing to risk per day. But I don't now how to allow the robot to open various trades and limit the robot to see the % in risk by all trades open. I use trailing stop once pips away from entry point. Is there a filter that I can use that monitor the percentage in risk by all trades open, example if I only have 2 trades open and I have 0.8% in risk the robot is allowed to open another trade, but if is at 2.0% risk its not allowed... Also I want this to allow my robot to open a 5th or 6 trade if I have various of the 4 trades open with trailing stops in profit. If I have 4 trades open, and 2 or 3 have stop loss in profit, I know I don't run risk of loss in those 2 or 3 trades. So I want my robot to be allowed to run other trades until 2% in risk open and if it has not hit 2% loss that day. Thanks for anyone that can help.
-
@kelrobot Well, that is not a trival thing to do. You will need a few variables controlling the open lot size right now. That another one to check it is not above you limit and so on. Do you have any initial project to begin with?
-
@l-andorrà hello, thanks. Yes, I'm working with the EA, but I wish to add these parameters. Just working with few thing here with him.
-
@kelrobot This is how you can get the maximum amount of money to be risked with a constant and a variable:
https://fxdreema.com/shared/bnwH1Zwwc
You will need to specify that percentage as decimal positions. So 2% should be 0.02.
-
So, you mean that I put a block of modify variable, (value, numeric 0.02, but followed by what other block? Thanks
-
@kelrobot I have never done what l'andora has advised, do you mean amount risked per trade? If so see picture, and SL is needed if using as reference. if you mean when equity = chosen amount close all, this can be done with a constant, formula and condition block.

-
That looks nice, but, I'm risking .40 in the %of balance per trade and working with trailing stop, no take profit. I would like to have the robot programed so he can be allowed to open till 2% of balance by all trades open. If 1 or 2 trades already moved their stop loss in profit, does spaces are open so he can make new trades. And also if it losses 2% a day, it ends its day in that last loss that made the final 2% loss in the day. No mere trading for the robot that day.
-
@kelrobot I think THIS will do all you require, I haven't tested though. To see if this is working add all variables to a comment block, so you can visibly check in back test. Add this to your project, or press the mq button import back into FXDreema and add your project to it. will also work with mq5 but will need converted.
-
@jstap thank, soon will try to check it out. let me solve first the problem of trailing stop.