fxDreema

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

    How to use Constant for Timeframe

    Questions & Answers
    3
    14
    2040
    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,

      The Timeframe data type is ENUM_TIMEFRAMES and in "Condition" block, when I choose "Indicator" -> "Moving Average" there is a dropdown list (Combo box) containing all Timeframes to choose. So, I would like Timeframe to be changeable as EAs input (Constant) for back testing. How to do that?

      ... many thanks in advance

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

        @prot82 ENUM_TIMEFRAMES as type, PERIOD_CURRENT as value.

        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

          It already offer Current Timeframe, but I would like to use 2 Timeframe's Indicators at once, so it has to be some kind of Constant to be able to change in EA's inputs

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

            @prot82 That is a constant changeable in the inputs, the timeframes you want to use must be next to each other to use only those 2 in strategy tester.

            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

              I want to use signals from H1 Timeframe as a main guide and signals from M1 as a local guide for trading

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

                @prot82 This is done inside the blocks, you can set up more than 1 with different names, right click and add to the box you need, when in strategy tester set eah up how you like.

                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

                  Sorry bro, but I don't understand you, I would like something like this in picture0_1654177327473_Timeframes.jpg

                  1 Reply Last reply Reply Quote 0
                  • P
                    Prot82 last edited by

                    I use FXDreema only for 3 weeks... I'm very inexperience, sorry

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

                      @prot82 That is correct but where you have H1/M1 in the constant list you need something like PERIOD_CURRENT instead.

                      In here you will see all the types:https://docs.mql4.com/constants/chartconstants/enum_timeframes

                      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

                        Many, many thanks bro, all works. I only had to enter "1" instead of "M1" and "60" instead of "H1", so no need even for PERIOD_CURRENT at all 🙂

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

                          @prot82 On MT4 you only need to use int as type then minutes in value, 1, 5, 15, 30, 60, 240 etc, doesn't work on mt5 though.

                          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

                            Yes, now I see, I only shouldn't use M and H letters

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

                              period current is the default that we all use regardless of what we want to use. Reason being, its easy to remember...what isn't easy, when you're in the heat of the moment...got on some tunes and you're cranking out some blocks, and you brain fart and say, "damn, was M1 or Month or Minute." This is why he said to just use period current, its a moot point because its selectable as an input later on.

                              1 Reply Last reply Reply Quote 0
                              • P
                                Prot82 last edited by

                                Thank you very much

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

                                Online Users

                                L
                                H
                                S
                                E

                                10
                                Online

                                146.7k
                                Users

                                22.4k
                                Topics

                                122.6k
                                Posts

                                Powered by NodeBB Forums | Contributors