AutoTrader Changelog#
v0.12.1 (2023-09-26)#
Fix#
autoplot.py: fix plot_data error for indicator scaling
v0.12.0 (2022-11-17)#
Feat#
indicators: added signal column to chandelier indicator
indicators: added chandelier exit indicator
cli: added option to initialise directory from demo repository
Fix#
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
v0.11.2 (2022-10-27)#
Fix#
AutoData: do not truncate yahoo data if start and end arguments are not None
v0.11.1 (2022-10-27)#
Refactor#
AutoData: optionally provide workers as kwarg to fetch
v0.11.0 (2022-10-27)#
Feat#
AutoData: batch fetch instruments
v0.10.1 (2022-10-26)#
Perf#
data fetch of yahoo finance with count extends range to account for business days
v0.10.0 (2022-10-25)#
Feat#
improved monitor and added dashboard template
cli.py: added backtest demo function to cli
Fix#
autotrader.py: write broker hist when click paper trading
autodata.py: raise exception when invalid granularity is provided to yahoo finance
Refactor#
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
v0.9.1 (2022-10-23)#
Fix#
indicators.py: fixed handling of different data types in find_swings indicator
v0.9.0 (2022-10-21)#
Feat#
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
Fix#
fixed circular import errors
tg.py: order side determination logic
Refactor#
tg.py: renamed telegram.py to tg.py to avoid name conflict
notifier.py: added abstract communications class Notifier
v0.8.2 (2022-10-19)#
Refactor#
Broker: all broker class inherit from AbstractBroker
brokers.broker.py: renamed Broker to AbstractBroker
broker.py: implemented initial broker abstraction
v0.8.1 (2022-10-19)#
Refactor#
ccxt.broker.py: added network exception handling with single retries
v0.8.0 (2022-10-17)#
Feat#
autoplot.py: portfolio plot includes equity and nav hovertool
v0.7.11 (2022-10-17)#
Fix#
email_manager import (#46)
datetime.timezone import
CCXT get_trades uses kwargs in fetchMyTrades call
Version 0.7.10#
Changes#
Improved verbosity for exception handling.
Improved verbosity in
autotrader.pyfor bot updates.Added utility to CCXT interface (
get_min_notionalandget_ticksizemethods).Improved CCXT
get_orderscapability.
Fixes#
CCXT interface
get_tradesmethod updated forTradeobject arguments.
Version 0.7.9#
Fixes#
Plotting bug when option to show cancelled orders is True.
Version 0.7.8#
Features#
Upgraded virtual broker: backtest speedup for large portfolio’s
Ability to specify
deploy_timeinAutoTrader.configure(), a datetime object for when to release trading bots.Improved verbosity from main module when running.
Version 0.7.7#
Fixes#
Decimal error when placing market orders with
dydxmodule.
Version 0.7.6#
Fixes#
Import error of
AutoDataindydxmodule.
Version 0.7.5#
Features#
AutoBot submits orders using
ThreadPoolExecutorto speedup submission of multiple orders.Ability to provide custom execution methods via
AutoTrader.configure(execution_method=).Improved verbosity from
autobots.
Fixes#
Handling of testnet/mainnet keys when paper/virtual/live trading.
Inclusion of
__init__.pyfile inautotrader/brokers/ccxt/.Timezone handling.
Virtual broker does not use lambda functions to allow pickling.
Unified
broker._utilsattribute naming.
Version 0.7.4#
Features#
Better exception handling in CCXT broker interface.
Ability to specify
mainnetandtestnetAPI keys in yourkeys.yamlfile.Ability to provide slippage models for backtests (via
at.configure()).
Fixes#
Inifite
whileloop bug in virtual broker_reduce_positionmethod due to machine precision.Backtest portfolio plotting of more than 18 instruments is possible now due to an increased color pallete.
Version 0.7.3#
Fixes#
Unification of
get_orderbookin supportingbrokermodules.Expected behaviour of
get_positionsmethod in CCXT broker module.
Features#
Trading object
Positionincludes attributeccxtto include the output fromCCXTmethods.Improved configuration options for CCXT exchanges in
keys.yamlfile.
Version 0.7.2#
Fixes#
Oanda live trade functionality restored (after
keys.yamlrename).
Features#
AutoDatais more intelligent when creating a new instance;kwargscan be used in place ofdata_configdictionary, simplifying instantiation.Utility methods
get_broker_configandget_data_confighave been simplified, allowing calling withoutglobal_configargument (keys.yamlwill be read in fromconfig/directory).
Version 0.7.1#
Changes#
Oanda configuration keys in
keys.yamlhave changed for clarification
Fixes#
Oanda
data_configincludes account id, restoring automated data retrieval
Features#
Improved portfolio plot type
Improved printouts
Version 0.7.0#
AUGUST 2022
Breaking Changes#
Backtest
spreadis now specified in absolute price units (rather than pips as previously)Environment specification: paper trading can be activated by setting
environmenttopaper(default) and live trading can be activated by settingenvironmenttoliveTo 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_resultstoAutoTrader.trade_results(and similar forAutoBot),AutoTrader.print_backtest_resultstoAutoTrader.print_trade_resultsandBacktestResultsclass toTradeAnalysis. Renaming generally followed the pattern of renaming*backtest*to*trade*.For consistency in naming conventions,
GetDataclass ofautodata.pyhas been renamed toAutoData.Broker interface method
get_positionswill directlyRename
virtual_livetrade_configtovirtual_account_config.Strategy configuration key
INCLUDE_POSITIONShas been deprecated in favour of usingINCLUDE_BROKER, then directly fetching positions from broker usingget_positionsmethod.Renamed
GLOBAL.yamltokeys.yamlfor 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_tradeshas changed: now returns a list of fills (executed trades based on theTradeobject), rather than a dictionary ofIsolatedPositionsobjects as before. This falls in line with the more common definition of a trade, but diverges from Oanda. As such, a new methodget_isolated_positionshas been added to the virtual broker and Oanda API interface to maintain the previous functionality ofget_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_configto 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: Truein your strategy configuration.Data feeds have been unified to make data retrieval simpler than ever. Now there are methods
fetchandquote, which can be used to fetch OHLC price data from various feeds, depending on thedata_sourcespecified in the data configuration dictionary. Retrieval of level 1 and level 2 data is also available (where possible), accessible via theL1andL2methods.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
configuremethod,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
PERIODin strategy configuration. This value will be converted to an integer using theINTERVALkey.
Deprecation Notices#
Broker method
get_trade_detailshas been deprecated in favour ofget_tradesmethod.Strategy configuration key
INCLUDE_POSITIONShas been deprecated in favour of usingINCLUDE_BROKER, then directly fetching positions from broker usingget_positionsmethod.
Fixes#
Minor improvements to margin requirement calculations in backtest
Version 0.6.6#
Features#
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_periodin autotrader.backtest) in continuous update modeImproved backtest printout
All instruments will be passed to a portfolio strategy as a list using the
instrumentargumentInstrument specific pip values can be provided when creating an order
Improved Trade and Position
__repr__methods
Fixes#
Bug with floating pnl calculation when running multi-instrument backtests
Pagination of Oanda data retrieval
Version 0.6.5#
Features#
General exception handling of bot updates in continuous mode
Fixes#
Link to documentation and website
Version 0.6.4#
Fixes#
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
Version 0.6.3#
Features#
Portfolio strategies: include
"PORTFOLIO": Truein 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
PARAMETERSnow 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_sizewhen 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).modifyorder 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.
Fixes#
generalised
get_sizemethod of broker utilities to give correct results for non-FX instruments (in this case, SL price must be provided rather than SL distance).
Version 0.6.2#
Features#
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 historyAddition of
BacktestResultsclass, improving readability and accessibility of backtest results.
Version 0.6.1#
Features#
Simpler imports: for example,
AutoTradercan be imported usingfrom autotrader import AutoTrader, instead offrom autotrader.autotrader import AutoTrader. Likewise forAutoPlot,GetData, and trade objects (Order,Trade,Position).
Fixes#
Handling of close and reduce order types in
autobotAssign 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
Version 0.6.0#
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_deployedadded to AutoTrader.Project heirarchy: note changes in location of
autodata,indicatorsand other modules previously in thelib/directory.Deprecated
helpandusagemethods of AutoTrader (replaced by in-code docstrings).AutoTrader method
add_strategynow accepts strategy classes as input argument, to directly provide strategy class objects.Broker public method name changes:
cancel_pending_ordertocancel_order,get_pending_orderstoget_orders,get_open_tradestoget_trades,get_open_positionstoget_positions.Broker public method deleted:
get_cancelled_orders- functionality available usingget_ordersmethod 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
OrderandTradeobjects (found inautotrader.brokers.tradingmodule).For new Order, Trade and Position objects, support for legacy code is included via
as_dictmethods, 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_signalis passed named argumentsiandcurrent_position.Continuous mode: single instantiation, iteration by timestamp
AutoStream deprecated: if using streamed data, local data file paths should be provided using the
add_datamethod.Abstracted data update method into
DataStreamclass (withinautotrader.utilitiesmodule) to allow custom data pipelinesAbility to trade multiple contracts on an underlying asset (continuous mode only)
Ability to use virtual broker in livetrade mode
Older Versions#
For a changelog of versions prior to v0.6.0, please refer to the
older versions changelog.