fxDreema

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

    Every "n" ticks block

    Questions & Answers
    2
    11
    3015
    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.
    • T
      Trader3487 last edited by

      Is there a way to achieve the following: instead of running ea every "n" ticks and then not again for another "n" ticks, run ea every "n" ticks and check every tick thereafter until conditions are met/order is opened and then (once condtions met to open order) check again in another "n" ticks?

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

        I think if you put this block below the condition, it will work that way, because this block counts ticks only when it is executed. And if you want you can also play with the counters (category Counters)

        1 Reply Last reply Reply Quote 0
        • T
          Trader3487 last edited by

          hmm, can't figure it out. Basically, if conditions are met and "n" ticks have passed, then buy order. But if conditions are not met and "n" ticks have passed, keep checking conditions every tick until conditions are met and then buy order. If I put every "n" ticks block under conditions, then it is not exposed to tick flow and does not count every tick. Not sure if counter could help here.

          Here is the logic in steps:

          meets conditions?
          open position
          wait n ticks before running again
          on nth tick, check condtions again. meets conditions?
          open another position
          doesn't meet conditions?
          keep checking conditions every tick until conditions satisfied

          Maybe this can't be accomplished without custom programming?

          Thanks

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

            __If I put every "n" ticks block under conditions, then it is not exposed to tick flow and does not count every tick. [/quote:3lxr2via]
            It is, while the condition is true. Then it stops.

            But there are also counters - a block that incremets itself every time when it is executed ("Count n, then pass" - if it is on the top, it actually count ticks and starts to pass after n ticks counted) and a block that can reset that counter by ID (you can reset it after Buy now/Sell now, so after a trade is placed - the counter starts to wait for n ticks again.

            1 Reply Last reply Reply Quote 0
            • T
              Trader3487 last edited by

              ok, thanks for that information. Based on that, I built this but something isn't working correctly: http://fxdreema.com/shared/aZn6u8Chc

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

                Block 27 - group is 0 (empty). In the other blocks it is 500.

                1 Reply Last reply Reply Quote 0
                • T
                  Trader3487 last edited by

                  good catch, thanks. It's working great now except... buy order should open on first tick (if no trade is running) but it doesn't. I removed all the conditions and still no luck: http://fxdreema.com/shared/e9c2qnaNb

                  Any ideas?

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

                    I don't know, on my backtester there are many buys. You are trying wrong EA file? 😏

                    1 Reply Last reply Reply Quote 0
                    • T
                      Trader3487 last edited by

                      I am also getting a lot of buys on my backtester but, based on the ea blocks, shouldn't there be a buy within the first bar if not the first few ticks? If no orders running, open buy position. Even if you take the conditions away, it doesn't open a buy order on the first tick.

                      1 Reply Last reply Reply Quote 0
                      • T
                        Trader3487 last edited by

                        figured it out... block #28 adjust value was too restrictive. Increased it to 0.0001 and now it's working as expected 🙂

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

                          I have it on the first tick. Even if I put the visual mode to pause (">>") a buy trade appears.

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

                          Online Users

                          V
                          C

                          14
                          Online

                          146.7k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors