fxDreema

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

    double or int affects running memory size?

    Questions & Answers
    3
    4
    864
    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.
    • V
      vnpython 0 last edited by

      as i am aware that using double will increase the memory used and using int will take less memory to run. Is this same here? I notice some value can be int (switch type on/off) to reduce overall running memory load?

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

        it depends on a calculation complexity, this is particularly relevant to huge arrays
        in most user cases you can use double for all numbers, everywhere (including switches)

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

        1 Reply Last reply Reply Quote 0
        • V
          vnpython 0 last edited by

          ok noted!

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

            I don't think that the type of one variable can change anything. After all, the EA that is generated contains many many variables with different types. It's true that the generated EA contains 100s and 1000s rows of code, while you could manually code the same strategy with so much less amount of code.

            Not only that, but I know that sometimes the MQL code itself is slow for reasons that I don't know. I noticed many times before that the amount of code in a function can make it slow, even if 99% of that code never runs. I guess that when the code is compiled, it is not optimized very good and it's like the code in a function is parsed every time the function runs. I don't know if this is true, but it feels this way.

            So again, the type of 2-3 variables will not make a change. And todays computers have so much RAM. Even with the 1000s rows of code that fxDreema produces, I think that there are not RAM problems. I personally have 32GB of RAM, only because of the amount of browsers that I use. MetaTrader is nothing compared to Chrome or Firefox in my opinion 🙂

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

            Online Users

            A
            A
            R
            S
            M
            P
            R

            20
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors