fxDreema

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

    Close all trades when open trades are in profit?

    Questions & Answers
    3
    5
    3533
    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
      coverman last edited by

      I want to make an EA that closes all open trades (no matter if they are opened by one specific EA).
      I want it to look if the total profit is 5 USD. Then it should close all trades, even the ones in loss.
      I tried to find a solution and I found something that might work, but the block doesn't look like this now. The Market Mode part isn't available.
      Old from an old solution

      So I'm looking for something to close everything, no matter what pair or magic number.

      Is it possible?

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

        I have used this block, but that one is only working if I set the MagicNumber to the same.
        So that one isn't working.
        0_1540980920897_ProfitTrades.png

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

          You need to use the blue block 'Close trades'.

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

            But I want to close ALL trades if the account is in profit. So if I have 5 trades and 3 of them are at 5 dollar profit and I have 2 trades that are open with 1 dollar loss each. Then the total profit is 3 dollar profit. I want the EA to close all open trades then, since the account is in a total profit. Not just closing the ones in profit.
            No matter if they have the same MagicNumber or opened by another EA or another currency pair. If my open trades all together have reached a certain profit I want to close even the ones going wrong.

            It would be even better if I could put a trailing stop on all trades, so they can continue if they go in the right direction.

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

              Take a look at the filter settings, especially the "Group" number. You have this for all blocks who deal with trades and orders. By default the value is empty... which is 0... and in some way this is connected with the magic number. But you can make it like this: 0_1541101497143_e4f92c58-6983-4215-9924-655f9c381930-image.png

              Also, the Symbol is also set to empty value, which means the current symbol. You may want to make it like this:
              0_1541101543680_34eaa0b1-5d70-45c9-82ef-0a93021f460f-image.png

              "Check profit (unrealized)" is the block to check the current profit from multiple trades. Or, you can also check the Equity in Condition.

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

              Online Users

              M
              M

              12
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors