fxDreema

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

    Give my variables eternal life

    Questions & Answers
    2
    3
    824
    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.
    • roar
      roar last edited by

      My ea collects info from the chart for several hours before making a trade.
      The problem is, when I (accidentally) close the terminal, all variables disappear and the ea would start at 0.

      What is the best way to store the variables somewhere, so the newly started ea could load the previous variable values?

      Need small help? Tag me in your post
      Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

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

        this is problem with metatrader, because variables are deleted when EA is closed ... so idea may be store these variables as "global" or terminal variables, this:
        https://docs.mql4.com/globals

        0_1500477907045_upload-7bb2717a-e336-4799-9bee-116660e46a56

        as you can read, they are stored for one month and than automatically deleted, and also they are shared with tester and all EAs in terminal ... so be careful 😄

        next option can be save variables into file, and than read this file (but it needs specific custom code) ...

        Between trading and gambling is a very small gap, be careful.

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

          Yeah, I went with the global variables, but it feels a bit clumsy solution, and makes a really weird interference in my backtest.
          The file approach would be better, I guess its time to learn some actual MQL coding 😄

          Need small help? Tag me in your post
          Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

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

          Online Users

          G
          H

          12
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors