fxDreema

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

    SL and trailing SL in the middle of the candlestick

    Questions & Answers
    3
    8
    1504
    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.
    • T
      TNS last edited by

      Hello,

      I am building and EA that opens a trade with a SL and adds a trailing SL to this trade. Here is the simple version of the EA: https://fxdreema.com/shared/2GfqteQ1e

      I want both the SL and the trailing SL to only activate at the closing of the last candlestick or the opening of the new candlestick, this is why I am using the 'once per bar' block. However, in the strategy tester I see that they activate when the SL price is reached, even if it is in the middle of the candlestick. Here is a screenshot: 0_1578074614687_example.JPG

      Why is this happening and what is the solution?

      Thank you.

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

        What you need is a new tree of blocks in wich you define those closing conditions and then you end up adding a 'close trades' block. Additionally you shouldn't use a SL price in your 'buy now' block.

        On the other hand, your trailing stop strategy cannot be implemented with that usual trailing block. You will need to create a new tree of conditions like this (look a 2nd pic):

        https://fxdreema.com/instructions/builder/trailing-stop

        (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
        • T
          trader.philipps @TNS last edited by

          @tns Looks like your spread is extremely high. Maybe you used current spread in tester and it is extremely high because of weekend? Just a guess.

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

          1 Reply Last reply Reply Quote 0
          • T
            TNS last edited by

            @l-andorrà Thank you for the reply.
            I have created a new tree of conditions following the example you sent to me but I do not think I can use this as a trailing SL because when I backtest it I see that the trailing SL is never activated. It actually trails the SL both upwards and downwards. Here is what i did: https://fxdreema.com/shared/VgSIeDYrd

            Also, I do not understand why you say that I should not use a SL price in the 'buy now' block, what is the problem with doing that? And why is the 'trailing stop' block not appropriate for my strategy?

            To clarify, the first EA that I had shared was doing what I wanted, the only problem was that it was not activating the SL at the correct timing...

            @trader-philipps Thanks for the suggestion. I am indeed using current spread in the tester but all these examples are not on weekend and it is in the EURUSD so i doubt the spread was that huge that many times...

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

              @tns I think this doesn't work with ATR as it is a price fraction.

              0_1578176427198_e0c591ef-b023-4e8c-a6cb-443b345a6fe9-image.png

              I use a custom mql block on the onInit tab to get the digits for pips multiplication like that ..

              0_1578176604243_56411bb6-94c2-408c-9874-20e1ca2db4c4-image.png

              where vd_to_pips_multi you would multipli the ATR result with.

              Maybe that function also works in a modify variables block. haven't tried, yet!

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

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

                @trader-philipps Ok, testet with modify variables block and works as well.

                0_1578177031772_13ca55c8-3e20-4935-bf01-5a3ff1fc9970-image.png

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

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

                  @trader-philipps Thank you, this is a good workaround but I do not think it provides a solution to what i want to do.

                  The problem I see with NOT using the block 'Trailing SL' and instead using the blocks: 'Pips away from SL' --> 'Modify Stops' is that it will modify the SL not only as a trailing SL that follows the price upwards, but it will also follow the price downwards...Also it does not have the 'trailing start' option that the 'Trailing SL' has.

                  This is why i would like to stick to the initial EA that I shared but I do not understand why the SL does not activate at the right timing. Maybe @fxDreema can explain?

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

                    @tns In that case you might calculate the SL value by yourself and compare if it's above (buy trade) your current SL and only modify the order if that is the case.

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

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

                    Online Users

                    A
                    G
                    Q
                    C
                    T
                    S
                    A
                    M
                    R
                    G

                    25
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors