fxDreema

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

    Limit number of BuyOrders through Counter Routine

    Questions & Answers
    2
    4
    737
    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.
    • H
      holygrailfx last edited by

      I want to know if the following setup would give the following result

      What I want to achieve:
      Each Time A certain trading condition is true the EA should buy once per bar. However the number of times the Buy should get executed is limited to 4
      So in other words the routine only adds maximum of 4 trades when the buy conditions are true, even if the condition stays true for many more bars
      When the market reverses it then resets the counter for the opposite trades, so when buy condition is true it reset the sellcounter

      Would this look like this in fxdreema magic?

      counterbuy.png

      ......
      counterbuy.png

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

        It doesn't look correct to me. You have this reset even before the counter. But what "market revrses" mean? And what should happen then with those Buy trades? Ok, it "resets for the opposite trades", but I don't see "Sell now" here or the opposite condition. But I don't think that counters are needed, they are very rarely needed.

        1 Reply Last reply Reply Quote 0
        • H
          holygrailfx last edited by

          Of course there is a similar routine on the sell side
          The counterreste is to reste the counter on the sellside

          Anyway Counter could be used (abused) like that, no?

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

            The idea of those counters is to count how many times the block runs. Optionally any counter can be reset, but the block to reset is normally located somewhere else, under another condition. You have the reset at the same place where the counter is, so the counter counts nothing.

            But I will suggest to not use counters, because their memory is temporary. It's much better if you use only conditions who check things about the trades - their type, count, profit or something like this.

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

            Online Users

            W
            A
            A
            E
            M
            5

            14
            Online

            146.8k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors