fxDreema

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

    Empty Group #

    Questions & Answers
    2
    9
    19
    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.
    • Boillot84
      Boillot84 last edited by Boillot84

      What happen if I left all the blocks with empty Group# and I have 2 EAs with different magic number in the same instrument? Will interact each other? In this case shall I set 0 (or other) to don´t?

      1 Reply Last reply Reply Quote 0
      • S
        sktsec last edited by

        2 magic numbers. The EAs will not interact, except when you deal with the option for all order

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

          Thank you for the answer sktsec, because I have 2 EAs magic numbers 9 and 6061, one have the block in loop for "each position" some condition an then buy at market and copy the SL and TP for the trade in loop, but the EA is trying to copy the SL and TP from the other EA.
          image.png

          1 Reply Last reply Reply Quote 0
          • S
            sktsec last edited by sktsec

            I have do a simple demo test in MT4. Pretty sure the Loop Block would not read those open trades with another magic numbers.

            I run 2 EAs which each open a trade and then loop to see it. Then I closed one of them. Confirmed the one without trade cannot see the other's trade.

            May be some bug in your case, provide you sure the trade is made by another EA. Any chance you misread the trade that is actually made by the same EA ?

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

              Nop, was trying to copy the stop loss from the other EA with the other magic number 100%, is MT5, and I readed somewhere that the block "For each position" could interact with other EAs if you don´t put at least Group# 0, but don´t know if it´s true,, should be true as my issue,, now I´m modifying the EA with Group 0 to check if happen again

              S 1 Reply Last reply Reply Quote 1
              • S
                sktsec @Boillot84 last edited by

                @Boillot84
                I check the code for MT5.
                if (group == "")
                {
                if (magic_number == MagicStart)
                {
                group_pass = true;
                }
                }
                But
                bool TradeSelectByIndex(
                int index,
                string group_mode = "all",
                string group = "0",
                string market_mode = "all",
                string market = "",
                string BuysOrSells = "both"
                )

                An attempted to fix the bug would be
                replace all -> group = "0"
                with -> group = ""

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

                  Wow, TY, I don`t really understand, is this mean that will be fixed with Group=0?

                  1 Reply Last reply Reply Quote 0
                  • S
                    sktsec last edited by

                    First open the downloaded source file and open it.

                    As you can see, the variable "group" is of string type, and it is likely to take up the value of "" as default value.

                    But instead it takes a value of "0", and thus magic number is not used according to the logic that "" should be used instead.

                    That means a quick fix try would be replace that "0" with ""

                    First find TradeSelectByIndex, then if you see group = "0", replace it with "".

                    Or more directly, use the editor to replace ALL "0" with "".

                    Noted that "0" is unusual because its type is string rather than number.

                    That's what I could probably guess, please try and see it can help

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

                      Oh, cool ty very much sktsec, I will, another idea is to use group 1 or 2 or so on for all the blocks in the EA, I´lllet you know

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

                      Online Users

                      E
                      D
                      O
                      A
                      J
                      M
                      R
                      F

                      24
                      Online

                      146.6k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors