Current version: 0.20 (20/Aug/2018)
New features
- Added support for Python 3.7.
- Added setShares method for back-testing broker. Thanks winkidney for implementing this.
- Added an option to support skipping errors while parsing CSV files.
- Added batchSize parameter to optimizer component. Thanks micmicmichael for implementing this.
- Added savePlot to the plotter to save the plot to a file. Thanks Kimble Young for implementing this.
Bug fixes
- Fixed a bug in the Event class when unsubscribing and re-subscribing while emitting. Thanks pjz for reporting this.
- Fixed a bug while generating nonces for Bitstamp. Thanks pjz for reporting this.
- Fixed callback for BaseStrategy.resampleBarFeed to match onBars prototype.
- Fixed extra columns parsing in csvfeed.GenericRowParser. Thanks Jones Chung for reporting this.
Breaking changes
- Removed support for downloading bars from Yahoo Finance.
- Removed support for downloading bars from Google Finance.
Version 0.18 (17/Aug/2016)
Download here:
PyAlgoTrade-0.18.tar.gz
New features
- Returns analyzer now stores datetimes along with each sample. Thanks MatthiasKauer for implementing this.
- Quandl tool to build feed supports mapping column names.
- Bar feeds now support including extra columns besides OHLC values.
- Added buildFigureAndSubplots to the plotter to return the subplots along with the figure. Thanks Carlos Tse for implementing this.
- Returns strategy analyzer now supports passing the maxLen for the dataseries. Thanks physicsd00d for implementing this.
Bug fixes
- Fixed zero division error in StochasticOscillator. Thanks Blake Jennings for reporting this.
- Fixed a rounding bug in the default fill strategy when calculating the volume left for a given instrument. Thanks Markus Trenkwalder for reporting this.
- Was not logging properly in backtesting broker when shares are not integers.
- Added exception handling to optimizer module. Thanks Sergey Cheparev for reporting this.
- Fixed a bug in VWAP calculation when using adjusted values.
- Added a way to change the dataseries.DEFAULT_MAX_LEN value.
- Added missing return in plotter.Series.getValues. Thanks physicsd00d for reporting this.
- optimizer.local was sometimes blocked waiting for child processes to finish.
Breaking changes
- Removed Xignite support (http://www.xignite.com/).
- Removed deprecated code that issued warnings in previous versions.
Version 0.17 (10/May/2015)
Download here:
PyAlgoTrade-0.17.tar.gz
New features
- Hurst exponent technical indicator (pyalgotrade.technical.hurst.HurstExponent).
- Added support for slippage models (pyalgotrade.broker.slippage) including a VolumeShareSlippage model like the one in Zipline (https://github.com/quantopian/zipline).
Bug fixes
- Automatically reconnect Bitstamp feed if the connection gets closed.
- Close connections ASAP to avoid running out of file descriptors when GC gets delayed. Thanks Tibor Kiss for reporting and fixing this.
- Fail when placing Market-On-Close orders when backtesting with intraday data. Right now this is not supported.
- Bitstamp backtesting broker was allowing trades below $5.
- Updated default Bitstamp fee to 0.25%.
- Fixed a bug when resampling localized intraday datetimes.
Breaking changes
- Backtesting broker fill strategies moved to pyalgotrade.broker.fillstrategy module.
Version 0.16 (31/Aug/2014)
Download here:
PyAlgoTrade-0.16.tar.gz
New features
- Added support for live trading Bitcoin strategies through Bitstamp.
Example here.
- Support for loading Bitcoin Charts historical trades CSV files.
- Support for downloading and loading bars from Quandl.
- Support for Google Finance CSV files. Thanks Maciej Żok for implementing this.
Bug fixes
- Fixed a bug in pyalgotrade.tools.resample and pyalgotrade.dataseries.resampled.ResampledBarDataSeries when using grouping frequencies greater than 1 day.
- Bitstamp BacktestingBroker and PaperTradingBroker will now fail to place orders without enough cash or BTC.
- Fixed a rounding error in pyalgotrade.bitstamp.broker.PaperTradingBroker.
- Fixed a bug in BarFeed.getCurrentDateTime.
- Fixed a bug in pyalgotrade.technical.cross.cross_above and pyalgotrade.technical.cross.cross_below.
Breaking changes
- Removed Google App Engine support.
- pyalgotrade.bitstamp.client.Client was removed and the functionality is now included in pyalgotrade.bitstamp.barfeed.LiveTradeFeed.
- Strategy.onOrderUpdated now gets called for all order events, including those generated using the position interface.
Version 0.15 (30/Mar/2014)
Download here:
PyAlgoTrade-0.15.tar.gz
New features
- Xignite support for realtime bars.
Example here.
- Support for papertrading Bitcoin strategies through Bitstamp.
Example here.
- Partial fill support for orders.
- MACD technical indicator (pyalgotrade.technical.macd.MACD).
- Average True Range (ATR) technical indicator (pyalgotrade.technical.atr.ATR).
- LeastSquaresRegression filter (pyalgotrade.technical.linreg.LeastSquaresRegression). Depends on SciPy.
- Added marketOrder method to the Strategy class to place market orders.
- Added limitOrder method to the Strategy class to place limit orders.
- Added stopOrder method to the Strategy class to place stop orders.
- Added stopLimitOrder method to the Strategy class to place stop limit orders.
- Added logging methods to the Strategy class.
- pyalgotrade.barfeed.yahoofeed.Feed now supports weekly bars.
- pyalgotrade.tools.resample and pyalgotrade.dataseries.resampled.ResampledBarDataSeries now support any grouping frequency.
Bug fixes
- Fixed a bug in pyalgotrade.technical.roc.RateOfChange when there was no change and the current value was 0.
- pyalgotrade.tools.resample and pyalgotrade.dataseries.resampled.ResampledBarDataSeries now set the datetime to that of the beggining of the bar.
Breaking changes
- Removed MtGox support.
- Changed the order of the stopPrice and limitPrice parameters in Strategy.enterLongStopLimit, Strategy.enterShortStopLimit and Position.exit.
- Support for auto-exit on session close was removed.
- pyalgotrade.technical.trend.Slope was moved into the pyalgotrade.technical.linreg package.
- Removed some deprecated methods from DataSeries (appendValue, appendValueWithDatetime, getValue, getValues, getValuesAbsolute, getFirstValidPos and getLength).
- Fail when resubmitting orders.
- Fail when changing order properties that are set during initialization.
- The last parameter to broker.backtesting.FillStrategy.fillStopLimitOrder was removed. FillStrategy will now handle all the details for order filling to allow better customization.
Other changes
- setUseAdjustedValues should now be called on the strategy instead of the broker.
- Position.getUnrealizedNetProfit and Position.getUnrealizedReturn will automatically use the last available price if None is given.
- Daily bars from Yahoo and NinjaTrader CSV feeds are loaded with time set to 00:00:00.
- All classes now inherit from object.
- The backtesting broker ignores volumeLimit when using trade bars.
- The backtesting broker now emits the cancelation event when cancelation is requested, not in the next bar.
Version 0.14 (12/Oct/2013)
Download here:
PyAlgoTrade-0.14.tar.gz
- Event profiler inspired in QSTK (pyalgotrade.eventprofiler).
Example here.
- Cumulative returns filter (pyalgotrade.technical.cumret.CumulativeReturn).
- Z-Score filter (pyalgotrade.technical.stats.ZScore).
- Added support for other types of time-series data in CSV format (pyalgotrade.feed.csvfeed.Feed).
Example here.
- Fixed a bug with loggers when using the optimizer: https://github.com/gbeced/pyalgotrade/issues/10.
- Fixed a bug in the trades analyzer.
Proportional commissions when switching from long to short or viceversa were not properly calculated.
Thanks Sam Jackson for reporting this and providing a patch.
- Fixed a bug when using the optimizer and a broker with adjusted values.
- Decreased task granularity in Google App Engine to improve performance.
- broker.backtesting.FillStrategy was changed to return a broker.backtesting.FillInfo instance.
- broker.backtesting.DefaultStrategy now takes bar volume into account to fill an order.
- pyalgotrade.barfeed.BarFeed was renamed to pyalgotrade.barfeed.BaseBarFeed and pyalgotrade.barfeed.BasicBarFeed was removed.
- Event handlers for pyalgotrade.barfeed.BaseBarFeed.getNewBarsEvent should expect two parameters: datetime and bars.
This change may break existing strategies that were manually subscribing to BarFeed events.
Version 0.13 (26/Aug/2013)
Download here:
PyAlgoTrade-0.13.tar.gz
- Added support for handling realtime Twitter events (pyalgotrade.twitter.feed).
Example here.
- Added support for backtesting and papertrading Bitcoin strategies through MtGox.
Thanks Jeremi Joslin for helping with the testing.
Example here.
- Bar feeds now support setting the maximum number of values to hold for the BarDataSeries in case you don't want them to grow too much.
- pyalgotrade.dataseries.SequenceDataSeries and DataSeries filters (everything inside the pyalgotrade.technical package)
now support setting the maximum number of values to hold in case you don't want them to grow too much.
- StrategyPlotter now calls autofmt_xdate on the figure before plotting it. Thanks Thomas Jung for suggesting this.
- StrategyPlotter now supports only building the figure so you can customize it (StrategyPlotter.buildFigure).
- bar.Bar was optimized to use less memory. Thanks Tibor Kiss for suggesting this.
- Added tools to resample BarFeeds to different frequencies and using them (pyalgotrade.tools.resample and pyalgotrade.barfeed.csvfeed.GenericBarFeed).
- Added a BarDataSeries that can resample another BarDataSeries to a higher frequency (pyalgotrade.dataseries.resampled.ResampledBarDataSeries).
- High and Low technical indicators (pyalgotrade.technical.highlow.High and pyalgotrade.technical.highlow.Low).
- pyalgotrade.technical.roc.RateOfChange indicator was changed and now it doesn't multiply by 100 the results.
- The pyalgotrade.technical.trend package does not depend on SciPy any more.
- Strategy class was renamed to BacktestingStrategy (the old name is still supported in this version).
- Max. drawdown duration is now returned as a datetime.timedelta object.
- Sharpe Ratio analyzer was modified to better support intraday trading. The tradingPeriods parameter is not supported anymore.
- In order to resubmit the exit order for a position, the orignal exit order has to be canceled first using cancelExit.
- DataSeries and DataSeries filters (everything inside the pyalgotrade.technical package) were refactored to an event based model.
- BarValueDataSeries and BarDataSeries were moved from pyalgotrade.dataseries into pyalgotrade.bards.dataseries.
- pyalgotrade.technical.cross.CrossAbove and pyalgotrade.technical.cross.CrossBelow were refactored as functions (pyalgotrade.technical.cross.cross_above and pyalgotrade.technical.cross.cross_below).
They are not DataSeries any more.
- pyalgotrade.technical.DataSeriesFilter was removed.
DataSeries filters now have to be modeled using pyalgotrade.technical.EventWindow and pyalgotrade.technical.EventBasedFilter classes.
- pyalgotrade.dataseries.SequenceDataSeries constructor no longer accepts values and datetimes.
- pyalgotrade.dataseries.datetime_aligned was moved to pyalgotrade.dataseries.aligned.datetime_aligned.
Version 0.12 (20/Apr/2013)
Download here:
PyAlgoTrade-0.12.tar.gz
- pyalgotrade.optimizer now has worker names associated with each worker. Thanks Matthieu Locas for implementing this.
- StrategyPlotter now allows plotting custom functions.
- Optimizations in different areas.
- Standard deviation technical indicator (pyalgotrade.technical.stats.StdDev).
- Bollinger Bands technical indicator (pyalgotrade.technical.bollinger.BollingerBands). Example here.
- Fixed a bug in EMA technical that could lead to max. recursion limit error.
- Fixed a bug in the Strategy class that had a big impact on execution time. Bookkeeping for active positions and orders was not handled properly.
Version 0.11 (17/Mar/2013)
Download here:
PyAlgoTrade-0.11.tar.gz
- DataSeries now provide the datetime associated with each value (getDateTimes), making it easier to plot using matplotlib.
- Function to align two DataSeries with respect to time (pyalgotrade.dataseries.datetime_aligned).
- VWAP technical indicator (pyalgotrade.technical.vwap.VWAP).
- Line Break technical indicator (pyalgotrade.technical.linebreak.LineBreak).
- Methods to calculate unrealized returns and PnL in positions (getUnrealizedReturn and getUnrealizedNetProfit).
- Bug fix: An IndexError exception was raised in plotter.py when plotting many dataseries in the same subplot.
Version 0.10 (11/Jan/2013)
Download here:
PyAlgoTrade-0.10.tar.gz
- Sharpe Ratio analysis (pyalgotrade.stratanalyzer.sharpe.SharpeRatio).
- Max. drawdown and max. drawdown duration analysis (pyalgotrade.stratanalyzer.drawdown.DrawDown). Thanks Sedov Anton for reporting a bug in the early implementation.
- Returns analysis (pyalgotrade.stratanalyzer.returns.Returns).
- Trades analysis (pyalgotrade.stratanalyzer.trades.Trades).
- Support for bar timezones (pyalgotrade.marketsession).
- Support for sequence like operations in dataseries (__getitem__ and __len__. getValue and getValueAbsolute will soon get deprecated).
- Support for mapping like operations in bar feeds (__getitem__ and __contains__).
- Support for mapping like operations in bar.Bars (__getitem__ and __contains__).
- Google App Engine: Added support for re-executing strategies.
- broker.backtesting.Broker.getValue no longer needs the bars as a parameter. It will take those out of the feed.
- Bug fix: broker.backtesting.getActiveOrders was not returning all orders during event dispatching.
- Bug fix: Fixed returns calculations for short positions. Thanks John Fawcett for explaining this.
- Bug fix: Fixed a bug in the Strategy class and the backtesting broker when dealing with multiple instruments. Was not handling absence of bars appropriately. Thanks Fabian Braennstroem for reporting this.
- Bug fix: Additional dataseries added to the portfolio subplot were not showing. Thanks Sedov Anton for reporting this.
- Bug fix: Additional subplots (those created using getOrCreateSubplot) are now ordered as created. Thanks Sedov Anton for reporting this and suggesting the fix.
Version 0.9 (1/Sep/2012)
Download here:
PyAlgoTrade-0.9.tar.gz
- Added a method to the strategy class to get notified when an order gets updated (onOrderUpdated). This is only called if the order was placed using the broker interface directly.
- Bug fix: A KeyError exception was raised in the strategy class when placing orders using the broker interface directly. Thanks 'Femto Trader' for reporting this.
Version 0.8 (28/Aug/2012)
Download here:
PyAlgoTrade-0.8.tar.gz
- StrategyPlotter now plots each instrument in a separate subplot. getMainSubplot was replaced by getIntrumentSubplot.
- Strategy.exitPosition allows setting the exit order as GTC or not, or matching the entry order (default).
- Bug fix: Was hitting an AssertionError in the strategy class when overwritting exit orders with new ones.
- Bug fix: Set exit-on-session-close orders as GTC.
Version 0.7 (22/Aug/2012)
Download here:
PyAlgoTrade-0.7.tar.gz
- Backtesting broker now allows customizing of order filling strategies.
- Added support Stop orders. Thanks Tibor Kiss for adding this.
- Added support StopLimit orders. Thanks Tibor Kiss for adding this.
- TA-Lib integration (pyalgotrade.talibext.indicator).
- Official support for NinjaTrader generated CSV files (pyalgotrade.barfeed.ninjatraderfeed.Feed). csvfeed.NinjaTraderRowParser was removed.
- pyalgotrade.barfeed.csvfeed.YahooFeed was moved to pyalgotrade.barfeed.yahoofeed.Feed. pyalgotrade.barfeed.csvfeed.YahooFeed still works but it will be removed soon.
- Major changes to the broker interface to support other broker types. These changes are not backwards compatible. Thanks Tibor Kiss for adding this.
- Bug fix: Was not honoring the good till canceled attribute when submiting exit orders from inside the position classes.
- Bug fix: Was not getting better prices (when available) for Limit orders. Thanks Tibor Kiss for reporting this.
Version 0.6 (26/Jun/2012)
Download here:
PyAlgoTrade-0.6.tar.gz
- Added initial support for NinjaTrader export format (csvfeed.NinjaTraderRowParser).
- pyalgotrade.optimizer.server.serve now returns the best results found.
- Fixes to the optimizer.local module when running on Windows.
- Fixes to the optimizer.local module. The socket used to find a random port to listen on was not being closed. Thanks Tibor Kiss for fixing this.
- Fixes to plotter.py. The marker style used was not supported in some matplotlib versions. Thanks Tibor Kiss for fixing this.
Version 0.5 (21/Jun/2012)
Download here:
PyAlgoTrade-0.5.tar.gz
- Added support for optimizing strategies inside Google App Engine.
- StrategyPlotter supports plotting a range.
- Stochastic oscillator supports using adjusted values.
- Improved optimizer module to distribute strategy executions in chunks.
Version 0.4 (8/May/2012)
Download here:
PyAlgoTrade-0.4.tar.gz
- Added rate of change technical indicator.
- Added stochastic oscillator technical indicator.
- Added error checking to yahoofinance.get_daily_csv.
- Normalized some method names in StrategyPlotter.
Version 0.3 (22/Apr/2012)
Download here:
PyAlgoTrade-0.3.tar.gz
- Support for plotting strategies (StrategyPlotter).
Version 0.2 (14/Apr/2012)
Download here:
PyAlgoTrade-0.2.tar.gz
- Added CrossAbove and CrossBelow technical indicators.
- Added support for limit orders.
- Fixed a bug when a position was set to exit on session close but the entry order was not filled.
Version 0.1 (27/Mar/2012)
Download here:
PyAlgoTrade-0.1.tar.gz