fxDreema

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

    Number of trades

    Questions & Answers
    2
    6
    2688
    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.
    • J
      juxta14 last edited by

      I need help with limiting the number of trades EA can place within a certain condition.
      Example say buy condition is met and I want EA to place trade once every bar. Normally when buy condition is met the conditions remain for like the next ten bars. How do I limit the number of trades to place to only the first 3 bars, also each trade placed closes at the end of each bar? After first 3 bars I don't want EA to place any more trades until the sell condition is met. Then EA will now start placing trades again for only the first 3 bars.

      Thanks.

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

        "Once per bar" (just before Buy now/Sell now) will allow only 1 trade per bar, but it can't count 3 bars. Then, maybe you can have "Check trades count" to limit the number of trades to 3 at a time.
        There are other ways, it depends. Like, there are few block in a category named "Counters".

        1 Reply Last reply Reply Quote 0
        • J
          juxta14 last edited by

          Thanks for your response. I have tried a lot of options and to no avail.
          I tried the "check trades count" and I observed it is only good to limit the active trades which is fine but not what I want, because my trades will be closed at the close of each bar.

          Again what I need is: for example when buy condition is met,
          EA will place the first buy trade at the open of the first bar with conditions met.
          This trade will close at the close of that bar.
          If the first trade closed in profit then EA will stop trading on the buy side and then wait for the first sell signal on the sell side.
          If the first trade closed in a loss then EA will place a second trade at the open of the second bar with buy conditions met.
          This second trade will be the last trade for the buy side it does not matter the out come whether profit or loss, EA will no longer trade buy signal again but repeat the same process on the sell side.
          After which it will come back again to the buy side and repeat again.

          Please see the map, it's how far I got before getting lost so please help correct.
          https://fxdreema.com/shared/ZZhAem9ub

          Thanks

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

            So, each trade has it's own role in the game and there is something like stages. In this case I am thinkig about the Group number. The first trade can have number 1, the second trade can have number 2. Then in any time you will be able to check the Group number of the last closed trade.

            About the stages. One way is to set the current stage as a value in a variable. If the variable is numeric, then let's say that stage 1 will be described with value 1, stage 2 will be value of 2 and so on. The downside of this is that Variables are something temporary and in case the EA is closed, they are gone.

            Another way is by usinf this feature https://fxdreema.com/demo/mt4-wait-crossovers These blocks with the blue border are something like stages. Each one of them will wait until it passes. This can be used if the logic can reach the last point and start again from the top

            1 Reply Last reply Reply Quote 0
            • J
              juxta14 last edited by

              Great, you've given me some hints. I'll try again and get back to you later.

              Thanks.

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

                Hopefully these hints will help. Because to be honest, what you are trying to do is too twisted for my weak lazy brain 🙂

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

                Online Users

                M
                A

                11
                Online

                146.8k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors