Release notes

V 4.2.5 on 20190118
  1. Fixed the bug of “for security in context.portfolio.positions”
  2. Fixed the bug of “returned hist ‘s index is not datetime”
V4.2.4 on 20190117
  1. Fixed the bug of “print context.portfolio.positions returns empty dict even if a position exists”
V4.2.3 on 20190116
  1. Fixed a deployment bug
V4.2.2 on 20190115
  1. create_order and place_combination_orders are supported.
V 4.2.1 on 20190111
  1. Fixed a minor bug
  2. Solved the backward compatibility issues: the 1st time of running handle_data with repBarFreq = xx is set at 00 seconds. For example, if repBarFreq = 5, the time of running handle_data will be 0, 5, 10, 15, 20, 25, …55.
V 4.2.0 on 20190110
  1. Support the following code “for stock, position in context.portfolio.positions.items():”
V 4.1.1 on 20190109
  1. Fixed the bug of “context.portfolio.positions[symbol(‘AAPL’)]
  2. Fixed the bug of “schedule_functions are not working”
  3. Fixed the bug of “index of data.history is not in the type of datetime”
  4. Fixed the bug of “showTimeZone is not working”
  5. Fixed the bug of “TrailStopLimitOrder is not defined”
  6. Fixed the bug of “modify_order is not working”
V 4.1.0 on 20190106
  1. Support “context.portfolio.position_values”, “context.portfolio.portfolio_values”, “context.portfolio.position_cash” and “context.portfolio.positions”
  2. Fixed the bug related to “Unable connect as the client id is already in use”
  3. Fixed the bug related to “modify orders”
V 4.0.3 on 20190102
  1. Fixed a bug related to Python 3.x compatibility issue
  2. Fixed a bug related to schedule_functions
V 4.0.2 on 20190101
  1. Fixed a bug related to Python 3.x compatibility issue
V 4.0.1 on 20181231
  1. New backend IBridgePy engine which will power up back-tester later
  2. A few API signatures have been optimized. More details will be updated  in
  3. Please let us know if you have any questions about IBridgePy 4 and we will try our best to fix them as soon as possible.
V 3.2.4 on 20181201
  1. Minor update related to TrailStopLimitOrder
  2. Fixed the bug of placing hidden orders
V 3.2.2 on 20181118
  1. Fixed the bug of Trailing Stop Limit Order
V 3.2.1 on 20181116
  1. Fixed the bug of “cannot get volume/size of securities”
  2. Fixed the bug of “placing hidden order to ISLAND”
V 3.1.10 on 20181109
  1. Fixed the bug of “real time price is not tree real time in runMode of run_like_quantopian”
V3.1.9 on 20181106
  1. Modified read_in_hashcode
  2. Removed the error message when open price is not available. User need to check by themselves.
V3.1.6 on 20181030
  1. Fixed a bug
V 3.1.4 on 20181006
  1. Added a new feature of placing hidden order at ISLAND
  2. Fixed a bug of consuming too many resources
V 3.1.2 on 20180930
  1. Fixed a bug
V 3.1.1 on 20180929
  1. Added a new feature in superSymbol to defined “localSymbol”
V 3.0.14 on 20180923
  1. Add a new feature of “modify_order”
V 3.0.11 on 20180918
  1. Fixed the bug of “STK BRK B is missing”
V 3.0.6 on 20180906
  1. Fixed the bug of “real time price does not update”
V3.0.5 on 20180905
  1. Fixed the bug related to barSize in data.history
  2. Fixed the bug of “repBarFreq does not work”
  3. Fixed the bug of waitForFeedbackInSeconds
V3.0.2 on 20180826
  1. New IBridgePy engine
  2. Added trailingPercent to TrailStopLimitOrder
  3. Fixed the bug related to secType of “BOND”
V2.2.12 on 20180812
  1. Added more examples
V2.2.11 on 20180809
  1. Fixed the bug of “No security definition has been found for the request” because of holding positions
V2.2.10 on 20180804
  1. More examples are added.
  2. Fixed the bug related to premium functions.
V2.2.9 on 20180802
  1. Fixed the bug of “scheduled functions do not run as scheduled”
V2.2.8 on 20180730
  1. Fixed the following bug in Win_Anaconda36_64
import pandas_market_calendars as mcal
ModuleNotFoundError: No module named ‘pandas_market_calendars’
V2.2.7 on 20180728
  1. Fixed the following bug
import pandas_market_calendars as mcal
ModuleNotFoundError: No module named ‘pandas_market_calendars’
2. Added Mac_Anaconda27_64 version.

V2.2.6 on 20180726

  1. Fixed a bug related to request_historical_data when disconnection happens
  2. Added a new feature. User can choose a market calendar. handle_data will run according to the chosen market calendar when runMode = ‘run_like_quantopian’

V2.2.5 on 20180707

  1. Fixed the bug of “ask_price = na”

V2.2.4 on 20180704

  1. Fixed the bug of “missing self.setHashConfig” in IBrigePy_python2_64

V2.2.3 on 20180703

  1. Fixed a typo

V2.2.2 on 20180702

  1. Fixed a few bugs in Windows Python 3.6 for incompatibility issues.

V2.2.1 on 20180701

  1. The default time-in-force for LimitOrder and StopOrder is to cancel the open orders by the end of the day. A feature is added to allow traders to designate time-in-force. See details at
  2. place_order_with_stoploss, place_order_with_stoploss_takeprofit and place_order_with_takeprofit are added to make placing orders much easier than before.
  3. Fixed a bug related to context.portfolio.position[a_security] returning 0 shares when the position is not 0.

V2.1.2 on 20180527

  1. Add a trader property of runScheduledFunctonBeforeHandleData. The scheduled_functions will run before handle_data runs when runScheduledFunctonBeforeHandleData = True. The default setting of Quantopian is to run handle_data before all scheduled functions.

V2.1.1 on 20180526

  1. Improved the performance of searching securities internally.
  2. Add a new function of place_order_with_SL_TP

V2.0.1 on 20180506

  1. Fixed the bug “No security definition when a position was in the account”
  2. Change the version number to semantic version 2.0.1


  1. Added a new function of get_order_status
  2. Fixed the bug in order_status_monitor, raised by Lamperti


  1. Added Trailing Stop Limit order


  1. Fixed a bug about superSymbol when accounts have positions


  1. Fixed the bug about printing positions.
  2. Added a feature of placing orders outside regular trading hours.
  3. Matched a feature to Quantopian. context.portfolio.portfolio_value is the actual value in the function of initialize.
  4. Fixed the bug about ending cash balances, reported by timma.
  5. Fixed the bug about handle_data running at unexpected times, reported by timma.
  6. Added displaying message when market is closed.


  1. Fixed the bug about “cannot find index in self.end__check__list” by recording all request data.
  2. Changed version number to string.
  3. Print out fileName.
  4. Exit the code after tried to request data for 3 times and failed.
  5. Fixed the bug about “cannot get real time price because of “No security is found” when init is holding the positions
  6. Changed the logic to search exchange and primaryExchange from stockList
  7. Moved some functions to better locations


  1. Fixed the bug of “Error processing request:-‘bm’ : cause – Duplicate ticker ID for xxx”
  2. Added a method in data, data.can_trade( ). It always returns True at the moment. It will be extended later.


  1. Fixed the bug of “missing handle_data”. The handle_data function is not required in IBridgePy.


  1. Changed default values of open, high, low, close, size to NaN, following Quantopian’s style
  2. The function of show_real_time_price ( ) returns the current values without extra checking even if the values are NaN. However, show_real_time_price ( ) will guarantee that the bid price and ask price of stocks are positive and the last_traded of indexes are positive.
  3. Fixed the bug of “duplicated orderId” when re-sending request data


  1. Fixed the bug of AttributeError: ‘float’ object has no attribute ‘param’ when requesting real time prices
  2. Fixed the bug related to Ubuntu version and Mac version about file path


  1. errorCode = 2148 becomes a warning, not a critical error anymore.
  2. Fixed the bug of getting real time prices of secType = ‘IND’, for example, IND, VIX, USD
  3. Fixed the bug in Mac and Ubuntu version


  1. Fixed the bug of repBarFreq = 60
  2. Fixed the bug of before_tradng_start ( )


  1. Changed: show_real_time_price will not show any negative number anymore. However, the code will stop if the real time prices are not available for any reasons.
  2. Fixed the bug of the log file path in Linux.
  3. Fixed the bug in handle calendar, for example 2017.11.30
  4. Changed: errorCode = 2105 is a warning message and not a critical error any more.
  5. Fixed the bug of handle_data in run_like_quantopian mode. It won’t run when the market is close.


  1. Fixed a print versionNumber when exit with error message.
  2. Fixed IBridgePy for Ubuntu errorCode = 509


  1. Fixed the print bug in windows Python 3_64 version


  1. Added order_value ( ), order_target_percent ( ), order_target_value ( ) and record ( ) , same as in Quantopian.
  2. Deleted positions from context.portfolio.positions when the quantity of the security is 0. Now it matches what Quantopian does.
  3. Fixed the because request_data is deprecated from version 2.20171004.
  4. Added showing versionNumber when IBridgePy terminates with error messages.
  5. Fixed the bug in showing latest_profit when printing out positions. It always showed “NA” in the previous versions
  6. Separated IBridgePy log with the log created by users using the function of record ( ).


  1. Fixed the bug in get_open_order
  2. Fixed check_date_rules overnight issue
  3. Changed to the code related to error messages and terminate the code when needed.
  4. Added “show sizes” to the function of show_real_time_price


  1. handle_data is not required anymore. It is optional.
  2. Changed the default exchange of stock to SMART. The problem related to XIV positions are solved because of the change.


  1. Started to support order_percent ( ) .
  2. The bug related to schedule_function is fixed.
  3. The bug related to handle_calendar is fixed.


  1. Fixed the bug of print in in python 3.x version


  1. Changed all_US_Stocks.csv to security_info.csv
  2. Allowed users to add the security details to security_info.csvt
  3. The issues related to order_target( ) and positions are fixed because of the above changes.


  1. Added versionNumber for IBridgePy. The current versionNumber is 1.20170905
  2. Fixed a bug related to positions[symbol(‘xxx’)].amount, which has impacts on order_target ( )