fxDreema

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

    Error in OnTick function

    Bug Reports
    2
    8
    1468
    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.
    • tcanuto
      tcanuto last edited by

      Hello fxDreema.

      I have this problem to do optimizations:

      11:11 Core 2 2015.05.25 pass 0 tested with error "critical runtime error 503 in OnTick function (zero divides, module Experts\Advisors\TCF DC MM DC MM v1.0.ex5, file v1.0.mq5, line TCF 2828, Coll. 83)" in 00:00: 07,519

      This line in the code is:

      else if (mode == "balanceRisk") {size = ((value/100) * AccountBalance ())/(sl * TickValue * PipValue (symbol));}
      
      

      You have something wrong? Tested in two MT5 and different accounts.

      ......
      TCF DC MM v1.0.mq5

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

        This error is because SL is 0. Your SL comes from the indicator you use. Is everything ok with this indicator?

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

          Yes. I had no problems in backtest visual.

          SL Mode Dynamic Level (price imput)

          Here's to analysis:
          https://fxdreema.com/shared/JWNVt9cXc

          ......
          donchian_channels.mq5

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

            The error comes because the "sl" part in this formula that you posted is 0, and "sl" comes from the indicator that is selected in the block. So, it reads that the indicator value is 0. Why... who knows. Or at least this is what I believe.

            I tested this and it works on my MT5 - visual mode and optimization.

            I can suggest to inspect those indicator values that you use for SL. I think that "Write to file" block can output this information when optimizing.

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

              __I can suggest to inspect those indicator values that you use for SL. I think that "Write to file" block can output this information when optimizing.[/quote:jx9c7utl]
              OK. How do I do that?

              Today I have compiled in mql5 and appeared to me the following message:
              "possible loss of data due to type conversion TCF DC MM v1.1.mq5 4183 16"

              Is a warning important? Can influence in my trandes?

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

                Just put the block to write data to file somewhere where you want to use, even under On Init, because you don't really need it to be filled with data too much. It will put the data in a file somewhere (use the windows search to find it). This seems to be the only way to output some data while optimizing. Otherwise we normally use Print, Alert, Comment, Objects and who knows wtah else. But these things just does not work when optimizing.

                This warning is not important.

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

                  Added this block, but I don't see in the code. Where is?
                  https://fxdreema.com/shared/FzsidmiLb

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

                    If you are talking about this - http://prntscr.com/7f1x8u - then I wonder how it's possible for you to not know that a single block like this is excluded from the project, which is some rule that exists from the very beginning. That's why I added this block called "Pass" - it does nothing, but when connected with other block it does the magic to put the other block into the output code 🙂 So, just connect one "Pass" block to "Write to file"

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

                    Online Users

                    M
                    P
                    R
                    S
                    E
                    M
                    P
                    C

                    18
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors