fxDreema

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

    Reference to candle price (setting an id for candle maybe? )

    Questions & Answers
    3
    7
    2111
    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.
    • A
      Azfireland last edited by

      Dear Community I m a newbie here ,
      And hope someone can help to this issue i faced.

      I want to set "condition" for Ea to make it trade or cancelling trade once price is touch (high/Low) of specific candle (predetermined) at the past.

      So i believe I required to give a reference to candle to include it in "condition".
      I know the current ID is 0 once we go back 1 step a time Candle id is incresing n+1 and so on.

      However i wanted to reference to prices of fixed candle in past.

      Pls help me to find it out.

      Thanks.

      T 1 Reply Last reply Reply Quote 0
      • T
        trader.philipps @Azfireland last edited by

        @azfireland Does it mean you want eg the candle that is 10 candles away? So just put ID10 for instance. Or what is the issue? Maybe I didn't get you right.

        I like to share my knowledge, but expect the others to contribute as well.

        1 Reply Last reply Reply Quote 0
        • A
          Azfireland last edited by Azfireland

          Dear @trader-philipps , Let me put it that way, we can set condition to EA to buy if price reach all time recorded highest high. Which is formed 10 candles away so, Id of 10 candles away will be "10" when next candle is formed, ID of that candle will be "11" and will continue increase as new candles formed. So when ea place order it will buy if price reach highest high of last 10 candles not the all time recorded highest high. please refer the image below

          What i want to say is that, as time passes and new candle is formed and ID is changing . i need to reference price of fixed candle in history not the last 10 candle. hope its clear now.

          1 Reply Last reply Reply Quote 0
          • A
            Azfireland last edited by

            0_1570694462825_2019-10-10_11-42-50.png

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

              Use a variable target_ID

              • At beginning set target_ID as 10
              • On every new candle, target_ID = target_ID+1

              Now the ID changes as time passes, but the reference candle stays the same.

              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
              • T
                trader.philipps @Azfireland last edited by

                @azfireland Would that do the trick?
                0_1570713054035_59085825-e46f-4a05-96cd-f006a6d94ac2-grafik.png

                If you need thecandle ID you can the "What to get" part to candle ID.

                I like to share my knowledge, but expect the others to contribute as well.

                1 Reply Last reply Reply Quote 0
                • A
                  Azfireland last edited by

                  @trader-philipps @roar Great it works.
                  Thanks.

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

                  Online Users

                  V
                  C

                  17
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors