fxDreema

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

    How do I get absolute value of a number?

    Questions & Answers
    4
    5
    1612
    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.
    • B
      BlueMoon last edited by

      I know this should be very easy but is there a block to do this? If not can someone give me the custom code to convert a value into its absolute value?

      e.g. of what I am looking for:

      I will have a variable for the value could be a position number or a negative number. I want to convert this always in a positive number.

      -3 should become 3
      3 should stay 3
      -5.987 should become 5.987

      1 Reply Last reply Reply Quote 1
      • M
        miro1360 last edited by

        lets say you have variable varNumber and this must be converted to absolute value, than
        use custom code block with this code inside:

        varNumber=MathAbs(varNumber);

        Between trading and gambling is a very small gap, be careful.

        1 Reply Last reply Reply Quote 0
        • B
          BlueMoon last edited by

          Thank you.

          1 Reply Last reply Reply Quote 0
          • L
            len 1 last edited by

            If I was to look at the difference between two moving averages and put those values into a variable, how do I position my blocks to include the varNumber=Math
            Abs(varNumber) into a variable? Is there an order to which I would do that? and when it comes time to compare the values in a condition block, do I use a variable or do I use custom code blocks?

            1 Reply Last reply Reply Quote 0
            • l'andorrà
              l'andorrà last edited by

              I replied to your question in the other thread. 🙂

              (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

              (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

              (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

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

              Online Users

              R
              G
              T
              G
              Y
              C
              S
              S
              S
              A

              25
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors