工作已完成
![](https://c.mql5.com/i/avatar/avatar_na2.png)
指定
Also, if the EAs are paused for news or because a limit was reached, that should also be indicated in the info panel, as well as a timer or indicator for when the EAs will be re-enabled again. "EAs paused for news" or "EAs paused due to limit" could be in red for example to show an alert for why they were suspended, and a timer for when they will be re-enabled.
I would like this developed for both MT4 and MT5 as I will be running it on both. Here is what I envision a structure for the EA might look like with some extra notes/details in parenthesis, though I'm open to suggestions if it makes it easier to code or simpler to use (the attached text file is easier to read):
List of EAs to monitor, separated by comma
Account management
Condition #1
Trigger (dropdown, choose one)
$ amount of floating loss from high water mark of positive equity (tracked as a global variable that can be manually set if the EA is added to a new chart, when the positive equity climbs above this manual number it starts tracking again)
$ amount maximum loss (aggregate loss of both open and closed positions since reset--daily, monthly, etc.)
$ amount in positive equity
$ amount in negative equity
$ amount increase in account balance (includes positive equity)
$ amount decrease in account balance (includes negative equity)
$ amount fixed account balance including equity (can be above or below current account balance for a threshold, both positive or negative equity is added to the account balance as a trigger)
$ amount fixed account balance ignoring equity (can be above or below current account balance for a threshold)
% decrease from high water mark of positive equity
% amount maximum loss (aggregate loss of both open and closed positions since reset--daily, monthly, etc.)
% increase in equity
% decrease in equity
% increase in account balance
% decrease in account balance
Max volume or lot exposure
Max number of trades
Max margin usage (% of account equity)
Amount for above trigger
Actions / Options (multiple options, not a drop down list)
Including pending orders in trigger calculation above? (yes, no)
Include trades of all EAs or just listed ones (some EAs place trades with other numbers) (yes, no)
Include manual trades with magic number of 0 (yes, no)
Suspend EAs (yes, no) (if true, make sure this suspends EAs before closing trades to avoid new trades from opening)
Close pending trades (yes, no) (if no other options below, then all pending trades are closed)
Close negative trades (yes, no) (if no other options below, then all negative trades are closed)
Close positive trades (yes, no) (if no other options below, then all positive trades are closed)
Close biggest negative trade in $ amount until condition no longer exists (yes, no) (requires negative trades = true)
Close biggest positive trade in % amount until condition no longer exists (yes, no) (requires positive trades = true)
Close positive trade with the greatest floating loss from high water point until condition no longer exists (yes, no) (requires close positive trades = true)
Close largest lot size until condition no longer exists (yes, no) (will only include pending, negative, or positive trades that are enabled above)
Close largest negative lot size only, ignoring positive trades (yes or no)
Close all negative lot sizes before largest positive lot size (yes, no)
Ignore positive trades that have a stop loss above break even (yes, no)
Ignore positive trades that have a take profit (yes, no)
Send alert (yes, no) (uses mobile notifications or email configured on the platform))
Disable autotrading entirely (yes, no)
Close platform (yes, no)
Reset time for EAs and tracking timer (if nothing is enabled in this section, then the timer is set to "always" and the EA would never be re-enabled if it was suspended)
Daily (None, Every day, Sunday, Monday, Tuesday, etc.,) (None is disabled)
Weekly (0, 1, 2, 3, etc. for number of weeks, 0 is disabled)
Monthly (0, 1-31 for day of month, 0 is disabled)
Time (00:00, 03:00, 14:00, etc., blank is disabled)
Specific # of hours (blank is disabled)
Until condition no longer exists (yes, no) (Yes overrides all the above, no is disabled)
Condition #2 (same options as above)
Condition #3 (same options as above)
Condition #4 (same options as above)
Condition #5 (same options as above)
Condition #6 (same options as above)
Condition #7 (same options as above)
Condition #8 (same options as above)
Condition #9 (same options as above)
Condition #10 (same options as above)
News
Source for news: mql5, investing.com, etc.
Type of news (2 bull, 3 bull, etc.)
Restrict to related symbols only (yes, no) [EUR news disables EAs only on EUR related symbols for example)
Date, start/end times, and currency for manual triggers, probably a list of 20 at least?
Minutes before event to suspend trading
Minutes after event to allow trading
Suspend EAs for news (yes, no)
Close all open and pending trades to bring account flat for news (yes or no)
Close all open and pending trades at end of session
Suspend EAs to prevent trading before closing trades (yes, no) (re-enable at session restart if yes)
Buffer time in minutes (15 minutes default before session end for example, to allow time to close open and pending trades)
End of session daily (yes, no) (overnights on weekdays allowed if disabled)
Time of session end (if blank, get market hours from symbol properties)
Time of session restart (if blank, get market hours from symbol properties)
Close on Friday at end of session (yes, no) (close for weekends only in other words)
Time of session end (if blank, get market hours from symbol properties)
Day of session restart (Dropdown list: Sunday, Monday, Tuesday, etc.,)
Time of session restart (if blank, get market hours from symbol properties)
Magic number of this EA