fxDreema

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

    How to cancel order if it takes too long to open

    Questions & Answers
    5
    19
    2937
    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
      rafaelgrecco last edited by

      Hi!

      I am running my EA on my real account. The EA opens orders (buys or sells) at market price, using a simple "Buy Now" and "Sell Now" block.

      Sometimes the trade takes too long to open, I believe the delay happens because of the broker. Here are some examples:

      2019.09.03 12:19:39.188 xxxxx Operation details: Speed 78 ms | Slippage 0.0 pips
      2019.09.03 12:29:43.792 xxxxx Operation details: Speed 3204 ms | Slippage 0.0 pips
      2019.09.03 15:30:14.486 xxxxx Operation details: Speed 4875 ms | Slippage 0.0 pips
      2019.09.03 15:56:25.387 xxxxx Operation details: Speed 3390 ms | Slippage 10.0 pips
      2019.09.03 15:56:25.387 xxxxx Correcting stops because of slippage...
      2019.09.03 15:57:44.715 xxxxx Operation details: Speed 5062 ms | Slippage -15.0 pips
      2019.09.03 15:57:44.715 xxxxx Correcting stops because of slippage...
      2019.09.03 15:59:39.500 xxxxx Operation details: Speed 2266 ms | Slippage 10.0 pips
      2019.09.03 15:59:39.500 xxxxx Correcting stops because of slippage...
      2019.09.03 16:02:32.633 xxxxx Operation details: Speed 2953 ms | Slippage 0.0 pips
      2019.09.03 16:03:36.914 xxxxx Operation details: Speed 4250 ms | Slippage 0.0 pips
      2019.09.03 16:05:52.391 xxxxx Operation details: Speed 43797 ms | Slippage -65.0 pips
      2019.09.03 16:05:52.391 xxxxx Correcting stops because of slippage...
      2019.09.03 16:07:08.739 xxxxx BuildOrdersList() - Error #4754
      2019.09.03 16:07:49.001 xxxxx Operation details: Speed 2468 ms | Slippage 0.0 pips
      2019.09.04 09:05:34.767 xxxxx Operation details: Speed 2578 ms | Slippage -10.0 pips
      2019.09.04 09:05:34.767 xxxxx Correcting stops because of slippage...
      2019.09.04 09:06:11.204 xxxxx Operation details: Speed 4937 ms | Slippage 5.0 pips
      2019.09.04 09:06:11.204 xxxxx Correcting stops because of slippage...
      2019.09.04 09:07:57.682 xxxxx Operation details: Speed 53890 ms | Slippage -25.0 pips
      2019.09.04 09:07:57.682 xxxxx Correcting stops because of slippage...
      2019.09.04 09:20:04.115 xxxxx Operation details: Speed 1235 ms | Slippage 0.0 pips
      2019.09.04 09:34:10.400 xxxxx Operation details: Speed 31 ms | Slippage 0.0 pips

      My ping to the broker is at 3 or 4 ms. While a few trades are opened very fast (less than one second), a couple trades takes almost one minute!

      I want to know if it's possible to cancel orders that takes more than 10 seconds to open. Is there a block (or code) that monitors how long a trade is taking to open, and cancel it if it takes too long?

      Thanks.
      Rafael

      1 Reply Last reply Reply Quote 0
      • T
        trader.philipps last edited by

        @rafaelgrecco I'm not aware of any max ordersend time value. However, you may control the price difference with the slipage settings instead. Or does it matter if you get the same price 10 seconds later?
        By the way, which broker are you using? Times appear very long to me.

        I like to share my knowledge, but expect the others to contribute as well.

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

          @trader-philipps actually time does not matter as long as price remains the same.

          But I see that by default, the Slippage is set to "4" pips on the Buy and Sell Now blocks. I am getting slippages a lot bigger than that... should I change or add something else to make it work?

          About the broker, it is a "futures" broker in Brazil, it is not Forex. It is actually the best national broker here in Brazil, it ususally has very tigh spreads and fast execution times, but there are days that it gets bad for no apparent reason.

          Thank you for your help.

          EDIT: By the way, tick size is 5 on the symbol I trade. Usually the slippage is 0.0, but I would be ok with slippage up to 10 pips.

          On the examples I posted, there is a trade where slippage is 65 pips 😞

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

            Is the open price very close to Ask/Bid? Probably your broker needs a wider distance between them.

            (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.

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

              @l-andorrà I am using "Buy Now" and "Sell Now" blocks. The trade opens at current Ask/Bid price, there is no distance. Just use the available price quotes.

              The problem is that sometimes the trade is executed in less than a second (which is normal) and another time it is executed in 20... 30.. 40 seconds!

              I wanted to cancel the execution if it took that long.

              1 Reply Last reply Reply Quote 0
              • T
                trader.philipps last edited by

                @rafaelgrecco the ordersend function has a time parameter, but I think that is only valid for pending orders and determining the point in time the pending order expires.

                int OrderSend(
                string symbol, // symbol
                int cmd, // operation
                double volume, // volume
                double price, // price
                int slippage, // slippage
                double stoploss, // stop loss
                double takeprofit, // take profit
                string comment=NULL, // comment
                int magic=0, // magic number
                datetime expiration=0, // pending order expiration
                color arrow_color=clrNONE // color
                );

                Same say the order blocks buy and sell.
                0_1567632213811_Auswahl_511.png

                Are you trading low liquid assets? Otherwise I'd take the order times and get in contact with broker's support and let them explain you the reason. On order open that may not be an issue if you get the price you want (or could use limit order), but for closing the order that can cost you a lot of money!

                I like to share my knowledge, but expect the others to contribute as well.

                R 1 Reply Last reply Reply Quote 0
                • R
                  rafaelgrecco @trader.philipps last edited by

                  @trader-philipps thanks for the tips.

                  I don't think "expiration" field will help. The lowest value possible is 1 minute. I would have to use something like 10 or 15 seconds (which is already a looong time for a trade to be executed).

                  The asset I am trading is the most liquid asset in Brazil. I'll contact my broker's support to see their explanation.

                  1 Reply Last reply Reply Quote 0
                  • P
                    paragorundu last edited by

                    Did you check your LAN/WAN connection? You may have connection issues. For example, I had similar issues with WLAN.

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      trader.philipps @paragorundu last edited by

                      @paragorundu said in How to cancel order if it takes too long to open:

                      Did you check your LAN/WAN connection? You may have connection issues. For example, I had similar issues with WLAN

                      @rafaelgrecco Good Point. I'm always using VPS with good connection to the broker. Didn't think about someone could run EAs from home :))

                      I like to share my knowledge, but expect the others to contribute as well.

                      1 Reply Last reply Reply Quote 0
                      • P
                        paragorundu last edited by

                        LOL @trader-philipps you may have to bro, believe me LOL

                        C 1 Reply Last reply Reply Quote 0
                        • C
                          CPxiom @paragorundu last edited by

                          @paragorundu There is free VPS for one year at Google, and Amazon as well.

                          P 1 Reply Last reply Reply Quote 0
                          • P
                            paragorundu @CPxiom last edited by

                            @cpxiom Thank you 🙂

                            C 1 Reply Last reply Reply Quote 0
                            • C
                              CPxiom @paragorundu last edited by

                              @paragorundu 🙂 search on youtube "mt4 VPS" , and you will find instructions and everything.
                              Make sure you limit the mt4 to 5000 history, and 5000 bars, or even 1000, otherwise it consumes a lot of CPU and has problems with the free versions of setups available.
                              So also check out on youtube "sluggish mt4", speed up mt4... etc. 🙂

                              P 1 Reply Last reply Reply Quote 0
                              • P
                                paragorundu @CPxiom last edited by

                                Dear @cpxiom,

                                I really thank you so much for sharing such valuable information with us. It will be very helpful.

                                Regards.

                                C 1 Reply Last reply Reply Quote 0
                                • R
                                  rafaelgrecco last edited by rafaelgrecco

                                  @paragorundu @CPxiom

                                  Hey, just to be clear I am using a VPS with a ping of 3 ms to the broker.

                                  My VPS is actually on the same data center that the broker uses. Connection is not an issue.

                                  Today all trades are getting executed in 30-40 ms.

                                  My problem is that eventually the broker messes something up and trades takes several seconds (sometimes up to 40 or 50 seconds) to execute the trade, and I wanted a way to prevent the trade from being executed when that happens.

                                  P 1 Reply Last reply Reply Quote 0
                                  • C
                                    CPxiom @paragorundu last edited by

                                    @paragorundu 🙂 glad I was of help.

                                    1 Reply Last reply Reply Quote 0
                                    • P
                                      paragorundu @rafaelgrecco last edited by

                                      @rafaelgrecco I understand.

                                      Maybe this tool can be useful for you to test broker execution time and see if there is really a problem with execution of market orders in time?

                                      https://www.mql5.com/en/market/product/19285#

                                      T 1 Reply Last reply Reply Quote 0
                                      • T
                                        trader.philipps @paragorundu last edited by

                                        @paragorundu I don't think that that might help as it only places stop orders, which doesn't cause an order that has to be filled. I'd say it's absolutely a broker issue.

                                        I like to share my knowledge, but expect the others to contribute as well.

                                        R 1 Reply Last reply Reply Quote 0
                                        • R
                                          rafaelgrecco @trader.philipps last edited by

                                          @trader-philipps Yeah, I've talked to other people that also uses my current Broker (or any Broker in Brazil) and it seems it is a common problem.

                                          Unfortunately there's nothing I can do, like changing brokers... all I wanted was a way to cancel the trade if it took too long to be executed, but I don't think that's possible 😞

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

                                          Online Users

                                          C
                                          S
                                          P
                                          T
                                          I
                                          B
                                          A
                                          H
                                          E

                                          21
                                          Online

                                          146.7k
                                          Users

                                          22.4k
                                          Topics

                                          122.6k
                                          Posts

                                          Powered by NodeBB Forums | Contributors