fxDreema

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

    Pass n times; general question about counters

    Questions & Answers
    3
    13
    3384
    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.
    • M
      mustafaaydinol last edited by

      Hi,

      I made an example to make it sure that I get this counter block right ๐Ÿ™‚

      https://fxdreema.com/shared/rEBy6mh0e

      Time bomb is activated --> turn off blocks --> counter: count "n", then pass --> turn on blocks --> reset counter.

      1. What is the value of n? Seconds? Minutes? Times? If it is times, then how many times in which time frames (2 times in second? 3 times per bar?)

      2. When it passes, it activates "turn on blocks" right?

      3. There is a "Counter ID (for reset)" input in "counter: count "n", then pass" block.
        Let's say the ID for "counter: count "n", then pass" block is 1 (number next to each block on black background).
        If I want to reset the counter using "reset counter" block, then should I write 1 to the "reset counter" block, or should I specify another ID in "Counter ID (for reset)" input?

      Thanks for your help ๐Ÿ™‚ I appreciate.

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

        "n" is the count of passes, that "Counts before pass" parameter. I use "n" in the title for better understanding of the thing that the block does. But maybe I am wrong about the better understanding ๐Ÿ™‚

        When the block passes... it will continue to pass again and again. It does not pass few times, then it passes forever (or until you reset it)

        The ID for reset have nothing to do with the ID of the blocks. This ID is only for those counter blocks and normally it should be something like 1, or 2, or 3... But again, maybe I was wrong to give this parameter such title ๐Ÿ™‚

        1 Reply Last reply Reply Quote 0
        • M
          mustafaaydinol last edited by

          I didn't understand :))

          In which time range it counts and then passes?

          I'm confused now:

          I want to do something like that: When price suddenly moves up or down (time bomb block will do that) I want EA to turn off certain blocks for certain time period and then turn on again and keep working as usual.

          Could you please give an example?

          1 Reply Last reply Reply Quote 0
          • M
            mustafaaydinol last edited by

            Maybe I'm asking too many questions but I think there should be more examples about the blocks especially for the rare and complex ones. You are doing a great job with fxdreema but a little more help would be great.

            Maybe each weak you can make a webinar and savevthe video and post the link for later access?

            And could you please explain me if it is possible to turn off blocks during erratic price moves for certain amount time for safety and turn them back on?

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

              There is no time range, this block counts the times it has been reached by other block

              I personally can't do webinars, I can only write in english. And I actually don't want.

              There is no such time delay block. There is a delay block that stops the whole EA (and MetaTrader freezes) for a while, but this one is more drastic and for small amounts of time. Otherwise this would be the idea: https://fxdreema.com/shared/JOQ3moZce

              1 Reply Last reply Reply Quote 0
              • M
                mustafaaydinol last edited by

                Thamks a lot for the idea ๐Ÿ™‚

                I still think that there must be a security measure for ea's in choppy markets. Maybe you would make a new block with this idea to turn off blocks for certain time.

                And I still did not get count "n" and pass. And I think you should make it clear, I wonder if anyone gets it...

                If it counts n, and if n=10 ; does it count 10 seconds? 10 ticks? 10 what?

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

                  I told you, this block counts how many times it runs, how many times it is executed, how many times other block reaches it. There are no minutes, no seconds. If this block is on top level, then it counts ticks.

                  And how do you know when to pause the EA and what is the correct time?

                  1 Reply Last reply Reply Quote 0
                  • M
                    mustafaaydinol last edited by

                    https://www.mql5.com/en/articles/1558

                    I want my EA to sleep/pause for certain times. Let's say that NFP news are coming out and I want my EA to stop for an hour.

                    Or if it detects sudden price movements, I want it to stop for ten minutes.

                    If last 5 bars are up 500 pips, pause 10 minutes, then resume...

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

                      Ok, I posted an example above. There is no 1 block to do that at this time, but with a Variable it can be done. Download the project as .mq4, import it into your projects and you will see how it's done... and build on top of it

                      1 Reply Last reply Reply Quote 0
                      • M
                        mustafaaydinol last edited by

                        Thanks a lot for your time and responses ๐Ÿ™‚

                        It would be great if you can add sleep or pause blocks in the future.

                        Regards

                        1 Reply Last reply Reply Quote 0
                        • M
                          miro1360 last edited by

                          __Thanks a lot for your time and responses ๐Ÿ™‚

                          It would be great if you can add sleep or pause blocks in the future.

                          Regards[/quote:1eetvj59]

                          you can do your own count with minutes (hours etc.) easy,

                          1. you create variable to count, lets say minutes count, so your variable: int variableMinute=0
                          2. you place block "Once per bar" and set in this block timeframe M1, this block connect with another one "Custom block" and here you place: "variableMinute=variableMinute+1;"
                            now this block with modify variable will be executed once per minute and variable increased +1 once per minute (minutes count)
                          3. another group of blocks is your condition where you compare variableMinute

                          see this example here, it executes 1 trade every 10 minutes:
                          https://fxdreema.com/shared/fYIkHbZ8c
                          (dont forget, variableMinute is defined in Variables)

                          Between trading and gambling is a very small gap, be careful.

                          1 Reply Last reply Reply Quote 0
                          • M
                            mustafaaydinol last edited by

                            So this can be used to stop EA from trading for a certain period?

                            1 Reply Last reply Reply Quote 0
                            • M
                              miro1360 last edited by

                              __So this can be used to stop EA from trading for a certain period?[/quote:390w9c1t]

                              yes, with few conditions you can do this

                              Between trading and gambling is a very small gap, be careful.

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

                              Online Users

                              P
                              K
                              E
                              F
                              M
                              F
                              J
                              F
                              M

                              17
                              Online

                              146.7k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors