fxDreema

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

    put a pending order on object after x pips

    Questions & Answers
    2
    6
    2171
    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.
    • Fabien S
      Fabien S last edited by

      Hey guys, so yesterday i tried to loop my Grid system and let it refill the levels. So i came up with an idea to create for each created order an object line, on which i can put the pending orders. What i need would be a condition to only let it put the orders on it after it has moved x pips from the object. So it would loop more properly. I'm out of inspiration on how i could implement this... This is my project: as you can see it opens multiple pending orders on level 3 and 2 and i need a way to improve it.... As always every help is appreciated!! 2_1571234941776_Bildschirmfoto 2019-10-16 um 12.03.54.png 1_1571234941775_Bildschirmfoto 2019-10-16 um 12.03.49.png 0_1571234941771_Bildschirmfoto 2019-10-16 um 11.53.44.png

      https://fxdreema.com/shared/BfdQxlf3d

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

        This will refill the levels without using any objects (they are always a mess):
        https://fxdreema.com/shared/xtZo20Ghe

        How it works:

        • first establish firstlevel variable, this is the lowest level in the grid
        • then check if price has moved below firstlevel and there are less than maximum number of orders
        • then make a loop that goes through every grid level
          • if the EA finds an order at the grid level, it moves on to next level
          • if an order is missing from a level, new pending order is placed there

        This is just a template that uses fixed firstlevel parameter, you will need to modify it to fit your system.

        Constants and variables:
        0_1571241198858_d396c342-abdb-425d-842b-d097d46045f9-image.png
        0_1571241208019_96715ace-6e0c-4002-ab1a-d9c146f63c03-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

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

          @roar said in put a pending order on object after x pips:

          This is just a template that uses fixed firstlevel parameter, you will need to modify it to fit your system.

          wow! Thanks for this block order and your time!! I would have never come up with this structure, i will analyse it now and try to understand how i can adapt it

          roar 1 Reply Last reply Reply Quote 1
          • roar
            roar @Fabien S last edited by roar

            @fabien-s Great! It may be a bit over-complicated, just made it in a fly..
            Note that I use adjust-field a lot, and I convert the raw values to pips:
            0_1571256394146_bfa8532f-9ad1-4dd7-8492-824e4b69ec8d-image.png

            If there's any particular section that needs more explanation, just ask!

            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

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

              @roar This way of scanning the variables is awesome! never thought of using variables this way with the adjust field. 0_1571261833320_Bildschirmfoto 2019-10-16 um 23.14.22.png

              I have one question:
              Why do we need this block when firstlevel starts with 0, theoretically one could also leave the block and directly connect modify variable to the blocks above? hmmm0_1571262547942_Bildschirmfoto 2019-10-16 um 23.43.45.png

              And i tested the structure using this project https://fxdreema.com/shared/PKKMSOM4b It all worked fine looped worked but somehow the grid got placed upwards from the inital grid.

              0_1571262632368_Bildschirmfoto 2019-10-16 um 23.07.46.png

              Overall i think i know what i have to change for it to work with my project, very grateful for the help

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

                Glad it works for you!

                @fabien-s said in put a pending order on object after x pips:

                Why do we need this block when firstlevel starts with 0

                This is just because I wanted a simple example with fixed grid.
                The EA checks if firstlevel has ever been modified, if not, it modifies it 1 time and then always uses the same value for ever after.

                A proper EA will need some new way to calculate the firstlevel as price moves on.

                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
                • 1 / 1
                • First post
                  Last post

                Online Users

                B
                A
                J
                D
                E

                14
                Online

                146.7k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors