fxDreema

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

    How to use Loop: Pass "n" times?

    Questions & Answers
    2
    4
    1214
    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.
    • E
      Erhan79 last edited by

      FxDreema please help me how to use this block. I created this project:

      https://fxdreema.com/shared/aaHBdtavb

      I want in every bar to check last "Lookback" number of bars and count the number of bars fitting my bullish trend bad criteria (a bar has a higher high and higher low with respect to previous bar) But my bar count result is always "1". I tried several altertive ways to do this but always failed. I think my way to use Pass "n" times block is wrong, but what need to do?

      Any help is appreciated 🙂

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

        This loop is very very basic and does not stop by itself, so the value of LookBack is always decremented RunTimes times. I think this is the reason.

        1 Reply Last reply Reply Quote 0
        • E
          Erhan79 last edited by

          I tried to stop it with loop (break) but it did not work 😞

          Any other way to stop loop?

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

            Not at the moment. As I said above, this block is very basic, it only does iterations and nothing more. It's code is as simple as this:

            for (int i=1; i<=Cycles; i++) {~next~}
            ~inext~
            

            ... where ~next~ is the orange output and ~inext~ is the yellow output.

            Who knows when will I decide to add some "break" and "continue" blocks.

            What if you turn these blocks into MQL4 code in a custom block?

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

            Online Users

            Z
            D
            A

            10
            Online

            146.9k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors