fxDreema

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

    Is this a resolution to the error code=4806?

    Bug Reports
    3
    5
    1643
    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.
    • gooseman
      gooseman last edited by gooseman

      Re: Error code=4806

      "We discussed this and it appears that the problem is that because he loads the same indicator with different settings like in something like 100 blocks, this takes long time. For some reason MQL5 loads indicators slowly. And in the EAs I programmed MQL5 to load them on demand, which is not the official way of doing that. So I have a "while" loop that waits for indicator to load for 500 ms and then throw that error. So I changed that time to 5 seconds. Unfortunately I still don't know how to make MQL5 to load indicators more quickly." - fxDreema

      This is from an old thread I found researching error code=4806 (custom indicator error) my system does not use any custom indicator but what fxdreema describes. My portfolio has over 200 moving average and RSI blocks and quadrupled checked my constants in ALL blocks. I know having missing or bad constants can throw this code. knowing that I'm still getting this code.

      As far as the resolution, I wasn't too sure if fxdreema was talking about the actual fxdreema platform or if he built this using blocks in his EAs?

      Edit - I apologize, I have created this topic in the wrong section. I tried to delete this and create it in the correct section but was not able to so. due to insufficient privelages.

      1 Reply Last reply Reply Quote 0
      • S
        sktsec last edited by sktsec

        I am not sure if 200 indicators in MT5 EA could work well (depend on PC speed), but my experience in MT4 is that some 10 indicators could make it freeze, crash and even file corruption.

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

          I'm also not sure about the performance implications of using many indicators in MQL5, I never tested so much indicators at once. But in programming, when we want to read something over and over again, and the reading itself tends to be slow, we cache it and read the cache instead. Also, there is one basic rule in programming called DRY (Don't Repeat Yourself) - the idea is to write some functionality once in some function, and run that function over and over again, instead of writing the same code at many places.

          I see your project (the current one at the moment of writing this), which is a large project, and it's large because you have copied the same groups of blocks multiple times. This makes you a newbie in programming 🙂 Well, to be fair, sometimes it's not very easy or intuitive to make things the good way in fxDreema. Sometimes it's not even possible.

          But here are my suggestions.

          • If you are using the same indicator with all the same settings in multiple blocks, make a "double" variable. Then, in "on Tick" before all other blocks set the value of that variable to be the indicator's value. For this use "Modify Variables" block with low block number, so it runs before the other blocks. And then in the blocks where the indicator is used, use the variable instead.
          • Re-use the same group of blocks... if you know how. Unfortunately, this is tricky. If you know how a function works in any programming language, it's the same idea. You would have 1 block at the top of the group of blocks, which would be the block you run. The alternative for function arguments would be multiple variables. It's also possible to use arrays by the way.
          • If possible, limit the execution of some groups of blocks. This depends, but let's say you have a group of blocks that runs on every tick without a problem, but it will be the same if it runs for example once per block, it will not change the behavior. In such case, put some "Once per bar" block. This will boost the performance.
          gooseman 2 Replies Last reply Reply Quote 1
          • gooseman
            gooseman @fxDreema last edited by

            @fxDreema

            Thank you for your insight into this problem. I kind of figured out that having many of the same blocks can cause issues, especially since it's just a moving average indicator. I've noticed any system I build with the moving average indicator in a portfolio setting, backtesting slows down to a crawl, due to the MA calculations.

            I will proudly wear that newbie badge! haha. I have zero programming skills. I did my best using the website documents, youtube, and here on the forums. I admit, I have avoided using variables..mainly because I couldn't wrap my head around how to use them. I knew there was going to be a point where I did need to eventually start to use them, guess that time is now! I really want to get my project live and spent some years getting this far. almost there!

            As far as your suggestions, I have tried re-using the same group of blocks to avoid the DRY rule (I will never forget what the DRY rule is, thanks!) but you're right it is tricky. I still have a lot to learn but its looking like I'm reaching the threshold of my fxdreema knowledge.

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

              @fxDreema said in Is this a resolution to the error code=4806?:

              If you are using the same indicator with all the same settings in multiple blocks, make a "double" variable. Then, in "on Tick" before all other blocks set the value of that variable to be the indicator's value. For this use "Modify Variables" block with low block number, so it runs before the other blocks. And then in the blocks where the indicator is used, use the variable instead.

              Is this okay? The variable is found in the condition 1 block. I am not sure where to connect the Modify Variables block.

              https://fxdreema.com/shared/LP0IvbCbe

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

              Online Users

              D
              C
              J
              E

              22
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors