fxDreema

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

    identify Highest close of last 10 candles then store to variable

    Questions & Answers
    3
    9
    2406
    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.
    • V
      VanceDavid last edited by

      I need help to:

      • Identify the highest close of last 10 candles
      • starting at Candle id 1
      • then store in variable.

      Thank you for helping.

      VanceDavid

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

        @vancedavid there is a direct mql function for that: https://www.mql5.com/en/docs/series/ihighest

        Your case (put this in custom mql block):

        somevariable = iHighest(NULL, 0, 10, 1);

        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

        V 2 Replies Last reply Reply Quote 0
        • V
          VanceDavid @roar last edited by

          @roar

          Thank you roar.

          I will research this solution (direct mql function) . I have never attempted custom mql block so we shall see how things work out.

          Thank you roar. I truly appreciate the help.

          VanceDavid

          1 Reply Last reply Reply Quote 1
          • V
            VanceDavid @roar last edited by

            @roar
            You said in identify Highest close of last 10 candles then store to variable:

            there is a direct mql function for that: https://www.mql5.com/en/docs/series/ihighest
            Your case (put this in custom mql block):
            somevariable = iHighest(NULL, 0, 10, 1);

            Pictures of Charts – Idea’s
            Identify Highest Close of Last 10 Candles
            Hi Roar,
            The Problem
            Identify the highest close of last 10 candles
            starting at Candle id 1
            then store in variable.

            You suggested that there is a direct mql function for that: https://www.mql5.com/en/docs/series/ihighest
            Your case (put this in custom mql block):
            somevariable = iHighest(NULL, 0, 10, 1);
            Shared Project for Testing- https://fxdreema.com/shared/K62Z6eXkb
            0_1617568887302_Variable HighestClose.png

            I have been attempting to incorporate your suggestion however when testing I do not get the Highest close

            The comment test suggest it is simply counting which bar I am on and rotating through bar 1 to 10

            Any idea’s how we can fix this.

            Note: In fxDreema I created the variable HighestClose.
            When I create the custom MQL code I cannot seem to add the fxDreema variable so I
            Typed in the variable in ---
            HighestClose = iHighest(NULL,0,MODE_CLOSE,10,1);

            I simple don’t know.

            TipsyWisdom roar 2 Replies Last reply Reply Quote 0
            • TipsyWisdom
              TipsyWisdom @VanceDavid last edited by

              @vancedavid under the conditions block, select market properties, and then you can look at the highest or lowest # of candles or time that you specify in there. a lot simpler than a code I think.

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

                @vancedavid yeah sorry, the function doesnt actually return a price value, it returns the index of the highest candle.

                0_1617598994620_62b426fc-1e32-4228-b886-ca849a547cb9-image.png

                So you have to do 1 more step.

                somevariable = iHighest(NULL, 0, 10, 1);
                highestclose = iHigh(NULL, 0, somevariable );

                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

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

                  @jsauter86

                  Thank You jsauter86.

                  You are right about highest price in Market properties. Unfortunately I really wanted the highest close of the last 10 candles (x Candles).

                  Market properties does not seem to allow for the highest Close only the highest price.

                  Thank you for your helpful and good suggestion.

                  VanceDavid

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

                    @roar

                    Thank Your Roar. Problem Solved.

                    I was thinking. How could I create a custom block so that I could select Highest High easily and simply change the number of bars to calculate on.

                    Would this even be a worthwhile endeavor. It most certainly would be a good learning or teaching endeavor.

                    Thanks again roar.

                    VanceDavid

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

                      @vancedavid said in identify Highest close of last 10 candles then store to variable:

                      I was thinking. How could I create a custom block so that I could select Highest High easily and simply change the number of bars to calculate on.

                      0_1617654059627_acde3c0e-8ff3-4ba6-b7b6-63c47c40f229-image.png

                      These two numbers decide the starting bar and ending bar. You can replace them with a constant or variable

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

                      Online Users

                      A
                      S
                      I
                      H
                      M
                      D
                      A
                      W
                      S
                      F

                      17
                      Online

                      146.7k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors