What on earth is going on? - page 9

 
Artyom Trishkin:

....

Tester mode includes optimisation mode, but not vice versa.

    ......
    Artyom Trishkin:
    No. On the contrary.
    Well that's if you need half measures.

    I'm afraid I do not understand.

    If MQL_OPTIMIZATION is included in MQL_TESTER, why check it too?

     
    Сергей Таболин:

    I'm afraid I don't understand.

    If MQL_OPTIMIZATION is included in MQL_TESTER, why check it too?

    Optimization is a subspecies of tester.
    But the tester is not a subspecies of anything.
     
    Сергей Таболин:

    Exactly right. If not a tester or optimiser, you don't get in here at all )))

    Artem, if I understood correctly, then my such construction

    is superfluous?

    It will be enough

    ?

    if(MQLInfoInteger(MQL_OPTIMIZATION)
    we know we are working in a tester, but we don't know if it is a single pass or an optimisation, so we need to check the optimisation flag
     
    Andrey Dik:
    We know that we are working in the tester, but we don't know if it is a single pass or optimization, so we have to check the optimization flag

    Yes, Andrew, I understand that.

    But this is a general question. If I'm optimizing or testing, some statistics is being collected for using in OnTester().

    Therefore, my question is whether it is sufficient to writeif(MQLInfoInteger(MQL_TESTER)) orif(MQLInfoInteger(MQL_OPTIMIZATION) || MQLInfoInteger(MQL_TESTER))?

    If the optimization is part of the test, then checking for the optimization mode seems to be unnecessary...

     
    Сергей Таболин:

    But this is a general question. If I'm optimizing or testing, some statistics is being collected for using in OnTester().

    Therefore, my question is whether it is sufficient to writeif(MQLInfoInteger(MQL_TESTER)) orif(MQLInfoInteger(MQL_OPTIMIZATION) || MQLInfoInteger(MQL_TESTER))?

    If the optimization is part of the test, then checking for the optimization mode seems unnecessary...

    Why complicate the construction?

    Looks like you have files for the real, for tester and optimizer.

    In that case - yours:

       filename = "ERR_dir\\"+filename+(MQLInfoInteger(MQL_OPTIMIZATION) ? ".opt" : ".tst");
       filename = "ERR_dir\\"+filename+(MQLInfoInteger(MQL_TESTER) ? ".tst" : ".opt");

    you could write it this way:

       filename = "ERR_dir\\"+filename + ".";
       if(MQLInfoInteger(MQL_TESTER)) filename = filename + "t";
       if(MQLInfoInteger(MQL_OPTIMIZATION)) filename = filename + "o";
    

    and that's it -- all your files will be clearly distinguishable by tester, optimizer and real

     
    Andrey F. Zelinsky:

    why complicate the design?

    It looks like you have files for the real, for the tester and for the optimiser.

    In that case, they're yours:

    you could write it this way:

    and that's it -- all your files will be distinguishable by tester, optimizer and real

    double x;
    int OnInit()
    {
       x = 0.0;
    }
    void OnTick()
    {
       ....
       // if new Bar
       if(MQLInfoInteger(MQL_OPTIMIZATION) || MQLInfoInteger(MQL_TESTER)) x += 1.618;
       ....
    }
    double OnTester()
    {
       return(x * 3.14159);
    }
    

    Is this check really necessary?

     
    Сергей Таболин:

    Is this test necessary?

    you need to start with -- what is the purpose of the distinction between tester, optimiser and real in your system?

    why can't you do without these checks?

     
    Andrey F. Zelinsky:

    you have to start with -- what is the purpose of the distinction between tester, optimiser and real in your system?

    Why can't you do without them?

    Forum on trading, automated trading systems and strategy testing

    What the hell is going on?

    Sergey Tabolin, 2020.05.20 15:11

    Yes, Andrey, I understand it.

    But it is a general question. If I'm optimizing or testing, I collect some statistics for using in OnTester().

    Therefore, my question is whether it is sufficient to writeif(MQLInfoInteger(MQL_TESTER)) orif(MQLInfoInteger(MQL_OPTIMIZATION) || MQLInfoInteger(MQL_TESTER))?

    If the optimization is part of the test, then checking for the optimization mode seems to be unnecessary...


     
    Сергей Таболин:

    Then just check the test.
     
    Сергей Таболин:

    Why are you asking anyone?

    CheckMQLInfoInteger(MQL_TESTER) andMQLInfoInteger(MQL_OPTIMIZATION) values in tester and optimizer

    and you will see for yourself.