fxDreema

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

    Break even for a group of trades

    Questions & Answers
    3
    34
    15322
    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
      ClauTrade last edited by

      Hallo,

      I have not find the info....

      Need to set a BE for a group of trades! ... block like a mix between the "trailing stop for a group of trades" and "break even each trade"?

      Of course I can set the close with "profit < zero" but I prefer to set a real SL in the broker.

      Thanks. Regards! 🙂

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

        I will probably not make such a block, but you can try with the trailing stop block. As you know, BE is similar to TS (trailing stop) and the regular TS block can be set to work as BE.

        I think it was something like this. Set "Start" to the profit where SL must be modified. For example 10 pips. Set "Stop" to the same value. Set "Step" to some big value. Something like this: https://fxdreema.com/shared/dfaqAlMpc

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

          Yes... this will solve the problem! Good idea! Thanks. 😉

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

            I have configured this setting for a BE and trainling stop for a group of trades,separating buys from sells, but it is not making a thing.
            According to what I understood, my settings are that if a group of buy trades from the same pair, achieves 20 pips in profit, it moves all stops to the value that gets a break even for all trades.

            It confuses me how to use "trail stop mode" and "trail step is". But still with this configuration I was expectig stops moved to BE value of all buys of that pair basket. In my demo have 7 trades with 110 pips profit in total, but no single SL has moved.

            Have same settings for strailing stop for a group of trades for sells.

            By the way, the block "if trade" is first connected to a "break even each trade", so that it sets the BE for each trade after few pips. Then it is connected to "trailing stop group of trades" which is intended to move all SL after the overall profit of the group trades of this pair has reached X amount of pips. So, this way I make my initial trades safer by moving them to BE.

            Attached an image.

            Thanks for your help.

            __I will probably not make such a block, but you can try with the trailing stop block. As you know, BE is similar to TS (trailing stop) and the regular TS block can be set to work as BE.

            I think it was something like this. Set "Start" to the profit where SL must be modified. For example 10 pips. Set "Stop" to the same value. Set "Step" to some big value. Something like this: https://fxdreema.com/shared/dfaqAlMpc[/quote:48p2wjao]

            ......
            trailstop.jpg

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

              "If trade" will probably speed up the backtest when there are no trades at all, nothining more. Each of the following blocks internally iterates through all available trades at the moment, which means that if there are no trades, nothing will happen (and because of that "If trade" is not necesarry).

              When many of these blocks are used, who knows what is going to happen. I don't understand these values - 2500 and 5000 - this is probably not for something like EURUSD.

              Otherwise here is how the trailing stop works - viewtopic.php?f=2&t=3330&p=10795#p10785

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

                Quite franqly I didn't get your answer.

                Those values are for CFD. But anyways I don't believe what pair you use it on, as an EA can be universal. Still changed those values setting "trailstop mode" to something less than "trail start".

                Anyways, have been playing with multiple connections and ways to do this, but none has worked out. What I need to do with my multiple attempts is this:

                • When have 1 trade, have its SL at 20 pips value. Then move it to BE + 1 when 15 pips in profit.
                • When a second trade or more kicks in in same direction and same pair, have a TrailStop and BE for the whole basket (group of trades). Having that BE when the basket profit is 20 pips, and trail in 15 pip increments.

                Thanks for your help

                __"If trade" will probably speed up the backtest when there are no trades at all, nothining more. Each of the following blocks internally iterates through all available trades at the moment, which means that if there are no trades, nothing will happen (and because of that "If trade" is not necesarry).

                When many of these blocks are used, who knows what is going to happen. I don't understand these values - 2500 and 5000 - this is probably not for something like EURUSD.

                Otherwise here is how the trailing stop works - viewtopic.php?f=2&t=3330&p=10795#p10785[/quote:4u94vasu]

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

                  I think you are missing something important here - each of these blocks will run on every tick. You probably think that block 21 must finish it's work before going to block 22, but this is not the case. Blocks 21, 22 and 23 always pass, even if there is no trade at all.

                  Trailing Stop is the distance of the SL relative to the current price.
                  Trailing Step is how often to move SL. This value is normally much lower than Trailing Stop.
                  Trailing Start is the profit that the trade must make before doing something with it's SL. This is distance relative to the Open Price of the trade. If the price is above this level, then SL can move, otherwise not.

                  Again, no block waits for other block to do it's job. Especially these blocks, they pass every time even if they did nothing at all. Inside each of them there is a loop that iterates through all trades and moves (or not) their SL. There blocks does not communicate. Each of them is doing it's job and does not care what is connected after

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

                    Still having problems to understand how to set this up. Sorry.

                    For simplicity, how can I set up a single BE and Trail stop that applies to one or multiple trades in the same group?

                    One that sets a SL of 20 pips, for all open trades (either 1 or multiple)
                    That moves all the stops to BE +1, when all open trades in the group are in profit of +20
                    When reaching 50 pips of profit from all trades in the group, trail stop, that only allows 30% drawdown from the maximum profit.

                    Of course, when a new trade kicks in, everything gets calculated again.

                    Thanks FxDreema

                    __I think you are missing something important here - each of these blocks will run on every tick. You probably think that block 21 must finish it's work before going to block 22, but this is not the case. Blocks 21, 22 and 23 always pass, even if there is no trade at all.

                    Trailing Stop is the distance of the SL relative to the current price.
                    Trailing Step is how often to move SL. This value is normally much lower than Trailing Stop.
                    Trailing Start is the profit that the trade must make before doing something with it's SL. This is distance relative to the Open Price of the trade. If the price is above this level, then SL can move, otherwise not.

                    Again, no block waits for other block to do it's job. Especially these blocks, they pass every time even if they did nothing at all. Inside each of them there is a loop that iterates through all trades and moves (or not) their SL. There blocks does not communicate. Each of them is doing it's job and does not care what is connected after[/quote:1fc7whih]

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

                      Aaa, you are working with groups. Or not? You know... I will suggest to try one block at a time and play with it. Even I don't know what to expect from these 3 blocks when they work together

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

                        What I don't like in the screenshot is the size of Step. I said this before, but Step is normally lower than Stop. It can be bigger of course, but the you don't have normal Trailing anymore.

                        I also said that Trailing Stop block can be used to make it work as Break Even. I think the configuration was something like this - Step is some giant value that never will be reached, Start is the profit that must be reached, Stop is equal to Start (or lower). Like this - https://fxdreema.com/shared/gaJnbwWY
                        It looks a little bit like this in the screenshot and because of that I giess that you have some SL movements that look like break even, but not real trailing stop frequent movements. Again, this is because of the Step size.

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

                          Been studying and playing around with this, but still lots of confusions. My system is now all depending on the SL and BE, and really need your input here so I can move forward.

                          Look at what I have configured so far. Attached link.

                          https://fxdreema.com/shared/No9MkdlWb

                          The explanation of what I pretend it to do is this. (please dont mind about decimals, as my broker uses this big numbers for CFD):

                          • If I have open trades, check the number of open trades.
                          • If open trades are less than 3, then each of the trades will move to BE when profit of each is over 90 points.
                          • If have 3 or more open trades, it will move to BE the whole basket when 2000 pips (sum of all trades) in profit.
                          • If have more than 5000 points on profit, start trailing stop at 30%.

                          What I see so far is this:

                          • None of the trades move to BE when reaching over 90 in profit.
                          • Some times it moves SL of the basket to BE, but not when reaching over 2000, even way over that, 2 or 3 times fold, and do not move them to BE stop. Haven't got when it is moving that BE when it does.
                          • At the top of my EA, it checks for time. I have a link to close all open and pending trades when time is not in my trading hours, but this is not closing anything at all.

                          Can you please check this and help? Maybe there are some other avenues to do what I want.

                          Many thanks again

                          __What I don't like in the screenshot is the size of Step. I said this before, but Step is normally lower than Stop. It can be bigger of course, but the you don't have normal Trailing anymore.

                          I also said that Trailing Stop block can be used to make it work as Break Even. I think the configuration was something like this - Step is some giant value that never will be reached, Start is the profit that must be reached, Stop is equal to Start (or lower). Like this - https://fxdreema.com/shared/gaJnbwWY
                          It looks a little bit like this in the screenshot and because of that I giess that you have some SL movements that look like break even, but not real trailing stop frequent movements. Again, this is because of the Step size.[/quote:3fmzsy8o]

                          1 Reply Last reply Reply Quote -1
                          • fxDreema
                            fxDreema last edited by

                            I noticed this:
                            http://prntscr.com/b3d05f
                            http://img.prntscr.com/img?url=http://i.imgur.com/AaVvqVw.png

                            And the same thing in other blocks. You have set Group to 1 and 2 in some blocks, but in other it's the default 0 (empty value means 0). If you decide to work with groups, it is very important to put that number in all trading blocks - from No trade to Buy/Sell now. Otherwise weird things happen. In my case, I tried this EA and it started to open trade after trade. What BE and what TS can we do in this case... But why using Group, you can separate Buys from Sells by their type only.

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

                              But before all, there is a TP at 100 pips.

                              I think there might be a problem with saving block's properties. I think I noticed that sometimes if I update a block, it doesn't really update, or something like this. This will explain why Group numbers are different everywhere. Can you confirm this?

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

                                Another issue. You have "No trade/order" before buying and selling. Max 1 Buy and 1 Sell, or 2 trades. There are no groups in this case. I think you are showing me the wrong project 😕

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

                                  Thanks for your input.
                                  I have eliminated the group numbers in the blocks. Let's see how it behaves.
                                  As per "No trade/order" before buying and selling. Max 1 Buy and 1 Sell, or 2 trades."... yes this is part of the project for simplicity. I have a set of conditions after "No trade/order" and before buys and sells. My trades are openning well accordingly, my issue being the SL, BE and trail.

                                  Other than that, connections for SL, BE and trail are correct? Will let you know how it works after eliminating group codes and going only by type (buy or sell).

                                  What is your observation on why the trades are not closing when time is out of time filter?

                                  Thanks a lot

                                  __Another issue. You have "No trade/order" before buying and selling. Max 1 Buy and 1 Sell, or 2 trades. There are no groups in this case. I think you are showing me the wrong project 😕[/quote:2mey2yoz]

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

                                    Time filter is working, I just tested it - the yellow output passes between 22:00 and 01:00. The other 3 blocks looks fine. I did my test and my trade is closing as expected.

                                    Here is my example of working with BE and TS at the same time. It's important for TS to not interfere with BE, that's why I'm using Start that is bigger than the point at which BE moves SL. You want TS to be working after BE does it's job, right?

                                    https://fxdreema.com/shared/F5FBQ3avc
                                    http://i.imgur.com/fxs9bI6.png

                                    You can see I start without SL. Then at certain point (30 pips in profit) BE moves SL to 1.08716, which is exactly the Open Price. In Visual mode I am able to see that modification.
                                    The next modification is by TS. When 50 pips of profit are reached, SL is set 30 pips below Ask at that time, which is 20 pips above the Open Price. 1.08916 is exactly 20 pips above the Open Price. I mean, for EURUSD. Sorry, I am not very used to CFD and all that kind of stuff.
                                    After that SL is moving in about 1 pips steps, because my Step is 1 pips.

                                    But because you are working with instrument that has... I don't know how many digits, make sure that everything is right with the pips amount. Open some trade with SL of 100 pips (for example) and measure if the real SL is something that you can describe as 100 pips. Otherwise you can tune this thing in the options - the bench icon on the upper right corner. This is another topic, but I'm just saying.

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

                                      If you have 2 or more trades, then TS keeps their SL the same. 30 pips below Ask for each trade. Lot sizes does not matter.

                                      If you want to move SL depending on the group profit of all trades, which depends on their lot sizes - then there is another type of TS block - Trailing money loss. I tend to always forget how this one works 🙂

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

                                        Thanks for your constant help... really appreciated.

                                        I still have issues. First removed the group numbers from trades, but then started to have problems on the close trades functionality. For a reason it didn't remove all pending trades qhen the condition was met. It was weird as all pending orders come from a grid. Really unsure why. So, I decided to put group numbers back again, and it is now closing trades according to the condition flawlesly.

                                        Now, still not able to make BE and TS for group of trades work. I have them set to BE when from each group trades are at 2000 pips in profit. This is not working... it has worked in situations when profit is at around 8000, after all pending trades from the grid I set are triggered, but not all the time, as I was closely looking at a group of trades, and they were over 9000 and didn't move the SL. I don't believe pending orders have an effect on this, but it simply does not set the SL to BE after the 2000 pips, where also I assume should be recalculating the SL at BE every time a new trade gets triggered.

                                        For trailing block, trailing start is at 5000, bigger than the one for BE (which is 2000). Trailing stop is also at 5000, and same thing at 2000 for BE (same values in both variables in its corresponding block), I have set trailing step at 30%, that according to my understanding, it should close all the trades when profit is reduced by 30% from the max watermark. But is not.

                                        I'm banging my head with this really.... hope you can help further. Many thanks

                                        __If you have 2 or more trades, then TS keeps their SL the same. 30 pips below Ask for each trade. Lot sizes does not matter.

                                        If you want to move SL depending on the group profit of all trades, which depends on their lot sizes - then there is another type of TS block - Trailing money loss. I tend to always forget how this one works :)[/quote:sjp45nxj]

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

                                          Again, your Step values are HUGE. I would not expect a Trailing block to behave as such when the Step option is bigger than the Stop option. What else can I say... I even posted an example. Well, not the same kind of values, but it works for EURUSD.
                                          Just do things one by one. Connect a block - test. Connect another block - test. Don't put 10s of blocks expecting that everything will magically work, it's so much harder to see what is really going on this way.

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

                                          Online Users

                                          M
                                          M

                                          16
                                          Online

                                          146.7k
                                          Users

                                          22.4k
                                          Topics

                                          122.6k
                                          Posts

                                          Powered by NodeBB Forums | Contributors