fxDreema

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

    Whick block can give MQL error codes?

    Questions & Answers
    2
    21
    3549
    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.
    • isp00rt
      isp00rt last edited by

      My recent EA works smoothly in 3 out of 4 times. For a reason I can't understand, some trades are not opened and I have no idea why. If code was wrong no one would be opened. I need to discard broker problems and this is why I need a block telling me why an order is not opened. Could someone please tell me which block can specify the error number for a failed trade?

      Thank you very much in advance.

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

        What error messages do you see in the logs in MetaTrader?

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

          That's the problem. No errors are shown. All conditions are met but no order is launched in one out of 4 trades. I have no idea why and I guess it can be a broker's server problem. Is there any way to confirm it using fxdreema?

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

            Make sure that you are not working under "on Init"
            When you don't know whether a block passes or not, put "Draw Arrow" after it and if you don't see any arrows on the chart, then the block does not pass. There is actually block "Trace Activity" for this purpose, but I personally mostly use "Draw Arrow" 🙂 Anyway, any block that prints something somewhere can be used.

            Otherwise when you run "Buy now", it should make a trade. If you are sure that this block runs and you don't have a trade as a result, then something is wrong. But I can't imagine running this block, not having any trade and not having any error message. If this is the case, are you sure you are running the right EA?

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

              Before doing that I want to be sure I understood your suggestion about looking at the logs. I created this easy EA:

              https://fxdreema.com/shared/dOCTWLPUd

              As you can see, I can specify the sop loss manually. This way I can open a trade with an incorrect SL price so that an Error 130 message should appear at the logs. Well, it simply doesn't happen. I'm still learning how MT4 works so I'm not sure if this is the way to know the error number of a failed trade. Could you please confirm this is the way to do it?

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

                For this particular example I can see that Virtual Stops are enabled, which means that you have horizontal lines instead of hard stops. By default this option is not enabled.

                People who use fxDreema would report to me so many errors if their EAs suddenly starts producing errors. So, for many processes, if something is not quite right, it will still work somehow. For example, whatever value you put for lot size - too small or too big - the EA will calculate the nearest possible value and will take it instead.

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

                  Interesting. I will follow your suggestion and will report what I get. Thank you.

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

                    Well, I finally found the origin of all my problems with this EA: Offquotes. All failed trades are caused by an Offquotes/Requotes problem. For some unexplainable reason, one out of four trades can never be traded because of that problem. I can see at the experts tab how the EA tried to open it up to 10 times, but for no avail. I read in another thread that Fxdreema doesn't use Refreshrates orders because of how it is designed, and this is the traditional solution for Offquotes. So how can I fix it here? 😢

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

                      Refreshrates orders?

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

                        Sorry, I'm still improving my English. 😳 What I mean is what is said on this thread in a different forum.

                        https://forum.mql4.com/20679

                        Could you please help me to do that?

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

                          Well, I don't use OrderSend() or OrderModify() directly. There is a big function that does some checks before and after trading. In case of failure, the EA should try again few more times (10 in total) and then will fail, which means that the gray output of the block will be active. But there are recoverable errors and fatal errors. In case of fatal error, there will be no retries. ERR_OFF_QUOTES is from the recoverable errors, so it will try 10 times with 1 second delay between each attempt.

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

                            Yes, that's exactly my case. I can see that after 10 retries, it stops. In effect all my errors are ERR_OFF_QUOTES. Is there a way to increase the number of retries? Or could you suggest me any other way to avoid ERR_OFF_QUOTES errors?

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

                              You can connect the gray output with the input, but is this a good idea... Why do you have so many off quotes?

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

                                I'm sorry. I don't understand what you mean. I'm talking about this EA:

                                https://fxdreema.com/shared/tYQleFAb

                                And I have no idea why I have so many offquotes. I tested up to three different brokers and the result is always the same. 😢

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

                                  I put this EA in my demo, but who knows when will I see trades and errors. Do you have some logs?

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

                                    No problem. I send the to you via private mail.

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

                                      I have MetaTrader here running with this EA for a while and I didn't noticed problems. I was also switching my PC on and off (Sleep actually, not restart) and here is what I got: http://prntscr.com/cxkywn

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

                                        Just curious. What broker did you use?

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

                                          MetaQuotes Demo, I guess. I have one main MetaTrader installation for experiments and I have few demo accounts in different brokers there 🙂

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

                                          Online Users

                                          E
                                          J
                                          T
                                          J

                                          18
                                          Online

                                          146.7k
                                          Users

                                          22.4k
                                          Topics

                                          122.6k
                                          Posts

                                          Powered by NodeBB Forums | Contributors