Take a Break
The basic idea behind Take a Break is being able to use any EA or indicator you like, pause their operation during news releases, times of increased spreads or time-based and resume their normal operation afterwards.
Example: You have an EA that usually works well but want to stop trading during specific news events or at certain times of the day. This is where Take a Break comes into play as it will pause your EA's operation automatically by applying the filter settings you defined and continue trading afterwards.
- Works with any Expert Advisor or Indicator
- 6 built-in filters for protecting your trades:
- news filter
- maximum lots filter
- spread filter
- volatility filter
- time filter
- daily profit/loss limit
How to set up
- Add the URL https://trading.custom-solutions.it to the list of allowed WebRequest URLs (press CTRL+O, tab "Expert Advisors")
- Download the FREE Take a Break Indicator and follow the setup example.
--- News Settings ---
- Pause during NFP/High/Medium/Low Impact News: Enable/disable news filters.
- Pause before NFP/High/Medium/Low Impact News (minutes)
- Pause after NFP/High/Medium/Low Impact News (minutes)
- Close trades X minutes before NFP/High/Medium/Low Impact News: Either all symbol trades ("-1") or only those with the specified "External EA - Magic Numbers" (e.g. "1,2,3") will be closed X minutes before the news.
- Filter News Events: Only pause during specific events. Separate multiple event names by a comma like e.g. "PMI,Rate Statement,CPI".
- Filter News Symbols: By default, Take a Break will determine the news for each symbol automatically. However, you can also specify your own set of symbols (e.g. "EUR,USD,GBP").
--- Additional Filters ---
- Maximum Lots (0 = not used): Trading will be disabled when the sum of ALL orders' (independent of any magic number) lots >= Maximum Lots. Set to "0" to disable it.
- Maximum Spread (0 = not used): Spread filter for each symbol. Set to "0" to disable it.
- Maximum Daily Profit Limit (0 = not used): Enter a daily profit limit in your account's base currency here. E.g. "100" means "stop trading when the daily profit reaches 100 EUR/USD/...". In this case, ALL trades (independent of any magic number) will be closed and the chart template "Daily Profit/Loss Limit reached" applied.
- Maximum Daily Loss Limit (0 = not used): Same as "Maximum Daily Profit Limit" but you specify a negative value here. E.g. "-100" means "stop trading when the daily loss reaches -100 EUR/USD/...".
- Daily Profit/Loss Limit calculation mode: If set to "Equity", the profit/loss of open positions will also be taken into account when performing calculations. If set to "Balance", only the profit/loss of closed positions will be taken into account.
- Timezone to reset Daily Profit/Loss Limit: By default, the limits are reset once every day at the specified "Time to reset Daily Profit/Loss Limit" broker server time. If you want the daily limits to be reset in another timezone, enter it here (e.g. "CET"). See List of Timezone Abbrevations.
- Close ALL trades on: In addition to the news filter, ALL trades (independent of any magic number) can be closed either daily or on a specific weekday at the time specified under "Close ALL trades at".
--- Template Settings ---
- Force template apply: If set to "true", templates will be applied even if there are open trades of your other EA. Useful to prevent your other EA from opening new trades during news, increased spreads etc. But can possibly leave the open trades unprotected during these periods (if they have no S/L set). Use with caution.
--- Time Settings ---
- Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday Trading: Specify trading times as ranges for each weekday and separate them by a comma.
E.g. "04:00 - 06:00,20:00 - 22:00" will trade from 04:00 to 06:00 and from 20:00 to 22:00 (broker server time).
Feedback, improvements or enhancements are appreciated.
If you need any assistance, please contact me.
Next up will be a major release to version 5.0 with the ability to backtest your Take a Break setup.
- Volatility filter was added.
- Improved handling of news updates + time filters.
- Close ALL trades when Minimum Equity is reached
- Occasionally, templates were applied multiple times which caused some EAs to crash on template load. Additionally, this also lead to broken templates, e.g. the EA was then missing entirely on the "Trading IS allowed" template.
This can be useful to prevent your other EA from opening new trades during news. But will leave the active trades unprotected during these periods - unless they are secured by a hard S/L or another EA on the "Trading is NOT allowed" template. Use with caution.
Once your overall Account Equity falls below the defined value, ALL trades (independent of any magic number) will be closed and the "Trading is NOT allowed" template applied.
- Minimum Balance until trading IS allowed
Once your Account Balance falls below the defined value, ALL trades (independent of any magic number) will be closed and the "Trading is NOT allowed" template be applied.
- Further performance improvements: the frequency of the time filters is now also dependent on the chart timeframe. Due to this, the EA must now be run on a chart with timeframe M1 so that these checks get executed every minute. Conveniently, the EA will change its timeframe to M1 automatically if that's not already the case.
- Updated Setup example + description to reflect these changes.
- Code cleanup
- NFP news filter did not work properly.
- News are now displayed properly again on the chart from highest to lowest impact.
- From this version onward, the frequency of the news filter checks is controlled by the chart timeframe of the Take a Break EA.
- Only one single WebRequest URL needed.
- Manage multiple Chart Groups and Magic Numbers from one single Take a Break EA instance.
Please make sure to read the updated setup example and description of the indicator + EA.
Additional note to existing users:
- Before the update, add the URL "https://trading.custom-solutions.it" to the list of allowed WebRequest URLs (press CTRL+O, tab "Expert Advisors"). The old URLs can be deleted if not used by other EAs.
- Check your existing Take a Break setups. Make sure you change the chart timeframe of the EA to M1.
- Multiple instances of the EA may be combined into one single instance if you use the same TaB EA settings (news filter settings, daily loss limit etc) for all your charts. Simply enter your Chart Groups + EA Magic Numbers (separated by a comma) into the corresponding inputs of the EA.
As always, just contact me if you need any assistance.
- Maximum Daily Profit/Loss Limit = -100
- Daily Profit = 100
- Floating Loss = -200 -> All trades are closed.
If set to "Balance", TaB will close all trades and stop trading for the day if Daily Profit/Loss exceeds the "Maximum Daily Profit/Loss Limit" (= this option does not take the Floating Profit/Loss into account).
- Terminal crashes / freezes on news time (when multiple instances of Take a Break are used).
- Improved internal news filter logic which should result in lower CPU usage. Feedback is welcome ;)
- No need to enter the "News Symbols" manually anymore. Take a Break will get all relevant news for each Chart Group automatically.
- Only those symbols are paused that are actually affected by the news. E.g. if you manage EURUSD and EURGBP in one Chart Group and there are news for GBP, only your EURGBP chart(s) will be paused.
- Likewise, if any "Close trades X minutes before ..." option is set, only those trades are closed that are actually affected by the news. E.g. if you manage EURUSD and EURGBP in one Chart Group and there are news for GBP, only your EURGBP will be closed.
- Revised Control Panel for a better overview of all filters and symbols managed in the current Chart Group.
- Optimized code structure.
- Fixed the "Close trades X minutes before ..." option. If there were many news within a short period of time, trades may not have been closed.
- Fixed the Spread filter which was not working properly after introducing the Chart Groups in version 2.0.
- Fixed an issue in the MT5 version where Take a Break was still active even after disabling Algo trading in the terminal or the EA settings.
- Added parameter "Filter News Events" with the ability to filter for custom news events (e.g. PMI,Rate Statement,CPI).
- Added parameter "Filter News Symbols" with the ability to filter for custom news symbols (e.g. EUR,USD,GBP).
- "News for current symbol only"
- Multi-chart handling is finally here! Please read the updated description for more information.
- "Timezone to reset Daily Profit/Loss Limit"
- "Chart Group"
- "Chart ID"
- Various minor code improvements
- "External EA - Close all open trades if trading is not allowed"
- "Close trades X minutes before Non-Farm Payrolls/High/Medium/Low Impact News": You can now specify the trade closing time in minutes before a news release.
- "Time to reset Daily Profit/Loss Limit": Usually, the daily profit/loss limit is reset every day at midnight (00:00 terminal time). If you want to specify another reset time, you can now do so.
- "Close ALL trades on/at": You can now specify a specific weekday and time for closing ALL your trades (useful if you don't want to keep positions open over the weekend).
- "External EA - Delete Pending Orders": If this is set to "true", Pending Orders will also be deleted X minutes before Non-Farm Payrolls/High/Medium/Low Impact News or if a weekday and time for "Close ALL trades on/at" is selected.
- Fixed "Array out of Range" error which caused the EA to stop working when it was active for a long time without terminal restart/re-initialization
- Various minor code improvements
- Deposits/Withdrawals should not count towards Daily Profit/Loss Limit
- Code improvements and preparation for MT5 version
- Added parameter "Maximum Daily Profit/Loss Limit"
- Added parameter "Apply this template if Daily Profit/Loss Limit is reached"
- Added Auto GMT detection (add the URL "http://time.is" to the list of allowed WebRequest URLs in order for this to work)
Minor improvements and bug fixes:
- Fixed Spread Filter
- Fixed several "Array out of range" errors which caused the EA to stop
- Revised Time Settings ("00:00 - 24:00" is now "all day"; e.g. "05:00 - 06:00" will now trade from 05:00 - 05:59:59)
- Improved time filter: you can now add unlimited time ranges for every weekday (including weekends for Bitcoin/Crypto trading). To do so, specify them as ranges and separate them with a comma like this:
10:00 - 18:00,20:00 - 22:00,04:00 - 06:00
Please note that the specified time ranges must be terminal/broker time in order to work properly.
- Changed default value for parameter "GMT offset of your broker" to "2" for upcoming winter time
- Added parameter "External EA - Close all open trades if trading is not allowed" (disabled by default - use with caution)
- Some changes to input parameters needed a complete reinitialization of the EA before they were reflected properly
- Changed the EA operation to use a millisecond timer instead of ticks