fxDreema

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

    Counting candles

    Questions & Answers
    2
    4
    1210
    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.
    • R
      rm1 last edited by

      Is there a simple way of counting the number of candles between two of them, and saving that result to a variable?

      I know how to create and modify variables, just unsure the best way of counting candles.

      Thanks

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        Between two of them... which two? If you know their ID's, just get the difference. If you know their times... the same, with little more calculations.

        1 Reply Last reply Reply Quote 0
        • R
          rm1 last edited by

          Thanks for the reply. How do I get the times or IDs of specific candles? For example, let's say I have a block that waits until a certain condition gets met. And then the same process happens again for another condition. I'd like to count the candles between those two conditions if that makes sense.

          1 Reply Last reply Reply Quote 0
          • fxDreema
            fxDreema last edited by

            If you do the whole process forward, I mean you detect condition 1 and then Condition 2, then meanwhile you can just increment some Variable while the EA is working. Counting candles is for the case when you somehow detect the previous candle NOW. If this is the case and you somehow know the ID, there is no reason to search for the time of the candle, because you already know its ID. If the ID is 15, then there are 14 candles between candle 0 and candle 15. But with the EA it's kinda tricky to find the ID of a past condition, because the Condition block works in the current time and does not search for past conditions.

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

            Online Users

            G
            S
            M
            G
            C
            F
            T
            E
            E
            A
            K

            32
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors