fxDreema

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

    doubt with "for each closed trade" and with "loop (pass" n "times)"

    Questions & Answers
    3
    5
    732
    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
      esteban_d last edited by esteban_d

      Hi guys, I have a question with these operators: In my EA, there is a loop that I want to repeat exactly 3 times. For this I have tried these two operators, but I find that the loop never stops executing, it does not stop at number 3 but continues until I stop it manually. I have used the operators the way I teach you in the images. I have also thought that if I removed the loop from "on tick" and put it in "on trade" it might fix the fact that it does not repeat permanently, but I don't know if this makes sense.

      Lastly, I thought about repeating the loop and its operators 3 times in the layout, that way I would fix it but it wouldn't seem like a clean job to me and I would add a lot of unnecessary code to my EA.

      Anyway, I hope you can help me, thank you very much.

      All the best

      ![alt text](0_1623145904829_each closed trade.png image url)0_1623145908653_loop pass n times.png

      Q 1 Reply Last reply Reply Quote 0
      • Q
        q8carpenter @esteban_d last edited by

        @esteban_d Hello,

        I would use the (Counter: pass 'n' times) block and i would place it after block 5 probably. that would make sure that this loop will pass 3 times only. In this case you can also reset this counter if you want. I don't remember ever using the (Loop: pass 'n' times) block, but my assumption is that you may also need to place it after block 5.

        I hope this works 🙂

        1 Reply Last reply Reply Quote 0
        • D
          diazoviedo last edited by

          0_1623190484135_908571c7-49a9-40f2-97e2-756428ac0456-image.png
          You don´t need to use the block Loop because For each Close Trade is a looping block, so this block loops through all trades that matches the filter settings. So if you want to catch the last 3 trades just put the number in Not More Tahn n history trades, Try...

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

            @q8carpenter @diazoviedo I'm going to try those two options to see what happens, I'll tell you about it, thank you very much

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

              Resolved using "Counter: pass 'n' times". Thank you again for answers!

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

              Online Users

              A
              J
              D
              E

              36
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors