fxDreema

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

    Dynamic Varaible

    Questions & Answers
    2
    3
    777
    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.
    • B
      BlueMoon last edited by

      I need variables in my blocks that I can't define while creating the EA. Basically my variables are dynamic.

      e.g.
      I have an EA for which the user will provide a list of all currency pairs that he wants to trade. I would like to create a double type variable for each of these values provided by the user. My EA will then assign value to these variables through blocks and use it when required.

      1 Reply Last reply Reply Quote 0
      • B
        BlueMoon last edited by

        I figured this can be very easily done using custom code. I have come so far. Can you please help me with the right syntax for this? What do I write in this code instead of $Market for this to work? I basically need the variable name to be passed by the previous block

        0_1500669734118_upload-856cabd9-be8e-48f3-925f-c05789b5cf58

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

          What about this Variables thing above the list of blocks?

          Otherwise if you are thinking about PHP-like variables, those are not possible. MQL4/5 is based on C++ (I believe), in which all variables are defined before the compilation. But you can probably work with arrays. There are some dynamic arrays. But it's a pain in the ass to work with arrays in MQL4/5, at least for me. You can try it. To define Variable that is array, try to name that variable with []

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

          Online Users

          M
          A
          E

          12
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors