Close my trades following equity level
-
Hi all! I am trying to close my trades when the equity reach a level of loss.
Example here. I want my positions close when my equity lose 20%. When my account start from 10 000 and my equity is at 8 000 I need my EA close all positions. How can I do?
I did something but it doesn't work. Maybe I have forgot something...
Thanks
https://fxdreema.com/shared/BqWAvRNmc -
@bagheria - You could try * -80 as the minus sign means 'less than'....*
-
@morpheus_0 Thanks. Like that? I will test but seems strange.

-
@bagheria - Yes...I'm not sure myself but building EAs is just a matter of trial and error right?

Perhaps a formula could work too but I'm sorry, I'm not that expertised*
-
@morpheus_0 Thank you. It is not working at all.
Anyone else to propose a solution.
Just a silly question: "Need I put the condition in "On init" tab or not?" -
@bagheria - > Just a silly question: "Need I put the condition in "On init" tab or not?"
This I know....No you do not
On Tick is fine* -
@morpheus_0 Ok, thanks. I have the good solution. For those who have the same question you need to do the following thing in the "On tick" tab.

The secret is Equity < Balance *0.80 (for 20% loss) and not Equity < Equity *0.80
Thanks for your help Morpheus!
-
@bagheria - My pleasure. Glad you got it sorted and thanks for sharing your results*
-