Testing and optimization of Black Night EA in mt5

Testing and optimization of Black Night EA in mt5

28 December 2021, 21:34
Heiko Kendziorra
0
309
Testing and optimization of Black Night EA in mt5

With the defaul setting UsePresets=true the Black Night EA uses different presets for 10+ currency pair.

By that it should show good results with most brokers.

But traders can do some fine tuning to optimize the EA for their broker.

The  Black Night EA is optimized for Roboforex ECN, a broker with fairly average pricing.

Only with few other brokers the following described optimizing should be really neccessary.


Quality and reliability of data
The Black Night EA is a night scalper, so it's result depends a lot on the broker, like every scalper.
Metatrader5 (mt5) allows fast and exact optimization of automatic trading systems by testing with the Strategy Tester. 

For a meaningful test of a night scalper it needs real tick data, what is easy to download and test in mt5.

Different brokers have different pricing, so it's good to have a tool to adapt a system to the broker.
A good thing in theory. But unfortunately few brokers provide correct data of the past years to download.

Some are more 'honest', after the test is shown e.g. 42% real ticks - not very reliable.

Others show a balance graph of a test that looks like the tested EA doesn't work well with the broker.
A look into the Journal of the Strategy Tester may show lines like below:  

71884 tick prices mismatch for 1301 minute bars
real ticks absent for 323 minutes out of 1430 total minute bars within a day
real ticks discarded for 1330 minutes out of 1430

If you find lines like that is clear that the broker's data is corrupted
Unfortunately that happens to many broker's data.
From 10 brokers downloaded real tick data of a dozen pairs was about half corrupted. 
So if your backtesting shows a bad result, take a look at the Journal. 
If the data is very corrupted there's no way to find out, if the EA works well with that broker.

The only 'broker' with perfect data is the Metaquotes demo (it's no real broker). 
They claim their data is a average of several brokers.
As Black Night shows with all currency pairs the best backtests with Metaquotes demo data 
it would be great to find a real broker with such an 'average' pricing.
With Metaquotes demo data the shown test results double!

Optimization 
Most users of mt5 should know how to optimize setting. 
For those who don't know will come a guide below this article before end of the year.
For now just some short notes for optimizing Black Night:

Optimization allows to test up to all setting at the same time. 
But that needs a lot of time and doesn't make sense in many cases.
Black Night trades buy and sell independent from each other, 
so it makes no sense to test buy and sell simultaneously. 
It only lasts a lot longer than testing one after the other.

Optimizing only buys e.g. it is done fairly fast, finding the best setting one after the other.
For the StopLoss and the Distance setting that is ok. 
But there are 2 TakeProfit settings that rely on each other - they should be tested together.

The TakeProfit1B/S sets how many points the price must be in profit when the over/under the middle line of the Bollinger Band, a hidden TakeProfit.

(See explanation of the strategy >> (mt4 and mt5 use the same strategy))

The TakeProfit2B/S sets the TakeProfit1 of the order shown in the chart.

That TP is wider, not reached very often. In a future version that TP maybe hidden if the EA is set so.


Note:
The settings for StopLoss, TakeProfit and Distance don't show the settings Black Night finally uses.
These setting are changed by internal presets to other levels. 
By setting UsePresets=false the presets are deactivated. Then every user can set his own settings.
But that would need a lot of time. 
The presets just add or substract some points to the shown settings.
So optimizing can be done with UsePresets=true, just you don't see the 'real' value of the setting used by the EA.
But optimizing that way should go fast, as together with the preset values your 'perfect' setting should be just some few points away from the given value.

As Black Night works with pending orders, the delay, the ping has nearly no effect on the result, no testing needed.
All shown tests are made with a delay of 20ms. 
You don't need a fast internet connection, something 'normal' is fully adequate.

Details for newbies in optimizing follow here on Sunday 2. Jan. 2022.


Share it with friends: