Announcement

Collapse
No announcement yet.

Having Problems with closePosition() with latest IB Plugin

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

  • Having Problems with closePosition() with latest IB Plugin

    Had several automated strategies that were working and after upgrading the IB plugin to the most recently posted version the Generic Broker Function: closePosition(getSymbol()) does not apprear to send an order to the IB TWS.

    The symbol passed is any of the cash forex symbols.

    Is anyone using the lastest IB plugin able to successfully execute closePosition?

    Using the closePosition() although not ideal was a partial workaround for not having the ability to determine via the generic broker functions if a position was held.

    Although you cannot determine if you have a position, at least before executing an order you had the ability to insure any prior position swere closed first before executing a new order.

    With closePosition() no longer working and the inability to determine position status if anyone has any suggestions on how to get around this problem it would be appreciated.

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

  • #2
    Hi Glen,

    I don't know if you recall but with your help I was able to get IB plugin working (after some work.)
    Since then I had not dared to touch it, i.e. attempt to upgrade to the latest plugin.
    I am wondering what is in the latest plugin that would entice me (and evidentally has enticed you) to upgrade to it?

    Thanks.

    ziggy

    Comment


    • #3
      Originally posted by z11
      Hi Glen,

      I don't know if you recall but with your help I was able to get IB plugin working (after some work.)
      Since then I had not dared to touch it, i.e. attempt to upgrade to the latest plugin.
      I am wondering what is in the latest plugin that would entice me (and evidentally has enticed you) to upgrade to it?

      Thanks.

      ziggy
      Hi Ziggy,

      Sure I remember it very well. I should have left it alone but I was experiencing some disconnection problem which it sounded like were resolved.

      I'm still exepriencing connection problems and was very surprised that closePosition() stopped working completely. There are only a few generic functions and one whould think that who ever wrote the plugin would have uncovered the failure in their testing.

      I may have to back out the latest plugin or code around it. closePosition() was an important function as without it all we can rely on is a global variable (vPosition) and if eSignal is restarted or the study unloaded the status of the flag is invalid and results in incorrect trades.

      Thanks for the heads up Ziggy. I'm interested in hearing about how you handle similiar situations if you want to elaborate either here if it's off topic email me [email protected]. My generic broker stuff is very rudimentary, market orders, I don't like to get too fancy with ordes, so I doubt I can give you many pointers.

      Glen
      Glen Demarco
      [email protected]

      Comment


      • #4
        Hi Glen,

        We're currently looking into this issie. I'll let you know once we check it.

        Comment


        • #5
          Hi Glen,

          We've checked and all seems fine. Could you please try gbroker_tester.efs to check if closePosition(getSymbol()) doesn't work?

          Comment


          • #6
            Originally posted by amol
            Hi Glen,

            We've checked and all seems fine. Could you please try gbroker_tester.efs to check if closePosition(getSymbol()) doesn't work?
            Hi Amol,

            I ran a few tests and I see it's not failing as consistently as last week. I suspect there were problems on IB's end when the failure was occurring as I was seeing alot of unusual happenings.

            However the failure is occurring. I am attaching a screenshot with the error messages that I am recieving when using gbrokker_tester.efs to execute closePosition(). The message is "error 110 The price does not confirm to the minimum price variation for the contract GBP-CASH-USD"

            Thanks,

            Glen
            Attached Files
            Glen Demarco
            [email protected]

            Comment


            • #7
              Found on wiki


              110

              The price does not conform to the minimum price variation for this contract.

              Note: One reason this might happen is if a Limit price has more than 2 decimal places. Here is a quick way to fix this: (double) ((int)(limitprice*100))/100;

              Comment


              • #8
                Originally posted by clearpicks
                Found on wiki


                110

                The price does not conform to the minimum price variation for this contract.

                Note: One reason this might happen is if a Limit price has more than 2 decimal places. Here is a quick way to fix this: (double) ((int)(limitprice*100))/100;
                Hey Mike,

                The limit price was for more the 2 decimal price, so it looks like you may have identified the problem.

                Not sure if that C code solution is applicable as by default java initializes numeric decimal fields to many more then 2 decimel places?

                If the error message is valid and I was entering a limit order for a 4 decimal place currency which maybe something that slipped through the cracks.

                I appreciate the help very much, BTW do you happen to know if this forum is the proper place for resolution of these issues?

                If not is this something IB or eSignal tech support people are charged with resolving these type pf problems.

                The reason I ask is it's been several weeks and I haven't heard anything and several times for IB related problems I've posted problems that are not answered so this may not be the offical place to seek assistance.

                Thanks again for the help and that useful link.

                Glen
                Glen Demarco
                [email protected]

                Comment


                • #9
                  Hi Glen and Mike,

                  Thank you very much for your posts.

                  We failed to reproduce this error. I'm not quite sure if the problem is in broker plug-in, but anyway we will always round all the prices according mintick before sending them to TWS.

                  Comment

                  Working...
                  X