fxDreema

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

    How can I create a delay in seconds?

    Questions & Answers
    5
    7
    3034
    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.
    • I
      ivanvc last edited by

      Hello, I need the orders to enter a few seconds later, I do not know if there is a block for this or I would have to include it in the mql4 code. Thank you.
      Instead of entering the order 13.00-12.00-5.00 (open price), for example 3 seconds 13.03-12.03 etc.
      https://fxdreema.com/shared/9wejeRI1b

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

        There is a Delay block. Note that this block stops the whole EA for a while and I think that MetaTrader itself may become unresponsive... but 3 seconds is not a big amount of time and if you don't have other EAs it could work.

        But maybe it's better to try this block "Skip Ticks"

        R 1 Reply Last reply Reply Quote 0
        • R
          riccardo @fxDreema last edited by

          @fxdreema
          How can use the "skip ticks"?
          Stop the ea, but then restart it?

          I want stop the ea after a condition and restart next day, i think i could to use "skip ticks" block

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

            That's a good question. I tried to use it at the most simple level and not a single tick is skipped.

            https://fxdreema.com/shared/1iMEur5jd

            I'm bery interested in someone solving our common problem.

            1 Reply Last reply Reply Quote 1
            • R
              richard96816 last edited by

              You could skip ticks manually.

              Create a variable as a flag that says don't execute your trade. Then count ticks from that point. When the counter reaches the desired number then set the flag variable to true.

              Maybe a Condition block and a Counter block is all you need ...

              Seems plausible.

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

                But this is almost what "Skip Ticks" do. When it runs, it sets some variable to a future time, and then on every tick (in OnTick()) that variable is compared with the current time. After the current time is > than the time in the variable, the rest of the code in OnTick() is allowed to work again.

                R 1 Reply Last reply Reply Quote 0
                • R
                  richard96816 @fxDreema last edited by

                  @fxdreema Why doesn't Delay do that too?

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

                  Online Users

                  F
                  R
                  S
                  D
                  V
                  O

                  14
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors