fxDreema

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

    Digit Adjustment of Variable ** SOLVED **

    Questions & Answers
    3
    8
    2639
    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
      paragorundu last edited by paragorundu

      Dear Friends,

      I set value of a variable from an indicator, which provides 6 digits after point. This causes bid value comparison issue in EA.

      For example:
      I get value from indicator which sets variable:

      myVar=0.123456
      bid= 0.12345

      How can I adjust digits of myVar to 0.12345?

      I tried many things with no success...

      Thank you.

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

        I think this can be useful for you:

        https://fxdreema.com/forum/topic/6692/last-digit/2

        (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
        • P
          paragorundu last edited by

          Hello @l-andorrà ,

          Thank you very much for your reply.

          I had seen that post. But what I need to do is to drop last digit. This code seems to get the last digit. Since I do not have programming knowledge I'm not sure if the mentioned post can be used to drop last digit.

          I wonder if the value of variable can be modified at 'Adjust' field of the the block?

          Any ideas @fxDreema ?

          Regards.

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

            Dear Friends,

            After hours of search, I figured out how to solve this issue. Since I have NO programming knowledge, this simple problem became headache for me.

            While I was searching similar issues in forum, I saw that most of the raised questions was not replied with a solution. I hope this info be useful to whom needs help on such topic.

            I used 'Custom MQL code' block with the following code to have 5 digits after decimal point.

            0_1567706719919_Capture.JPG

            Problem solved!

            Regards.

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

              Impressive. Congratulations for your effort. 😉

              (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.

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

                @l-andorrà Thank you! I've spent hours! Lack of knowledge is very bad :))))

                Thanks again for your kind help on the subject.

                Regards.

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

                  DoubleToStr() function takes a variable from "double" type and turns it into "string". "double" is a floating point number, while "string" is text. So it's not very correct what you are doing. Try NormalizeDouble() instead. The description of this function is like this: Rounding floating point number to a specified accuracy.

                  In Adjust there is some trick that you can do. You know that in Adjust you normally start with +, 0, * or /. But you can also do it like this:

                  = NormalizeDouble($, 5)
                  

                  When it starts with =, it's a little bit different. The final value will equal to whatever is on the right side of =. Well, I want to change the value that I got a little bit, not to give it a whole new value, so I use the value itself. That symbol $ is the value.

                  1 Reply Last reply Reply Quote 2
                  • P
                    paragorundu last edited by

                    Hi @fxDreema ,

                    I have missed your solution on this subject. That's very informative.

                    It somehow worked for me but as you said I have to do it in the right way.

                    Thank you very much.

                    Regards.

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

                    Online Users

                    S
                    A
                    R
                    B
                    N
                    M
                    A
                    T
                    V
                    M
                    A
                    A
                    R

                    25
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors