Request: EA that closes all open trades by equity number

MPTM's new home
Post Reply
User avatar
Jemook
Trader
Posts: 1085
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Request: EA that closes all open trades by equity number

Post by Jemook »

Hi guys,

I'm having trouble finding this one. I'm looking for an EA that closes all trades based on a static equity number. IE:

Account size is $50,000. I want the EA to close all trades when equity <= $48,000.

Now, I have plenty of scripts that shut all trades when open equity reaches a floating loss of X amount but that's not what I'm looking for. I'm looking to input a set number that i don't want the account to go below.

This will enable me to make profit and take the $50,000 account to $60,000 and the EA will only close everything if I lose $12,000 from there and the account is back to $48,000.

I've been searching all day but hard to find something this specific. If no one has anything I'll ask an acquaintance who shall not be named to code it up whose name is Steve. :lol:

Cheers,
J
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
User avatar
kwanann
Trader
Posts: 948
Joined: Thu Nov 29, 2012 1:53 am

Re: Request: EA that closes all open trades by equity number

Post by kwanann »

So meaning no matter what is your balance, as long as equity reaches your predefined number it will close all trades?

e.g you have 1 mil, you set eqity close at 50K, so once it loses 950K, all trades will be closed?
I've been trading using OM Dual N EA for the past 2 years, live results can be found over at https://www.fxblue.com/users/kwanann
User avatar
Jemook
Trader
Posts: 1085
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Re: Request: EA that closes all open trades by equity number

Post by Jemook »

Exactly! But wow I hope if I ever do have 1 mil I don't have to auto-close at a 950k loss!!
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
phil_trade

Re: Request: EA that closes all open trades by equity number

Post by phil_trade »

Jemook wrote:Exactly! But wow I hope if I ever do have 1 mil I don't have to auto-close at a 950k loss!!
please find this simple one. Let me know if something else needed or if I misunderstood :)

Philippe
You do not have the required permissions to view the files attached to this post.
User avatar
kwanann
Trader
Posts: 948
Joined: Thu Nov 29, 2012 1:53 am

Re: Request: EA that closes all open trades by equity number

Post by kwanann »

here u go, please test, i just coded this in like 5 min
You do not have the required permissions to view the files attached to this post.
I've been trading using OM Dual N EA for the past 2 years, live results can be found over at https://www.fxblue.com/users/kwanann
User avatar
Jemook
Trader
Posts: 1085
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Re: Request: EA that closes all open trades by equity number

Post by Jemook »

Nice one guys! They both work a treat :)

Kwan if you can be bothered and it's easy enough could you make the EA turn itself off after it closes all the trades? It's not necessary but right now if someone tries to open trades after it goes below the equity and closes all the EA will auto-close any new positions as soon as they are opened.

For my purposes what you've supplied is perfect - thank you SO much!
J
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
User avatar
kwanann
Trader
Posts: 948
Joined: Thu Nov 29, 2012 1:53 am

Re: Request: EA that closes all open trades by equity number

Post by kwanann »

Hi Jem,

Here you go, added auto disable

K
You do not have the required permissions to view the files attached to this post.
I've been trading using OM Dual N EA for the past 2 years, live results can be found over at https://www.fxblue.com/users/kwanann
User avatar
Jemook
Trader
Posts: 1085
Joined: Thu May 10, 2012 10:19 am
Location: Bondi, Sydney, Australia

Re: Request: EA that closes all open trades by equity number

Post by Jemook »

Thanks champ :)
Please note I am no longer affiliated with Global Prime. I've moved on to my next adventure with Afterprime.

Catch me here: https://www.afterprime.com
User avatar
cadolino
Trader
Posts: 35
Joined: Tue Jan 10, 2012 11:16 am

Re: Request: EA that closes all open trades by equity number

Post by cadolino »

that's a super idea!...
gives me time to cool down and the start trading again...

tank you guys for the idea and indi...

regards
Cado
Post Reply

Return to “Utilities Indicators and Scripts”