Discussion of article "Continuous walk-forward optimization (Part 8): Program improvements and fixes" - page 2

 
Andrey Azatskiy:

Regarding the error that there is no data to create - are you sure you have included automatic upload and report generation in the EA? There are two options here, either you have not included in the EA code the functionality of automatic unloading and report generation, or the trading results of the EA did not pass the optimisation filters you have set.

In my understanding, I have connected unloading, added lines to the Expert Advisor:

#include<Trade\Trade.mqh>
#define  CUSTOM_ON_TICK // Tell to uploading system that we implement OnTick callback ourself
#include <History manager/AutoUpLoader2.mqh> // Include CAutoUploader

#define  TESTER_ONLY
And everything worked according to the parameters. Optimisation was visualised in the tester and the Expert Advisor wrote the results to its file. But only by history. The forward pass was not recorded. There was nothing at all in the optimiser results window.
 
Good Beer:

In my understanding, I connected the unloading, added strings to the EA:

And everything worked according to the parameters. Optimisation was visualised in the tester and the Expert Advisor wrote the results to its file. But only by history. The forward pass was not recorded. There was nothing at all in the optimiser results window.

If you used "CUSTOM_ON_TICK", you need to add the following code to your OnTick method (at the very beginning):

CAutoUploader2::OnTick(); // If CUSTOM_ON_TICK was defined

Either rename OnTick to MyOnTick or something else and in OnInit write the connection :

CAutoUploader2::SetCallback(MyOnTick, ENUM_CALLBACK_TYPE::CB_ON_TICK);
 
Good Beer:

You've got it wrong. You're the one with the 12:00 to 12:00 optimisation time. And I haven't found where to change that.

Because of this we lose 12 hours of the first day of the history and get optimised for 12 hours for the forward period. Because of this, the forward is moved a day forward, because this day is taken up by the history.

Since there are 7 days in a week, the optimisation period must be divided into seven days. The history period ends on Monday 0-00 and the forward starts on Monday 0-00. It turns out that on Monday we do not test but make a forward. No time machine.

The time is displayed in foreign format (MM.DD.YYYY HH:MM), but is set in our format (DD.MM.YYYY).
Where time is not 12:00 pm = 00:00.

And since we specified time Po equal to DD.MM.YYYY 00:00:00, if we specify the same time, the tester will not understand that we need to test from the next date, instead it will start the test from the same date and we will get the same time machine. That's why we're backtracking a day. However, you can rewrite the logic of setting the time, just modify the method"public void Calculate(DateTime From, DateTime Till, uint history, uint forward)" which is located in the class "AutoFrame". , which is located in the class " AutoFillInDateBordersM". This class is described in the file that can be found at the path "MetaTrader-Auto-Optimiser/Metatrader Auto Optimiser/Model/AutoFillInDateBordersM.cs".

This is how it is implemented in the current version :
public void Calculate(DateTime From, DateTime Till, uint history, uint forward)
        {
            if (From >= Till)
                throw new ArgumentException("Date From must be less then date Till");

            List<KeyValuePair<OptimisationType, DateTime[]>> data = new List<KeyValuePair<OptimisationType, DateTime[]>>();

            OptimisationType type = OptimisationType.History;

            DateTime _history = From;
            DateTime _forward = From.AddDays(history + 1);

            DateTime CalcEndDate()
            {
                return type == OptimisationType.History ? _history.AddDays(history) : _forward.AddDays(forward);
            }

            while (CalcEndDate() <= Till)
            {
                DateTime from = type == OptimisationType.History ? _history : _forward;
                data.Add(new KeyValuePair<OptimisationType, DateTime[]>(type, new DateTime[2] { from, CalcEndDate() }));

                if (type == OptimisationType.History)
                    _history = _history.AddDays(forward + 1);
                else
                    _forward = _forward.AddDays(forward + 1);

                type = type == OptimisationType.History ? OptimisationType.Forward : OptimisationType.History;
            }

            if (data.Count == 0)
                throw new ArgumentException("Can`t create any date borders with setted In sample (History) step");

            DateBorders?.Invoke(data);
        }
 
Nguyen Tien Duong:

Hi, your series articles were really helpful, I am not good at c # so I am trying to learn it from your lessons

I downloaded the Attached filesfrom Part 4 to 7 but i can't build the "Metatrade Auto Optimiser" project. i got error like the picture:


Attached filesfrom Part 8 that's my fisrt time seeing your program interface, it succeeded in launching mt5 when optimisation mode is disable , and wwhen i turn on it like this picture I got error



please help me fix it thank you

Use the last past, it contanes all nessasary files and links.

You need to add uploading options in your expert. To do it, use file "/Data/MQL5/Experts/Test Expert/New uploading variant/SimpleMA.mq5" as an example, or compile it and use for the tests.

 
Andrey Azatskiy:

If you used "CUSTOM_ON_TICK", you need to add the following code to your OnTick method (at the very beginning) :

Sorry for being obtuse; could you have done away with the standard 'OnTick()'?

 
Andrey Azatskiy:

Time is displayed in foreign format

Sure, I'll try to rewrite it. The issue was not the time format, but the fact that the forward period was to the right than it should be. Perhaps my terminal is set to 24-hour format and this causes the error.

 
Good Beer:

Forgive me for being obtuse; was it possible to get by with the standard 'OnTick()'?

Everything is customisable there. Study the file "History manager/AutoUpLoader2.mqh" + an example with the new data upload format, then everything should become clearer.

If the defyne "CUSTOM_ON_TICK" is described in your message - it means that you are saying that OnTick is standard, but it also means that you have to take care that the code string

CAutoUploader2::SetCallback(MyOnTick, ENUM_CALLBACK_TYPE::CB_ON_TICK);

at the beginning of the OnTick method.

 

Hello,


Thank you so much for this project. I'm sure it'll be very useful.

I just started to use it and I'm facing a problem with the selection of the currency on "Metatrader Auto Optmiser .exe". Is it possible to use another one instead of the defaults?

There isn't an option to write a new one besides of the available options (RUR, USD, EUR, GPB, CHF).


Thank you.

 
Marinho10:

Hello,


Thank you so much for this project. I'm sure it'll be very useful.

I just started to use it and I'm facing a problem with the selection of the currency on "Metatrader Auto Optmiser .exe". Is it possible to use another one instead of the defaults?

There isn't an option to write a new one besides of the available options (RUR, USD, EUR, GPB, CHF).


Thank you.

Hi.

You have to edit code of the Auto optimiser and recompile it.
1. Open program in Visual Studio.
2. Open file "AutoOptimiserVM.cs"
3. At the line #41 - the following code is responsable for the collection ofcurrencies. Edit it:

new OptimiserSetting( " Currency", new []{ " RUR", " USD", " EUR", "GBP", " CHF"}),
4. Recompile the programme and you will see your currency in the combobox.

 
I request the Author to record a video that shows the different uses of this project.