fxDreema

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

    How to get the maximum price after the price crosses the ma21.

    Questions & Answers
    2
    2
    926
    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.
    • S
      scs9559 last edited by

      HI.

      I am trying to get the max price, so in the block condition the highest price (candles period) the parameter "end candle" was the cross of the price above the ma 21.

      thanks.

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

        Here the question is how to calculate at which candle that cross happened. Here is some idea: https://fxdreema.com/shared/eHWR6SX5d

        But what do you mean by "price crosses the ma21" - it matters. Because in the history of prices you have 4 prices for each candle and these values.

        The idea in this example is that I have one variable that I set with value 0 before the calculation, then I check whether the Condition is true for candle 0, and if it's not, I increment its value and run Condition with the updated value... as a result Condition runs one or more times, until it passes. After that the value of the variable will have some value - the number of times that Condition passed minus 1, which is the same as the last CandleID used in Condition.

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

        Online Users

        E
        N
        A
        H
        H
        O
        R
        S
        Z
        J
        M
        H

        23
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors