fxDreema

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

    Check age based on candles

    Questions & Answers
    2
    2
    1105
    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.
    • X
      Xander last edited by

      Hi All
      Is it possible to check the age of a trade based on candles rather than time? From what I can see the check age block does not have this option.

      1 Reply Last reply Reply Quote 0
      • J
        josecortesllobat last edited by

        The easiest way is to define a variable that increases by 1 when a new candle opens if there is a trade running.

        int BarCounter = 0

        Once per bar - If trade -> BarCounter = BarCounter+1

        You have to reset that variable when there is no trade. My suggestion is to reset it when a new trade opens.

        This is just an example

        0_1553928120909_09a7492d-b945-40c4-b90b-59fa66c20cb5-image.png

        0_1553928394714_092a7b9b-da16-444e-a438-72d2e1566460-image.png

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

        Online Users

        E
        J
        D
        M
        X
        K
        E
        D
        M
        H

        21
        Online

        146.6k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors