tag:blogger.com,1999:blog-261139923818144971.post7039837230898956023..comments2024-03-27T07:58:49.946+00:00Comments on This Blog is Systematic: The placing of orders to interactive brokers with swigibpy / pythonRob Carverhttp://www.blogger.com/profile/10175885372013572770noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-261139923818144971.post-81474691432158625952016-10-29T10:06:41.495+01:002016-10-29T10:06:41.495+01:00No sorry I don't use any special order types s...No sorry I don't use any special order types so I can't help you. Try IB support or the appropriate forums on elitetrader.comRob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-9015314504941520042016-10-27T23:52:09.544+01:002016-10-27T23:52:09.544+01:00Hi Rob,
Do you have any advice on VWAP or Arrival ...Hi Rob,<br />Do you have any advice on VWAP or Arrival Price orders? I cannot find a way to execute these in IB...<br />Thanks!AvantGardehttps://www.blogger.com/profile/13449856505135293636noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-32491612717253597642016-07-05T06:28:41.822+01:002016-07-05T06:28:41.822+01:00Sorry... it just works for me without doing anythi...Sorry... it just works for me without doing anything special. You'll have to speak to IB support.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-86331449570382317692016-07-05T00:51:34.991+01:002016-07-05T00:51:34.991+01:00Hi Rob,
one quick question, how do you introduce t...Hi Rob,<br />one quick question, how do you introduce the price for limit or stop orders for futures bonds? Like ZF, ZN... i try a lot of ways but IB API is rejecting my price always, could you help me? ThanksA.https://www.blogger.com/profile/08441307745666226310noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-36591995832964070762015-12-15T15:40:20.193+00:002015-12-15T15:40:20.193+00:00Great! Thanks for the explanation.
The code did w...Great! Thanks for the explanation.<br /><br />The code did work for my paper account during market hours after the trade went through. I guess one more exceptions to catch for me!VitaminChttps://www.blogger.com/profile/11867967457842833196noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-33548304299347984752015-12-14T09:42:12.358+00:002015-12-14T09:42:12.358+00:001) in def get_executions(), the code request list ...1) in def get_executions(), the code request list of executions from TWS using self.tws.reqExecutions(...) and somehow the data shows up in the IBWrapper() in self.cb.data_fill_data[reqId]? How does that work?<br /><br />2) Under Class IBWrapper(), function add_fill_data() and execDetails() have only been called within each other but not been callback under Class IBClient. What do those function fit in the whole scheme of things?<br /><br />What happens is when you call IBclient.get_executions, specifically self.tws.reqExecutions(reqId, ExecutionFilter()):<br /><br />- the IB server starts sending details of any executions done today<br />- the IB wrapper receives these details, and will call execDetails when it gets one<br />- This then calls self.add_fill_data(reqId, execdetails) [unless it's a fill for an active order]<br />- This adds the execution data to a dictionary, keyed off reqId<br />- when too much time has elapsed or there is no more data to come, we stop and return<br /><br />There is more explanation of how the server and client talk to each other in the first post in the series. <br /><br />As to your problem; well outside of market hours it would be a surprise if you had any fills... try and do this in market hours and see if you get the same problem<br /><br />RobRob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-7525918557959041562015-12-14T08:11:11.400+00:002015-12-14T08:11:11.400+00:00Hi Rob,
Run into errors with client.get_execution...Hi Rob,<br /><br />Run into errors with client.get_executions() and I have two questions regarding the code.<br /><br />Any help will be greatly appreciated!<br /><br />1) in def get_executions(), the code request list of executions from TWS using self.tws.reqExecutions(...) and somehow the data shows up in the IBWrapper() in self.cb.data_fill_data[reqId]? How does that work?<br /><br />2) Under Class IBWrapper(), function add_fill_data() and execDetails() have only been called within each other but not been callback under Class IBClient. What do those function fit in the whole scheme of things?<br /><br />I am executing the code in off hours so there's no fill. Order placement, checking active orders, and order cancellation all works fine. But getting execution details seems not to be working; data_fill_data is only a {} and reqId is not associated with anything.<br /><br />Here's the error code:<br /><br />Traceback (most recent call last):<br /><br /> File "", line 1, in <br /> runfile('C:/Python27/User/swigibpy/ibswigsystematicexamples-master/test4_IB.py', wdir='C:/Python27/User/swigibpy/ibswigsystematicexamples-master')<br /><br /> File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile<br /> execfile(filename, namespace)<br /><br /> File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile<br /> exec(compile(scripttext, filename, 'exec'), glob, loc)<br /><br /> File "C:/Python27/User/swigibpy/ibswigsystematicexamples-master/test4_IB.py", line 80, in <br /> execlist=client.get_executions()<br /><br /> File "sysIB\wrapper_v4.py", line 457, in get_executions<br /> execlist=self.cb.data_fill_data[reqId]<br /><br />KeyError: 1729<br /><br /><br />VitaminChttps://www.blogger.com/profile/11867967457842833196noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-35746337952933584222015-04-10T11:19:02.004+01:002015-04-10T11:19:02.004+01:00Okay I will take your word for it. The IB API docu...Okay I will take your word for it. The IB API documentation shows XYZ. It is very stupid to be forced to pass an empty argument. This is why I don't update my API if I can help it.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-41872657243223917482015-04-10T01:09:04.669+01:002015-04-10T01:09:04.669+01:00I found None in the swigpy example.I found None in the swigpy example.Mudit Wahalhttps://www.blogger.com/profile/03985795548507450963noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-37881223821179591822015-04-10T01:07:46.765+01:002015-04-10T01:07:46.765+01:00You need to use "None".You need to use "None".Mudit Wahalhttps://www.blogger.com/profile/03985795548507450963noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-25124534440837385682015-04-08T10:51:25.949+01:002015-04-08T10:51:25.949+01:00It looks like the API has been updated recently (I...It looks like the API has been updated recently (I ran the example without updating it, and mine still works). You need to include an extra argument. So at line 149 of wrapper_v2.py to read:<br /><br /> self.tws.reqHistoricalData(<br /> tickerid, # tickerId,<br /> ibcontract, # contract,<br /> today.strftime("%Y%m%d %H:%M:%S %Z"), # endDateTime,<br /> durationStr, # durationStr,<br /> barSizeSetting, # barSizeSetting,<br /> "TRADES", # whatToShow,<br /> 1, # useRTH,<br /> 1, # formatDate<br /> "XYZ"<br /> )<br /><br /> Let me know if it works.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-74373499512972149632015-04-08T06:31:38.007+01:002015-04-08T06:31:38.007+01:00Hi,
First of all, great help!
I ran test2_IB.py ...Hi,<br /><br />First of all, great help!<br /><br />I ran test2_IB.py and running into some issues. Would appreciate some help.<br /><br />Thanks<br />Mudit<br /><br />Traceback (most recent call last):<br /> File "test2_IB.py", line 20, in <br /> ans=client.get_IB_historical_data(ibcontract)<br /> File "/Users/xxx/Ibapi/ibswigsystematicexamples/sysIB/wrapper_v2.py", line 157, in get_IB_historical_data<br /> 1, # formatDate<br />TypeError: Required argument 'chartOptions' (pos 10) not foundMudit Wahalhttps://www.blogger.com/profile/03985795548507450963noreply@blogger.com