Account Protector

Greetings - testing out your EA, aiming for protection if a 15% drawdown occurs, and I would like to close all orders in a FIFO-compliant manner.

Are there any options for "CloseFiles: Close which trades first?" that result in a FIFO close order?
If not, could you add an option like "Close FIFO order" to this input option?
There's currently no option for FIFO closing. Maybe I will add it in the next version. However, the default option (No order, as quickly as possible) will almost always result in the first open position closing first. But that's not guaranteed.
 
  • 👍
Reactions: forexheffe
Hi. Great EA! I did have a bug, potentially. Just hit the equity desired, and it did close all open positions, and turn off the automated trading, but did not close the pending orders, which I did have checked as an action. Or rather it closed them, but then they re-opened. I closed them manually, and as the automated trading had been shut off by that point, they stayed closed. I guess automated trading must be active for Account Protector to work, so it's a race to close with the other EAs trying to open. Manually set pendings wouldn't be a problem.
Ah. I just see that Close All Other Charts has priority... so if I checked that action, it would solve the problem, yes?
 
Hi. Great EA! I did have a bug, potentially. Just hit the equity desired, and it did close all open positions, and turn off the automated trading, but did not close the pending orders, which I did have checked as an action. Or rather it closed them, but then they re-opened. I closed them manually, and as the automated trading had been shut off by that point, they stayed closed. I guess automated trading must be active for Account Protector to work, so it's a race to close with the other EAs trying to open. Manually set pendings wouldn't be a problem.
Ah. I just see that Close All Other Charts has priority... so if I checked that action, it would solve the problem, yes?
Yes, closing all charts with other EAs should solve this.
 
When does the Equity Snapshot update it's values - how often does this take place. It has been over 20 minutes w/o an update. Seems like that would cause potential problems when using the equity protection settings (like I am). I can send you an image if you would like.1747286147866.png
 
Last edited:
When does the Equity Snapshot update it's values - how often does this take place. It has been over 20 minutes w/o an update. Seems like that would cause potential problems when using the equity protection settings (like I am). I can send you an image if you would like.View attachment 32574
They don't update automatically. That's the point. Which equity protection settings are you using? Conditions that don't mention equity snapshot have nothing to do with equity snapshot even if they are based on equity.
 
They don't update automatically. That's the point. Which equity protection settings are you using? Conditions that don't mention equity snapshot have nothing to do with equity snapshot even if they are based on equity.
I am using the Equity <=% of snapshot. I have it set to 90%. I am trying to have the EA close opened trades if the drawdown hits 10% of equity. Do I need to use the floating loss rises to % of balance instead?
 
I am using the Equity <=% of snapshot. I have it set to 90%. I am trying to have the EA close opened trades if the drawdown hits 10% of equity. Do I need to use the floating loss rises to % of balance instead?
Equity <=% of snapshot set to 90% will work as a 10% equity drawdown condition if you took your snapshot at the right moment - at the point from which you are measuring your drawdown. If you update your snapshot after that, it will be measuring drawdown from a new point. I don't know if you want that or not.

Floating loss as % of balance works the same as Equity <=% of snapshot if the snapshot was taken when there were no open trade (basically, when equity = balance) and there are no further changes to your balance (deposits/withdrawals/trades closing).
 
Equity <=% of snapshot set to 90% will work as a 10% equity drawdown condition if you took your snapshot at the right moment - at the point from which you are measuring your drawdown. If you update your snapshot after that, it will be measuring drawdown from a new point. I don't know if you want that or not.

Floating loss as % of balance works the same as Equity <=% of snapshot if the snapshot was taken when there were no open trade (basically, when equity = balance) and there are no further changes to your balance (deposits/withdrawals/trades closing).
So there is no auto updating option where everytime a trade closes or is initiated that it updates the snapshot? That is only a manual thing - requiring manual updating each time?
 
