fxDreema

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

    getting the candle id for previous day high and low

    Questions & Answers
    3
    11
    2990
    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.
    • Zackry
      Zackry last edited by

      hello everyone
      can somebody please suggest a way to get the candle id of the previous day high and low (not the price , but the candle id)?

      for example take the a look at the image below , the timeframe is m15 , and i want to get the candle id of the candles that are the highest and lowest during that day
      0_1602575414640_Screenshot_7.png

      1 Reply Last reply Reply Quote 0
      • M
        miro1360 last edited by

        this? 😄

        0_1602600741987_c40425df-0df7-494d-beda-23b3298625a3-image.png

        0_1602600679558_e79b818e-ffa1-418c-9494-e32021a207f7-image.png

        Between trading and gambling is a very small gap, be careful.

        Zackry 2 Replies Last reply Reply Quote 2
        • Zackry
          Zackry @miro1360 last edited by

          @miro1360 i cant believe i never noticed it before ......thanks miro

          1 Reply Last reply Reply Quote 0
          • Zackry
            Zackry @miro1360 last edited by

            @miro1360 another question please ...... what would be the best way to get the candle id where an indicator had made the highest point during a day ?

            1 Reply Last reply Reply Quote 0
            • M
              miro1360 last edited by

              again the same technique, but with "My Indicators" option, because it has much more settings
              0_1602606412285_89c0a9f4-034c-47b9-9516-3156d203c6c6-image.png

              indicators can be downloaded here:
              https://www.mql5.com/en/code/mt4/indicators/page57

              Between trading and gambling is a very small gap, be careful.

              1 Reply Last reply Reply Quote 0
              • M
                miro1360 last edited by

                But there is no option to get Candle ID 😄 anyway, you can always do a loop 😄 😄

                Between trading and gambling is a very small gap, be careful.

                Zackry 2 Replies Last reply Reply Quote 1
                • Zackry
                  Zackry @miro1360 last edited by

                  @miro1360 well loops on their own are not a problem i have finally got a grasp on the loops a little bit , but how can we restrict the loop to run between a specific period ?
                  i mean how to make the loops avoid all of "today's candles" and only take all of yesterdays candles into consideration
                  0_1602613811446_Screenshot_8.png

                  1 Reply Last reply Reply Quote 0
                  • Zackry
                    Zackry @miro1360 last edited by

                    @miro1360 Whats your opinion on the ArrayMaximum() function ?
                    if i understood it correctly , this function it returns the index of the highest array value ? if i store the all the values of indicator during the specified period of time (previous day in this case) and then use the index of the highest value as the candle id ? do you think it could work ?

                    1 Reply Last reply Reply Quote 0
                    • M
                      miro1360 last edited by miro1360

                      the custom code can help you ("for" is the loop, "break" ends the loop before it comes to an end)
                      iMA is the indicator, it can be any, even a custom
                      https://docs.mql4.com/indicators/ima

                      0_1602635748453_37f0112e-f070-4f4f-9f28-ad5b3b6d338d-image.png

                      you can recreate it into blocks, or use it as is
                      https://fxdreema.com/shared/ye5WVCBpb

                      working with time in mql is sometimes tricky

                      if you don't understand some variables, you can easily print them on the screen with the comment block (debugging :D)

                      0_1602636306577_ea7d28a2-b2dc-4222-ba47-24412d1cee18-image.png

                      Between trading and gambling is a very small gap, be careful.

                      Zackry 1 Reply Last reply Reply Quote 0
                      • Zackry
                        Zackry @miro1360 last edited by Zackry

                        @miro1360 amazing just amazing!!!!!
                        no amount of words can express my appreciation and gratitude , you are an absolute gem , all i can say is thank you miro , THANK YOU!

                        1 Reply Last reply Reply Quote 2
                        • D
                          drankman last edited by

                          Hi @miro1360

                          I am trying to use this to find candle ID for another indicators (MACD in this case).
                          Basically I would like to find candle ID with the highest MACD value or lowest MACD value.
                          However, I am kinda failed.

                          Can you help?
                          How to find candle ID within evaluation period of the highest MACD value or lowest MACD value.

                          image.png

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

                          Online Users

                          A
                          E
                          K
                          J
                          J
                          G

                          20
                          Online

                          146.7k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors