fxDreema

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

    Please add "NormalizeDouble" block/function (or is there onboard solution?)

    Questions & Answers
    2
    5
    2345
    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
      TM 0 last edited by TM 0

      I tried for weeks to get my desired system running.. always failing at getting eg a fraction of indicator value as pips input.

      Means eg calculating a fraction of bollinger bands.. then unsing this value as "GridSize" in grid pending orders.

      The calculation outputs correct numbers for bollinger.. but with too many digits.
      Hence it is displaying (output via comment block) something like 0.0009354757473274575e5 whereas the value would be 9 Pips.

      I was able to transform 0.009xx into pips via "Ticksize" and/or "Pointsize" but the calc will result in zero. I guess because of not being able to normalize the value.

      In best case i need a way to get from 0.0009xxx to 9 pips.
      Or being able to normalize the value to eg 5 digits.

      I tried to create custom block from this info:
      https://docs.mql4.com/convert/normalizedouble

      but failed.

      I guess this affects all fxDreema users so i think this really would be great benefit in the core system.

      What do you think?
      How should i handle that numbers in a better way?

      1 Reply Last reply Reply Quote 0
      • J
        josecortesllobat last edited by

        0.0009354757473274575e5 == 0.0009354757473274575e5 * 0.0001 (PointSize) = 9.354757473274575

        You can try this:

        double CalcResult
        double PipsCalc

        Formula block -> CalcResult * PointSize --> PipsCalc

        (PointSize --> MarketProperties->PointSize [Customized or Original])

        0_1542621141495_01fd2528-7e78-4c7a-803c-5f08fddbfe4d-image.png

        And display "PipsCalc".

        You can add a "Custom MQL" block and apply the NormalizeDouble function to "PipsCalc".

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

          @josecortesllobat said in Please add "NormalizeDouble" block/function (or is there onboard solution?):

          0.0009354757473274575e5 == 0.0009354757473274575e5 * 0.0001 (PointSize) = 9.354757473274575

          You can try this:

          double CalcResult
          double PipsCalc

          Formula block -> CalcResult * PointSize --> PipsCalc

          (PointSize --> MarketProperties->PointSize [Customized or Original])

          0_1542621141495_01fd2528-7e78-4c7a-803c-5f08fddbfe4d-image.png

          And display "PipsCalc".

          You can add a "Custom MQL" block and apply the NormalizeDouble function to "PipsCalc".

          Thank you very much for your reply.

          I already tried with Pointsize (and also TickSize) .. but not working.
          I also tried to set the Variable from "double" to "int" which was not working (expected.. but i took the chance..)

          Would you be able to show me how to do/make that Custom MQL block with NormalizeDouble function?

          I tried, but failed 😞

          1 Reply Last reply Reply Quote 0
          • J
            josecortesllobat last edited by

            0_1542695666552_00c8e48e-23b7-46cb-9fc9-63cc601ce256-image.png

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

              Ahhh... lightbulb on ..that easy?!
              I was thinking way to complicated..

              Thank you very very much for your help!

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

              Online Users

              E
              J

              13
              Online

              146.8k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors