Monthly Archives: April 2017

Example of requesting historical data

request_data request_data(historyData= None, realTimePrice = None, contractDetails= None, marketSnapShot=None, waitForFeedbackinSeconds=30,repeat=3) historyData: a list of requests of historical data. Each request is defined by a tuple with three elements, security, timeframe, goBack. IB supports the following timeframes: 1 sec, 5 secs,

Posted in Uncategorized

Use IBridgePy to place a group order with One Cancel All (OCA)

You can use create_order ( ) and place_combination_orders ( ) to place a bracket order with One Cancel All (OCA) features. Create_Order User create_order to clear define all kinds orders that IB supports using critical parameters. action: “BUY” or “SELL”

Posted in Uncategorized

Is there any way for me to save history data using IBridgePy?

A: Yes. The historical data received in IBridgePy from the IB server are saved in data[symbol(‘xxx’)].hist that is a pandas dataframe. Therefore, you can save it to a csv file by pd.dataframe.to_csv(“Path_to_your_local_folder”) and use it later in anyway. Example: Request

Posted in Uncategorized

IBridgePy update information on 4/14/2017

Change the default clientId to 99. clientId=1 may be occupied when TWS and IB gateway are opened and closed for many times so that IBridgePy will not receive any responses from IB. When cliendId is occupied, IBridgePy will hang in

Posted in Uncategorized

Add reqHistParam( ) to IBridgePy documentation 4/10/2017

reqHistParam(security=None, barSize=None, goBack=None, Use reqHistParam to clearly define the parameters when you request historical data from IB. security: use symbol( ) or symbols( ) or superSymbol( ) to define security barSize: 1 sec, 5 secs, 15 secs, 30 secs,

Posted in Uncategorized

Add superSymbol to IBridgePy documentation 4/8/2017

superSymbol(self, secType=None, symbol=None, currency=’USD’, exchange=’ ‘, primaryExchange=’ ‘, expiry=’ ‘, strike=-1, right=’ ‘, multiplier=-1, includeExpired=False) Create a security object by clearly defining every details. It can be used to define any securities/commodities that are available at IB. secType:  STK, OPT, FUT, IND,

Posted in Update info