Announcement

Collapse
No announcement yet.

interval between two submitted orders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • interval between two submitted orders

    I used a testing code to buy 2 ER2 contracts with a stop loss order sent out along with the "Buy MKT" order. What I do not understand is that why it took 3 seconds for TWS to accept the stop loss order. A screenshot image is attached. The code which submitted the orders is as follows.

    function sendSellMktWithBuyStopOrder(symbol, size, stop)
    {
    var size_ = size;
    if ( symbol.indexOf("ES ") == 0 || symbol.indexOf("AB ") == 0 || symbol.indexOf("NQ ") == 0 ) {
    if ( size_ > 0 && stop > 0 ) {
    sellMarket(symbol, size_, "GLOBEX", indexFuturesExpirationDate);
    buyStop(symbol, size_, stop, "GLOBEX", indexFuturesExpirationDate);
    }
    }
    else if ( symbol.indexOf("YM ") == 0 ) {
    if ( size_ > 0 && stop > 0 ) {
    sellMarket(symbol, size_, "ECBOT", indexFuturesExpirationDate);
    buyStop(symbol, size_, stop, "ECBOT", indexFuturesExpirationDate);
    }
    }
    else if ( symbol.indexOf("SPY") == 0 || symbol.indexOf("DIA") == 0 || symbol.indexOf("QQQQ") == 0 ) {
    if ( size_ > 0 && stop > 0 ) {
    if ( size_ < 10 ) size_ = 100 * size_;
    sellMarket(symbol, size_);
    buyStop(symbol, size_, stop);
    }
    }
    }


    The stop order is almost sent out at the same time as the buy mrk order. Why in the broker window in eSignal the buy mrk order was filled at 3:51:01pm while the stop loss order was timestamped at 3:51:04pm (PendingSubmit status). I think 3:31:04PM was the time the stop order accepted by TWS.

    My question is that what is the reason causing the three second delays between two orders.

    - Clearpicks
    Last edited by clearpicks; 01-19-2007, 01:28 PM.

  • #2
    Re: interval between two submitted orders

    Originally posted by clearpicks
    I used a testing code to buy 2 ER2 contracts with a stop loss order sent out along with the "Buy MKT" order. What I do not understand is that why it took 3 seconds for TWS to accept the stop loss order. A screenshot image is attached. The code which submitted the orders is as follows.

    function sendSellMktWithBuyStopOrder(symbol, size, stop)
    {
    var size_ = size;
    if ( symbol.indexOf("ES ") == 0 || symbol.indexOf("AB ") == 0 || symbol.indexOf("NQ ") == 0 ) {
    if ( size_ > 0 && stop > 0 ) {
    sellMarket(symbol, size_, "GLOBEX", indexFuturesExpirationDate);
    buyStop(symbol, size_, stop, "GLOBEX", indexFuturesExpirationDate);
    }
    }
    else if ( symbol.indexOf("YM ") == 0 ) {
    if ( size_ > 0 && stop > 0 ) {
    sellMarket(symbol, size_, "ECBOT", indexFuturesExpirationDate);
    buyStop(symbol, size_, stop, "ECBOT", indexFuturesExpirationDate);
    }
    }
    else if ( symbol.indexOf("SPY") == 0 || symbol.indexOf("DIA") == 0 || symbol.indexOf("QQQQ") == 0 ) {
    if ( size_ > 0 && stop > 0 ) {
    if ( size_ < 10 ) size_ = 100 * size_;
    sellMarket(symbol, size_);
    buyStop(symbol, size_, stop);
    }
    }
    }


    The stop order is almost sent out at the same time as the buy mrk order. Why in the broker window in eSignal the buy mrk order was filled at 3:51:01pm while the stop loss order was timestamped at 3:51:04pm (PendingSubmit status). I think 3:31:04PM was the time the stop order accepted by TWS.

    My question is that what is the reason causing the three minute delays between two orders.

    - Clearpicks
    Hi Clearpicks,

    I'm curious, was the market and stop order for the exact same price. As you know a market order get get filled immediately and a stop price needs to be printed and then becomes a market order. Was the market printing at the stop price when you submitted.

    Also it was a 3 second not 3 minute as you may have finger checked on that last sentenance.
    Glen Demarco
    [email protected]

    Comment


    • #3
      I forgot to attach the screenshot
      Attached Files

      Comment


      • #4
        Re: Re: interval between two submitted orders

        Hello Glen,

        As I wrote in one of my older posts, I use the highest high or lowest low of the last two bars as the stop trigger price. What do you mean by "the market is printing"?

        Do you mean the stop order has to wait for a transaction happens in the exchange before it can be accepted?

        Regards,
        Clearpicks


        Originally posted by demarcog
        Hi Clearpicks,

        I'm curious, was the market and stop order for the exact same price. As you know a market order get get filled immediately and a stop price needs to be printed and then becomes a market order. Was the market printing at the stop price when you submitted.

        Also it was a 3 second not 3 minute as you may have finger checked on that last sentenance.

        Comment


        • #5
          Re: Re: Re: interval between two submitted orders

          Originally posted by clearpicks
          Hello Glen,

          As I wrote in one of my older posts, I use the highest high or lowest low of the last two bars as the stop trigger price. What do you mean by "the market is printing"?

          Do you mean the stop order has to wait for a transaction happens in the exchange before it can be accepted?

          Regards,
          Clearpicks
          Clearpicks,

          "Print" is shorthand indicating an actual trade, or "trade print" that you can see nowadays, in the Exchange's Time and Sales data, or years ago on the actual ticker tape printer.



          To answer your question your will broker will accept the order, but that order will not be "elected" for execution until the market trades at that level, upon which time your stop order becomes a market order and get's executed. That's looks like what the "pending submit" status mean, it is accepted but will be submitted for execution when the market trades there.

          Based on a quick look in the time and sales for AB #f for the emini russell 2k, the market was trading 7990 when you sent the order and didn't print 7880 unitil 20 seconds or so later the earliest time your order could have been executed.
          Last edited by demarcog; 01-19-2007, 07:48 PM.
          Glen Demarco
          [email protected]

          Comment


          • #6
            Re: Re: Re: Re: interval between two submitted orders

            Glen,

            The testing was done in my IB papertrader account, but I did not notice any data delay compared with the real IB account.

            When a stop order is received by IB TWS, the broker window in eSignal shows that order with "PendingSubmit" status. This might be because of stop order is not a native order type in CME, so it is simulated by IB server or IB TWS ( I am not sure which side is correct place the stop order is held) After the market print hits the stop price, the stop order would be elected to market order and get executed. In such case the order status in eSignal broker window gets updated and changed to "Filled". That is the reason why in my screenshot, there is only one order with "PendingSubmit" status, although there were quite some stop orders sent out and got executed before it.

            One more question, in real trading account, if a buy stop order's stop price is set to lower than the current market print, is that order got rejected by the exchange or got elected immediated to market buy order? I never used stop orders in this way. However in my automatic trading, the stop price may get too close to the market print when it arrives at TWS and there is possibility it is already higher (for sell stop order) or lower (for buy stop order) than the market print. I need to know how it gets handled in real trading account. Do you know the answer?

            BTW, potentially I may use TWSLink as a second data feed to cross verify my order entry price.

            - Clearpicks


            Originally posted by demarcog
            Clearpicks,

            "Print" is shorthand indicating an actual trade, or "trade print" that you can see nowadays, in the Exchange's Time and Sales data, or years ago on the actual ticker tape printer.

            My question was did the market trade or "print" at the actual stop price in your order?

            To answer your question your will broker will accept , as in this case a Sell Stop order below where the market is currently trading or printing, but that order will not be "elected" for execution until the market trades at that level, upon which time your stop order becomes a market order and get's executed.

            Based on a quick look in the time and sales for AB #f for the emini russell 2k, the market was trading 7990 when you sent the order and didn't print 7880 unitil 20 seconds or so later when you stop was elected.

            Comment


            • #7
              Re: Re: Re: Re: Re: interval between two submitted orders

              Originally posted by clearpicks
              [B]Glen,

              The testing was done in my IB papertrader account, but I did not notice any data delay compared with the real IB account.
              I wasn't suggesting there was delay. Your price stop wasn't hit until 30 seconds after you send the order. Open up a time and sales window for the symbol you are trading and you will see the trade history..


              When a stop order is received by IB TWS, the broker window in eSignal shows that order with "PendingSubmit" status. This might be because of stop order is not a native order type in CME

              The CME accepts stop orders for E-Mini E-russell contracts.



              One more question, in real trading account, if a buy stop order's stop price is set to lower than the current market print, is that order got rejected by the exchange or got elected immediated to market buy order? I never used stop orders in this way. However in my automatic trading, the stop price may get too close to the market print when it arrives at TWS and there is possibility it is already higher (for sell stop order) or lower (for buy stop order) than the market print. I need to know how it gets handled in real trading account. Do you know the answer?
              A sell stop will become a market order if the market trades at or BELOW you stop price. A buy stop becomes a market order if the market trade at or ABOVE your stop price.

              You definately have to be very careful.. as if you put in the wrong price for a sell stop for example above the current price you get filled instantly......you are out of a good position and it could take you five minutes before you figure out why....a long time when trading..


              Now, depending on the broker and software there may be "sanity checks" and orders can be rejected if the market is trading too close to your stop or you put in a stop price beyond (2.5 percent or something like thaton the CME i think) of the current price on the CME.

              Same thing with limit orders, check, double check and triple check the order before sending it.
              Glen Demarco
              [email protected]

              Comment


              • #8
                Re: Re: Re: Re: Re: Re: interval between two submitted orders

                Glen,

                The screenshot was taken after the stop order was sent out but before it was elected. I did not made screenshot after the pendingsubmit status was changed to filled when that stop order was triggered.

                I will go to check whether CME accepts stop order as native order type for all eminis. Becareful IB provides simulated stop order if an exchange does not support native stop order. It seems ECBOT and DTB support native stop order, while for smart and CME, IB does simulated stop order.

                I still can not figure out what those orders were not sent out at almost the same time.

                - Clearpicks


                Originally posted by demarcog
                I wasn't suggesting there was delay. Your price stop wasn't hit until 30 seconds after you send the order. Open up a time and sales window for the symbol you are trading and you will see the trade history..


                The CME accepts stop orders for E-Mini E-russell contracts.




                A sell stop will become a market order if the market trades at or BELOW you stop price. A buy stop becomes a market order if the market trade at or ABOVE your stop price.

                You definately have to be very careful.. as if you put in the wrong price for a sell stop for example above the current price you get filled instantly......you are out of a good position and it could take you five minutes before you figure out why....a long time when trading..


                Now, depending on the broker and software there may be "sanity checks" and orders can be rejected if the market is trading too close to your stop or you put in a stop price beyond (2.5 percent or something like thaton the CME i think) of the current price on the CME.

                Same thing with limit orders, check, double check and triple check the order before sending it.

                Comment


                • #9
                  Re: Re: Re: Re: Re: Re: Re: interval between two submitted orders

                  Originally posted by clearpicks
                  [B]Glen,

                  The screenshot was taken after the stop order was sent out but before it was elected. I did not made screenshot after the pendingsubmit status was changed to filled when that stop order was triggered.
                  It looks to me like everything is working fine. You were asking why the order was delayed before being filled.

                  You were asking about why the "pendind submitted" status and time delay. That was because as I mentioned and you suggested your stop order won't be filled until the market trades there, which is what happened.

                  I will go to check whether CME accepts stop order as native order type for all eminis. Becareful IB provides simulated stop order if an exchange does not support native stop order. It seems ECBOT and DTB support native stop order, while for smart and CME, IB does simulated stop order.
                  If IB allows you to place stop orders for exchanges that do not support stop orders then that is a AWESOME capability that most brokerage systems don't not provide (like Goldman Sachs Redi Plus for the SPY's & QQQQ's). Not being able to put a stop in is a trading nightmare and I'm glad to hear that about IB.


                  I still can not figure out what those orders were not sent out at almost the same time.
                  Now I'm totally confused. Are you talking about the "pending submitted" orders that remain in the "pending submitted" state until the market trades at your stop price when they get executed?

                  Or other orders?
                  Glen Demarco
                  [email protected]

                  Comment


                  • #10
                    Re: Re: Re: Re: Re: Re: Re: Re: interval between two submitted orders

                    I was asking why the buy mkt order was sent out first ( at 3:51:01PM) then almost three seconds later the sell stop order was sent out (at 3:51:04PM).

                    - Clearpicks


                    Originally posted by demarcog
                    It looks to me like everything is working fine. You were asking why the order was delayed before being filled.

                    You were asking about why the "pendind submitted" status and time delay. That was because as I mentioned and you suggested your stop order won't be filled until the market trades there, which is what happened.


                    If IB allows you to place stop orders for exchanges that do not support stop orders then that is a AWESOME capability that most brokerage systems don't not provide (like Goldman Sachs Redi Plus for the SPY's & QQQQ's). Not being able to put a stop in is a trading nightmare and I'm glad to hear that about IB.



                    Now I'm totally confused. Are you talking about the "pending submitted" orders that remain in the "pending submitted" state until the market trades at your stop price when they get executed?

                    Or other orders?

                    Comment


                    • #11
                      Hi Clearpicks,
                      I had a problem that my order would get canceled or a partial fill with IB's paper trading

                      I seached IBs form and found this:

                      "There is a unhandled error: "138 | 202 | Order
                      Canceled - reason:The market order was partially
                      executed. Remaining quantity of 1 was removed".

                      I did a little bit of research and it appears that
                      this is a paper trading anomaly. Very often, when I
                      trade the paper trading account manually, there is no
                      bid/ask even with the very liquid contracts such as
                      ES. In such situations, if I have a market order to
                      buy, there is no one to sell, and the order will be
                      cancelled. So, I'd say that the error "138 | 202 |
                      Order Canceled" would never happen in the real
                      account, as long as there is bid/ask for the security.
                      "

                      So the issue was with IB's paper trading account.

                      Maybe they fixed the problem by waiting a few sec until they got a bid/ask?

                      Just a thought
                      Tom

                      Tom

                      Comment

                      Working...
                      X