fxDreema

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

    Please help to close positions after reaching profit / loss

    Questions & Answers
    2
    13
    2949
    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
      Leandro Allmer last edited by

      I've tried all possible combinations and could not. I have used formulas, condition and any works. It only remains that to complete the EA. The condition needs to add the profit / loss of the closed and open positions and gather into a single value to compare with the input constant and close the position if it meets.

      I noticed in the forum that this is a question many users. So someone could help showing us an example. Thank you

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

        You want the profit made by few history trades + the current unrealized profit? I think that "Check profit (period of time)" can help with this.

        Or if you want to get the actual value, then Buckets. Unfortunately there is no Bucket block for both - closed positions and the current position, so there are two separate values. Try this - https://fxdreema.com/shared/Pra5mTsZ

        1 Reply Last reply Reply Quote 0
        • L
          Leandro Allmer last edited by

          __You want the profit made by few history trades + the current unrealized profit? I think that "Check profit (period of time)" can help with this.

          Or if you want to get the actual value, then Buckets. Unfortunately there is no Bucket block for both - closed positions and the current position, so there are two separate values. Try this - https://fxdreema.com/shared/Pra5mTsZ[/quote:2wumjvw9]

          the block "Check profit (period of time)" is only considering the open positions, it is not adding to the closed position. In the example showed me https://fxdreema.com/shared/Pra5mTsZ[/quote] can not use these values to close positions

          1 Reply Last reply Reply Quote 0
          • L
            Leandro Allmer last edited by

            If there is any indicator that shows the profit / loss of the day, you could use it to close the trades.

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

              No, this block works with the closed positions. "Check profit (unrealised)" is the one who works only with open positions.
              From this example https://fxdreema.com/shared/JvbQZ9Y5e I got this result http://prntscr.com/boud15. The EA was automatically terminated when the profit reached 20 dollars for the day.

              When I'm showing examples, I'm showing something that can be seen with the eyes. In this case, the values, as they are. I don't want to make EAs by request, I want to show people how things work. That's why I prefer to show something that exaplains how something works, not exactly the thing that the person is asking for. I want people to know and understand what is going on in these blocks.

              1 Reply Last reply Reply Quote 0
              • L
                Leandro Allmer last edited by

                Thanks a lot for the help. Your example works perfectly when road here, but when I do exactly the same in my robot does not work. I do not know what can be. He closes before.
                https://fxdreema.com/builder/

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

                  What symbol are you working on? I can see in one of your projects that you have lot sizes like 1. This is huge lot size for symbols like EURUSD. The result I got is that my positions are closed after less than 1 minute.

                  For those "Draw..." blocks, note that you have set them in a way to make brand new object every time they run. As a result, tousands of objects are created and the backtest runs so slow. Look at the first two options in these blocks. Try with No - Yes instead of No - No.

                  1 Reply Last reply Reply Quote 0
                  • L
                    Leandro Allmer last edited by

                    Use in the Brazilian futures market (WINFUT), the minimum lot here is 1. I see in relation to the "Draw". Thank you.

                    1 Reply Last reply Reply Quote 0
                    • L
                      Leandro Allmer last edited by

                      __What symbol are you working on? I can see in one of your projects that you have lot sizes like 1. This is huge lot size for symbols like EURUSD. The result I got is that my positions are closed after less than 1 minute.

                      For those "Draw..." blocks, note that you have set them in a way to make brand new object every time they run. As a result, tousands of objects are created and the backtest runs so slow. Look at the first two options in these blocks. Try with No - Yes instead of No - No.[/quote:3d6mdfr4]

                      Wow, I changed the option to "NO - YES" according to their orientation and "backtest" became much faster. Thank you.

                      Too bad today win my license and could not address the issue of closing position profit / loss. Just missed it to finish my EA.

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

                        You still have time

                        1 Reply Last reply Reply Quote 0
                        • L
                          Leandro Allmer last edited by

                          I found out because some blocks are not working properly. You have an error in reading the closed positions. So the block "check profit (period of time)" is not closing the positions properly.

                          https://picasaweb.google.com/108561293887245046669/6304030654714999425#6304030653042176914

                          1 Reply Last reply Reply Quote 0
                          • L
                            Leandro Allmer last edited by

                            I found out because some blocks are not working properly. You have an error in reading the closed positions. So the block "check profit (period of time)" is not closing the positions properly.

                            https://picasaweb.google.com/108561293887245046669/6304030654714999425#6304030653042176914

                            http://prnt.sc/bpc1vf

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

                              I can see your projects. I can only say that the number of blocks matter when they are connected... without any order. When you want to run some block first and then another block, better connect them one after another. If such blocks are not connected one after another, then be aware of block numbers.

                              https://fxdreema.com/demo/blocks-execution-order

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

                              Online Users

                              F
                              W
                              C

                              5
                              Online

                              146.8k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors