fxDreema

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

    Time filter blocks operation

    Questions & Answers
    2
    5
    1226
    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.
    • S
      seb 0 last edited by

      Hi
      Wanted to know how time filters blocks were working precisely, in particular the "every 'n' bars" one. Because i see that every time, when i use it interferes with my trades not the way i want.
      For exemple, the simplest one : https://fxdreema.com/shared/U4lE5nbub
      The first construction is gonna buy every time MA5x>MA20
      The second one, only time to time even if the last buy order is older than 10 bars
      0_1575315619842_Capture d’écran (62).png
      Looks like it's passing to the last blocks with only 1 chance on 10 when there is a cross..
      Thanks answering my rookie question

      roar 1 Reply Last reply Reply Quote 0
      • roar
        roar @seb 0 last edited by roar

        @seb-0 You are thinking that "every n bars" counts some bars, and after the bars, always passes. That is not the case.

        If n=5, then
        bar 1 PASS
        bar 2 NOT
        bar 3 NOT
        bar 4 NOT
        bar 5 NOT
        bar 6 PASS
        bar 7 NOT
        bar 8 NOT
        etc...

        So you will only get a trade if the PASS happens same time as MA cross.

        0_1575320136109_4bc2ead3-1ccf-4cdf-af53-a5e676760151-image.png

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        S 1 Reply Last reply Reply Quote 0
        • S
          seb 0 @roar last edited by seb 0

          @roar
          Alright so when there is a cross, there is 1 chance on 5(oops not 10) that it passes. That's weird cause if you have no chance you can have no trade at all. I guess it's dedicated to work with lasting conditions like "MA5>MA20".
          I wanted to be sure before using more complicated structures like loops : once ber bar; pass 'n' times ; turn on a flag. Or the on timer event with loops as well but based on seconds then. It takes more time 😛

          roar 1 Reply Last reply Reply Quote 0
          • roar
            roar @seb 0 last edited by roar

            @seb-0 Yeah it surely takes some time and lots of testing. It's not that bad after all - failed backtest doesn't cost very much real money, lol.

            Using a variable would be most efficient in this case. Just make a variable barcount increase +1 on every bar, and set it to zero when opening a trade. Now you can just check condition: barcount > 5

            https://fxdreema.com/shared/3dIyLzxCc
            This example trades the cross with minimum 5 bars interval. See how I modified the variable inside the regular blocks.

            Need small help? Tag me in your post
            Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

            S 1 Reply Last reply Reply Quote 0
            • S
              seb 0 @roar last edited by

              @roar
              Yes fortunately. Better the EA to be as much as you want it to working, before using it on real account.
              The way you did it is quicker to build than mine, thanks for the exemple ^^
              I hope this topic is gona help other newbies, ill try to stop opening new ones for a moment, you guys must be busy!

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

              Online Users

              N
              S
              E
              S
              N
              O

              20
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors