fxDreema

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

    MathRound question

    Questions & Answers
    3
    4
    175
    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
      Tulefi last edited by

      I have scoured the forum but nothing that answers this speciifc situation.

      I am building an EA to trade USDJPY and one of the conditions needs a round number. So for example, if the actual price is 134.123 I need 134, and if it is 134.567 I need 135.

      How do I achieve this in the actual condtion box? Do I need customer code (never used that before)?

      S 1 Reply Last reply Reply Quote 0
      • A
        ambrogio last edited by

        you have to search for MathCeil and MathFloor
        https://fxdreema.com/forum/topic/4454/draw-horizontal-line-and-calculate-round-numbers-from-open-price/3

        1 Reply Last reply Reply Quote 0
        • S
          sktsec @Tulefi last edited by sktsec

          @Tulefi
          Maybe you can define a new variable and then using the Modify Variable block

          new_price = MathRound(original_price)

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

            Thank you. I tried the customer code and it seems to work!!

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

            Online Users

            G
            L
            K
            H

            17
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors