percentage of account at risk
-
Good morning everyone, I have a question with Fxdreema ... I don't know if you could help me ... how could I add a function to an EA, in which the same EA verifies all the open operations in the account it does not matter If they are from different pairs, well of those operations that I verify the Stop Loss of each operation to know what percentage of the account is at risk based on all the operations that are already open ... more than anything what I want to get to is that the EA no longer opens any operation if there is already 6% of the account at risk.
I would greatly appreciate your help. -
@leka-0 You can use this condition BEFORE your buy/sell now blocks to check if equity now is no more than a 6% in profit. If you want to check a loss the you should use the multiplier *0.94 instead.
-
@l-andorrà Yes, but I mean the sum of all the Stops, that is, for example we have 4 operations, each one has a stoploss of 50 dollars of loss, suppose that those 50 dollars are equivalent to 1.5% of the account, in total with the 4 Summary operations 6% of the account, and what I need is that the EA no longer opens operations in any asset when the sum of the stops equals 6% of the account, I do not know if it explained me well.
-
@leka-0 My previous solution already takes that into account. That formula can identify when the sum of all open positions right now has reached a 6% loss so far. If that condition is true, you can block your trade launcher.
-
@l-andorrà Yes, but I did not refer to the float, perhaps I have not explained myself well yet, well the first thing in this case is that we are not interested in knowing the float that the operations have, we are not interested in knowing if the float is negative or positive, we are not interested either To know if the operation was closed by SL or TP, what we are interested in knowing is what percentage of the account is added by those Stops of the operations that are active regardless of whether their float is negative or positive.
For example, let's say that the EA opened 4 trades for me, each in a different pair, and at the time the trades are open I want the EA to calculate how much those stops of said trades are, if they are already equal to 6% of the account. Well, I no longer open more operations. -
@leka-0 Ok. I think I understand now. What you mean is that the EA should calculate the percentage of the balance that is in risk right now if all open trades hit the SL. Correct?
-
@l-andorrà Sure, I just need to know how to get the value and then compare it.
-
@leka-0 AFAIK there is no block doing that directly, but maybe I'm wrong. Obviously you would neet a loop doing those calculations but I have to admit I don't know how to design it. It should be a 'For each trade' loop for sure, but beyond that maybe miro or roar would shed some light.
-
@l-andorrà thank you very much, help @miro or @roar
-
@leka-0 its a bit complicated, but here
https://fxdreema.com/shared/omHNw9vFc -
@roar nice work as always man. I wish I knew what all of it meant! lol
-
@roar you are a crack, thank you very much
-
@roar Hello me again, there is something in the custom code block that affects some parameters of the EA in other assets, for example I have programmed the EA that when a certain event occurs I turn off some blocks, the detail is that it turns them off for all currency pairs in which I also have the EA running, and it turns them off although that event did not occur there, how could I tell the EA that the only thing I want to take into account of the other pairs is the percentage that is in account risk, not affected by any other EA parameter?
-
@leka-0 didn't fully understand, but I think you want to change the "Group Mode"
