fxDreema

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

    EA for certain hours

    Questions & Answers
    3
    11
    3709
    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.
    • W
      widi87 last edited by

      hello,

      I need help, because I am new in forex and MT4, and not advanced in programming.

      I want to make an EA as below:

      if certain hours and there is a new candle
      then check the certain condition for buy and sell.

      I will attached this EA a couple hours before the certain hours reached.

      thank u.

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

        Something like that: http://fxdreema.com/shared/iplq0CcPc

        1 Reply Last reply Reply Quote 0
        • H
          hilavoku last edited by

          Hi,

          additionally i would like to have a constant input variable where the user defines a specific time of day when to take action. When using the hours and minutes filter i can only set a constant within the minutes filter. The hours filter won't let me do this.

          Some ideas?

          As you can see i tried it with a condition block using the current time of the M1 candle and comparing it with a string containing for example "08:30".
          Is this a way to go or can't we compare candle time with a string?

          thx in advance
          hila

          ......
          block.JPG

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

            You are right about time options in Condition, I should add some.
            By the way, just for trying things, there is also Minutes filter and it can be used after Hours filter.

            Are you sure you want to use those type of global variables, designed to exchange values between EA's?

            1 Reply Last reply Reply Quote 0
            • H
              hilavoku last edited by

              Thx for the reply. In the minutes filter i can set a variable instead of a fixed time value... I think in the hours filter it should only be an integer value and not 08:00 for example. So i can't set a variable for it. Thats not consistent for me. What do you think?

              thx in advance
              hila

              PS: just subscribed for a year. Hope to see those time options 🙂

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

                I will add time things into Condition, but I also think that there is a good reason to have some time period instead of just one moment in time. If you tell the system to do something on 08:00, and in the same time... for example there is a problem with internet, when it becomes 08:01 - it's all over. But if you have bigger period of time, say 5 or 10 minutes, there is a bigger chance to do what is supposed to do, if not in 08:00, then in 08:03.

                But you can also put 0 and 1 as start and end minute in Minutes filter, and "Once per bar" after that. And if you work with server's time, it's better to have some small period of time in case of slow ticks flow.

                1 Reply Last reply Reply Quote 0
                • H
                  hilavoku last edited by

                  Okay but how can i make the time window as user input?

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

                    I will rebuilt time blocks or I will add another one to work with these formats listed here: http://docs.mql4.com/convert/strtotime

                    1 Reply Last reply Reply Quote 0
                    • H
                      hilavoku last edited by

                      Hiho,

                      me again. It seems i really get you working 😆
                      Also here waiting eagerly for your next info!!!!

                      bye bye
                      hila

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

                        Added "Time filter" block which compares the current time (server or local) with predefined period of time (start time - end time). If Year, Month and Day are not defined, current year, month and day are used.
                        I tested this new block, but if you find some problems with it, let me know 🙂

                        1 Reply Last reply Reply Quote 0
                        • H
                          hilavoku last edited by

                          Wow. Many thanks. Will try it and report...

                          bye bye
                          hila

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

                          Online Users

                          C

                          16
                          Online

                          146.8k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors