Lavoro terminato
![](https://c.mql5.com/i/avatar/avatar_na2.png)
Specifiche
Hello,
I am looking for an EA which is capable of doing the following:
1. Accepts following inputs:
a. Start time of day (say STARTTIME). Default should be 00:00.
b. Profit level (say MINPROFIT).
c. Loss percentage (say OPENLOSS).
2. If the total historic profit (made from all closed trades so far on the day from 00:00 or STARTTIME) crosses the MINPROFIT level then do the following:
3a. Check if the total floating loss (from all open trades) is equal to (or greater than) OPENLOSS percentage of MINPROFIT at any time then close all open trades.
3. If the total historic profit is less than MINPROFIT then do nothing.
4. If the toal floating loss (from all open trades) is less than OPENLOSS percentage of MINPROFIT then do nothing.
For example:
My inputs:
STARTTIME 08:00
MINPROFIT 100.00
OPENLOSS (%) 40
13:00 - Total historic profit made (closed trades only from 08:00) is : 90 and total loss (from open trades only) is -150. Do nothing as historic profit (closed trades only from 08:00) is less than MINPROFIT (ie. 90 < 100).
14:00 - Total historic profit made (closed trades only from 08:00) is 120 and total loss (from open trades only) is -30. Do nothing as total loss (from open trades only) is less than 40% of 120. (ie. 30 < 48).
14:30 - Total historic profit made (closed trades only from 08:00) is 140 and total loss (from open trades only) is -50. Do nothing as total loss (from open trades only) is less than 40% of 140. (ie. 50 < 56).
14:45 - Total historic profit made (closed trades only from 08:00) is 150 and total loss (from open trades only) is -60. EA should close all open trades as total loss (from open trades only) is greater than or equal to 40% of 150. (ie. 60 = 60).
14:50 - Total historic profit made (closed trades only from 08:00) is 90 (We closed all trades when loss was at -60 so historic profit has reduced) and total loss (from open trades only) is 10. Do nothing as historic profit (closed trades only from 08:00) is less than MINPROFIT (i.e 90 < 100).
15:00 - Total profit made (closed trades only from 08:00) is 100 and total loss (from open trades only) is -40. EA should again close all open trades as total loss (from open trades only) is greater than or equal to 40% of 100. (ie. 40 = 40).
That's it.
Thank you.