So there is no auto updating option where everytime a trade closes or is initiated that it updates the snapshot? That is only a manual thing - requiring manual updating each time?
There are some auto-updating options (after all, there's an action in the Actions tab for that), but it's not needed in most use cases. What exactly are you trying to achieve?
 
There are some auto-updating options (after all, there's an action in the Actions tab for that), but it's not needed in most use cases. What exactly are you trying to achieve?
I want all open trades to close if the floating drawdown of equity exceeds 10% of the overall balance. Bascially protect the balance from losing more than 10% during excessive drawdown. I have a system that already incorrporates trailing stop, news filtration and such - but I need an equity protection / balance protection EA to help assist with auto closing trades once a floating drawdown exceeds 10%.
 
I have a beginner's question: does this Expert work if my computer is turned off? I do long trades and other people use the computer in my house, so I can't leave MT5 always open.
 
I have a beginner's question: does this Expert work if my computer is turned off? I do long trades and other people use the computer in my house, so I can't leave MT5 always open.
No, it won't work if you close your MT5 or turn your computer off. I recommend using it with a VPS if you cannot keep your computer on with MT5 running all the time.
 
  • 👍
Reactions: Zoran10
Hi,

Love the look of this - have had success in trading, but blown it due to over-trading and the like - but need to spend some time trying to understand it.

I've got a VPS (have a couple of EAs and a copy/trader that I've tried previously), I understand I can use that here.

I'm looking for something that can do the below; is it suitable?

Ideal setup -

Max daily loss of 5% per day (close when exceeded)

Max daily profit of 15% per day (don't close open positions when exceeded <close when falls back too, or based on trailing SL?>, but don't allow any new positions).

SL to BE at TP?

Trailing stop loss - parameters to be defined (recommended?); gold as an example, if my TP was $5 away from entry, if there was a $3 move, could I move SL to $1 and have it trail by $2 as a rule? I trade on momentum on short time frames primarily, so I'm more interested in protecting downside in that area.

Only 2 positions open at a time, 4 per day total.

Thanks!
 
Last edited:
Max daily loss of 5% per day (close when exceeded)
Yes, that's pretty easy. Especially, if all you want is to close all trades when this happens.
Max daily profit of 15% per day (don't close open positions when exceeded <close when falls back too, or based on trailing SL?>, but don't allow any new positions).
Now this becomes tricky. You can add a second instance of the AP to define this condition-action, but how exactly are planning to prevent new positions from opening. If you disable autotrading, your first instance (that reacts to daily loss) won't be able to close any positions. If you want it to close all other charts, it will remove all other EAs from the platform (including your first AP) and you will have to add them again when you decide to restart he setup.

SL to BE at TP?

Trailing stop loss - parameters to be defined (recommended?); gold as an example, if my TP was $5 away from entry, if there was a $3 move, could I move SL to $1 and have it trail by $2 as a rule? I trade on momentum on short time frames primarily, so I'm more interested in protecting downside in that area.
There are two trailing stop-loss options in the AP: a simple TSL that acts separately on each position and is defined in points, a hidden equity trailing stop that acts on the entire account and is defined in currency units.
Only 2 positions open at a time, 4 per day total.
It can perform actions when a third position is opened, but it is a suboptimal way to regulate the number of open positions. This should be done by your original EA. And it cannot do any actions based on the number of trades per day.
 
Yes, that's pretty easy. Especially, if all you want is to close all trades when this happens.

Now this becomes tricky. You can add a second instance of the AP to define this condition-action, but how exactly are planning to prevent new positions from opening. If you disable autotrading, your first instance (that reacts to daily loss) won't be able to close any positions. If you want it to close all other charts, it will remove all other EAs from the platform (including your first AP) and you will have to add them again when you decide to restart he setup.


There are two trailing stop-loss options in the AP: a simple TSL that acts separately on each position and is defined in points, a hidden equity trailing stop that acts on the entire account and is defined in currency units.

It can perform actions when a third position is opened, but it is a suboptimal way to regulate the number of open positions. This should be done by your original EA. And it cannot do any actions based on the number of trades per day.

Thanks for the thorough reply 🙂

I wasn't clear at the start - I intend to be trading manually, no other EAs, I'm just looking for something to control my impulses and prevent my over-trading etc from destroying my otherwise good results.

Is this suitable for that, or I have misunderstood initially?