fxDreema

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

    Get ID for oldest candle on chart

    Questions & Answers
    3
    5
    308
    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.
    • N
      nk0815 last edited by nk0815

      Hello,

      I have an EA that loops back through many candles on the chart. It works so far when putting it on a live chart, but when I run it in the tester, there are only around 100 candles in the past. and it causes a critical error.

      Is there a way to identify the oldest candle on the chart, so that I could stop the loop at that candle? Or add something like "if candle exists" to the loop.

      I am aware that I can add a delay to the EA, but that does not solve the problem if it ever occurs on a live chart, so the oldest candle ID would be good to know.

      l'andorrà 1 Reply Last reply Reply Quote 0
      • l'andorrà
        l'andorrà @nk0815 last edited by

        @nk0815 Apparently the loop searching for that last candle is having some limitations. Can you please share that part of the project?

        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

        1 Reply Last reply Reply Quote 0
        • N
          nk0815 last edited by

          Hey, thanks for the reply 🙂

          This is the part that checks the candles:

          https://fxdreema.com/shared/6VSzHpSBd

          I think I need to find a way to stop the loop once it hits the oldest candle on the chart.

          jstap 1 Reply Last reply Reply Quote 0
          • jstap
            jstap @nk0815 last edited by

            @nk0815 You could use this in custom code

            CANDLES = WindowBarsPerChart();

            CANDLES is a int variable, this will contain all the visible candles so if you zoom in or out it will change.

            Learn fxDreema Without the Wait!

            My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

            The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

            Don’t miss out

            Click here➡️ https://mybook.to/fxDreema to get your copy today!

            Enjoy! 😊

            1 Reply Last reply Reply Quote 0
            • N
              nk0815 last edited by

              Thanks a lot, didn't know that one. This would't give me enough candles though. However, I added a condition to only loop back 2000 candles and it works now 🙂

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

              Online Users

              E
              B
              M
              J
              B
              A
              E
              R

              21
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors