fxDreema

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

    IF - THEN - ELSE logic

    General Discussions
    4
    8
    1565
    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.
    • C
      cesar_defez last edited by

      Hi there.
      I want to place in an if block, the following condition with low level code.
      if Bid> = X OR Bid <= Y
      where X and Y are variables
      if this condition is met, go to the next block
      can you correct my expression
      these are the errors it gives.
      Thank you
      0_1630338145203_a0839477-1267-4559-b93b-620ba3fd15cf-image.png

      jstap 1 Reply Last reply Reply Quote 0
      • jstap
        jstap @cesar_defez last edited by

        @cesar_defez I am unsure why Or isn't working, but like this should do as you need.

        0_1630339875318_Screenshot (602).png

        Learn fxDreema Without the Wait!

        My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

        The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

        Don’t miss out

        Click here➡️ https://mybook.to/fxDreema to get your copy today!

        Enjoy! 😊

        C 1 Reply Last reply Reply Quote 0
        • C
          cesar_defez @jstap last edited by

          @jstap
          Hello, you can not place an OR operator, and that it is together in the same box?

          jstap 1 Reply Last reply Reply Quote 0
          • jstap
            jstap @cesar_defez last edited by jstap

            @cesar_defez When I tried to add "OR" in the same box I got the same errors you did.

            Learn fxDreema Without the Wait!

            My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

            The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

            Don’t miss out

            Click here➡️ https://mybook.to/fxDreema to get your copy today!

            Enjoy! 😊

            C 1 Reply Last reply Reply Quote -1
            • C
              cesar_defez @jstap last edited by

              @jstap
              Hi, I think I have it fixed.
              I have looked around the web and found this.
              0_1630531903842_4bfefaae-c2c5-45c8-afee-a5e97103b350-image.png

              apparently the operator or, is written "||" (without "").

              the expression would be like this:
              0_1630532293484_cc6facf4-5f03-4b56-b8fe-94c9916a2fb6-image.png

              Bid cannot be used, it gave me an error, so I had to assign the Bid value to a variable (Bid_0).
              in this way when compiling it no longer gives me an error.
              Thank you @jstap

              jstap 1 Reply Last reply Reply Quote 0
              • jstap
                jstap @cesar_defez last edited by

                @cesar_defez Thank you for this, as usual the fix is quite simple, so OR = ||. I will quite often use a variable to replace functions, might also work different on MT4 compared to MT5.

                Learn fxDreema Without the Wait!

                My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                Don’t miss out

                Click here➡️ https://mybook.to/fxDreema to get your copy today!

                Enjoy! 😊

                1 Reply Last reply Reply Quote 0
                • A
                  augostine last edited by

                  kindly help me with this similar expression in the if condition.

                  here is the problem to be solved by the expression {a comparative expression}. (MA10 - MA20) > 2(MA 20 - MA50)

                  The output be true (orange) if logic is correct, else false (yellow)

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

                    Why can't you use a standard 'condition' block? You can do it there normally. No need to create a new block.

                    (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

                    N
                    C
                    S
                    S
                    P
                    C

                    13
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors