Author name: ibridge

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” amount: number of shares security: a security object that is created by symbol ( ) […]

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

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 historical data of AAPL and SPY and save them to local folder. def initialize(context): pass

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

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

reqHistParam(security=None, barSize=None, goBack=None, endTime=dt.datetime.now()) 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, 1 min, 2 mins, 3 mins, 5 mins, 15 mins, 30 mins, 1 hour, 1

Add reqHistParam( ) to IBridgePy documentation 4/10/2017 Read More »

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, CASH; (FOP, BAG, NEWS upon request) symbol: Symbol of securities that are defined by IB

Add superSymbol to IBridgePy documentation 4/8/2017 Read More »

IBridgePy update information on 3/9/2017

Add a few easy-to-use functions: superSymbol( secType, symbol, currency, exchange, primaryExchange, expiry, strike, right, multiplier) Specify a security by more parameters reqHistParam(security, barSize, goBack, endTime, whatToShow, useRTH, formatDate): Specify a historical data request by more parameters calculate_profit(a_security): Calculate profit of a position. create_order(action, amount, security, orderDetails, ocaGroup, ocaType, transmit, parentId): Create orders with more parameters. It

IBridgePy update information on 3/9/2017 Read More »