Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

First independent community of traders

First independent community of traders Logo First independent community of traders Logo

First independent community of traders Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • Buy Theme
  • Home
  • About Us
  • Blog
  • Contact Us
Home/ Questions/Q 4233
Next
In Process
-aleks-
-aleks-

-aleks-

  • 2 Questions
  • 35 Answers
  • 0 Best Answers
  • 72 Points
View Profile
  • 0
-aleks-
Asked: December 27, 20202020-12-27T05:02:52+00:00 2020-12-27T05:02:52+00:00In: Forex Expert Advisors

Automatic code generation

  • 0

I suggest that in this branch we discuss the possibility of automatic code generation based on a template and its automatic compilation at the request of the expert Advisor.

For example, I will tell you about my task:

1. there Are files with data, the data are variables of different types with an assigned value

2. you need to read the data and make it an array of data or enum or something else, so that one line from the file corresponds to one set of variables. This is tedious to do for each file.

3. taking into account the data from the file, generate a code counter that can iterate through all combinations of sets of variables.

4. Save the result to a file to connect to the expert Advisor/other code

Here, in General, the task is theoretically not difficult, except that it is necessary to somehow automate the process of creating a template. Is it even possible to do this using MQL?

And you need all this to speed up the optimization process, if there are a lot of variables and they belong to groups (for example, independent filters).

  • 10 10 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    10 Answers

    • Voted
    • Oldest
    • Recent
    1. -aleks-

      -aleks-

      • 2 Questions
      • 35 Answers
      • 0 Best Answers
      • 72 Points
      View Profile
      -aleks-
      2020-12-27T05:04:05+00:00Added an answer on December 27, 2020 at 5:04 am

      Dennis Kirichenko:

      You need to compare the distributions of the effective indicator from each of the filters.  If they are different, it means, firstly, that the filters work differently, and secondly, you can take the one with the best indicators.

      How can you take one of the two if they have different functions and logic???

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. denkir

      denkir

      • 0 Questions
      • 9 Answers
      • 0 Best Answers
      • 38 Points
      View Profile
      denkir
      2020-12-27T05:04:00+00:00Added an answer on December 27, 2020 at 5:04 am

      Aleksey Vyazmikin:

      …but if the input is not generated so obviously and a ban on the input at point A gives permission to the input at point B, then this approach will not work – any ideas how to compare filters in this case?

      You need to compare the distributions of the effective indicator from each of the filters.  If they are different, it means, firstly, that the filters work differently, and secondly, you can take the one with the best indicators.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    3. -aleks-

      -aleks-

      • 2 Questions
      • 35 Answers
      • 0 Best Answers
      • 72 Points
      View Profile
      -aleks-
      2020-12-27T05:03:48+00:00Added an answer on December 27, 2020 at 5:03 am

      Dennis Kirichenko:

      I agree here only with one thing: here the filter is the predictor, at best. At worst, a dummy.

      Let’s go with my example, where there are 3 filters, and then I think badly, I’m afraid to get confused…

      Let Ri be the i-th predictor.

      If there are 3 filters then we have:

      1) 3 first-level predictors: R1, R2, R3;

      2) 2 second-level predictors: R1*R2 (effect of cohabitation of predictors R1 and R2), R1*R3, R2*R3;

      3) 1 third-level predictor: R1*R2*R3 (effect of cohabitation of predictors R1,R2 and R3).

      In total, we have 6 predictors (although of different levels, it is important to clarify)! 

      As far as I understand, you are now looking for optimal values for R1, R2 and R3 separately, getting private predictor results. Then you cross them in an attempt to find the optimal values of the entire group based on partial predictor results. 

      The question is, is this the right thing to do? And if not, what should be done in the beginning? :-))

      You understand correctly, so I do-I cross all the options in search of the greatest efficiency – efficiency is a reduction in loss to a greater extent than revenue, while the resulting profit increase should not occur much slower than the revenue decreases, the fact and improvement of other relative indicators are important. By setting such conditions, we understand that if the filter in a single person does not meet these criteria, then when it is combined with other filters, the result will not be much better, and if we select options that meet these criteria, then we can expect that the result will not become much worse, but it can become better.

      And what do you propose to do in the beginning – so tell us, maybe something brilliant.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    4. denkir

      denkir

      • 0 Questions
      • 9 Answers
      • 0 Best Answers
      • 38 Points
      View Profile
      denkir
      2020-12-27T05:03:43+00:00Added an answer on December 27, 2020 at 5:03 am

      Aleksey Vyazmikin:

      A predictor is not a variable, but the result of the algorithm’s calculations, which forms a certain attribute. 10 filters will give 10 units of predictors for the expert Advisor. But what each of them can show is the result of individual settings.

      I agree here only with one thing: here the filter is the predictor, at best. At worst, a dummy.

      Let’s go with my example, where there are 3 filters, and then I think badly, I’m afraid to get confused…

      Let Ri be the i-th predictor.

      If there are 3 filters then we have:

      1) 3 first-level predictors: R1, R2, R3;

      2) 2 second-level predictors: R1*R2 (effect of cohabitation of predictors R1 and R2), R1*R3, R2*R3;

      3) 1 third-level predictor: R1*R2*R3 (effect of cohabitation of predictors R1,R2 and R3).

      In total, we have 6 predictors (although of different levels, it is important to clarify)! 

      As far as I understand, you are now looking for optimal values for R1, R2 and R3 separately, getting private predictor results. Then you cross them in an attempt to find the optimal values of the entire group based on partial predictor results. 

      The question is, is this the right thing to do? And if not, what should be done in the beginning? :-))

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    5. -aleks-

      -aleks-

      • 2 Questions
      • 35 Answers
      • 0 Best Answers
      • 72 Points
      View Profile
      -aleks-
      2020-12-27T05:03:32+00:00Added an answer on December 27, 2020 at 5:03 am

      Dennis Kirichenko:

      IMHO, a template, and even with some automatic compilation, is not needed. Although here you can have a good time 🙂

      You can write sample results to a bunch of*. set files. This is for example…

      As far as I understand, then, based on Your task, the MQL program should read data from the file and form a*. set file, where a range of possible values will be specified for each optimized parameter. And then feed this file for subsequent optimization, a kind of fine-tuning. 

      If you open a set file with Notepad, it will list the parameters for which ranges can be set.

      For example, I have such a parameter in the EA code as InpTakeProfit (take profit in points)

      In the set file, the parameter looks like this:

      That is, when optimizing, it will be used (at the end is Y, otherwise N). Start value is 100, step = 50, Final value = 500.

      From Your answers, it is obvious to me that I was not able to explain the essence of the problem.

      Let’s say we have 10 filters (filter-let there be an external indicator with a bunch of settings and a logic switch), each such filter has at least 5 variables, optimizing everything at once is the height of idiocy and irrationalism. Therefore, it is assumed to optimize each such filter separately, collect the selected options according to different criteria and thus represent a set of filter variables as a single variable. When data is collected for 10 filters, you will need to optimize between sets of parameters, not each parameter. And what would it be to automate this business and need an automatic code generator, well, or another alternative solution that does not take much time to create sets of variables and include all combinations in a common counter or just design in separate variables – one for each filter, this is if you need genetics. 

      This method works, I use it, it is effective, but I have to do everything with my hands, which is tiring, so I’m looking for an opportunity to speed up the process.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    6. denkir

      denkir

      • 0 Questions
      • 9 Answers
      • 0 Best Answers
      • 38 Points
      View Profile
      denkir
      2020-12-27T05:03:26+00:00Added an answer on December 27, 2020 at 5:03 am

      IMHO, a template, and even with some automatic compilation, is not needed. Although here you can have a good time 🙂

      You can write sample results to a bunch of*. set files. This is for example…

      As far as I understand, then, based on Your task, the MQL program should read data from the file and form a*. set file, where a range of possible values will be specified for each optimized parameter. And then feed this file for subsequent optimization, a kind of fine-tuning. 

      If you open a set file with Notepad, it will list the parameters for which ranges can be set.

      For example, I have such a parameter in the EA code as InpTakeProfit (take profit in points)

      In the set file, the parameter looks like this:

      InpTakeProfit=300||100||50||500||Y

      That is, when optimizing, it will be used (at the end is Y, otherwise N). Start value is 100, step = 50, Final value = 500.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    7. -aleks-

      -aleks-

      • 2 Questions
      • 35 Answers
      • 0 Best Answers
      • 72 Points
      View Profile
      -aleks-
      2020-12-27T05:03:16+00:00Added an answer on December 27, 2020 at 5:03 am

      Dennis Kirichenko:

      Well, all this can be done in frame mode. There are several articles on the topic, the last one too: VISUALIZATION of OPTIMIZATION RESULTS BY the SELECTED CRITERION

      How is visualization related to collecting data for subsequent optimization?

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    8. denkir

      denkir

      • 0 Questions
      • 9 Answers
      • 0 Best Answers
      • 38 Points
      View Profile
      denkir
      2020-12-27T05:03:11+00:00Added an answer on December 27, 2020 at 5:03 am

      Aleksey Vyazmikin:

      Something like that, a certain sample is saved, Yes.

      Well, all this can be done in frame mode. There are several articles on the topic, the last one too: VISUALIZATION of OPTIMIZATION RESULTS BY the SELECTED CRITERION

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    9. -aleks-

      -aleks-

      • 2 Questions
      • 35 Answers
      • 0 Best Answers
      • 72 Points
      View Profile
      -aleks-
      2020-12-27T05:03:01+00:00Added an answer on December 27, 2020 at 5:03 am

      Dennis Kirichenko:

      The idea is not new. Discussed in the thread about articles. There, if I’m not mistaken, Roche wrote about a possible article that would describe how to run the Tester of another terminal from the Tester of one terminal.

      I looked at the list of topics. In the Table first goes:

      1 Optimization management
      Graphical interface for launching the second terminal . MQL5

      Yes, I wrote in that thread about my idea, but I realized that either it is not clear or not interesting, so I decided to try to implement it here, if possible.

      However, it is not particularly related to the launch of the second terminal, the idea serves as an alternative to blind genetic optimization, i.e. we conduct pre-training, and there is at least a direct search, even genetics. The point is to exclude obviously bad results, leaving potentially interesting sets of variables for each group of optimized parameters.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    10. denkir

      denkir

      • 0 Questions
      • 9 Answers
      • 0 Best Answers
      • 38 Points
      View Profile
      denkir
      2020-12-27T05:02:56+00:00Added an answer on December 27, 2020 at 5:02 am

      The idea is not new. Discussed in the thread about articles. There, if I’m not mistaken, Roche wrote about a possible article that would describe how to run the Tester of another terminal from the Tester of one terminal.

      I looked at the list of topics. In the Table first goes:

      1 Optimization management
      Graphical interface for launching the second terminal . MQL5
      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    Stats

    • Questions 504
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 676
    • Popular
    • Comments
    • Tags
    • forexcommunity

      Highlighting what’s important about questions & Answers on Discy Community!

      • 0 Comments
    • forexcommunity

      Introducing Keyboard Shortcuts, our first Labs feature

      • 0 Comments
    • forexcommunity

      Defining quality on Discy Engine — what a helpful answer ...

      • 0 Comments
    • forexcommunity

      Organizational and company accounts on Discy Engine the next step

      • 0 Comments
    • forexcommunity

      Hello world!

      • 0 Comments

    Related Questions

    • Brus Agell

      Правельный выбор

      • 0 Answers
    • pinupcasinoo

      Pin Up Casino

      • 0 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 2 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 0 Answers
    • c00l777

      Optimization results differ on different accounts

      • 3 Answers

    Users

    Geraldimaky

    Geraldimaky

    • 0 Questions
    • 0 Answers
    Jeffreytix

    Jeffreytix

    • 0 Questions
    • 0 Answers
    RobertFoeta

    RobertFoeta

    • 0 Questions
    • 0 Answers

    Footer

    First independent community of traders

    About

    An independent community of forex traders. This is where traders communicate. You can ask your questions and you will receive an answer to your question.
    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Knowledge Base
    • Support

    © 2021 Forexcommunity.net. All Rights Reserved