fxDreema

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

    How to make custom ENUM constant ENUM_REFERENCE_PRICES?

    Questions & Answers
    2
    4
    595
    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
      Prot82 last edited by

      Hi Guys,

      I would like to make a custom ENUM constant named ENUM_REFERENCE_PRICES and it should contain 3 elements:

      1. STARTING_PRICE
      2. CURRENT_PRICE
      3. MOVING_AVERAGE

      And all 3 should be contained in one combo box or drop down list in EA inputs (like timeframes), so the trader can choose what price will be the reference price in trading.

      Very important:

      1. If "Starting price" selected in EA inputs: value should be set when EA starts (on Init).
      2. If "Current price" selected in EA inputs: value should be set every Tick.
      3. If "Moving Average" selected in EA inputs: value should be set from existing project constant "Moving Average" which, also, trader can enter period (14 or 20 or 200) in EA inputs.

      Idea is that the EA decides which position to open (buy or sell) regarding to which chosen price is currently above or below.

      So, if trader choose "Starting price" all above that price will be buy and below sell.

      Next, if trader choose "Moving Average" all above MA will be buy and below sell.

      I hope that I explained well

      P.S.
      Please detailed explanation because I'm beginner

      Thank in advance

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

        @prot82 I looked at this the other day, is defiantly possible but am unsure how to use this code in a custom code block on FX.

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

          To make it simple, I just want to have implementation like in picture. Trader can choose 1 of 3 options and I would like to deal it like 3 cases

          0_1656707687706_enum.jpg

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

            @prot82 If you want to use a pre defined function like timeframe, this is simple, type = ENNUM_TIMEFRAMES, a personal one I don't know.

            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

            T
            A
            P
            K
            M
            M
            E
            L

            19
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors