fxDreema

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

    Help on Trailing stop block appreciated (SOLVED)

    Questions & Answers
    4
    28
    4877
    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.
    • l'andorrà
      l'andorrà last edited by l'andorrà

      I know it can be done but I'm afraid I'm so stuck I can't simply see it before me. I want to specify a trailing stop equivalent to a percentage of open price. Then the trailing step will be a different percentage of that same open price. This second part I can do but I can't see how to implement the first one considering the options available in the block.

      Let me put a numerical example. Let's imagine I choose the TS to be triggered at an accumulative 11% of open price and then the trailing step is specified as a 4% of open price. This means that when price hits 11% of open price in profit SL is moved to 4% of open price. When price hits 22% then SL is moved to 8% of open price and so on. Considering that 4 is a 36.6% of 11, this is the trailing step to be inserted here:

      0_1579100398899_00.png

      What I can't find is how to insert the first percentage as a price level, price fraction, pips or something else.

      Any help will be much appreciated.

      (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

      (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

      (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

      T 1 Reply Last reply Reply Quote 0
      • T
        trader.philipps @l'andorrà last edited by

        @l-andorrà Don't know if I get the issue right, but I'd start like that

        0_1579102445779_5c716cf9-c332-485d-8d30-224f7745f8b7-image.png

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

        1 Reply Last reply Reply Quote 0
        • l'andorrà
          l'andorrà last edited by

          Didn't consider that option. I'll try it. Thank you.

          (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

          (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

          (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

          T 1 Reply Last reply Reply Quote 0
          • T
            trader.philipps @l'andorrà last edited by

            @l-andorrà Let me know if it works.

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

            1 Reply Last reply Reply Quote 0
            • l'andorrà
              l'andorrà last edited by

              I'm afraid it doesn't work. The first move is done correctly. The first stop is moved at 4% when 11% is hit. However, 11+4 = 15. so when price hits 15% of open price a new move of SL is done when I need it to be a 22% (11+11).

              Any other hint? 😕

              (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

              (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

              (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

              T 1 Reply Last reply Reply Quote 0
              • T
                trader.philipps @l'andorrà last edited by

                @l-andorrà So your trailing step is wrong?

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

                1 Reply Last reply Reply Quote 0
                • l'andorrà
                  l'andorrà last edited by

                  No, the trailing step is correct. The problem is that the trailing stop should be applied to specific % levels (11, 22, 33, etc.) and not as soon as the SL has moved. Your configuration will look for an 11% profit as soon as the SL was moved to the 4% level whereas I need the TS to be triggered at those concrete levels.

                  (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                  (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                  (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                  1 Reply Last reply Reply Quote 0
                  • l'andorrà
                    l'andorrà last edited by

                    I see there is a nice option called 'Multiple levels'. Apparently that is exactly what I need but it can only be selected in pips. What kind of loop inside the 'For each trade' loop should I create to 1) transform the initial percentages into pips, 2) referred to each open price, 3) to be inserted as a string variable into that box?

                    I pray for it to be feasible without custom code blocks. Otherwise I'm doomed. 😞

                    (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                    (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                    (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      trader.philipps @l'andorrà last edited by

                      @l-andorrà You lost me as you haven't shared your project ;-))

                      However, as far as I understood calculate the first 11 % in pips and than multiply it?!? If you need to multiply a pricefragment to Pips you may try this function MathPow(10,_Digits-1) as an multiplicator.

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

                      1 Reply Last reply Reply Quote 0
                      • l'andorrà
                        l'andorrà last edited by

                        You're right, sorry :D. Here it is:

                        https://fxdreema.com/shared/ZPUTG3aKb

                        This is for buys only. This is what I do:

                        1. Trail percentage and trail step are inserted as input parameters as decimal numbers (11 and 4 for example).
                        2. Both percentages are translated into fraction numbers (in this example 0.11 and 0.04)
                        3. Then they are used in that loop inside a loop structure.

                        The loop below the buy block is designed to visualize all trailing triggers ans trail steps. None of them is visualized.

                        The loop below 'For each trade' is supposed to do the job. It doesn't. I'm still struggling with loops. I guess the solution is there but I can't see it right now. Any hint?

                        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                        T 1 Reply Last reply Reply Quote 0
                        • T
                          trader.philipps @l'andorrà last edited by trader.philipps

                          @l-andorrà okay, tried to understand your approach, but my brain didn't make it in the end.
                          May you please repeat the price levels when the stop should be modified and at what distance?

                          EDIT
                          After reflecting once more, I still don't understand why you can't use the regular traling stop as the values are variable per trade, but the basis is static as it's the open price.

                          Example: My asset has the price of 100 USD and I'm in a Buy trade. My trailing starts at 11% profit and SL is set to 4% of open price.

                          1. Adjustment - at 111 USD -> SL 104
                          2. Adjustment - at 122 USD -> SL 108
                          3. Adjustment - at 133 USD -> SL 112

                          If that is what you want to achieve, all input values such as start, step and stop are static for the trade, right?

                          With static values and assuming that the 1 pip is 1 point, it would look like that, right?
                          0_1579350083444_c75c5096-c67d-4dc1-820a-63b4f0dc37ae-image.png

                          If that is still right I think your mistake is in calculating the price percentage as pips. But let's do one step after the other.

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

                          l'andorrà 1 Reply Last reply Reply Quote 0
                          • J
                            josecortesllobat last edited by josecortesllobat

                            I would suggest to calculate the trailing step beforehand.

                            This could be a starting point for a long trade.

                            OpenPrice = 1.00000 (get the openprice as a variable)
                            PointSize = 0.0001 (get this value from the market properties)
                            PercentToMove = 11%
                            TrailStepPercent = 4%
                            TrailStopLevel

                            PriceToMoveStopLoss = OpenPrice + PercentToMove = 1.00000 + 1.00000*(11/100) = 1.11
                            PipsToMoveStopLoss = (PriceToMoveStopLoss - OpenPrice)/PointSize = (1.11000 - 1.00000)/0.0001 = 1100
                            TrailStepPips = PipsToMoveStopLoss x TrailStepPercent = 1100 x (4/100) = 44
                            TrailStopLevel = StopLossLevel + TrailStepPips (as a price fraction)

                            If Price (Ask, Mid, Bid) >= PriceToMoveStopLoss -> {Move stop loss to (SL + TrailStepPips as price fraction) AND Modify [PercentToMove = PercentToMove x 2 (or +11) AND TrailStepPercent = TrailStepPercent x 2 (or +4)]}

                            As a project, something like

                            0_1579349801882_bfebdd67-5a4f-425c-b329-e9ce812472cd-image.png

                            It does not look very polite but it can be improved.

                            Don´t forget to reset variables to initial point when a new trade opens.

                            Hope this might help a few.

                            l'andorrà 1 Reply Last reply Reply Quote 0
                            • l'andorrà
                              l'andorrà last edited by

                              Thank you to both of you. Let me study your suggestions in detail and I will be back with my results.

                              (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                              (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                              (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                              1 Reply Last reply Reply Quote 0
                              • l'andorrà
                                l'andorrà @trader.philipps last edited by

                                @trader-philipps I tried as per your first post above and I confirm it doesn't work. For a reason I don't understand the stop moves before hitting the first level. 😞 Let me show my last backtest example. I tried GBPJPY qith a 4% trailing stop and a 1% trailing step.

                                The open price for a buy was 131.094. This means that:
                                a) Trailing stop = 131.094 x 1.04 = 136.338.
                                b) Once the previous price is hit the trailing step should move the stop to: 131.094 x 1.01 = 132.405.

                                Well, because of weird calculation made by the block, the stop moved when price reached 135.300, far before it should.

                                On your second suggestion, yes, I need static values. The problem is finding the equivalent of pips or price levels from the initial percentages and then 'translate' them into the trailing stop block.

                                (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                                (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                                (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                                1 Reply Last reply Reply Quote 0
                                • l'andorrà
                                  l'andorrà @josecortesllobat last edited by l'andorrà

                                  @josecortesllobat Your suggestion is apparently very close to what I need. However, I see two problems. The first one is this formula

                                  TrailStepPips = PipsToMoveStopLoss x TrailStepPercent = 1100 x (4/100) = 44

                                  If you read my first post, the trailing step is a % of the ope price too. This means the formula should be:

                                  TrailStepPips = OpenPrice x TrailStepPercent = 1.00000 x (4/100) = 0.04.

                                  Then I don't understand the following one:

                                  TrailStopLevel = StopLossLevel + TrailStepPips (as a price fraction). Is StopLossLevel the initial SL? And how TrailStepPips (as a price fraction) is affected by the new result 0.04?

                                  The second problem is your loop. Those calculations before the 'For each trade' block will not be updated for all open trades, but on a tick on tick basis. If I have 3 open trades, all of them will have to have their specific TrailStopLevel value, for example. In your structure, if I understand it correctly, that cannot happen as those calculations will be applied before eavary trade is searched for.

                                  (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                                  (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                                  (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                                  roar 1 Reply Last reply Reply Quote 0
                                  • roar
                                    roar @l'andorrà last edited by roar

                                    @l-andorrà I have a feeling this is unnecessarily complicated approach 😄
                                    Why doesn't "% of profit" work as a solution?
                                    What do you mean by "11% of open price", isn't that like EURUSD crashes to 0.1234 ?
                                    0_1579452288615_32acadd5-4776-43ee-9534-926f3d47f370-image.png

                                    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

                                    l'andorrà 1 Reply Last reply Reply Quote 0
                                    • l'andorrà
                                      l'andorrà @roar last edited by l'andorrà

                                      @roar said in Help on Trailing stop block appreciated:

                                      @l-andorrà I have a feeling this is unnecessarily complicated approach 😄
                                      Why doesn't "% of profit" work as a solution?
                                      What do you mean by "11% of open price", isn't that like EURUSD crashes to 0.1234 ?
                                      0_1579452288615_32acadd5-4776-43ee-9534-926f3d47f370-image.png

                                      That option doesn't work because that % is static on the block (something I want) but is linking the current price to the open price (something i do NOT want). Is that same option was available for the current SL level instead of the open price that would do the trick. Additionally it is calculated as money (profit), and not pips or price level. Why transforming the initial % into money first and then put them here? Double effort worthless, I'm afraid. 😞

                                      On the other hand, when I say '% of open price' I mean exactly that, an percentage applied to the open price that is added (for buys) or substracted (for sells) in order to get the trigger for the TS to move up/down to the trail step.

                                      (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                                      (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                                      (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                                      T 1 Reply Last reply Reply Quote 0
                                      • T
                                        trader.philipps @l'andorrà last edited by

                                        @l-andorrà Did I get you right that you want for 2and adjustment the same value percent of the current SL as pricefraction for the 3rd adjustment and so on for all next?
                                        As I asked before, please have an example for understanding what you try to achieve!

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

                                        1 Reply Last reply Reply Quote 0
                                        • l'andorrà
                                          l'andorrà last edited by l'andorrà

                                          Ok, I will detail a concrete example.

                                          1. Initial conditions: TS trigger every 4% and TS step at 1% of open price. Both percentages are input parameters, so they can different every time the EA is run.

                                          2. Sell trade at 1.12320

                                          3. This means that 1.12320 x (4/100) = 0.04493. So when price hits the following levels:
                                            a) 1.12320 - (0.04493 x 1) = 1.07827
                                            b) 1.12320 - (0.04493 x 2) = 1.03334
                                            c) 1.12320 - (0.04493 x 3) = 0.98842
                                            d) 1.12320 - (0.04493 x 4) = 0.94349
                                            e) ...and so on the TS is to be moved.

                                          1. SL is moved according to the input parameter: 1.12320 x (1/100) = 0.01123. This means it is moved to the following price levels:

                                            a) 1.12320 - (0.01123 x 1) = 1.07827
                                            b) 1.12320 - (0.01123 x 2) = 1.03334
                                            c) 1.12320 - (0.01123 x 3) = 0.98842
                                            d) 1.12320 - (0.01123 x 4) = 0.94349
                                            e) ...and so on.

                                          And this is to be calculated for all open trades (up to 10 open trades at the same time).

                                          I hope it is more clear now.

                                          (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                                          (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                                          (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                                          T 1 Reply Last reply Reply Quote 0
                                          • T
                                            trader.philipps @l'andorrà last edited by

                                            @l-andorrà Besides that the SL prices are wrong in calculation I think I got what you try to do. And I still believe that you can do this with the standard trailing block.

                                            Even if the inputs are variable depending on open price, trailing start trailing step and trailing stop are static from there on, right?

                                            In your case if I get it right it's
                                            trailing start: 0.04493
                                            trailing step: 0.04493
                                            trailing stop: 0.01123

                                            Is that correct? In that case you just need to calculate those values and place the variables in the input fields. Maybe you need to transfer in Pips using the MathPow(10,_Digits-1); multiplicator. Or if possible use the price fraction.

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

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

                                            Online Users

                                            2
                                            M
                                            M
                                            N
                                            B
                                            A
                                            B
                                            S
                                            E
                                            W
                                            M
                                            M

                                            30
                                            Online

                                            146.6k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors