ranaroussi / ezibpy

ezIBpy, a Pythonic Client for Interactive Brokers API
Apache License 2.0
324 stars 116 forks source link

createOrderSpecAccount #26

Closed Git2TheChoppa closed 5 years ago

Git2TheChoppa commented 5 years ago

Hey, great library. I've added a small extension to the createOrder function, that allows you to specify a specific account that you'd like the order to route to. If you're trading under an FA account or any account with multiple users/accounts the default way the function is written will throw an error.

I've tested and this works and clears the error.

Cheers,

Tyler

ranaroussi commented 5 years ago

I'm rejecting this pull request as it gave me the push I needed to add support for multiple/FA accounts throughout the library.

You can now...

Thanks!

Git2TheChoppa commented 5 years ago

Awesome thank you! Any documentation in tutorials to be added? I guess I could also just read through the added methods if not... Has this been updated via pip install upgrade etc yet? Thanks, Tyler Martin  

-------- Original Message -------- Subject: Re: [ranaroussi/ezibpy] createOrderSpecAccount (#26) From: Ran Aroussi notifications@github.com Date: Thu, March 21, 2019 1:22 pm To: ranaroussi/ezibpy ezibpy@noreply.github.com Cc: Tyler Martin tyler@thompsonhouston.com, Author author@noreply.github.com

I'm rejecting this pull request as it gave me the push I needed to add support for multiple/FA accounts throughout the library. You can now... get info using getAccount('DUXXXXXX'), getPositions('DUXXXXXX'), getPortfolio('DUXXXXXX'), or getOrders('DUXXXXXX') submit orders to a specific account by specifing account=DUXXXXXX in createOrder(), placeOrder(), createBracketOrder(), createTrailingStopOrder(), createStopOrder(), and createTargetOrder() methods. Thanks! —You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

Git2TheChoppa commented 5 years ago

TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:01 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST 2019-03-21 18:24:02,502 [ERROR] ezibpy: [#326] Unable connect as the client id is already in use. Retry with a unique client id. Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST Server Version: 76 TWS Time at connection:20190321 18:24:02 CST 2019-03-21 18:24:12,995 [ERROR] ezibpy: [#515] Cancel Order Sending Error -[WinError 10053] An established connection was aborted by the software in your host machine Server Version: 76 TWS Time at connection:20190321 18:24:12 CST 2019-03-21 18:24:14,020 [ERROR] ezibpy: [#326] Unable connect as the client id is already in use. Retry with a unique client id. 2019-03-21 18:24:14,053 [ERROR] ezibpy: [#326] Unable connect as the client id is already in use. Retry with a unique client id.

I don't know if you'll still see this since it's closed but after submitting one order successfully, I get this error when trying to submit another... I assume something is possibly wrong with the disconnect function?

ranaroussi commented 5 years ago

Can you tell me which steps should I take to reproduce the error you're referring to?