fxDreema

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

    Project variables are getting reset

    Questions & Answers
    5
    13
    2524
    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.
    • T
      tswaldi last edited by

      I have exactly the same problem. Can someone explain the solution to me better? What can I do? Unfortunately, the image from the previous post is no longer available.

      l'andorrà 1 Reply Last reply Reply Quote 0
      • R
        Robi last edited by

        Hi, this is my first attempt at building an expert. I am facing a problem while running my expert in a demo account. It seems that whenever I stop Autotrading on my MT4 platform and then turn it back on, the expert goes to it's default setting i.e., all the project variables get reset to the default. Here is the link to my project,

        https://fxdreema.com/shared/7GQWEhe3e

        Can you please help me with this issue? Thanks in advance.

        1 Reply Last reply Reply Quote 0
        • C
          cfabian last edited by

          __Hi, this is my first attempt at building an expert. I am facing a problem while running my expert in a demo account. It seems that whenever I stop Autotrading on my MT4 platform and then turn it back on, the expert goes to it's default setting i.e., all the project variables get reset to the default. Here is the link to my project,

          https://fxdreema.com/shared/7GQWEhe3e

          Can you please help me with this issue? Thanks in advance.[/quote:tu24itif]

          I believe this is a normal condition, as the calculations are stored in a temporary memory I belive, and not hardcode written.
          What variables are the ones that shouldn't change and why?

          1 Reply Last reply Reply Quote 0
          • R
            Robi last edited by

            @cfabian Tnx for replying..all the user declared variables get reset. And as the lot size of the trades depend on how many trades have been opened, the reset hampers the trading. My other EA's do not face this problem and that were not built with fxdreema. Can u give me any solution??

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

              Variables are global variables in the MQL4 program, they will reset. Well, if you stop the EA and add it again on the chart, there is no question about it - everything will reset. But if you only change the input parameters of the EA while it is still active, values should remain. Here is a little test - https://fxdreema.com/shared/2w5eBTFbb It forks fine for me.

              But I will not recommend to rely on variables for counts and lot sizes. It's better if you get information from existing trades and orders, because they exists in all memories - in the MQL4 program, in MT4, on the server. And if any type of shutdown happens, they are still there after restart. Be very careful if you organize things with Variables and such temporary data and test different scenarios.

              1 Reply Last reply Reply Quote 0
              • R
                Robi last edited by

                "Many thanks. I want to keep track of the number of Buys and Sells (separately) that I have opened and also the total size of bought and sold lots.
                I need to put those values in variables to calculate and make decision of future trades. As you have explained, if I use variables they get reset when the EA gets closed.
                I have tried using "Bucket of trades" block, but when I use the "Modify Variables" block underneath it to load values in my variables, it doesn't seem to work. Can you please help me with this?"

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

                  Show me specific problem and I will help. That's why I am here. But you can check counts with Check trades count and all the other blocks in that category.

                  1 Reply Last reply Reply Quote 0
                  • R
                    Robi last edited by

                    Yes, but the Check Trades Count block only checks the number of trades with a value, while what I really need is the number itself, to store in one of my variables. I am attaching a screenshot here.
                    http://postimg.org/image/e6lmqrki7
                    I took your advice and I am restructuring my EA to get the trade counts and lot sizes information from existing trades by using the Bucket of Trades block. I have four variables 1) CumulativeBuy- the amount of total lots that are bought, 2) CumulativeSell- the amount of total lots that are sold, 3) BuyCounter- number of buys, and 4) SellCounter- number of sells. I need the new values to be loaded in these variables whenever a new trade is opened. However, in the current setting, the values are not getting loaded in the variables. Am I doing it wrong? Please also let me know if there is a better way to do this.

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

                      The reason I made "Bucket" blocks was because people wantet to get values like this 🙂

                      Block numbers are important when you connect blocks like this in parallel. Both of your Comment blocks has lower numbers than Modify Variables, so they run first. Connect Comment blocks after Modify Variables to print the newest information

                      1 Reply Last reply Reply Quote 0
                      • R
                        Robi last edited by

                        Hi, Thanks a lot, it worked. No more data loss after shutting down and restarting "autotrading", and the EA seems to be working fine. 😄 😄
                        There is another thing I am working on, and was hoping you can give me some advice on that as well. I would like to have a comment output that shows at which point of market price (Ask or Bid) my trades will reach the desired amount of profit that I have set for them. The EA I have built checks the amount of profits and losses amassed by all trades and closes them all when the total profit reaches an amount set by me. I would like to calculate that point and show it on the comments. But so far I haven't been able to do it, actually being a noob I can't even find the right blocks to do it. Could you please advice me on which blocks can I use to get it done?

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

                          Well, I'm also not very good in calculations 😄 If your deposit is in USD and you work on EURUSD, then the amount of money per pip is fixed. But if you cross symbols, then it's a little bit weird. Somewhere in Condition -> Market Propertied there is option "Money per tick". I think this one can be used for these calculations. But how... :)))

                          1 Reply Last reply Reply Quote 0
                          • l'andorrà
                            l'andorrà @tswaldi last edited by

                            @tswaldi Are you removing the bot from the chart, maybe?

                            (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                            (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                            (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                            T 1 Reply Last reply Reply Quote 0
                            • T
                              tswaldi @l'andorrà last edited by

                              @l-andorrà No, the bot stays in the chart after the terminal restart and continues to work. Only the values are no longer correct. @jstap suggested a solution to my problem that should work. I'll share the link to the other conversation, maybe it will help someone else looking for this solution.
                              https://fxdreema.com/forum/topic/20532/when-metatrader-is-restarted-the-ea-opens-new-positions-with-0-01-lot

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

                              Online Users

                              S
                              O
                              K
                              M
                              M
                              C

                              17
                              Online

                              146.7k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors