Release Notes

January 11, 2019


  • Set strategy’s logging level to INFO
  • Suppress SQL messages when using --dbskip
  • Added option to set trailing stop offset type by specifiying trail_stop_type. Options are: amount and percent (default)
  • Defaults to single threaded mode unless otherwise specified
  • Requires ezIBpy >= 1.12.66
  • Lots of bugfixes, and code improvements

September 17, 2018


  • Added official support for Python 3.7
  • Removed Google and Yahoo data retrieval methods from Workflow
  • Added auto-resample option to Workflow.prepare_data
  • Fixed backtesting issues related to sometimes not logging positions
  • Lots of bugfixes, and code improvements

September 12, 2018


  • Fixed issues related to multi-instrument strategies
  • Misc fixed typos, bugfixes, and code improvements

September 7, 2018


  • Changed license to Apache License 2.0
  • Trailing stop compared against 0 instead of None
  • Fix prices to comply with contract’s min-tick
  • Fixed IB futures margin fetcher
  • Fixed CME scraping and active contract parser
  • Avoid sending empty tick/bars to algo
  • Updated code to work with latest version of Pandas
  • Fixed compatibility with the ezIBpy v1.12.62
  • Misc fixed typos, bugfixes, and code improvements

July 26, 2018


  • Fixed compatibility with the ezIBpy v1.12.58
  • Pushed develop branch to master

January 12, 2018


  • Check for dbskip on Blotter.mysql_connect() (issue 75)
  • Changed numpy.std() estimator bias (ddof = 1)
  • Fixed Heiken-Ashi bar calculation
  • Added Zero-lag SMA/EMA/HMA
  • Misc bugfixes and code improvements

September 25, 2017


  • Fixed possible miscalculation of local machine’s timezone (hotfix)


  • Futures spec is now downloading from (updated daily)
  • Technical indicators made faster
  • Added tools.multi_shift method to for shifting multiple rows in Pandas DataFrames
  • Misc bugfixes and code improvements

July 26, 2017


  • Checks for Python >= 3.4 before running
  • Requires ezIBpy >= 1.12.56
  • Option to group contracts togther (groundwork for spreads / combo orders)
  • Allows to add contracts/symbols to Algo after initialization via Broker.add_instruments(...)
  • Algo instruments now accepts IB Contracts as instruments
  • Instrument’s get_ticks() and get_bars() returns None when empty and reqested in dict format
  • Added instrument.get_price() and instrument.price (returns current market price)
  • Added instrument.pnl_in_range(min, max) method to the instrument object
  • Added TotalPNL to the portfolio object (unrealizedPNL + realizedPNL)
  • Added option to get timezone as delta in tools.get_timezone()
  • Better Heikin-Ashi candle formula (fixed first candle’s open calculation)
  • Improved Stochastic indicator
  • Added Awesome Oscillator indicator
  • Added TDI (Traders Dynamic Index) indicator
  • Added crossed() indicator (returns True if first series crosses above or below second series)
  • Crossing indicators/methods works with numbers as 2nd series (ie bars['close'].crossed_above(30))
  • Misc bugfixes, code improvements, cleanup and abstraction

May 7, 2017


  • Requires ezIBpy >= 1.12.51


  • Better PEP8 compliance
  • Checking for Python version >= 3.4
  • Upgraded to Twilio version >= 6.0.0
  • Improved Stochastic indicator
  • Added Awesome Oscillator and TDI indicators
  • Misc bugfixes, code improvements, cleanup and abstraction

March 25, 2017


  • Fixed pip installer


  • Fixed minor bug in machine timeozone detection

