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

 
fxsaber:
I request the Author to record a video showing the different uses of this project.

If you have free time. But in general the request from you is a bit unexpected, you have seen my publications since the very first article (though maybe not all of them were followed).

 

Hello, 

Amazing project.  Thank you so much for this. 

I have a problem with compiling the DealHistoryGetter.mqh and the error message is:  'calcContracts' - member function not defined line 488.


Thank you very much again.

 

Hello,

Amazing project.Thank you so much for this.

I have a problem with compiling the DealHistoryGetter.mqh and the error message is: ' calcContracts' - memberfunction not defined line 488.


Thank you very much again.

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
Predefined Macro Substitutions - Named Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Franco87:

Hello,

Amazing project.Thank you so much for this.

I have a problem with compiling the DealHistoryGetter.mqh and the error message is: ' calcContracts' - memberfunction not defined line 488.


Thank you very much again.

Hello, I recently conpiled my expert that is using this file and everything was ok.

 
If i compile the .mq5 files you sent from your expert advisor named "New uploading variant" its showing a lot of errors as you can see in the image below. Ive just downloaded the lastest version posted (8th article).

What shoul i do to solve this?





Regards
 

Hello Andrei. I decided to return to the search for the grail and was glad to find your optimiser working and finalised. Solutions built entirely on Mql5 turned out to be demanding for the author's support and went off the rails. And your optimiser will work as long as there is C# and the strategy tester window in MT5 will be unchanged. Strange that there is no mass demand for back-forwardoptimisation. Anyway, thank you very much for your hard work!


The tester is already working, but I will voice a few wishes. Maybe even someone else will continue to refine the project and put it in the codebase.
1. I would like to have tooltips with explanations in the header of tables with results. What are: var 90, var 95, mx....
2. The values of PL and DD in windows 1 and 3 of the "results" tab do not match. Well, and units of measurement?
3. The OnTester() function is not compiled because it is defined in the optimiser files, so completely custom criteria are cancelled. From the standard ones the programme allows you to type any set.
4. How can we do without balance charts? You can glue all the forwards together and run them on a tester, for example. Or better - a rough graph in the optimiser window at once to assess the worthiness of the EA for further time wasting. At least, the optimiser should display the final result of all forward passes.
5. Calculation of profit in pips is necessary. Especially considering how the tester works with crypto. Add a checkbox.
6. And lastly, I would like to dream about the possibility of adding multiple TFs. Similar to the possibility of adding several assets.
Well, and much, much money....

 
Good Beer optimisation. Anyway, thank you very much for your labour!


The tester is already working, but I will voice a few wishes. Maybe even someone else will continue to refine the project and put it in the codebase.
1. I would like to have tooltips with explanations in the header of tables with results. What are: var 90, var 95, mx....
2. The values of PL and DD in windows 1 and 3 of the "results" tab do not match. Well, and units of measurement?
3. The OnTester() function is not compiled because it is defined in the optimiser files, so completely custom criteria are cancelled. From the standard ones the programme allows you to type any set.
4. How can we do without balance charts? You can glue all the forwards together and run them on a tester, for example. Or better - a rough graph in the optimiser window at once to assess the worthiness of the EA for further time wasting. At least, the optimiser should display the final result of all forward passes.
5. Calculation of profit in pips is necessary. Especially considering how the tester works with crypto. Add a checkbox.
6. And lastly, I would like to dream about the possibility of adding multiple TFs. Similar to the possibility of adding several assets.
Well, and much, much money....

Thank you for your feedback, I do not support this project, but yes it should be working for a long time.

If anyone has a desire to refine, tweak the project - then do it)
https://github.com/AndreyKrivcov/MetaTrader-Auto-Optimiser.

GitHub - AndreyKrivcov/MetaTrader-Auto-Optimiser
GitHub - AndreyKrivcov/MetaTrader-Auto-Optimiser
  • AndreyKrivcov
  • github.com
Experts mast use class CAutoUploader (CustomInclude/History manager/AutoLoader.mqh)
 
EDUARDO RODRIGUES NASCIMENTO #:
If i compile the .mq5 files you sent from your expert advisor named "New uploading variant" its showing a lot of errors as you can see in the image below. Ive just downloaded the lastest version posted (8th article).

What shoul i do to solve this?





Regards

So. Download the archive attached to the article and see two folders in it:

So. We download the archive attached to the article and see two folders in it:


Move the MetaTrader-Auto-Optimiser folder from the archive to the root directory where MetaTrader 5 is located:

Move the MetaTrader-Auto-Optimiser folder from the archive to the root directory where MetaTrader 5 is located:


There are two folders in the MQL5 folder in the archive - copy them to the MQL5 folder of your terminal. Accordingly, the Test Expert folder will be copied to the MQL5 folder, and two folders: CustomGeneric and History manager will be copied to the MQL5 folder.

Compile the SimpleMA.mq5 file in the folder Experts\Test Expert\New uploading variant:

There are two folders in the archive, in the MQL5 folder - copy them to the MQL5 folder of your terminal. Accordingly, the Test Expert folder will be copied to the MQL5\Experts folder, and two folders will be copied to the MQL\Include folder: CustomGeneric and History manager.

Compile the SimpleMA.mq5 file located in the Experts\Test Expert\New uploading variant folder:


We get 100 errors and 60 warnings:

We get 100 errors and 60 warnings:


Let's move on to the very first error and see that it is not a closed import:

Let's move on to the very first error and see that this is not a closed import:


Double-click on the inscription about the error and get to the file UploadersEntities.mqh on the line with the error:

Double-click on the inscription about the error and get into the UploadersEntities.mqh file on the line with the error:


What do we see? And we see really not closed import. Let's fix it:

What do we see? And we see really not closed import. We fix:

//+------------------------------------------------------------------+
//|UploadersEntities.mqh |
//| Copyright 2020, MetaQuotes Software Corp. | |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"

#include "ReportCreator.mqh"
#import "ReportManager.dll"
#import
//+------------------------------------------------------------------+
//| Structure storing data on input parameters |
//+------------------------------------------------------------------+
struct BotParams
  {
   string            name,value;
  };

// Adding a new value to the dynamic array
#define ADD_TO_ARR(arr, value) \
{\
   int s = ArraySize(arr);\
   ArrayResize(arr,s+1,s+1);\
   arr[s] = value;\
}

// add a new robot parameter to the dynamic parameter array
#define APPEND_BOT_PARAM(Var,BotParamArr) \
{\
   BotParams param;\
   param.name = #Var;\
   param.value = (string)Var;\
   \
   ADD_TO_ARR(BotParamArr,param);\
}

//+------------------------------------------------------------------+
//|| Function copying the list of arrays |
//+------------------------------------------------------------------+
void CopyBotParams(BotParams &dest[], const BotParams &src[])
  {
   int total = ArraySize(src);
   for(int i=0; i<total; i++)
     {
      ADD_TO_ARR(dest,src[i]);
     }
  }

//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
double GetAverageCoef(CoefChartType type, CReportCreator &report_manager)
  {
   CoefChart_item coef_chart[];
   report_manager.GetCoefChart(false,type,coef_chart);

   double ans= 0;
   int total = ArraySize(coef_chart);
   for(int i=0; i<total; i++)
      ans+=coef_chart[i].coef;

   ArrayFree(coef_chart);
   return (ans/(double)total);
  }
//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
string get_path_to_expert(void)
  {
   string arr[];
   StringSplit(MQLInfoString(MQL_PROGRAM_PATH),'\\',arr);
   string relative_dir=NULL;

   int total= ArraySize(arr);
   bool save= false;
   for(int i=0; i<total; i++)
     {
      if(save)
        {
         if(relative_dir== NULL)
            relative_dir=arr[i];
         else
            relative_dir+="\\"+arr[i];
        }

      if(StringCompare("Experts",arr[i])==0)
         save=true;
     }

   return relative_dir;
  }
//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
typedef void(*TCallback)();
typedef double(*TCustomFilter)();
typedef int (*TOnTesterInit)();


//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
void EmptyCallback() {}
//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
double EmptyCustomCoefCallback() {return 0;}
//+------------------------------------------------------------------+
//||
//+------------------------------------------------------------------+
int EmptyOnTesterInit() {return(INIT_SUCCEEDED);}

enum ENUM_CALLBACK_TYPE
  {
   CB_ON_TICK,
   CB_ON_TESTER_DEINIT
  };

struct Data
  {
   int tf, // ReportItem.TF
       laverage, // ReportReader.Laverage
       totalTrades, // ReportItem.OptimisationCoefficients.TotalTrades
       totalProfitTrades, // ReportItem.OptimisationCoefficients.MaxPLDD.Profit.TotalTrades
       totalLooseTrades, // ReportItem.OptimisationCoefficients.MaxPLDD.DD.TotalTrades
       consecutiveWins, // ReportItem.OptimisationCoefficients.MaxPLDD.Profit.ConsecutivesTrades
       consequtiveLoose, // ReportItem.OptimisationCoefficients.MaxPLDD.DD.ConsecutivesTrades
       numberProfitTrades_mn, // ReportItem.OptimisationCoefficients.TradingDays[Mn].Profit.Trades
       numberProfitTrades_tu, // ReportItem.OptimisationCoefficients.TradingDays[Tu].Profit.Trades
       numberProfitTrades_we, // ReportItem.OptimisationCoefficients.TradingDays[We].Profit.Trades
       numberProfitTrades_th, // ReportItem.OptimisationCoefficients.TradingDays[Th].Profit.Trades
       numberProfitTrades_fr, // ReportItem.OptimisationCoefficients.TradingDays[Fr].Profit.Trades
       numberLooseTrades_mn, // ReportItem.OptimisationCoefficients.TradingDays[Mn].DD.Trades
       numberLooseTrades_tu, // ReportItem.OptimisationCoefficients.TradingDays[Tu].DD.Trades
       numberLooseTrades_we, // ReportItem.OptimisationCoefficients.TradingDays[We].DD.Trades
       numberLooseTrades_th, // ReportItem.OptimisationCoefficients.TradingDays[Th].DD.Trades
       numberLooseTrades_fr; // ReportItem.OptimisationCoefficients.TradingDays[Fr].DD.Trades
   ulong startDT, // ReportItem.DateBorders.From
         finishDT; // ReportItem.DateBorders.Till
   double payoff, // ReportItem.OptimisationCoefficients.Payoff
          profitFactor, // ReportItem.OptimisationCoefficients.ProfitFactor
          averageProfitFactor, // ReportItem.OptimisationCoefficients.AverageProfitFactor
          recoveryFactor, // ReportItem.OptimisationCoefficients.RecoveryFactor
          averageRecoveryFactor, // ReportItem.OptimisationCoefficients.AverageRecoveryFactor
          pl, // ReportItem.OptimisationCoefficients.PL
          dd, // ReportItem.OptimisationCoefficients.DD
          altmanZScore, // ReportItem.OptimisationCoefficients.AltmanZScore
          var_90, // ReportItem.OptimisationCoefficients.VaR.Q_90
          var_95, // ReportItem.OptimisationCoefficients.VaR.Q_95
          var_99, // ReportItem.OptimisationCoefficients.VaR.Q_99
          mx, // ReportItem.OptimisationCoefficients.VaR.Mx
          std, // ReportItem.OptimisationCoefficients.VaR.Std
          max_profit, // ReportItem.OptimisationCoefficients.MaxPLDD.Profit.Value
          max_dd, // ReportItem.OptimisationCoefficients.MaxPLDD.DD.Value
          averagePl_mn, // ReportItem.OptimisationCoefficients.TradingDays[Mn].Profit.Value
          averagePl_tu, // ReportItem.OptimisationCoefficients.TradingDays[Tu].Profit.Value
          averagePl_we, // ReportItem.OptimisationCoefficients.TradingDays[We].Profit.Value
          averagePl_th, // ReportItem.OptimisationCoefficients.TradingDays[Th].Profit.Value
          averagePl_fr, // ReportItem.OptimisationCoefficients.TradingDays[Fr].Profit.Value
          averageDd_mn, // ReportItem.OptimisationCoefficients.TradingDays[Mn].DD.Value
          averageDd_tu, // ReportItem.OptimisationCoefficients.TradingDays[Tu].DD.Value
          averageDd_we, // ReportItem.OptimisationCoefficients.TradingDays[We].DD.Value
          averageDd_th, // ReportItem.OptimisationCoefficients.TradingDays[Th].DD.Value
          averageDd_fr, // ReportItem.OptimisationCoefficients.TradingDays[Fr].DD.Value
          balance; // ReportReader.Balance
   char              currency[100];
  };
//+------------------------------------------------------------------+

Compile again. The import error is gone, but now the compiler does not see functions and methods from the imported file:

Let's compile again. The import error is gone, but now the compiler does not see the functions and methods from the imported file:


Remember that we are importing methods and classes from a third-party dll. It should be located in the MQL5/Libraries folder.

Open the MetaTrader-Auto-Optimiser folder, copied from the archive to the root directory of MetaTrader 5. We see the file Metatrader Auto Optimiser.sln in it:

We recall that we are importing methods and classes from a third-party dll. And it should be in the MQL5\Libraries folder.

Open the MetaTrader-Auto-Optimiser folder copied from the archive to the MetaTrader 5 root directory. We see the file Metatrader Auto Optimiser.sln in it:


Double-click on this file to open the project in MS Visual Studio.

When opening the project, we see that it is for an outdated platform:

Double click on this file to open the project in MS Visual Studio.

When opening the project, we see that it is for an outdated platform:


Leave the checkbox checked for "Upgrade target to .NET Framefork 4.8 platform" and click the "Continue" button.

Then again for the second project:

Leave the checkbox "Upgrade target to .NET Framefork 4.8 platform" and click the "Continue" button.

Then again for the second project:


After loading the projects, select "Release" and Any CPU:

After loading the projects, select "Release" and Any CPU:


And press Ctrl+F5 to compile and build the projects.

After compiling the project in MS Visual Studio go to the root directory of the terminal and in it to the folder \MetaTrader-Auto-Optimiser\ReportManager\bin\Release. Copy the file of the built ReportManager.dll library from this folder to the MQL5/Libraries directory of the terminal.

Now compile the SimpleMA.mq5 file from the MQL5\Experts\Test Expert\New uploading variant folder again.

Done, no errors:

And press Ctrl+F5 to compile and build projects.

After compiling the project in MS Visual Studio, go to the root directory of the terminal and in it to the \MetaTrader-Auto-Optimiser\ReportManager\bin\Release folder. Copy the compiled library file ReportManager.dll from this folder to the MQL5\Libraries directory of the terminal.

Now let's compile the SimpleMA.mq5 file from the MQL5\Experts\Test Expert\New uploading variant folder again.

Done, no errors:


Enjoy

Files:
 
Artyom Trishkin #:

So. Download the archive attached to the article and see two folders in it:

So. We download the archive attached to the article and see two folders in it:


Transfer the MetaTrader-Auto-Optimiser folder from the archive to the root directory where MetaTrader 5 is located:

Move the MetaTrader-Auto-Optimiser folder from the archive to the root directory where MetaTrader 5 is located:


There are two folders in the MQL5 folder in the archive - copy them to the MQL5 folder of your terminal. Accordingly, the Test Expert folder will be copied to the MQL5 folder, and two folders: CustomGeneric and History manager will be copied to the MQL5 folder.

Compile the SimpleMA.mq5 file located in the folder Experts\Test Expert\New uploading variant:

There are two folders in the archive, in the MQL5 folder - copy them to the MQL5 folder of your terminal. Accordingly, the Test Expert folder will be copied to the MQL5\Experts folder, and two folders will be copied to the MQL\Include folder: CustomGeneric and History manager.

Compile the SimpleMA.mq5 file located in the Experts\Test Expert\New uploading variant folder:


We get 100 errors and 60 warnings:

We get 100 errors and 60 warnings:


Go to the very first error and see that it is not a closed import:

Let's move on to the very first error and see that this is not a closed import:


Thanks, updated the sources attached to the article