fxDreema

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

    how i can close first trade when third trade opened

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

      how i can close first trade when third trade opened?

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

        You need to explain more about what when and why you want this to happen, there are many options to achieve this.

        Learn fxDreema Without the Wait!

        My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

        The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

        Don’t miss out

        Click here➡️ https://mybook.to/fxDreema to get your copy today!

        Enjoy! 😊

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

          ticket=1 buy position opened
          ticket=2 sell position opened
          ticket=3 buy position opened
          ticket=4 sell position opened
          ticket=5 buy position opened
          ticket=6 sell position opened
          ticket=7 buy position opened
          ticket=8 sell position opened

          when open 3,close 1
          when open 4, close 2
          when open 5,close 3
          when open 6, close 4

          1 Reply Last reply Reply Quote 0
          • M
            Mitchp last edited by Mitchp

            Maybe you can use loop.

            "For each position"

            Loop direction: Oldest to newest
            Not more than "n" trades: 1

            Then link it to a "Close positions" block.

            Put the loop after your Buy and Sell block, then every time a position is opened it should theoretically close the oldest position.

            And since you want it separate for buys and sells, you create 2 of these identical loops and connect one to Buy block and one to Sell block. Also filter each loop by type for Buys or Sells.

            I hope this works for you.

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

              Or use the for each trade, get the open time in seconds after 1970, then use this to close by time value.

              Learn fxDreema Without the Wait!

              My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

              The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

              Don’t miss out

              Click here➡️ https://mybook.to/fxDreema to get your copy today!

              Enjoy! 😊

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

              Online Users

              D
              E
              N
              N
              F
              M
              A
              L
              O

              25
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors