- AutoTrader: add initial check fro active bots directory before entering trade loop
- ccxt: type conversion of order limits check
- logging: logging kwargs get passed to strategy instances
- ccxt: pass ccxt order params when modifying order
- ccxt: add exception handling for place_order
- AutoTrader: only try instantiate notifier if notify > 0
- Notifier: reimplement telegram notifier
- option to instantiate ccxt broker as read only
- Strategy: add method for including indicators to plot
- utilities.py: added ccxt-download data stream object
- using logging throughout
- utilities.py: added logger function
- Broker: ccxt broker will translate native TP/SL to ccxt params
- Broker: added broker base class
- added ability for bots to kill instance
- Strategy: added strategy base class
- utilities.py: ccxt global config indexing case
- pass logging config to brokers
- AutoTrader: handling of logger kwargs
- AutoTrader: logging arguments
- log handling and ccxt instrument precisions
- Broker: use _safe_add method to update ccxt_params
- AutoPlot: fixed plotting nav timezone bug
- DataStream: use generalised data fetch methods of AutoData
- simplified broker module strucutre
- major refactor of entire project
- data: renamed data to package_data for clarity
- autoplot.py: fix plot_data error for indicator scaling
- indicators: added signal column to chandelier indicator
- indicators: added chandelier exit indicator
- cli: added option to initialise directory from demo repository
- indicators.py: fill na values in indicator data for finding swings
- autoplot.py: skip autoscaling when there is no data variation
- indicators.py: fixed outdated argument for autodecting divergence
- AutoData: do not truncate yahoo data if start and end arguments are not None
- AutoData: optionally provide workers as kwarg to fetch
- AutoData: batch fetch instruments
- data fetch of yahoo finance with count extends range to account for business days
- improved monitor and added dashboard template
- cli.py: added backtest demo function to cli
- autotrader.py: write broker hist when click paper trading
- autodata.py: raise exception when invalid granularity is provided to yahoo finance
- added exception handling for click papertrade
- autodata.py: added exception handling for ccxt orderbook method
- moved print_banner function to utilities
- cli.py: init method more robust
- macd_strategy.py: load data from yahoo finance
- macd_strategy.py: changed data directory path to cwd
- deprecated support for email notifications
- indicators.py: fixed handling of different data types in find_swings indicator
- reimplemented scan mode
- integrated Telegram for trade notifications (#12)
- tg.py: telegram bot can write chat id to keys.yaml
- telegram.py: telegram bot returns chat id for initialisation
- added initialisation method
- fixed circular import errors
- tg.py: order side determination logic
- tg.py: renamed telegram.py to tg.py to avoid name conflict
- notifier.py: added abstract communications class Notifier
- Broker: all broker class inherit from AbstractBroker
- brokers.broker.py: renamed Broker to AbstractBroker
- broker.py: implemented initial broker abstraction
- ccxt.broker.py: added network exception handling with single retries
- autoplot.py: portfolio plot includes equity and nav hovertool
- email_manager import (#46)
- datetime.timezone import
- CCXT get_trades uses kwargs in fetchMyTrades call
- Improved verbosity for exception handling.
- Improved verbosity in
autotrader.py
for bot updates. - Added utility to CCXT interface (
get_min_notional
andget_ticksize
methods). - Improved CCXT
get_orders
capability.
- CCXT interface
get_trades
method updated forTrade
object arguments.
- Plotting bug when option to show cancelled orders is True.
- Upgraded virtual broker: backtest speedup for large portfolio's
- Ability to specify
deploy_time
inAutoTrader.configure()
, a datetime object for when to release trading bots. - Improved verbosity from main module when running.
- Decimal error when placing market orders with
dydx
module.
- Import error of
AutoData
indydx
module.
- AutoBot submits orders using
ThreadPoolExecutor
to speedup submission of multiple orders. - Ability to provide custom execution methods via
AutoTrader.configure(execution_method=)
. - Improved verbosity from
autobot
s.
- Handling of testnet/mainnet keys when paper/virtual/live trading.
- Inclusion of
__init__.py
file inautotrader/brokers/ccxt/
. - Timezone handling.
- Virtual broker does not use lambda functions to allow pickling.
- Unified
broker._utils
attribute naming.
- Better exception handling in CCXT broker interface.
- Ability to specify
mainnet
andtestnet
API keys in yourkeys.yaml
file. - Ability to provide slippage models for backtests (via
at.configure()
).
- Inifite
while
loop bug in virtual broker_reduce_position
method due to machine precision. - Backtest portfolio plotting of more than 18 instruments is possible now due to an increased color pallete.
- Unification of
get_orderbook
in supportingbroker
modules. - Expected behaviour of
get_positions
method in CCXT broker module.
- Trading object
Position
includes attributeccxt
to include the output fromCCXT
methods. - Improved configuration options for CCXT exchanges in
keys.yaml
file.
- Oanda live trade functionality restored (after
keys.yaml
rename).
AutoData
is more intelligent when creating a new instance;kwargs
can be used in place ofdata_config
dictionary, simplifying instantiation.- Utility methods
get_broker_config
andget_data_config
have been simplified, allowing calling withoutglobal_config
argument (keys.yaml
will be read in fromconfig/
directory).
- Oanda configuration keys in
keys.yaml
have changed for clarification
- Oanda
data_config
includes account id, restoring automated data retrieval
- Improved portfolio plot type
- Improved printouts
AUGUST 2022
- Backtest
spread
is now specified in absolute price units (rather than pips as previously) - Environment specification: paper trading can be activated by setting
environment
topaper
(default) and live trading can be activated by settingenvironment
tolive
- 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
toAutoTrader.trade_results
(and similar forAutoBot
),AutoTrader.print_backtest_results
toAutoTrader.print_trade_results
andBacktestResults
class toTradeAnalysis
. Renaming generally followed the pattern of renaming*backtest*
to*trade*
. - For consistency in naming conventions,
GetData
class ofautodata.py
has been renamed toAutoData
. - Broker interface method
get_positions
will directly - Rename
virtual_livetrade_config
tovirtual_account_config
. - Strategy configuration key
INCLUDE_POSITIONS
has been deprecated in favour of usingINCLUDE_BROKER
, then directly fetching positions from broker usingget_positions
method. - Renamed
GLOBAL.yaml
tokeys.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'
inconfigure
. - The behaviour of broker method
get_trades
has changed: now returns a list of fills (executed trades based on theTrade
object), rather than a dictionary ofIsolatedPositions
objects as before. This falls in line with the more common definition of a trade, but diverges from Oanda. As such, a new methodget_isolated_positions
has been added to the virtual broker and Oanda API interface to maintain the previous functionality ofget_trades
.
- 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
andquote
, which can be used to fetch OHLC price data from various feeds, depending on thedata_source
specified in the data configuration dictionary. Retrieval of level 1 and level 2 data is also available (where possible), accessible via theL1
andL2
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.
- Ability to specify a time range for
PERIOD
in strategy configuration. This value will be converted to an integer using theINTERVAL
key.
- Broker method
get_trade_details
has been deprecated in favour ofget_trades
method. - Strategy configuration key
INCLUDE_POSITIONS
has been deprecated in favour of usingINCLUDE_BROKER
, then directly fetching positions from broker usingget_positions
method.
- Minor improvements to margin requirement calculations in backtest
- Support of local data with portfolio strategies
- Backtest spread is now specified in price units for disambiguation
- Skip data warmup period to speed up backtests (specify
warmup_period
in autotrader.backtest) in continuous update mode - Improved backtest printout
- All instruments will be passed to a portfolio strategy as a list using the
instrument
argument - Instrument specific pip values can be provided when creating an order
- Improved Trade and Position
__repr__
methods
- Bug with floating pnl calculation when running multi-instrument backtests
- Pagination of Oanda data retrieval
- General exception handling of bot updates in continuous mode
- Link to documentation and website
- Autodetect divergence order of operations, timeseries indexing
- Specification and handling of 'home_currency' (provided through
configure
) - Calculation of home conversion factors, and handling of oanda quote data
- Portfolio strategies: include
"PORTFOLIO": True
in your strategy configuration to signal that the strategy is a portfolio-based strategy. Doing so, data for each instrument in the watchlist will be passed to the strategy, allowing a single strategy to control multiple instruments at once, as in a portfolio. Currently supported for continuous mode only. - Strategy configuration key
PARAMETERS
now optional. - Autodetection of multiple instrument backtests for plotting.
- Option to select chart type (standard or portfolio) for single instrument
backtests, via
AutoTrader.plot_settings()
. - Option to specify
base_size
when creating anOrder
. This refers to the trade size calculated using the base currency, pre-conversion using the account's home currency (particularly useful for Forex traders). modify
order types are now supported by the Oanda broker API, allowing a trader to change the take profit or stop loss attached to an open trade.
- generalised
get_size
method of broker utilities to give correct results for non-FX instruments (in this case, SL price must be provided rather than SL distance).
- Named arguments for strategy initialisation: strategies must be constructed from named arguments "parameters", "data" and "instrument". Additionally, "broker" and "broker_utils", when including broker access, and "data_stream" when including data stream access. This change was made for disambiguation of input arguments.
- Improvements to
AutoPlot
, including autoscaling of indicator figures and backtest account history - Addition of
BacktestResults
class, improving readability and accessibility of backtest results.
- Simpler imports: for example,
AutoTrader
can be imported usingfrom autotrader import AutoTrader
, instead offrom autotrader.autotrader import AutoTrader
. Likewise forAutoPlot
,GetData
, and trade objects (Order
,Trade
,Position
).
- Handling of close and reduce order types in
autobot
- Assign UTC timezone to data after downloading from yfinance
- Fetch current positions from virtual broker after updating with latest data.
- Duplicate bar checking method in
autobot
- Interactive Brokers is now supported.
- Improvements to public broker methods for clarity.
- Comprehensive docstrings and type hints added.
- Distinction of broker and feed, allowing specification of broker and feed separately.
- New broker template directory added.
- All AutoTrader attributes have been made private to avoid confusion - the configuration methods should be used exclusively to set the attributes. This also clarifies and promotes visibility of public methods.
- New method
get_bots_deployed
added to AutoTrader. - Project heirarchy: note changes in location of
autodata
,indicators
and other modules previously in thelib/
directory. - Deprecated
help
andusage
methods of AutoTrader (replaced by in-code docstrings). - AutoTrader method
add_strategy
now accepts strategy classes as input argument, to directly provide strategy class objects. - Broker public method name changes:
cancel_pending_order
tocancel_order
,get_pending_orders
toget_orders
,get_open_trades
toget_trades
,get_open_positions
toget_positions
. - Broker public method deleted:
get_cancelled_orders
- functionality available usingget_orders
method withorder_status = 'cancelled'
. - To facilitate strategies built with prior autotrader versions, the previous
format of signal dictionaries from strategy modules is still supported.
Support for this format will be phased out in favour of the new
Order
andTrade
objects (found inautotrader.brokers.trading
module). - For new Order, Trade and Position objects, support for legacy code is
included via
as_dict
methods, to convert class objects to dictionaries. - AutoTrader demo repository has been updated to reflect the changes above.
- Option to include/exclude positions from broker when updating strategy.
- Distinction of order/trade size and direction; size is now an absolute value representing the number of units to be traded, while direction specifies if the trade is long or short.
- Strategy module: method
generate_signal
is passed named argumentsi
andcurrent_position
. - Continuous mode: single instantiation, iteration by timestamp
- AutoStream deprecated: if using streamed data, local data file paths should
be provided using the
add_data
method. - Abstracted data update method into
DataStream
class (withinautotrader.utilities
module) to allow custom data pipelines - Ability to trade multiple contracts on an underlying asset (continuous mode only)
- Ability to use virtual broker in livetrade mode
For a changelog of versions prior to v0.6.0
, please refer to the
older versions changelog.