fxDreema

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

    When to stop OnInit()

    Bug Reports
    9
    17
    1422
    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.
    • roar
      roar last edited by roar

      When viewing the generated code, the OnInit() function always contains the code shown below.

      What is the purpose of it? It seems the code stops the initializing process if the init reason is a change of symbol or change of timeframe.
      Well that seems appropriate for most cases, but why the else statement? Now the init is stopped in any case, right?

      The problem: Lets say a project contains some graphical objects on the OnInit() tab, and some boolean constant input determines if those objects should be drawn or not.
      If the user changes this boolean while the EA is running, the changes will not take effect because the OnInit() is stopped before those blocks are executed.

      I often delete that else statement manually to make those objects inputs work properly, but I'd rather have this code changed for good.

      Example: https://fxdreema.com/shared/pd9JF900c

      9cd9e8ca-f048-4b3b-aec4-1e46b3eee0da-image.png

      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 1
      • jstap
        jstap last edited by

        @roar This is very interesting, hopefully @fxDreema will give his opinion on this.

        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
        • fxDreema
          fxDreema last edited by fxDreema

          I probably put this code there when someone was having issues when changing the parameters of the EA, or changing the timeframe. I don't remember exactly.

          I think the only two possible uninitialize reasons in OnInit() are REASON_CHARTCHANGE or REASON_PARAMETERS, which means that the "else" statement is about REASON_PARAMETERS.

          It looks that I wanted to prevent re-execution of blocks in "on Init" when the user changes the timeframe or the EA parameters. Only if the symbol is changed, the blocks would run again, which was probably because I have some symbol-related functions just below this code.

          I guess it depends. Maybe the user wants to redraw his objects, maybe not.

          Actually these REASON_CHARTCHANGE and REASON_PARAMETERS are forming possible events, something like "on Timeframe Change", or "on Parameters Change". Sometimes I'm thinking about adding some more events in the EA builder, or better changing the way events are used in the EA builder, maybe allowing for making custom events. But at the moment there are only these standard events and the use of REASON_CHARTCHANGE and REASON_PARAMETERS in on Init is opinionated.

          By the way, I don't think this is a bug.

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

            With the current system, there is just no way for any input changes to take effect immediately. But its ok, I can live with that.

            Some event tabs have those specific filters, maybe the OnInit could have similar blocks too...

            03725474-f6ae-4b34-9338-99d6e7ce34fc-image.png

            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

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

              @roar said in When to stop OnInit():

              Some event tabs have those specific filters, maybe the OnInit could have similar blocks too...

              03725474-f6ae-4b34-9338-99d6e7ce34fc-image.png

              The problem with this is that if I want to add such blocks, I should remove this code and allow the whole OnInit() body to run always, which can change the behavior of the EAs for some people.

              There are such problems everywhere in the EA builder where if I want to change or remove something, unexpected things could happen to many user's projects. And this is not like fixing a bug. If it's a bug, at least I can say "Yeah, but it worked wrong before and now I fixed it".

              I think I should somehow make a whole new version of the EA builder, incompatible with this one, on a different link. Like 2.0 or something. Similar to how MT4 and MT5 exist in parallel. But I don't think I have enough breaking changes in mind to justify this.

              roar 1 Reply Last reply Reply Quote 1
              • roar
                roar @fxDreema last edited by roar

                @fxDreema just go ahead with version 2, and finance it with some nice fat partnership contract with some major forex broker 😄 swing for the fences lol

                The cock favicon probably would have to go though

                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

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

                  @roar I had parthership proposals from brokers, and not only brokers, but I always decline. I'm very anti-parthership for some reason, so much that I don't even want to hire someone to do something instead of me. But lately, and especially after the hack, I started to realize that I'm probably not enough for this project and my strong anti-parthership shell is starting to crack a little bit.
                  But brokers... I look at them as the enemy, although without them this website would not exist.

                  roar l'andorrà S S 4 Replies Last reply Reply Quote 1
                  • roar
                    roar @fxDreema last edited by

                    @fxDreema I understand, both of your points.

                    I have just seen some "EA builders" offered by brokers, and they are always miles, light years behind fxdreema. This is the iPhone of EA industry lol

                    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 2
                    • l'andorrà
                      l'andorrà @fxDreema last edited by

                      @fxDreema Amen, brother!

                      (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                      (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                      (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

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

                        @fxDreema
                        Interesting, how would a partnership with brokers work ? I mean what would be the way to force the users importing the built EA to the broker ?

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

                          @fxDreema I'm really glad you don't like partners. Partners always have interests that conflict with a best and first vision. One of the reasons FXDreema is ahead of its peers. Creative license for users or devs doesn't play well with controlling partners. You don't need em because its pretty easy to see your user base will have your back with any kind of support needed. I am currently a novice in coding and find this community easy to learn and share ideas with. I wouldn't be here if this were a big box e-tailor. Ive been a trader and in tech for years but I'm soaking it in like a sponge right now!

                          TipsyWisdom 1 Reply Last reply Reply Quote 0
                          • TipsyWisdom
                            TipsyWisdom @speedsk8r last edited by

                            @speedsk8r said in When to stop OnInit():

                            @fxDreema I'm really glad you don't like partners. Partners always have interests that conflict with a best and first vision. One of the reasons FXDreema is ahead of its peers. Creative license for users or devs doesn't play well with controlling partners. You don't need em because its pretty easy to see your user base will have your back with any kind of support needed. I am currently a novice in coding and find this community easy to learn and share ideas with. I wouldn't be here if this were a big box e-tailor. Ive been a trader and in tech for years but I'm soaking it in like a sponge right now!

                            to be fair as well though, a good partner pushes you to be better, and strive for more....this is what I look for in someone at least.

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              speedsk8r @TipsyWisdom last edited by

                              @TipsyWisdom not the ones I've been in. Plenty of resources to "do better" without another controlling interest. If I need $ to do better it'd be an equity only relationship.

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

                                @TipsyWisdom We're not talking about women here 😉

                                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! 😊

                                A TipsyWisdom 2 Replies Last reply Reply Quote 2
                                • A
                                  ambrogio @jstap last edited by

                                  @jstap 😂

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

                                    @jstap lol

                                    true true...but a business partner shouldn't be any different in that regard!

                                    1 Reply Last reply Reply Quote 1
                                    • J
                                      jbillionz last edited by

                                      Hello How can I access your discord group

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

                                      Online Users

                                      S
                                      E
                                      J
                                      D
                                      M
                                      X
                                      K
                                      E
                                      D
                                      M

                                      25
                                      Online

                                      146.6k
                                      Users

                                      22.4k
                                      Topics

                                      122.6k
                                      Posts

                                      Powered by NodeBB Forums | Contributors