fxDreema

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

    Variabiles

    Questions & Answers
    3
    10
    3505
    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.
    • A
      activemax last edited by

      hello,
      sorry for my english, I'm Italian.

      I'm using fxdreema professional and I would like to know how to valorize a variable ..

      example .. I would like a price or a value is stored in a variable so you can use it later.

      variables can create them properly in OPTIONS/SET VARIABILES

      Best regards..

      Activemax

      1 Reply Last reply Reply Quote 0
      • A
        Alepie last edited by

        __example .. I would like a price or a value is stored in a variable so you can use it later.[/quote:2cojmvqh]

        use global variables.

        ......
        2012-10-04_20-38-46.jpg

        1 Reply Last reply Reply Quote 0
        • A
          activemax last edited by

          I try..

          Thx

          Activemax

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

            No, no, no...

            Global Variables are something very special in MetaTrader itself. Hit "F3" and you will see a window named "Global Variables" with variables which are global for all EA's running into MetaTrader now. They are defined in MQL4 with a special functions, and they are NOT global variables in MQL4.

            There are global variables in MQL4 as well, and they exists in fxDreema in some ways:

            1. When you hit the checkbox for some parameter to become an input parameter for quick optimization in MT4, this creates a global variable at the top of MQL4 code.
            2. Using "Formula" block. This automatically creates a global variable with the same name as it is written in Result fileld. The result of Formula block is actually saved in a normal global variable in MQL4. Again, defined at the top of the file.
            3. Constants (Options -> Set Constants). Again, global variables. In addition with automatic "extern" keyword to make them input parameters in MT4.
            4. Variables (Options -> Set Variables). Almost the same like Constants, normally without "extern" keyword.

            I created all of these in a different phases of fxDreema for different purposes, but in the end they all serve to the same idea - to hold values.

            Now I start to think that global MQL4 variables are not the best choise to be used for all these in the same time. The problem comes when one wants to use the same variable name for Formula result and Variables, and MQL4 just cannot do that - it is not possible to have two different variables with the same name.

            But now the point is, Global Variables in fxDreema and MetaTrader IS NOT the same as global variables in MQL4. Global variables in MQL4 are variables global into the scope of the MQL4 code. Global Variables in MetaTrader are variables, global into the scope of all EA's running at the moment, and they are used to share information between EA's. In addition, they stay into the memory for 4 weeks.

            And to answer the question - right click on any field that you normally can see as field for typing numbers or text. Or directly type the name of the Constant/Variable (if it is without blank spaces or starting with digit)

            1 Reply Last reply Reply Quote 0
            • A
              activemax last edited by

              __

              And to answer the question - right click on any field that you normally can see as field for typing numbers or text. Or directly type the name of the Constant/Variable (if it is without blank spaces or starting with digit)[/quote:3pn99lgv]

              ok I understand how to define the variables correctly..

              my example it's:

              I have to put in a variable called "FRUP" the price level when there is formed a fractal up (indicator build in) ..

              first, i define a variable "FRUP" in option "project variable", and assign numeric value = 0

              how can I with the formula block to enter the price level in "FRUP" variable, when I have a fractal signal UP?

              This passage is difficult to understand..

              Sorry for my eng.. 😉

              Activemax..

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

                Variables (defined from Options -> Set Variables) cannot be updated in this way... still. I should create a special block for that probably, but now Variables are updated in a different way (via "Variables >>").

                Formula itself creates a new global variable (with MQL4 scope), so you can name it FRUP ("Result:" field) and use it later.

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

                  I think you don't need variables. There is another "problem" with Fractals - for the current candle this indicator always returns 0. For the previous - the same story. Fractals shows up on the 2'nd candle, so you can set "Candle ID" to 2 in order to get value from Fractals.

                  1 Reply Last reply Reply Quote 0
                  • A
                    activemax last edited by

                    __I think you don't need variables. There is another "problem" with Fractals - for the current candle this indicator always returns 0. For the previous - the same story. Fractals shows up on the 2'nd candle, so you can set "Candle ID" to 2 in order to get value from Fractals.[/quote:28px0pj2]

                    ok..

                    Its possible for you can give me simple graphics example in step of a put a value into a variable for future use ?

                    i'm sorry .. I'm not very experienced in mq4 or fxdreema ..

                    activemax

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

                      Via "Variables >>" link, but now I don't like this way so much. My initial idea was to be able to get and use parameters from blocks, combine them with other variables or constants and set the result of these calculations into the variable.
                      I'm still thinking for the best way to work with variables.

                      1 Reply Last reply Reply Quote 0
                      • A
                        activemax last edited by

                        I try..

                        Thx..

                        Activemax

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

                        Online Users

                        V
                        O
                        J
                        B

                        11
                        Online

                        146.7k
                        Users

                        22.4k
                        Topics

                        122.6k
                        Posts

                        Powered by NodeBB Forums | Contributors