fxDreema

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

    Is it possible to set core Magic number from variable ?

    Questions & Answers
    2
    4
    1438
    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
      Mantadiver last edited by

      Hi,

      I already assign different magic numbers to each trade, which as I understand it are a suffix to the core magic number defined in:-

      Project Options / Genertal Properties / Magic Number

      I would be interested to know if it is possible to change the core Magic Number (Project Options / Genertal Properties / Magic Number) from a user entered external variable input when the EA starts.

      This would be useful for running multiple versions of the same EA on the same pair.

      Many thanks.

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

        There is already one input parameter called MagicStart that sets the magic number. This parameter is automatically created for all EAs. The name "MagicStart" is a litthe bit stupid, it means that this is the magic number and "start" means that you start with this number and if in the EA you are using Group numbers bigger than 0, the actual magic numbers of the trades will be bigger that MagicStart.

        1 Reply Last reply Reply Quote 0
        • M
          Mantadiver last edited by

          I couldn't find availability of that input parameter in any of the block so I created a simple code block: [MagicStart = My_Magic_Start;]

          Works great, thank you.

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

            There is no block to change this value, because the value is an input parameter and in my opinion it is not supposed to be modified in the EA. Actually if you try this trick in MQL5 you will get an error message.

            In the EA, in all trading blocks you can find this Group parameter. If you want to somehow have 2 or more strategies in the same EA, you can try do it with this parameter.

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

            Online Users

            F
            R
            S
            D
            V
            O

            13
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors