fxDreema

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

    Draw Text Variable

    Bug Reports
    2
    11
    2209
    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.
    • E
      edwardseer last edited by

      hi, the variable at the side of the block for the variable = start of the block seems to have some problems. it does not make the variable = to what i input there before the start of the block.

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

        Example, screenshot?

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

          http://snag.gy/yvy4K.jpg

          i added the formula to the right block then it started to work. whatever changes made to the block in the draw text does not affect the y coordinate at all.
          it seems to only do it after the block has completed its function

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

            This one is working for me 😕 : https://fxdreema.com/shared/y44Xj1bHd

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

              what i think is that the y coordinate was set before the variables were initalise by the block.
              look at mt4-2201.
              i realised this problem only today and did not notice that it was present in the past. if this was fixed i have to modify a bit of my projects =O haha.
              the change this refer to y coordinate

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

                I don't know, there might be some but. You can check the source code if you want. The variable name will be Ycoortinate I think, and you should see something like this below the code that defines input variables:

                Ycoordinate = Ycoordinate+YGap;
                

                Do you have something like this?

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

                  i think the problem in here was that the y coordinate was set to the obj first before the adjust happened
                  http://snag.gy/vlJ6L.jpg

                  the objy was set to y first then the adjust came. the draw text uses the objY to set the coordinate. so the block was not initialise first before the draw text happened. although im fine with keeping it like this as the project im doing already was working in this format but there might be others who might be wondering about whats happening if they tried initialising the coordinate in the same block.

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

                    i think that most of the block have the input parameter set first before the variables were adjusted to initalise. the white portion of the variable should be set before the input parameter i think. now if a user is trying to initialise certain input parameters of the block, it would still use the previous value the variable is holding. i think a reminder would be good to ask them to set the parameter in a pass block to initialise for example in the block before the actual block if its too much to change. i only saw that the buy/sell block also have this issue and the draw part but i think most of the block should have this issue. input parameter were set to the variable if used before the variables were changed to what is wanted using the variables at the right. so it ended up that the variable were using previous value before its changed in the main code then used in the main code.

                    an example to show for buy block. y-coordinate was reused so i set it to 0.01, and in the next block i set it to 0.1 lot. this are in oninit. ran it in a strategy tester, it should be using 0.1 lot if its working fine but it uses the value in the pass block 0.01

                    http://snag.gy/c1Kzu.jpg

                    the code problem
                    http://snag.gy/o6NLP.jpg

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

                      I understand you now 🙂

                      Obviously, variables (from the white input) are modified after initialization of block's inputs. Why is that... Because of these P1, P2... and so on. These are block's input parameters actually. If I decide to modify variables above those parameters, then I need to remove them all. I have no problems to remove this and that, but what if someone is using those P1, P2... 🙂

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

                        no problem. im fine with the current way. i was not using the P1,P2 so i din notice. just highlighting it cause i think it caused me some problems in the past which i did not notice as i was wondering why the block would not initialise with the variable i set in it as it wrote there the variable would be equal to this before the block starts.

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

                          As you can see, even I can't spot this issue quickly. I'm sure that people are using Constants and Variables, but I don't remember seeing someone using P. So I don't know, maybe I will dump this functionality. I was happy with this when I first created it, but not everything that I did was actually a good idea 🙂

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

                          Online Users

                          X
                          J
                          A
                          N
                          S
                          E

                          23
                          Online

                          146.7k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors