fxDreema

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

    Close Positions Problem

    Bug Reports
    2
    9
    1583
    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.
    • R
      ravaneda last edited by

      Hi!

      I need to solve a very huge problem with close position block. Today I lost more than 50% on options because when I close a buy position it opens a sell position automatically.

      It's not the first time that it's happening to me, so i tried a lot ways to fix it like putting "once per bar" blocks before close position block, but it didn't work. Other thing I tried too was informing a deviation of 10 pips or more, but it didn't work too. So now I really don't know what to do more.

      Could someone help me with it?

      I really love fxdreema! Congratulation for this amazing software!

      Thanks!

      ......
      screenshot1070.jpg
      screenshot1069.jpg

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

        Oh no, MT5 problems again. I will check what is going on 😕

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

          The problem is that MT5 does not wait for it's local database to be updated when something important happens. For example, it can successfully close a position and the function to do that will return only success messages, but for all the other functions it will appear that the position is still present... for some time, sometimes 1 ms, sometimes seconds.

          This was reported few times before, so I added some trick to wait while the local database is really updated. The trick is that the program will wait for 5 seconds (at most) for the local database to be updated after the position is closed. But maybe this happens slowly than 5 seconds for you. So I will just put an endless loop with the risk of someone complaining that his EA stuck while trying to close some position 🙂

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

            Can you try on your system how it works now. Here is my test EA https://fxdreema.com/shared/aEnXaRG3e It should open a new position and then close it immediately.

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

              Hi!!!

              Im so sorry for delaying on my reply! I was on vacation!

              Thank you very much for being so fast!

              I will try it today on my system and i'll tell you later if it's working properly. For now, I solved it inserting a 'sell block' instead of a 'close position'. I know it's not the right way but It's working well. 🙂

              See you later!

              Thanks again! 😄

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

                Hi!!!

                I have been trying to open your link but it's not working. If I open a new project will it be working with this trick that you have added?

                Thank you very much!!!! 😄

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

                  Oh damn, I generated it on my local fxDreema 😆 I updated it: https://fxdreema.com/shared/aEnXaRG3e

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

                    Hi!

                    It worked very fine!

                    If I create a new project with close position block it will work in the same way of this sample you built? Or you have to update anything?

                    Thanks you!!!! 😄 😄 😄

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

                      I don't know, try it 🙂

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

                      Online Users

                      P
                      M
                      C
                      J
                      V
                      G
                      E
                      H
                      C
                      D

                      17
                      Online

                      146.7k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors