Announcement

Collapse
No announcement yet.

closeAllPositions() does work correctly (Error message: duplicate order id)

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

  • #16
    Originally posted by stevehare2003
    Hi Clearpicks,

    IB has a pdf document that discusses the functions (and how they work) associated with their API. I do not believe cancelAllOrders(), closePosition() or cancelOrder() are functions or commands that are valid for that platform. If that is the case, any issues or problems you have with the commands are most likely with the software that is communicating with the API.

    I have a link to the documentation for IB API here. Perhaps that will be helpful in chasing down some of the issues you are having with the interface.
    Steve,

    Thanks for the link, somehow I missed that pdf file, great doc...all 670 colcrful pages, almost worth printing.....

    BTW, that latest renko4drift.efs....solid as a rock...works like a charm

    Keep in touch,

    Glen
    Last edited by demarcog; 01-26-2007, 11:02 AM.
    Glen Demarco
    [email protected]

    Comment


    • #17
      Hello Clearpicks,

      Originally posted by clearpicks
      However there are still quite a few issues:

      1. closePosition(symbol) does not work.
      Confirmed. This function is not generating any orders. I'll report this to development.

      OBCBridge 1.2.529.1342
      eSignal 8.0 build 782
      TWS build 865.7
      Java version 1.5.0_10


      2. cancelOrder(symbol) and cancelAllOrders() can not cancel orders manually set in IB TWS if IBBridge uses client id other than 0.
      I think this is the expected behavior. The TWS client ID is set at 0 by default for all manual orders placed through TWS. The IBBridge in eSig has client set at 0 by default but can be changed by the user. The GB functions should only attempt to cancel orders in TWS associated with the client ID number set in the eSignal IB settings. If this number is set at 1 or higher manual orders in TWS should be unaffected by these functions.

      3. If there are positions in multiple instruments, it seems closeAllPositions() does not send out orders to close those positions at the same time. It seems the order sending rate is limited to one or two message per second. In the screenshot attached, I tried to close positions in ES, YM, QQQQ, NQ, ER2, DIA, SPY, QM, YG, USO at the same time using closeAllPositions().
      However

      at 11:21:15 orders to close ES was placed
      at 11:21:16 orders to close NQ was placed
      at 11:21:17 YM and QQQQ
      at 11:21:18 DIA and ER2
      at 11:21:19 QM and SPY
      at 11:21:20 YG
      at 11:21:21 USO

      Is it the IBBridge or IB TWS limiting the number of transactions per second done via API or it is just because I am using IB papertrading account?

      - Clearpicks
      In my testing all closing orders appeared to be sent almost simultaneously. The execution time stamps were the same at least. I tested this using 4 open positions.
      Jason K.
      Project Manager
      eSignal - an Interactive Data company

      EFS KnowledgeBase
      JavaScript for EFS Video Series
      EFS Beginner Tutorial Series
      EFS Glossary
      Custom EFS Development Policy

      New User Orientation

      Comment


      • #18
        Jason,

        Thanks very much for confirming and passing on the information about closePosition(), I really appreciate it.

        Glen
        Glen Demarco
        [email protected]

        Comment


        • #19
          Hello Jason,

          Thanks. I wish the closePosition(symbol) bug be fixed soon.
          Any comment on the issue of "duplicate order id error" I had?


          - Clearpicks

          Comment


          • #20
            Hello Clearpicks,

            Regarding the duplicate order ID error message, I did not see one last week when using the OBCBridge with 8.0. In one of your earlier messages here you mentioned a solution to this that looks like C# code. Is the error message you're receiving be generated while using a 3rd party product?
            Jason K.
            Project Manager
            eSignal - an Interactive Data company

            EFS KnowledgeBase
            JavaScript for EFS Video Series
            EFS Beginner Tutorial Series
            EFS Glossary
            Custom EFS Development Policy

            New User Orientation

            Comment


            • #21
              Hello Jason,

              The "duplicate order id error" was generated by IBBridge, not any other third party program.

              It seems IBBridge can not track order id usage correctly if the IBBridge uses the same client id as instructed on esignal IBBridge installation webpage. Whenever the user does same trade manually in TWS, the IBBridge will use one duplicate order id in its next trade, which always results a duplicate id error.

              - Clearpicks

              Originally posted by JasonK
              Hello Clearpicks,

              Regarding the duplicate order ID error message, I did not see one last week when using the OBCBridge with 8.0. In one of your earlier messages here you mentioned a solution to this that looks like C# code. Is the error message you're receiving be generated while using a 3rd party product?

              Comment


              • #22
                Hello Clearpicks,

                Confirmed. If you use 0 for the client ID in eSignal and you are entering orders manually through TWS for the same symbol the order ID in eSignal does not increment accordingly, which results in the error message. The solution is to use a client ID in eSignal that is different than 0. I'm not sure if this is something that can be changed, but if it is an enhancement that is necessary for your trading, please feel free to submit a request to add this functionality at [email protected].
                Jason K.
                Project Manager
                eSignal - an Interactive Data company

                EFS KnowledgeBase
                JavaScript for EFS Video Series
                EFS Beginner Tutorial Series
                EFS Glossary
                Custom EFS Development Policy

                New User Orientation

                Comment


                • #23
                  Originally posted by JasonK
                  Hello Clearpicks,

                  Confirmed. If you use 0 for the client ID in eSignal and you are entering orders manually through TWS for the same symbol the order ID in eSignal does not increment accordingly, which results in the error message. The solution is to use a client ID in eSignal that is different than 0. I'm not sure if this is something that can be changed, but if it is an enhancement that is necessary for your trading, please feel free to submit a request to add this functionality at [email protected].
                  Jason,

                  I just wanted to verify that this is a different condition from where no orders are placed in TWS for the same symbol as positions generated by a strategy EFS.

                  When executing the closePosition(getsymbol()) function I am not receiving any message from TWS and the positioned is also not cancelled.

                  I think you mentioned in an earlier post that this information was passed on to development and hopefully they are working on a solution?

                  This is a problem for me as I rely on closePosition() to insure my positions generated within my strategy EFS is in sync with the actual position in TWS.

                  Do you have any idea if the functionality provided by EFS will be enhanced significantly in the near future either with 8.1 or otherwise or do you recommend another 3rd party API (such as NinjaTrader)?


                  Thanks very much,

                  Glen
                  Last edited by demarcog; 01-30-2007, 02:14 PM.
                  Glen Demarco
                  [email protected]

                  Comment


                  • #24
                    Hello Glen,

                    Originally posted by demarcog
                    Jason,

                    I just wanted to verify that this is a different condition from where no orders are placed in TWS for the same symbol as positions generated by a strategy EFS.

                    When executing the closePosition(getsymbol()) function I am not receiving any message from TWS and the positioned is also not cancelled.

                    I think you mentioned in an earlier post that this information was passed on to development and hopefully they are working on a solution?

                    This is a problem for me as I rely on closePosition() to insure my positions generated within my strategy EFS is in sync with the actual position in TWS.
                    Yes, this is a different issue. The problem with closePosition() was confirmed earlier in this thread. See my post from 1/26.


                    Do you have any idea if the functionality provided by EFS will be enhanced significantly in the near future either with 8.1 or otherwise or do you recommend another 3rd party API (such as NinjaTrader)?


                    Thanks very much,

                    Glen
                    There won't be anything new in this regard for 8.1 as that version is in it's final stages. As far as 3rd party products go, I'm not at liberty to make any recommendations.
                    Jason K.
                    Project Manager
                    eSignal - an Interactive Data company

                    EFS KnowledgeBase
                    JavaScript for EFS Video Series
                    EFS Beginner Tutorial Series
                    EFS Glossary
                    Custom EFS Development Policy

                    New User Orientation

                    Comment


                    • #25
                      Hi Jason,

                      Yesterday I received an email from Brent announcing a new version of quotetrader. Do you known whether those known bugs in IBBridge such as closePosition(getsymbol()) has been fixed or not? Thanks.


                      - Clearpicks

                      Comment


                      • #26
                        Hello Clearpicks,

                        The last time I tested this function on 2/1/07 with OBCBridge 1.2.724.1134 closePosition() was working properly. Are you seeing something different now with this function? If so, what is the OBCBridge version number you are currently using?
                        Jason K.
                        Project Manager
                        eSignal - an Interactive Data company

                        EFS KnowledgeBase
                        JavaScript for EFS Video Series
                        EFS Beginner Tutorial Series
                        EFS Glossary
                        Custom EFS Development Policy

                        New User Orientation

                        Comment


                        • #27
                          Hello Clearpicks,

                          I've also tested this function in QT v866 and it appears to be working. Let us know if you have any problems with the function.
                          Jason K.
                          Project Manager
                          eSignal - an Interactive Data company

                          EFS KnowledgeBase
                          JavaScript for EFS Video Series
                          EFS Beginner Tutorial Series
                          EFS Glossary
                          Custom EFS Development Policy

                          New User Orientation

                          Comment

                          Working...
                          X