Announcement

Collapse
No announcement yet.

IB plugin

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

  • IB plugin

    using Esignal 10.3.1476.1063 1/15/09
    ibbridge.1473.exe

    I am testing out this IB bridge via efs (as well as via the Order Ticket dialog) to evaluate it's viability. I acknowledge that this is "not ready for prime time" as stated in the docs/disclaimer.

    0) I have the IB plugin configued and working. I can create trades with the Order Ticket as well as efs buy/sell apis.

    1) When a trade is entered (either via efs buyMarket etc, or via Order Ticket button) eSignal goes away for 10 full seconds. After the 10 seconds the trade occurs and is reflected on IBs TWS app. Obviously the main gui thread is being used to perform the IB plugin api call, instead of it occuring on a background thread. By "goes away" I mean that eSignal is unresponsive. The clock in lower left eSignal window stops for 10 seconds.

    2) Both the closePosition and closeAllPositions efs functions do not work. They do not appear to do anything at all. There are several disadvantages of this w.r.t. fully automated trading driven by efs. 1) If you want to close out of all position at the end of the day a closeAll api is ideal. 2) if you have auto created bracket orders with a trade the closePosition api should take care of cancelling the brackets as well.

    3) The OrderTicket window does not reflect positions created by efs. I noticed that if I Disconnect from IB, then reconnect, then the OrderTicket window does reflect a position. (Upper right corner of OrderTicket window, Pending/Positions/Last Fill)

    4) On the OrderTicket the purple "Close <symbol>" button always shows "1 Position" regardless. Clicking it has not affect, i.e. it fails to close out a position.

    5) Periodically the eSignal ibbridge/ TWS connection appears to be lost. At that time the ibbridge attempts to initiate a reconnect, at which point the confirmation dialog is presented on TWS requiring that the user be sitting at this keyboard. This will not work for an automated efs trading system.

    6) It strikes me as odd that you have buy, sell, sellShort apis, but you left out the buyCover.

    Anyone else using the ibbridge I'd appreciate knowing if you are experience similar or different issues. Thanks, Mike

  • #2
    Hi mikem2006.

    Thanks for the post. We'll check this shortly and I let you know the conclusion.

    Best regards.

    Comment


    • #3
      ibbridge

      One more observation.

      As a test I am running an efs that places a trade once every minute (1 min chart, computeOnClose(1)). Sort of running an endurance test on the whole rube goldberg contraption to see just how well and how long it can stay on it's tracks.

      For the most part it works. Except for the occaisional connection lost problem and one thing I just noticed. 2 or 3 trades were missed, and in the bottom right of the eSig chart there was a balloon message (yellow background) indicating that the trades were rejected by IB. Then the next trade was accepted and it continued to work, accepting buy and sell each minute. Nothing appears on the TWS app in the form of error msgs.

      My test efs is alternately buying and selling each minute, so that one minute it is in a position, then the next minute it is flat and so on. So missing a trade like this can cause efs to get out of sync, i.e. it no longer has the correct trade position state. Couple this with the absence of a working closePosition api and we're not left with any more than a system in alpha testing, IMHO.

      Still I am hopeful that these issues will be resolve in the near term. I hope to get some response from eSignal. Thanks

      Here is some info from the TWS log:
      grep -i rejected x
      GX 12:54:15:999 AWT-EventQueue-0: [1:32:43:1:0:4:2ET] [4;2;244;201;Order rejected - reason:COULD NOT VALUE THIS CONTRA
      CT AT THIS TIME]
      GX 12:54:36:627 AWT-EventQueue-0: [1:32:43:1:0:4:2ET] [4;2;245;201;Order rejected - reason:COULD NOT VALUE THIS CONTRA
      CT AT THIS TIME]
      GX 13:16:35:339 AWT-EventQueue-0: [1:32:43:1:0:4:2ET] [4;2;266;201;Order rejected - reason:COULD NOT VALUE THIS CONTRA
      CT AT THIS TIME]
      GX 13:16:35:523 AWT-EventQueue-0: [1:32:43:1:0:4:2ET] [4;2;267;201;Order rejected - reason:COULD NOT VALUE THIS CONTRA
      CT AT THIS TIME]
      GX 13:17:46:607 AWT-EventQueue-0: [1:32:43:1:0:4:2ET] [4;2;268;201;Order rejected - reason:COULD NOT VALUE THIS CONTRA
      CT AT THIS TIME]

      The times correspond to missed trades. I will send this to IB as well to see if they can help.
      Last edited by mikem2006; 02-02-2009, 11:23 AM.

      Comment


      • #4
        IB Plugin Issues

        To Max S:

        I too am experiencing connectivity issues with the IB plugin while trading equities. For eMinis, it works flawlessly. However, when trading equities the buyMarket(), sellMarket() commands are not performing the sends to the TWS. Is there a parameter I am missing or...?

        equities command line = buyMarket(getSymbol(), [num shares])

        eMinis command line = buyMarket(getSymbol(), [num contracts])

        Both the equity and eMini instrument symbols have been added to the Symbology list and are listed in the Order Management API window of the TWS, yet only the eMini trades are executed.

        I spoke with IB at some length this morning and they were unable to help me. They think it may be something to do with how the EFS IB bridge is interpreting the JAVA based send commands from inside the EFS script (noted above), and therefore they directed me back to eSignal tech support, who in turn directed me to this forum.

        Any help would be appreciated.

        Regards,
        Ryan.

        Comment


        • #5
          TWS logs

          Are you monitoring the TWS logs? They are a help to me.

          I found the IB plugin to be a bit finicky to configure before my trades would go through. I found I had to get the symbol in the symbol map, get the default order entry set just right etc. I did find that the SMART exchange did not work for me, rather had to specify GLOBEX.

          Have you tried the closePosition apis?

          Comment


          • #6
            Hi,

            closePosition() does not work for me either...

            Re: Symbol Map - to trade the March eMinis contract of the YM I have:
            IB symbol = YM
            eSig symbol = YM H9
            exhange = eCBOT
            expirey = 200903

            To buy 4 contracts @ Market:
            EFS command line = byMarket(YM H9,4) ..... Works perfectly.

            For equities, I tried:
            IB symbol = MSFT
            eSig symbol = MSFT
            exchange = SMART
            expirery = 200912

            To buy 100 MSFT @ Market:
            EFS command line = byMarket(MSFT, 100) ..... no luck.

            The trade simply does not register with the TWS.

            Any suggestions?

            Thanks.

            Comment


            • #7
              What default order entry settings were required?

              Comment


              • #8
                I had a similar result when I used SMART. You might try the correct exchange, NYSE or what ever it is If you haven't. Maybe there's a problem with SMART.

                On my default Order settings I had to create an entry for my symbol ES H9, and set the route GLOBEX and type to MKT. Until I did this I did not get trades to go.
                Last edited by mikem2006; 02-02-2009, 08:01 PM.

                Comment


                • #9
                  I have similar proplems with my own solution. Sometimes orders don't get transmitted to IB. So far, the only thing I can attribute to the problem is ISP problems.

                  You've gotta watch your robots when you run them.
                  Brad Matheny
                  eSignal Solution Provider since 2000

                  Comment


                  • #10
                    That may well be interesting, but here we are talking about eSignal <-> TWS api communication on the same host (at least that's what I am talking about). ISP is not involved.

                    Thanks

                    Comment


                    • #11
                      IB Plugin &quot;buyMarket()&quot; parameters

                      Thanks for your Input fellas,

                      Can anyone tell me the exact syntax of the EFS script that is required to successfully execute EQUITY trades using the IB plug-in?

                      Specifially, are all the following parameters required?

                      buyMarket( [instrument], [# shares], [instrument type], [exchange], [order type], [currency] )

                      eg: "buyMarket(MSFT,100,STK,NASDAQ,MARKET,USD)"

                      or will simply "buyMarket(MSFT, 100)" get the job done... since the symbology map has been correctly populated...?

                      I guess what I really need to land on is the exact set of parameters necessary to execute a stock trade from within eSignal using the built-in Java-based EFS script.

                      Also, rather than hard-coding a default # of shares per order, I would prefer to let EFS calculate share size based on risk which is why I am after the precise syntax.

                      Any help would be appreciated.

                      Thank-you.

                      Comment


                      • #12
                        eSig &lt;-&gt; TWS interface

                        Yes Mike, this is exactly what I am talking about as well...

                        Regards,
                        Ryan.


                        Mike2006 wrote >>

                        That may well be interesting, but here we are talking about eSignal <-> TWS api communication on the same host (at least that's what I am talking about). ISP is not involved.

                        Thanks

                        Comment


                        • #13
                          IB bridge

                          I've been running my test script for 3 days now, round the clock, since my original post on this thread.

                          I addressed (5) Connection problems by adding my IP to TWS trusted clients. That makes it appear as though the connection is never lost. In any case, it paves over the issue and things keep running uninterrupted.

                          I also slowed down the trade frequency to once every 5 minutes. It has been working non stop for 3 days without missing a beat and it has remained in-sync with TWS. What I mean by that is, if a trade is missed then TWS might show a position while eSignal does not. This has not happened so far.

                          So I am pleased with the endurance results so far, just for the record. The other issues I mentioned previously (1) - (4) are still present and a big problem for anyone wanting to do live trading with efs/ibbridge

                          (1) is particularly troubling. Is this a known issue and is there anything that can be done about it?

                          1) When a trade is entered (either via efs buyMarket etc, or via Order Ticket button) eSignal goes away for 10 full seconds. After the 10 seconds the trade occurs and is reflected on IBs TWS app. Obviously the main gui thread is being used to perform the IB plugin api call, instead of it occuring on a background thread. By "goes away" I mean that eSignal is unresponsive. The clock in lower left eSignal window stops for 10 seconds.
                          Last edited by mikem2006; 02-05-2009, 08:43 AM.

                          Comment


                          • #14
                            Re: IB plugin

                            Hello Mike,

                            Originally posted by mikem2006
                            using Esignal 10.3.1476.1063 1/15/09
                            ibbridge.1473.exe

                            ...

                            1) When a trade is entered (either via efs buyMarket etc, or via Order Ticket button) eSignal goes away for 10 full seconds. After the 10 seconds the trade occurs and is reflected on IBs TWS app. Obviously the main gui thread is being used to perform the IB plugin api call, instead of it occuring on a background thread. By "goes away" I mean that eSignal is unresponsive. The clock in lower left eSignal window stops for 10 seconds.
                            This is a new issue that we've recently encountered with 10.3. The problem is in the eSignal application and will be fixed for the next version. It's related to order confirmation dialog option. If you enable the order confirmations, the delay goes away.

                            2) Both the closePosition and closeAllPositions efs functions do not work. They do not appear to do anything at all. There are several disadvantages of this w.r.t. fully automated trading driven by efs. 1) If you want to close out of all position at the end of the day a closeAll api is ideal. 2) if you have auto created bracket orders with a trade the closePosition api should take care of cancelling the brackets as well.
                            Both close functions are working properly in our internal build for the next release. Both functions do cancel all bracket orders as well. This will also be working in the next release.

                            3) The OrderTicket window does not reflect positions created by efs. I noticed that if I Disconnect from IB, then reconnect, then the OrderTicket window does reflect a position. (Upper right corner of OrderTicket window, Pending/Positions/Last Fill)
                            This is also working in our current internal build and will be fixed for the next release.

                            4) On the OrderTicket the purple "Close <symbol>" button always shows "1 Position" regardless. Clicking it has not affect, i.e. it fails to close out a position.
                            Problem confirmed. We'll report this to engineering.

                            5) Periodically the eSignal ibbridge/ TWS connection appears to be lost. At that time the ibbridge attempts to initiate a reconnect, at which point the confirmation dialog is presented on TWS requiring that the user be sitting at this keyboard. This will not work for an automated efs trading system.
                            There are many reasons for a loss of connection that our software has no control over. If your internet connection goes down or the broker server etc, our plug-in can only detect that the connection is lost and will automatically try to reconnect. The connection may not be able to reestablish if your internet connection is lost. Therefore, any auto-trading system should not be left unattended.

                            6) It strikes me as odd that you have buy, sell, sellShort apis, but you left out the buyCover.
                            The buy functions can be used to cover short positions. Did you try this?
                            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


                            • #15
                              Ok

                              Ok great. What's the ETA on the next release?

                              5) I am referring to the connection between eSignal and TWS. My eSignal and TWS are on the same host, so the internet connection is not involved here. I can confirm that the connection is periodically lost; for no apparent reason. I confirm this by removing 127.0.0.1 from the trusted api clients list in TWS. When I do that the TWS 'allow client connect' confirmation dialog may and does appear at some point in time. And eSignal complains that it cannot connect to IB/TWS. Once I click OK to allow it it begins working again.

                              You may wish to examine why the ibbridge connection drops so often on the same host. As long as I have 127.0.0.1 in the TWS trusted clients things appear copasetic. But it still begs the question as to why the connection is periodically lost & reconnected.

                              6) It strikes me as odd that you have buy, sell, sellShort apis, but you left out the buyCover. >>The buy functions can be used to cover short positions. Did you try this?<<

                              Yes it works that was not my point. I was speaking to the api design issue.

                              buy and sell api calls are all that is needed. Yet the designer chose to provide a separate api for sellShort. I presume just to make code more readable since I do not think that the exchange distinguishes between sell and sellShort. I.O.W. in the absense of an existing long position a sell order will do the same thing as a sellShort order.

                              I was merely saying that since you added "sellShort" to the buy,sell api set, you might have also added buyCover to round out the api. No big deal just an observation.

                              Thanks
                              Mike Makuch

                              Comment

                              Working...
                              X