fxDreema

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

    How to write condition OR with "darker condition block"

    Questions & Answers
    2
    4
    791
    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.
    • M
      migen last edited by

      My condition is: example - there are 6 variables D1 D2 D3 -- D11 D22 D33

      "D1 > D11 or D1 = 7" and "D2 > D22 or D2=7" and "D3 > D33 or D3=7"

      How to write these condition correctly in "darker condition block" ?

      roar 1 Reply Last reply Reply Quote 0
      • roar
        roar @migen last edited by roar

        @migen This should work
        (D1 > D11 || D1 == 7) && (D2 > D22 || D2==7) && (D3 > D33 || D3==7)
        0_1591255162481_b1a3f0d4-d3c1-4b38-adf9-52e80fcc6629-image.png

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        M 1 Reply Last reply Reply Quote 1
        • M
          migen @roar last edited by

          @roar Thanks!

          I have another question : If I want to count how many conditions are valid (I'm using variable to count), how to write conditions separately in "darker condition block" ?

          With example above:

          "D1 > D11 or D1 = 7" ; "D2 > D22 or D2=7" ; "D3 > D33 or D3=7"

          I just need to remove && symbol, is it right ?
          (D1 > D11 || D1 == 7) (D2 > D22 || D2==7) (D3 > D33 || D3==7)

          roar 1 Reply Last reply Reply Quote 0
          • roar
            roar @migen last edited by

            @migen I'm not sure, but generally a logical TRUE is equal to numeric 1. So you could try just replacing && with + sign:
            variable = (D1 > D11 || D1 == 7) + (D2 > D22 || D2==7) + (D3 > D33 || D3==7)

            Need small help? Tag me in your post
            Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

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

            Online Users

            A
            M
            A
            R
            G
            S
            M
            G

            21
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors