fxDreema

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

    Can i use constants as global variables in mq5

    Questions & Answers
    2
    5
    217
    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.
    • D
      Domeonline last edited by

      Hi All,

      is it possible to turn a constant into a global variable?

      The reason is that I have an EA attached to a lot of charts.

      Changing now an input manually in all instruments takes ages and can lead to human errors.

      So my idea is to use a script which updates all in one go.
      But the script can't directly use inputs/constants it needs global variables.

      If there is another route to achieve this I'm also happy to test this...

      Thanks!

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

        Try the terminal global variable as the shared input

        You don't even need a script

        D 1 Reply Last reply Reply Quote 0
        • D
          Domeonline @sktsec last edited by

          @sktsec
          Amazing!!
          Thanks a lot for the tip, that's a game changer!

          I attached the terminal block to the "on Init" tab. I read somewhere that the files for terminal variables stay only for 30 days. You think I have to redeploy it every month?

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

            "terminal variables stay only for 30 days" probably means after you closing the MT4/M5

            1 Reply Last reply Reply Quote 0
            • D
              Domeonline last edited by

              Excellent! Thanks it works fine now. I even managed to change the global variables with a telegram message.

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

              Online Users

              B
              P
              S
              S
              T
              F
              I
              S
              S
              G

              24
              Online

              146.6k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors