fxDreema

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

    Increase Lot Size and Close all? (Round 2)

    Questions & Answers
    lot size close all equity close trades loosing trades
    3
    14
    1204
    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.
    • fxbam
      fxbam last edited by fxbam

      If you have been following what I've been trying to do. You already know that we were unable to figure out a solution. I wanted to be able to close my most most recent trade in (%) profit and close all the other ones in drawdown at the same time.

      This would leave me with a slight increase from the original amount I started with. Here's the link to the original post: https://fxdreema.com/forum/topic/16259/increase-lot-size-and-close-all?_=1678109632847

      New idea
      After trying to get my head around this problem I believe I've come up with a new way (better way) to approach this.

      1. Check Balance: Equity is Below Balance
      2. Formula: Balance Minus Equity
      3. Formula: Equity Plus Balance
      4. Formula: Balance Plus (In Loop) Trade/Order - Volume Size Lots
      5. Closing all positions: I think this part is figured out but I'm also curious on any suggestion you may have.

      I know this is incomplete but I'm hoping someone here can understand what I'm trying to do here and help me complete this puzzle.

      • When my first trade opens I want it to be 1% of the balance.

      • When my 2nd, 3rd, 4th or more trades are open my equity will be below my balance.

      • I want add the current equity I've lost from the open positions and add it onto my current balance, then I want to open my new position that will be 1% of the new total.

      • (Balance - Equity) + (Total + Balance)
        New Trade = 1% of new Balance (Balance + Equity lost on open positions)

      This seems more achievable than what I was originally asking help for but this will also accomplish what I'm trying to do. I wish I understood this better but the resources available to learn how to do this are limited.

      I appreciate anyone that can help me put this puzzle together.
      Increasing lot size.png

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

        Copy of Increasing lot size.png

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

          Can someone please help me solve this problem?

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

            So your goal is to close all trades when the overall profit (or "net profit") is +1% of balance?

            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

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

              The goal is to close all trades when I reach the take-profit. When I reach the take-profit all the trades should close (the one profitable and the other ones in drawdown) and give me a net profit of 1% from the original balance. So, this means the most recent trade would always have to factor in the current balance and the drawdown on equity.

              roar 1 Reply Last reply Reply Quote 0
              • roar
                roar @fxbam last edited by roar

                @fxbam ok, so maybe do this:

                1. Calculate the total profit of all running trades (profit can be positive or negative)
                2. Condition: total profit > 1.01 * Balance
                3. Close all trades

                Do you think this would work? Does the balance stay same during the process, or do you close some trades early?

                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

                fxbam 1 Reply Last reply Reply Quote 0
                • fxbam
                  fxbam @roar last edited by

                  @roar the original balance stays the same while the positive and negative positions are open. When the trade(s) close then the balance will change. The only thing that fluctuates is the equity and will continue to have a larger negative balance as each new trade opens. The cycle ends when the most recent trade hits take-profit to close everything. So the lot size I need to get the 1% will depend on how far my take-profit is each time, the balance, and the current drawdown on equity.

                  roar 1 Reply Last reply Reply Quote 0
                  • roar
                    roar @fxbam last edited by roar

                    @fxbam so the closing part is actually done already, but we need to calculate the lot size, given current drawdown and TP level? The TP level is same for all trades?

                    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

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

                      Yes, we need to calculate the lot size, given the current drawdown and TP level, and original balance before the trade(s) were opened, but the TP will be different each time.

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

                        So, when calculating the lot size, we know the TP pips and we know how much $$$ the trade will yield. There is actually some functions to make this calculation, let me make an example...

                        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

                        1 Reply Last reply Reply Quote 0
                        • A
                          Alan.paredes2 last edited by

                          https://www.youtube.com/watch?v=WOxvqqmN9Rg el que sale en el video es que solio usar en mis bot para cerrar ordenes cuando se lelgaba a un profit x

                          fxbam 1 Reply Last reply Reply Quote 0
                          • roar
                            roar last edited by

                            Here is a function to calculate lot_size when target profit is 567 $ and 123 pips.
                            https://fxdreema.com/shared/WYkYDtbee

                            Now you will need to put your own target profit amounts to the formula.
                            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

                            fxbam 1 Reply Last reply Reply Quote 0
                            • fxbam
                              fxbam @roar last edited by

                              @roar I missed your last message. Now, I can have it where I know what the first TP is and how big the lot size would be if it was only one trade. The problem is when it doesn't hit TP and triggers another trade, and another, and so on. Let's say 4 trades are open now. The last 3 are in drawdown and the newest one hits TP. When this happens it needs to close all the trades and end up with a % gain from the original balance before those trades were opened. So, after all the positive and negative balance trades close I will end up in profit. I appreciate the help.

                              1 Reply Last reply Reply Quote 0
                              • fxbam
                                fxbam @Alan.paredes2 last edited by

                                @Alan-paredes2 I've seen that one a few times. I'm trying to figure out if that will work. I did message this person about 12 hours ago and mentioned the issue I'm having.

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

                                Online Users

                                M
                                F
                                E
                                T
                                M
                                P
                                S
                                A

                                21
                                Online

                                146.6k
                                Users

                                22.4k
                                Topics

                                122.6k
                                Posts

                                Powered by NodeBB Forums | Contributors