AUGUST 2022
Breaking Changes
- Backtest `spread` is now specified in absolute price units (rather than
pips as previously)
- Environment specification: paper trading can be activated by setting
`environment` to `paper` (default) and live trading can be activated
by setting `environment` to `live`
- To further remove the distinction between backtesting and livetrading,
various methods and attributes have been renamed to reflect their
generality and indifference to mode of trading. Important changes include
`AutoTrader.backtest_results` to `AutoTrader.trade_results` (and similar for
`AutoBot`), `AutoTrader.print_backtest_results` to `AutoTrader.print_trade_results`
and `BacktestResults` class to `TradeAnalysis`.
Renaming generally followed the pattern of renaming `*backtest*` to
`*trade*`.
- For consistency in naming conventions, `GetData` class of `autodata.py` has
been renamed to `AutoData`.
- Broker interface method `get_positions` will directly
- Rename `virtual_livetrade_config` to `virtual_account_config`.
- Strategy configuration key `INCLUDE_POSITIONS` has been deprecated in favour
of using `INCLUDE_BROKER`, then directly fetching positions from broker using
`get_positions` method.
- Renamed `GLOBAL.yaml` to `keys.yaml` for clarification.
- Run mode 'continuous' has become the default run mode. To continue running strategies
in periodic update mode, you will now need to specify `mode='periodic'` in `configure`.
- The behaviour of broker method `get_trades` has changed: now returns a list of fills
(executed trades based on the `Trade` object), rather than a dictionary of
`IsolatedPositions` objects as before. This falls in line with the more common
definition of a trade, but diverges from Oanda. As such, a new method
`get_isolated_positions` has been added to the virtual broker and Oanda API interface
to maintain the previous functionality of `get_trades`.
Features
- Major backtest speed improvements: over 50% reduction in backtest time for
large, multi-asset backtests
- Live paper-trading via the virtual broker: use `AutoTrader.virtual_livetrade_config`
to configure virtual broker.
- To check-in on paper trading status, there is a new convenience method
`papertrade_snapshot`, which will print up-to-date trade results from
the virtual broker pickled instance.
- Support for decentralised crypto exchange dYdX
- Support for many more crypto exchanges via CCXT
- Introduction of 'portfolio' strategies: passing data of multiple assets to
a single strategy. Simply include `PORTFOLIO: True` in your strategy
configuration.
- Data feeds have been unified to make data retrieval simpler than ever. Now there
are methods `fetch` and `quote`, which can be used to fetch OHLC price data
from various feeds, depending on the `data_source` specified in the
data configuration dictionary. Retrieval of level 1 and level 2 data is also
available (where possible), accessible via the `L1` and `L2` methods.
- Improved backtest accuracy, with orderbook simulation and order type dependent
commissions.
- Additional commission schemes for backtesting.
- Option to specify bid/ask spread as a percentage value.
- Manual trading (paper and live) via command line. Simply configure an instance
of AutoTrader without adding a strategy, and the broker specified will be
instantiated ready for trading. Papertrading via the virtual broker supported.
- Ability to trade across multiple venues from a single strategy. Simply
provide the broker names with comma separation via the `configure` method,
- Exchange-specific precision checking for Orders. Even in backtest mode, AutoTrader
will communicate with your chosen exchange to precision-check your orders.
- Code is now formatted using [Black](https://github.com/psf/black).
- Ability to specify a time range for `PERIOD` in strategy configuration. This value
will be converted to an integer using the `INTERVAL` key.
Deprecation Notices
- Broker method `get_trade_details` has been deprecated in favour of `get_trades`
method.
- Strategy configuration key `INCLUDE_POSITIONS` has been deprecated in favour
of using `INCLUDE_BROKER`, then directly fetching positions from broker using
`get_positions` method.
Fixes
- Minor improvements to margin requirement calculations in backtest