fxDreema

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

    Round Variable

    Questions & Answers
    2
    4
    1863
    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.
    • P
      Philipp_tradet last edited by

      Hi Folks,
      Im trying to round a variable, I've created. Can you help me? Is there a build-in feature of Dreama, which can do this for me or do I have to use NormalizeDouble (double Wert, int Ziffern). When I have to use the formula, where I have to put it? Assume, I take a "modify variable" and put something in it. In this case the money per Tick - how can I say, I only want 2 Numers behind the . ? (y,xx)

      Thanks!!!!

      Philipp

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

        try this calculation with Custom code:

        0_1518456249432_1fab5ade-2328-4e85-8160-6c7e4dbf03b9-image.png

        variable1 is your variable to be rounded, roundDigits is on how much digits it should be rounded (0 is not allowed) ... I have not tried it, maybe it is not working or some mistake can be in code ...

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

        1 Reply Last reply Reply Quote 0
        • P
          Philipp_tradet last edited by

          Thanks a lot for your help, it works fine for me. It's nice, because you can change the number of rounding digits.

          but I found another way to shorten die Variable to 2 Digits with only the DoubleNormalization. I just want to share it as an Alternative to your explizit way!

          Thanks again for your fast response!

          0_1518471355738_2ee9eeee-42ed-4e44-bc5d-21daeb6fc5e6-image.png

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

            ah yea, I understood your question badly, I though, that NormalizeDouble is not working for you, now I understood 😄

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

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

            Online Users

            H

            6
            Online

            146.9k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors