I could not find an EA solution for this:
I have a trading pc that i need to close at the end of the day, sometimes the equity is almost at the balance level so i can close all positions immediately with perhaps only a small loss compared to the last balance level. But most of the time there are a lot of positions open (negative). So mostly i try to sit and wait, looking at the screen until the biggest part of the open positions climb to the balance level or when they have finally closed by their corresponding EA's and then i close all left open orders manually, preferrable with the equity at a minimum of 99% of the last balance total.
But this takes some time to do manually and i was wondering if it is possible to have an EA that does this automatic, so not just closing all open positions immediately, because i already found such EA, but close all when the equity reaches a predefined level for instance 99% of the account balance. If this 99 % cannot be reached within a predefined time, lets say for instance 1 hour, then close all open positions no matter of equity % . (Because finally i need to switch off the pc)
So the idea is that the EA has a equity% of the balance component and time component, and to complete this it would be great to have a sound alarm when the EA closes all positions and also have a second sound alarm when equity reaches x amount of profit compared to the startbalance. (Startbalance measured when the EA is activated or if this is more easy, as input variable)
Would such be possible to code?
P.s. Wondering if it is possible to code a function that immediately after all positions are closed also disables all EA's that are active? (Same sort of function like the "Expert Advisors" button located above in MT4)
Many thanks in advance.