February 26, 2017


  • Added 2 Indicators: PVT (Price Volume Trend) and Z-Score
  • Fixed resample bug when using local timezones (merge pull request #55)

February 6, 2017


  • Requires ezIBpy >= 1.12.45 (fixes a few open issues)

December 31, 2016


  • Misc bugfixes, code improvements, cleanup and abstraction

December 30, 2016


  • Bugfixes and code cleanup


  • Max # of threads is set to 1 (single-threaded) by default and can be changed using the max_threads run-time parameter in Blotter() and Algo(). It’s recommended that you set this parameter based on your strategy’s needs and your machine’s capabilities (strategies trading a handful of symbols probably won’t need to tweak this parameter).

December 25, 2016


  • Threading-related code improvements: tools.resample() syncs last timestamp of all symbols; add_stale_tick() checks for real tick with same index before triggering _tick_handler()
  • Instrument object not defaults to strategy’s bar_window and tick_window if no window specified (to get full bar window, use instrument.get_bars() or simply instrument.bars)

December 22, 2016


  • add_stale_tick() made thread-safer


  • Blotter market data handlers now using threaded, non-blocking architecture.
  • Misc bugfixes, code improvements, cleanup and abstraction

December 21, 2016


  • All market data events are now asynchronous / non-blocking
  • Misc bugfixes, code improvements, cleanup and abstraction

December 20, 2016


  • Minor bugfixes, code improvements, cleanup and abstraction


  • Minor bugfixes, code improvements, cleanup and abstraction

December 19, 2016


  • Fixed bugs that may occur on multi-instrument strategies
  • Misc code improvements, cleanup and abstraction

December 18, 2016


  • Bugfixes


  • Introduced an all new Workflow module for downloading, cleaning, preparing and uploading market data to the database
  • Backtesting can now be done using CSV files (converted into a QTPyLib-compatible format using the Workflow module)
  • Misc bugfixes and code improvements, cleanup and abstraction
  • Requires ezIBpy >= 1.12.44

December 12, 2016


  • Bugfixes

December 11, 2016


  • Blotter automatically backfills missing historical data for back-testing (based on the start and end parameters) and live-trading (based on the preload parameter)
  • Better local timezone detection
  • Requires ezIBpy >= 1.12.42
  • Misc bugfixes and code improvements/cleanup

Note regarding backfilling: Backfilling is currently supported for strategies with 1-minute or higher resolution. Historical data availability is subject to Interactive Brokers Historical Data Limitation.

December 7, 2016


  • Changed to lowercase utf-8 encoding in file’s header

December 6, 2016


  • Fixed bug introduced in version 1.5.42a


  • Forcing expiry in symbols.csv to be stored as int


  • Fixed bug in Blotter.log2db() (closing issue #36)
  • Fixed multi-instrument strategy initialization (closing issues #37 + #38)
  • Misc bugfixes and code improvements/cleanup

December 4, 2016


  • Fixed bug that caused Blotter to store data in MySQL before timezone was set (possibly resulting in out-of-sequence time-series for historical data) by ignoring the captured first tick.
  • Blotter now removes out-of-sequence ticks/bars from historical data (should fix issue #31)
  • Misc bugfixes and code improvements/cleanup

December 1, 2016


  • Portfolio playing nice with multi-symbol portfolios
  • Cleanup portfolio data before saving
  • Implemented shorter delay and more elegant code in Blotter.drip() (used by the backtester)
  • force_res is now always on for time-based bars
  • Renamed Blotter.listen() to
  • Misc bugfixes and code improvements

November 29, 2016


  • load_blotter_args() moved to Broker class file to be used by clients
  • Broker.get_portfolio() now returns empty portfolio object as default when symbol is specified
  • Reports uses unified logger and arg parsing
  • Misc bugfixes and code improvements
  • Requires ezIBpy >= 1.12.41

November 22, 2016


  • Fixed Broker logging initilizer
  • Requires ezIBpy >= 1.12.39 (solves misc issues with expired contracts)


  • Blotter saves expiration dates for Futures and Options based on ezIBpy’s contractDetails() data


  • Misc bugfixes and code improvements
  • Requires ezIBpy >= 1.12.38

November 21, 2016


  • Fix parsing of contract expiration

November 16, 2016


  • Fixed command line agrument parsing issues
  • All params in Algo() and Blotter() are now explicit and are overridden in runtime using command line arguments
  • Make sure expiry values aren’t decimals
  • Requires ezIBpy >= 1.12.36
  • Renamed force_resolution to force_res in Algo()
  • Using unified logging from latest ezIBpy (use self.log.LEVEL(...) instead of loggig.LEVEL(...) in your strategies)
  • Misc bugfixes and code improvements

November 15, 2016


  • Set ticksize to 0 for stale ticks (for when using "force_resolution" = True)

November 13, 2016


  • Requires ezIBpy >= 1.12.32
  • Added support for tif (time in force) parameter in order creation. Options are: DAY (default), GTC, IOC and GTD.

November 12, 2016


  • Requires ezIBpy >= 1.12.31
  • Added instrument.get_contract_details() and instrument.tickerId() methods (see API reference section in docs for more info)
  • futures.get_contract_ticksize() marked as deprecated (instrument.get_ticksize() or instrument.ticksize instead)
  • Ignoring ticksize parameter in order() (ezIBpy’s auto detects min. tick size based on contract spec.)


  • Interval-based bars are now tread-safe and working correctly when "force_resolution" = True

November 11, 2016


  • Fixed a bug that prevented backtesting second-level resolution strategies


  • Introduced force_resolution parameter in Algo to force a new bar on every resolution even if no new ticks received (default is False)


  • Fixed parsing of flag params (related to issue #17)

November 10, 2016


  • Fixed bar events in backtesting mode to fire every 250ms instead of 2.5s (closing issue #21)
  • Fixed parsing of backtest param in Algo (closes issue #17)


  • Fixed issue that caused errors when bar resolution was set to seconds (closing issue #18)


  • Requires ezIBpy >= 1.12.29
  • Blotter uses refactored logging in ezIBPy 1.12.29

November 9, 2016


  • Blotter and Algo now accepts all command-line arguments as __init()__ parameters (closing issue #17)

November 8, 2016


  • Blotter logs warnings and errors sent by TWS/GW


  • Upped version number due to malformed submission to PyPi (1.5.1)


  • Wait 5ms before invoking on_fill() to allow portfolio to sync from TWS/GW
  • Renamed Instrument object’s margin_max_contarcts() to max_contracts_allowed()
  • Added get_bar() and get_tick() methods to Instrument object (as well as tick and bar properties)
  • Misc bugfixes and code improvements

November 6, 2016


  • Added move_stoploss() to instrument object. This method auto-discover orderId and quantity and invokes self.modify_order(...)
  • Fixed bug that prevented modification of stop orders using modify_order(...)
  • Fixed rederence to renamed and modified method (active_order_id => active_order)


  • Using the new IbPy2’s PyPi installer; no separate install of IbPy is required
  • Using latest ezIBpy (now also using IbPy2)

November 2, 2016


  • Added support for Orderbook-based strategies via on_orderbook(...) (requires the --orderbook flag to be added to Blotter)
  • Added bar(s), tick(s), quote and orderbook properties to the Instrument object

October 25, 2016


  • Made changes to .travis.yml to help Travis-CI with its Pandas build issues


  • Creating synthetic ticks for instruments that DOESN’T receive RTVOLUME events (issue #9)
  • futures.make_tuple(...) auto selects most active contract when no expiry is provided (CME Group Futures only)
  • Misc bugfixes and code improvements

October 24, 2016


  • Removed debugging code


  • Fixed bug caused by self.record (closing issue #12)
  • Misc bugfixes and code improvements

October 23, 2016


  • Bugfix: Updated backtesting mode to use correct variable names (closing issue #10)

October 21, 2016


  • Full support for Options trading (greeks available upon quotes, ticks and bars)
  • Improved asset class and symbol group parsing
  • QTPyLib’s version is now stored in MySQL for smooter upgrades
  • pip Installer requires ezIBpy >= 1.12.23
  • Misc bugfixes and code improvements

October 18, 2016


  • Misc bugfixes


  • Continuous Futures contract construction is now optional (defaults to True)
  • Added futures.make_tuple(...) for automatic tuple construction for Futures

October 14, 2016


  • Using a synthetic tick for CASH contracts (cash markets do not get RTVOLUME)

September 30, 2016


  • Fixed issue that prevented from blotter to assign asset_class to stocks

September 29, 2016


  • Rounding numbers in SMS message template

September 28, 2016


  • Fixed sms formatting by sending SMS before logging trade

September 27, 2016


  • Added open trades + unrealized PNL to instrument.trades and instrument.get_trades()
  • Switched DataFrame length check to len(df.index)>0 (faster than df.empty or len(df)>0 in my checks)
  • Fixed last price in recent orders

September 26, 2016


  • Introduced instrument.trades / instrument.get_trades() as quick access to the instuments trade log


  • Updated pip installer to use ezIBpy >= 1.12.19

September 22, 2016


  • Added support for working with Volume based bars (by using nV in the resolution parameter)

September 20, 2016


  • Fixed setup import to prevent built error


  • Added option to send limit stop orders


  • tools.round_to_fraction() now auto detects decimals based on resoution rounder
  • Fixed Eurodollar’s base url in
  • Fetching correct ticksize for futures (including those that aren’t using decimal ticks, eg 1/32 for bonds)

September 19, 2016


  • Strategies now have access to IB Account info via self.account
  • Added support for Fill-or-Kill and Iceberg orders (see API docs)
  • Automatic re-reconnection to TWS/GW when connection lost