fxDreema

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

    Distance less than certain amount of time

    Questions & Answers
    2
    4
    721
    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.
    • T
      Trader3487 last edited by

      I am playing around with the "check the distance between two levels" block to try to do the following: if the distance between point A (candle close[0]) and point B (MA20/50 crossover which is stored in a variable) is less than 10 candles, then execute orange output. For "... this value" I'm using Value -> Time -> Candle Time but it's not working. Any ideas?

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

        Distance less than 10 candles, what is that means? This blocks check the vertical distance, prices, how 10 candles fit in this picture?

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

          I want to say "if the distance in time (horizontal distance, not veritical) between point and and point b is less than 10 candles"

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

            Well, this block does A-B and compares this to C. The time is in it's own format - seconds from 1.1.1970 - and you can for example compare Candle Time [0] (or the current server time, notice that Candle Time does not change in every second) with another Candle Time that you have it in a variable. Again, this is measured in seconds, so foe example 1 hour is 3600 seconds.
            If this function can also help: http://docs.mql4.com/en/common/periodseconds

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

            Online Users

            V
            C

            18
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors