fxDreema

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

    Halving an order after x amount of pips, until complete closure

    Questions & Answers
    3
    4
    673
    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.
    • Alex81
      Alex81 last edited by

      I am developing a bot for investment, so with an average trade os several days, even weeks.
      After putting a decent trailing stop, I am trying to close partially after an amount of pips, until complete closure of the trade: f.e. close 25% of the trade after every 50 pips, so after 200 pips trade is totally close.
      But I am only getting a single exit, whatever amount % I put.
      Here my snippet:
      0_1639431393397_4fbd9e4a-1fb8-4ccb-b603-9c7871da45fb-image.png

      Any suggestion?

      The only edge on the market is to lose less than you win...

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

        @alex81 Use separate pink trees for each pipa away, 1st tree 50 pips away close 25%, 2nd tree 100 pips away close ?%,3rd tree 150 pips away close ?%, 4th tree 200 pips away close all. The problem is % to close will be different for all trees to ensure it closes a quarter of the trade every time.

        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! 😊

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

          Go to the Examples and find one that is called Partially Close (every 10 pips)

          I don't recommend using "once per trade/order", because it uses temporary memory. When you remove the EA, the memory is gone. Better try to understand this "Open Price belongs to..." option. Imagine the first trade (the parent) and the following remains of it (children) and work with that.

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

            @jstap I thought this solution too, but I hoped there could be a more elegant and simpler way...

            @fxDreema the Example is exactly what I did. What do you mean with " try to understand this "Open Price belongs to..." option"?

            The only edge on the market is to lose less than you win...

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

            Online Users

            R
            F
            S
            D
            V

            23
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors