fxDreema

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

    MagicStart + Random?

    Questions & Answers
    3
    8
    1664
    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.
    • M
      MetaTrader last edited by

      Hello,

      I am curious if there is a way to set the Magic Number for EA's to something thats related to Symbol and maybe Timeframe.

      Why: I wrote an EA and I am still working on deatails. I have it on several Charts / Symbols / Timeframes. Everytime I put the EA on a new chart or recompile the EA I have to stop trading and set the Magic Number manually for not having conflicts

      Solution would be to do something like that: MagicStart + NumericRespresentation of Symbol (maybe the AsciiValues or is there a SymbolEnum) + TimeFrameEnum = individual unique Magic Number 🙂

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

        At the moment I don't use such function. I remember that someone advised me to do it like this before, but I wasn't convinced do make it fact. Well, if you have such function you can use it. Custom function can be defined in https://fxdreema.com/studio and then used directly from every block. Don't try to modify MagicStart, if you do something, better do it with the Group number.

        But if you add the same EA in two different symbols with the same magic numbers, this is not a problem because the default setting in all blocks like "No trade" are to work with the current symbol only.

        You know what... I think it will be enough to use Group number as something like _Period. This is predefined integer variable in MetaTrader and is something like the function Period(). This will separate trades when the same EA is used in different timeframes. As I mentioned above, by default there is symbol (market) separation.

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

          __But if you add the same EA in two different symbols with the same magic numbers, this is not a problem because the default setting in all blocks like "No trade" are to work with the current symbol only./quote]

          Interesting. I did not know that. I was changing the magic number for each chart.

          I am also planning to create a multicurrency putting EA in one chart, and I'm searching here in the forum a way to do this that does not give conflict between currencys.

          So in this case if you open a position in EURUSD (using the block No position, for example), and give a signal on GBPUSD, this new position will not be opened because it is still open a position on EURUSD, that, even though in other currency?

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

            For MT5 as you know, 1 position per symbol is allowed. I guess that it's not possible to have 2 separate EAs under the same symbol. At least until now, I am talking for those classic positions. So for MT5 magic number does not really matter when it comes for positions

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

              __For MT5 as you know, 1 position per symbol is allowed. I guess that it's not possible to have 2 separate EAs under the same symbol. At least until now, I am talking for those classic positions. So for MT5 magic number does not really matter when it comes for positions[/quote:1r7k83sd]
              Yes yes ... perfectly. I wonder if adding EA in one currency chart , but operate in different currencies at the same time with a magic number for each currency.

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

                Absolutely. But what is the point of the magic number in this case, the symbol name is enough to separate positions. Only in MT4-like environment you need magic number to separate trades from the same symbol and type.

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

                  Ah ... interesting ... so it is more practical to operate with several currency pairs at the same time through the MT5?

                  Just by using the Set "Current Market" Block for next blocks?

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

                    EDIT: sorry, I wrote something here in the wrong topic

                    Well, yes, this block can do what it is supposed to do, I guess

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

                    Online Users

                    P
                    R
                    S
                    R
                    E
                    M
                    P
                    C
                    J

                    19
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors