fxDreema

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

    I need help with distance block

    Questions & Answers
    0
    13
    535
    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.
    • L
      lwoodruff last edited by lwoodruff

      I am trying to get it to place a pending order when the current candle (0) has moved a certain distance away from the previous candle's low/high. I want the candle to move the same distance as the previous candle's wick size (in pips) but I can never get it to do exactly that.

      It only takes trades with candles with no wicks, which doesn't make sense. I've tried everything for hours and nothing is working.
      https://fxdreema.com/shared/k17nOWbtd

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

        @lwoodruff you are mixing up raw units (0.00001, 0.00002, 0.00003...) and pip units (1, 2, 3...)

        This method should work, you need to declare 1 variable https://fxdreema.com/shared/cWggZvXad

        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

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

          @roar Do I have everything set up right for buys? https://fxdreema.com/shared/jxOMBhVYc
          I pasted what you had and created the wick variable, but now it is just placing orders whenever the candle goes below the previous candle's low. Not the distance of the previous wick.

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

            @lwoodruff sorry made a mistake, it should be candle low in the circled part
            0_1672260632952_b63789b6-3447-46e6-9444-63ed3da925d9-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

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

              @roar Hey, I changed it to "Candle low" but it's still doing the same thing. I also tried to remove the first condition below the time filter I had but it didn't change anything. Can you run it real quick? I appreciate your reply.
              https://fxdreema.com/shared/xBcaxj1mb

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

                @lwoodruff its difficult to see, because your buy order is still placed at candle low.
                You can use a Draw line block to visualize the target better

                https://fxdreema.com/shared/Unr4smtnc

                0_1672310661108_bb13f47b-cd6c-4cf3-9ccd-097023ea6cf2-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

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

                  @roar Okay so I put the blocks in to draw the target, and it's drawing it at the previous candle's low, not below it but yours is doing the correct thing. I also made the SL bigger to try it out. Do you think it's something to do with my variable?
                  https://fxdreema.com/shared/v053mIrR

                  0_1672327081555_f47f47cc-9a12-492d-8652-a434211d248c-image.png
                  0_1672327262982_52e001db-270b-4d6c-b770-a00cb841c6c3-image.png

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

                    @lwoodruff ah yes, its the variable. The datatype needs to be double, not int.

                    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

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

                      @roar Thank you so much! Also, is there a way to just measure the bottom wick? Or have different formulas for both bullish and bearish candles? The candles that close bullish have a long way to go because the close is higher.
                      0_1672328157259_2052912c-3b10-4ae9-b0e9-1a92a930ca34-image.png

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

                        @lwoodruff we need to first check if the last candle was a bull or a bear, and then calculate the difference either from candle close (bear case) or candle open (bull case)

                        https://fxdreema.com/shared/ImZm5Iu8

                        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

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

                          @roar Thank you!! Calculating the wick size and distance is good now. The problem now is that sometimes it takes trades when it's not supposed to. I think it may have something to do with the open order area in my EA but I'm not sure why it's happening.

                          I don't know how to explain it perfectly but if you run it you should see.
                          https://fxdreema.com/shared/1DsXv8mZb

                          1 Reply Last reply Reply Quote 0
                          • L
                            lwoodruff last edited by lwoodruff

                            @roar Nevermind, I fixed it, I'm new to variables. Thank you so much for your replies. Do you know how to make the pending order expire after the next candle opens?

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

                              @lwoodruff once per bar -> delete pending orders

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

                              Online Users

                              L
                              S
                              M
                              T
                              M
                              A
                              R
                              E

                              18
                              Online

                              146.7k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors