fxDreema

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

    Multiple Condition Trailing Stops

    Questions & Answers
    2
    14
    1999
    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.
    • C
      Chemdog last edited by Chemdog

      Would anybody know how I would go about making two separate trailing stops. Say I enter a position have my stop placed, then as soon as price goes into profit 100% from SL I step up 100% (my break even). Then for the second as soon as I got into profit another 200% I step up again 200%. And I only want to do this 1 time for each. Right now I have my stop loss start under my by block.

      T 1 Reply Last reply Reply Quote 0
      • T
        trader.philipps @Chemdog last edited by

        @chemdog It looks a bit overcomplicated. I see 2 issues:

        1. How do you know how many times you already stepped
        2. How do you know how much is 200% once you set to breakeven?

        For 1) you may come around if so is near or equal to open price.
        For 2) It's a bit complicated. Is it possible to re-calculate your initial SL? Maybe it's some kind of ATR multiplier or other indicator value?

        I like to share my knowledge, but expect the others to contribute as well.

        1 Reply Last reply Reply Quote 0
        • C
          Chemdog last edited by Chemdog

          @trader-philipps I'm thinking something like this may work. Basically I have a money management plan of only risking $100 per trade no matter the size of the bear candle it bases the trade off of. And with this info I can first do the normal break even stop. Then after I can check my unrealized profit to see if im 300% in Profit. Then go ahead and modify the stop again to say lock in 2:1.
          https://fxdreema.com/shared/k5OGAOlU
          0_1569333225307_v.24.mq4

          So from the last time you helped me I removed the targetlevel variable and any take profits for now. But for some reason its taking the position off at a 2:1. I've gone through but couldn't find why its doing this. i'm going to have different exit conditions for my take profit in the future. My questions are how I could get the EA to stop taking profit at 2:1 and if my logic for trailing stops looks ok? 😄

          1 Reply Last reply Reply Quote 0
          • T
            trader.philipps last edited by

            @Chemdog I think you are facing exactly the issue that I previously described in point 2)

            Let's assume your SL is 10 pips.
            Once your BE condition is met, your Sl will be something like 0 pips from open price.
            Next time EA wants to adjust SL it takes 200% of 0 pips as it doesn't know the initial SL.

            Do you understand now what I meant?

            I like to share my knowledge, but expect the others to contribute as well.

            1 Reply Last reply Reply Quote 0
            • C
              Chemdog last edited by

              @trader-philipps Ah yes. So do you think once i've changed my stop to break even I could loop back to find the bear candles data, get its original stop and modify it from there once im up a certain %? or no because i've already moved it to break even? if not I may take a more conventional way of doing this 😄

              T 1 Reply Last reply Reply Quote 0
              • T
                trader.philipps @Chemdog last edited by

                @chemdog You may try to re-calculate the initial SL. That would be the most precise method.
                If you have a TP set based on initial SL you may use that in order to re-calculate the initial SL.

                I like to share my knowledge, but expect the others to contribute as well.

                1 Reply Last reply Reply Quote 0
                • C
                  Chemdog last edited by

                  @trader-philipps thank you, i'll do what I can.

                  1 Reply Last reply Reply Quote 0
                  • C
                    Chemdog last edited by

                    So I was able to get this to work 🙂

                    https://fxdreema.com/shared/AFRtuZnYb

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      trader.philipps @Chemdog last edited by

                      @chemdog Cool! If profit in money is sufficient for you. The other way would be to re-calculate the initial SL.

                      I like to share my knowledge, but expect the others to contribute as well.

                      1 Reply Last reply Reply Quote 0
                      • C
                        Chemdog last edited by Chemdog

                        @trader-philipps Yea profit in money was the only way to I could change it up easily.
                        I'm not sure I could have re-calculated the initial SL based on a take profit because my
                        take profit is the first bear candle to close after ive got 300 in profit. But with my knowledge
                        level I don't think my brain could muster up what that would look like xD but this is fun
                        and im sure ill get there.

                        T 1 Reply Last reply Reply Quote 0
                        • T
                          trader.philipps @Chemdog last edited by

                          @chemdog So how do you specifiy your initial SL? I use similar calculation in one of my projects.

                          0_1569429773073_2c2a63e0-2a3c-4823-8e0e-32e755a6eb53-image.png

                          This custom MQL code wil store the bar when the trade was opened (vi_order_bar ist my integer variable I specified in fxdreema).

                          Once you know the candle ID you may be able to re-calculate the SL valid for that candle.

                          I like to share my knowledge, but expect the others to contribute as well.

                          1 Reply Last reply Reply Quote 0
                          • C
                            Chemdog last edited by Chemdog

                            @trader-philipps By looping back to the most relevant bear candle to be broken out over storing that candles information and using its low as my SL.
                            Ah so when you first told me I could re-calculate the SL I did try to get the bear candles ID/Info and
                            re-calculate the stop once I hit a certain % of profit but I think I must have failed somewhere getting its
                            data and re-calculating its SL. Which I think is what you are showing me now.

                            T 1 Reply Last reply Reply Quote 0
                            • T
                              trader.philipps @Chemdog last edited by

                              @chemdog Yes. The code calculates the candle I'd when the trade was opened. With this value you can do the same calculation like you did before entering the trade. Just use different candle id .. start is open order candle + 1 and open order candle + whatever you took for look back.
                              Or in other words you do the same SL calculation just candle ids are shifted.

                              I like to share my knowledge, but expect the others to contribute as well.

                              1 Reply Last reply Reply Quote 0
                              • C
                                Chemdog last edited by Chemdog

                                @trader-philipps thanks, going to try this out.

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

                                Online Users

                                N
                                S
                                E
                                H
                                E
                                S
                                A
                                T
                                A
                                A
                                M
                                A
                                M

                                28
                                Online

                                146.7k
                                Users

                                22.4k
                                Topics

                                122.6k
                                Posts

                                Powered by NodeBB Forums | Contributors