Trabajo finalizado
Tarea técnica
I need a EA for close all orders (open and pending) and disable AutoTrading (optional) when is achieved the specific difference between the current equity and the balance that was at the beginning of the current session. The difference is to profit or to loss defined in currency. The current session is from open the current daily candle, or from the last start of AutoTrading.
Set working hours in local time for the EA (start time and finish time for each day of the week).
When is start time the EA enable AutoTrading (if is disabled).
When the difference is achieved (target) the EA close all orders (without option) and disable AutoTrading (optional) 2 seconds after the closing of the last order is confirmed from the broker´s server. Before disabled AutoTrading check there is no open order (another EA can open order in the last two seconds. If there is an open order, close it and wait 2 seconds since broker confirmation for disable AutoTrading)
When is finish time if the AutoTrading is enabled the EA close all orders (optional) and disable AutoTrading (optional) 2 seconds after the closing of the last order is confirmed from the broker´s server. Before disabled AutoTrading check there is no open order (another EA can open order in the last two seconds. If there is an open order, close it and wait 2 seconds since broker confirmation for disable AutoTrading)
When is finish time if the AutoTrading is disabled the EA does not take any action.
Parameters
Titles Options
Current session begins when Open daily candle /
Start AutoTrading
Apply for Profit /
Loss
Target: Currency P/L to close (the user write in currency format)
Disable AutoTrading at target Yes /
No
Disable AutoTrading at finish time Yes /
No
Close all orders at finish time Yes /
No
Working hours (local time)
Monday (the user write format hh:mm-hh:mm for start-finish
Tuesday if is empty or value 00:00-00:00 no working
Wednesday if is value 00:00-24:00 working all day)
Thursday
Friday
Note: I will use this EA with different setups in the same terminal for control profits / losses generated by another EA.
For example in one chart I use it with a specific target in daytime hours, and in another chart I use it with different target in night hours. Or I will use one setup for control profits, and in other chart different setup for control losses.
No is required differentiation by symbols.
I need access to the EA code