Optimizing Outbreak EA with the PRO settings
Outbreak is optimized for a long term steady equity growth.
In a backtest it shows good profit over years with little drawdown.
Outbreak works well for users, who want a plug & play solution without any work on the system.
But users who want to play with the system, try it with very different settings have the option.
For several reasons it may be useful for some users to optimize Outbreak their own way:
1. If the broker has a fairly different pricing than other brokers.
That may be a disadvantage but it also can be an advantage, if the settings are adapted to that broker.
2. Market conditions have suddenly changed to extreme high or low volatility or ... whatever.
3. A user wants to optimize in a way, that results in a backtest - years ago - worsen, but currently improve.
Optimizing that way may mean overoptimizing - but possibly it works well.
Try your personal setting first in demo account live trading, to see how it works.
And share the set file!
Markets change continously, normaly slowly but steady - or the world changes fast and fierce, as happened when the pandemic started or the war.
Since then we live in a world of constant crisis, market changes come fast sometimes.
A static trading system may need much time to be adapted by the coder, a system with many setting may be adapted faster if clever users help.
Optimizing by backtests is a wide field. costs a lot of time.
But if there's users creating their setfiles sharing with other user ... I hope there'll be some feedback and exchange.
It would be good to be prepared in case of turbulences like we had in financial crisis 2008 when eurusd easily moved 200 pips/hour.
If you have the time and the inclination try to find the best setting for those extreme months and share it!
We all have a common interest: we want to make money - let's work together to get it! ;-)
Following a description of the settings that make already a lot possible. But there's a lot more internal settings.
With every new versions such settings become more visible, step by step, so the system can be configurated to trade other currencies.
A guide how to optimize the EA will come in another article.
On top are MaximumRisk and Lots, seperately for sell and buy.
This makes it possible to trade different lotsizes for buy and sell, no matter if with or without auto money management.
The function MaxLosses (in PRO SETTINGS) can change the lotsize after x losses.
Testing and optimizing only buy or sell
The settings LotsBuy or LotsSell set to 0 deactivate the corresponding type, no matter if Auto_Moneymanage is active or not.
Below the standard setting are the PRO SETTINGS:
MaxSpread: Spread in points when pending orders are deleted if the spread exceeds the setting.
Distance BuyStop means the distance where a Stoporder is set above a certain level.
In strategy 1 the value depends on many things, mostly it is a recent high, the exact value is floating.
In strategy 2 the value where the Buy Stoporder is set is static, generally the high of the day before, the Sell Stoporder is set at the low.
Some functions change the value. Later more about that.
In strategy 1 changing Distance BuyStop may improve the trading result in some few cases, with special brokers, but generally not.
It is not very surprising that the value 100 is perfect here. All our thinking and machine calculations rely on the decimal system.In strategy 2 changing Distance BuyStop changes the result a lot. The best value is in most cases the default setting.
Filter Buy test deactivates filters according to their number. That for now works only in strategy 1.
How many filters there are to test is shown in comment#41, in the provided Outest.set file.
This setting can be run in optimization to find out fast which filter may be obsolete.
If it shows in optimization that deactivating a filter improves the overal result, it can be deactivated in the next setting, writing the number(s) of the filter(s).
Every filter stops the EA from setting a buystop. There's 1001 reason to surpress a stopbuy, two examples:
Filter buy 1 stops setting a order if the stoplevel is higher than the last 2 lows + 7 times current average true range - if a moving average rises and not on mondays.
Filter buy 2 stops setting a order if the stoplevel is more than the last 2 lows + 6 times current average true range - if the moving average falls and not if
the price is over the high of 2 month ago (hhm2=highest high month 2) what means the currency pair is in a medium term uptrend.
Both settings avoid setting a buystop when recent upmove was extraordinary strong. The additional conditions like e.g. not on mondays improve the filter result.
A backtest with 1 or 2 set in Filter Buy test (or 001 in the setting below) shows the impact of these filters.
NoFilterBuy deactivates filters according to their number like above, but this setting cannot run in the optimization.
This setting allows to set more than one filter number, even dozens.
If a test with optimizing Filter Buy test shows that there's more than 1 filter deactivated improving the result, several numbers can be set with a space between them. Only here it must be written always in 3 digits: 001 002 ...
If you write all into the field all filters are deactivated, an absolute basic configuration.
Even this basic setup shows profit on the long run, a good base.
(The next step here iwould be a setting to reverse the system by deactivating all filters and only activate the filters numbered.
That's much coding work. Later.)
A word about the filters:
All filters rely on chart situations that somehow repeat in the past. But the markets are under stress now as never since 2008.
A filter that improved the profit over years may fail suddenly, even reverse the signal.
So it's a traders/programmers task to control if all filters still work well, a big task - something where users can help.
Not yet, but in a following version users can activate a print function that writes in Experts which filter was when active.
If there is a loss users can see if a bad filter is the reason. If the same filter appears several times as looser it can be deactivated.
Anyway my thinking about filters: the less the better.
After adding new filters I run a backtest checking if a filter has become obsolete.
It happens often, as filters overlap in their effect, that after adding new filters that improve the result others can be deactivated
- what sometimes improves the overall result again. An almost evolutionary process.
Following settings still don't have the possibiity to set more than one filter number, they can be used in optimization.
Change Buystop deactivates functions that change the distance of the buystop like described in Distance BuyStop.
The functions have effect only if there's still no order in the market and a new order is set.
Instead of 100 points the distance is often something between 60 - 80 points, if certain conditions are met.
Modify Buystop deactivates functions that modify (move) a buystop that is already in the market, if certain conditions are met.
Change TakeProfit Buy deactivates functions that change the standard TakeProfit.
Some lead to an earlier close of a position, to avoid a loss if there's danger that the price returns.
Others make the EA wait for a higher profit, what sometimes may lead to a loss.
On these functions I work a lot. It is sometimes a pity, seeing that the EA closed a position with few pips profit but some minutes later it was 3 times more.
If I can improve the average profit/trade just 10% the overall profit rises 20%. Why?
If a system has 1000 of profit - 500 of loss there's 500 profit left.
If a system has 1100 of profit - 500 of loss there's 600 profit left.
Just a simple example to show how important these functions are. In backtests you can see that some function have huge impact.
Change StopLoss Buy deactivates functions that change the StopLoss to a level above entry price - like a trailing stop with only 1 level.
The functions become active if market conditions may lead to a sudden return of the price.
A general trailing stop can't improve the result, it only worsens it - please stop asking me for that.
HourNoTradeBuyTest deactivates the set hour. It can be used in optimization to find out if certain hour(s) deactivated improve the test result.
HoursNoTradeBuy deactivates the set hour(s). It can not be used in optimization but here can be set more than one hour to deactivate.
The hours set here must have 2 digits and a space between 2 sets, like: 01 02 ..
StartTrailBuy sets the minimum points of profit the trailing stop starts to be come active.
DistTrailBuy sets the number of points the trailing stop follows the current price.
Both settings requiere a minimum set of 10, a smaller value deactivates the trailing stop.
MaxLosses - if the number of losses exceeds the set number, the lotsize is changed to the value set below. If set to 0 the function is deactivated.
HoursAgoLosses sets the number of hours regarded back to reduce the lotsize. The preset 18 hours shows the best value in backtests.
LotsBuyAfterLoss - sets the lotsize for buys after x buy losses within last y hours like set above.
LotsSellAfterLoss - sets the lotsize for sells after x sell losses within last y hours.
If set less than the min. lotsize on the account or 0 the EA will order min. lotsize (0.1 or 0.01 lot).
Sorry, setting no order at all after losses is very difficult to program.
Following the same setting as above but for sells.
If you don't know how optimization works don't ask me! There's a lot of info about that in mql5 website, please search there!
If you do not understand these explanations at all, do not ask me, I can not explain it better!
It's already a half time job to answer question from users, I don't need it as full time job.
Maybe you do some testing and optimization and understanding comes.
If you have an idea of trading and can make sense of my ideas you are welcome to bring the project forward with questions and feedback.
Of course, there is no guarantee that the implied changes in Outbreak will one day occur!