fxDreema

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

    Enum Operators as Inputs

    Questions & Answers
    2
    4
    241
    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.
    • K
      kekhumbo last edited by

      I have a situation. I want to be able to use the condition block with indicators but the operator should be an input field in a form of an enum. How can i achieve this? So I want a situation where a user defines the operator from the input if i choose eg Price and Moving Average. So the operators that a user should be able to specify are :

      • Is Above

      • Is Below

      • Crosses Above

      • Crosses Below

      Enum Operators.png

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

        Create the enum, if 1 is selected activate the relevant block, if 2 is selected activate a different block etc. You'll see how to achieve in here: https://fxdreema.com/shared/Q79GHec1c

        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
        • K
          kekhumbo last edited by

          Thanks @jstap . That has given me a great idea.

          But now for the operator as depicted on the picture, is it a string? I would like to replace the operator with a variable but am not sure what data type to use for the operator.

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

            On FX these data types can't be changed (in my experience), so I would activate a different block for the one I need.

            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
            • 1 / 1
            • First post
              Last post

            Online Users

            S
            M
            2
            M
            M
            N
            B

            18
            Online

            146.6k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors