fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    onTester()

    Questions & Answers
    7
    14
    4916
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Spuzy
      Spuzy last edited by

      is it possible to add this to options of the project?

      for instance I always manually add

      double OnTester()
      {
      return(TesterStatistics(STAT_PROFIT)/TesterStatistics(STAT_EQUITY_DD));
      }

      is there already an option for this?

      if not is it possible to add it? let us write our own code that goes into return()?

      sorry if I posted in the wrong section didn't see a request section šŸ˜„

      love your work btw ā¤

      E 1 Reply Last reply Reply Quote 1
      • A
        arrkain last edited by

        I second this motion to add this feature if it is not already available!

        I want to be able to optimize based on trade winning percentage so:

        double OnTester()
        {
        return(TesterStatistics(STAT_PROFIT_TRADES)/TesterStatistics(STAT_TRADES));
        }

        Please and thank you!

        E 1 Reply Last reply Reply Quote 0
        • fxDreema
          fxDreema last edited by

          I never added Tester event obviously. And to be honest, I never tried how this works. But if OnTester() is supposed to just return a value, I can't imagine what "on Tester" button and field with blocks in it will be able to do.

          1 Reply Last reply Reply Quote 0
          • Spuzy
            Spuzy last edited by

            make it a choosable option in "Project Options" box and add a box in which we can type the code in and then place that text within return(); inside OnTester()

            and put OnTester anywhere inside the mq file, for instance just bellow OnInit()

            once you optimize a strategy you will have an additional thingy in Optimization Results which will be the value ontester returns. so if I get 8k different results and I can see it's profit, total trades, profit factor and such in the optimization results tab I will also be able to see number of profitable trades

            0_1549380636520_d032210f-eafa-4549-856a-54477397da40-image.png

            doesn't have to be a block and actually not sure if it can be a block. hope I explained it right

            roar A 2 Replies Last reply Reply Quote 1
            • roar
              roar @Spuzy last edited by

              @spuzy
              Off topic - have you tried optimizing by recovery factor? I have found it to be better than profit factor, as some backtests with 2 trades can have a huge profit factor but the statistical credibility is still negligible..

              Need small help? Tag me in your post
              Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

              1 Reply Last reply Reply Quote 0
              • A
                arrkain @Spuzy last edited by

                @spuzy said in onTester():

                make it a choosable option in "Project Options" box and add a box in which we can type the code in and then place that text within return(); inside OnTester()

                and put OnTester anywhere inside the mq file, for instance just bellow OnInit()

                These were exactly my thoughts! Just have it be in Project Options. The text box would just be the code inside the return() inside OnTester(). Then have a link or reference to this page to explain all the values you can return or perform math on. @fxDreema

                https://docs.mql4.com/constants/environment_state/statistics#enum_statistics

                1 Reply Last reply Reply Quote 0
                • fxDreema
                  fxDreema last edited by fxDreema

                  Here is another idea. Go here: https://fxdreema.com/studio/MQL4 And create a new custom function (lower right corner, hit button New). Then write the OnTester() function with its contents.... something like this:

                  0_1550005085776_6e37f5a1-91ab-4681-b815-423c36c8c1a5-image.png

                  Then mention that function somewhere, for example in Init:

                  0_1550005124789_abe12727-fb55-4af8-a1b6-77265aa0dbef-image.png

                  Because the function is mentioned in the block, the EA generator will search for the function in the custom functions and will place it in the output code. Because this function is actually a system function, MetaTrader will run it when its needed.

                  if (0) => this prevents the function from running, because we don't need to run it.

                  1 Reply Last reply Reply Quote 1
                  • Spuzy
                    Spuzy last edited by

                    nice, thanks for that šŸ˜„

                    1 Reply Last reply Reply Quote 0
                    • E
                      ellemitless @arrkain last edited by

                      @arrkain hello , where do you put onTester codes on fxdreema to function on meta trader terminal when optimizing???

                      1 Reply Last reply Reply Quote 0
                      • E
                        ellemitless @Spuzy last edited by

                        @Spuzy hello , where do you add the custom code of on tester on fxdreema?

                        1 Reply Last reply Reply Quote 0
                        • jstap
                          jstap last edited by

                          Not enterally sure what you mean but, if testing will ensure all blocks beneath only work on testing

                          Learn fxDreema Without the Wait!

                          My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                          The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                          Don’t miss out

                          Click hereāž”ļø https://mybook.to/fxDreema to get your copy today!

                          Enjoy! 😊

                          E 1 Reply Last reply Reply Quote 0
                          • E
                            ellemitless @jstap last edited by

                            @jstap i mea where should I put on fxdreema , if i want to create a on Tester custom max formula??? When I tried , it says it only global functions something like that

                            1 Reply Last reply Reply Quote 0
                            • jstap
                              jstap last edited by

                              Global functions require the creation of a custom block, anything else can be put into custom code on the on tick tab

                              Learn fxDreema Without the Wait!

                              My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                              The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                              Don’t miss out

                              Click hereāž”ļø https://mybook.to/fxDreema to get your copy today!

                              Enjoy! 😊

                              1 Reply Last reply Reply Quote 0
                              • T
                                toinedos last edited by

                                Bonjour jstap,
                                J'ai achetƩ votre livre sur kindle, mais je ne parle pas anglais, y a t'il une version en franƧais ?

                                1 Reply Last reply Reply Quote 0
                                • 1 / 1
                                • First post
                                  Last post

                                Online Users

                                N
                                S
                                T
                                A
                                Y

                                19
                                Online

                                146.7k
                                Users

                                22.4k
                                Topics

                                122.6k
                                Posts

                                Powered by NodeBB Forums | Contributors