fxDreema

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

    Profit trailing

    Questions & Answers
    3
    8
    3144
    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.
    • M
      MMaarits last edited by

      Hello,

      I want to set TP and SL manually and I would like that the algorithm will trail my profit and will do following:
      if price has reached 25% of TP level, move SL to 12% of TP level
      if price has reached 50% of TP level, move SL to 25% of TP level
      if price has reached 75% of TP level, move SL to 50% of TP level

      for example: I set manually TP level to 100pip. And if price reaches to 25 pip from the open price, then SL is moved to 12pip level. If the price reaches to 50 pip from the open price, then it moves SL to 25 pip. If price reaches 75 pip from the open price it moves SL to the 50 pip level.

      Could anyone help me to implement that logic?

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

        Try the trailing stop, it has all kinds of options, like trail by a % of profit or a % of TP

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        M 1 Reply Last reply Reply Quote 0
        • M
          MMaarits @roar last edited by

          @roar Thank You for the quick response!

          Unfortunately I did not find that option in trailing stop block.0_1550088270254_trailing stop profit.png

          I tried to do the following:
          Check distance between open price and TP and if it is 75% then modify SL to 50% etc. But it did not work.
          0_1550088588020_trailing profit.png

          roar 1 Reply Last reply Reply Quote 0
          • roar
            roar @MMaarits last edited by roar

            @mmaarits
            You have to use some kind of "trailing start", a treshold before applying the "% of profit" trailing, because 50% of 0 is 0, so it will not work at the open price.
            0_1550089512942_a3ff0acb-3aa1-4989-b99c-d8cbd1076e8c-image.png

            This trails 50% of profit, it does not have just 2 steps like in your example, it continuously adjusts the distance.

            @mmaarits said in Profit trailing:

            if price has reached 75% of TP level, move SL to 50% of TP level

            Why the 3rd step is not half of profit anymore? Do you need some exponential function, like the trailing stop gets thinner the closer the TP is?

            Need small help? Tag me in your post
            Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

            M 1 Reply Last reply Reply Quote 0
            • M
              MMaarits @roar last edited by MMaarits

              @roar Thank You again for the very quick reply!

              And I want also to thank You for the solution! It's great and helps me too!

              My idea is to protect profit and my initial idea was to do it with 3 steps. Those levels seemed valid.
              Profit levels description:
              12,5% level - to avoid loss
              25% level - minimum profit
              50% level - good profit
              TP level - excellent profit

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

                I tried to use "check distance" block, but it doesn't work also.0_1550147282839_trailing profit v2.png

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

                  This might be work (not tested)

                  0_1550305205541_66bc204c-7256-48a5-9801-d4767262b518-image.png

                  0_1550306117771_7b10b382-e3a0-4a9f-ad9f-4b02d9b33eb7-image.png

                  https://fxdreema.com/shared/ehY5VNLF

                  The project´s logic shoud be:

                  TrailingStopStep == 12.5
                  ProfitStep == 25
                  TrailStopEnabled == false

                  If no position exists -> Modify (TrailStopEnabled == true) && Reset values && Reset Counter

                  If position exists && TrailStopEnabled == true -> For each position -> If profit >= TP*(ProfitStep/100) --> Modify SL Level to (TrailingStopStep %) of current TP && Modify (TrailingStopStep *2, ProfitStep +25) && Counter == 1

                  That will be executed again for the new values of TrailingStopStep & ProfitStep.

                  When the Counter == 2, next time (3) the block passes && TrailStopEnabled == false disabling the TrailingStop and no other TS move is expected.

                  Hope this helps.

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

                    @josecortesllobat WOW! Thank You very much!!! I will test it tomorrow when the market is open.

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

                    Online Users

                    S
                    O
                    K
                    M
                    M

                    15
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors