- Fix unnecessary upper() in
is_stablecoin_like
- Add more stablecoins
- Add
DEXPair.volume_30d
shortcut - Add
DEXPair.from_row
shortcut
- Fix: Better error messages when
fetch_trading_data_availability()
cannot process input
- Add
DEXPair.fee_tier
to get the trading pair fee as 0..1 float - Add
PandasPairUniverse.create_pair_universe
- Deprecate
PandasPairUniverse.create_single_pair_universe
- Deprecate
PandasPairUniverse.create_limited_pair_universe
- Add
USDT.e
andUSDC.e
bridged stablecoins on Avalanche
- Add: caching to
get_candles_by_pair()
andget_single()
methods. This can result in backtesting time being more than halved. - Fix: Bad wick filtering code crashed on empty dataframes
- Add:
tradingstrategy.utils.groupeduniverse.fix_bad_wicks
to deal with candle data where high and low values are abnormal due to various price manipulation issues. - Update: Automatically filter bad wicks when creating a candle universe
- Add a shortcut function
tradingstrategy.pair.generate_address_columns()
to generatebase_token_address
andquote_token_address
columns - Update API:
resolve_pairs_based_on_ticker()
supportsHumanReadableTradingPairDescription
- Fix: Some error message polish
- Have classical
Candle.volume
field as buy volume and sell volume cannot be separated for Uniswap v3
- change
resample_candles()
to use timedelta instead of timebucket
- Fix JSON data loading for Uni v3 exchanges that lack trade count
- Add
fee_tier
option toget_one_pair_from_pandas_universe()
andget_pair_by_human_description()
- Bump max pairs to load over JSONL to 75
- Chart visualization fixes
- remove
price_chart_rel_size
andsubplot_rel_size
options (will all be specified inrelative_sizing
) - refactor and clean code in
tradingstrategy/charting/candle_chart.py
- remove
- Fix SyntaxError caused by a typo
- We have now
tradingstrategey.client.BaseClient
as the base class for different client implementations - Adding
UniswapV2MockClient
implementation that mimicsClient
, but reads all data from an EVM test backend. Makes live trading tests much easier. - Small improvements to PairUniverse
- Fix detached indicator charting bugs for different
volume_bar_modes
- Adds support for different subtitle font sizes
- Adds tests to make to catch charting bugs earlier in the future
- Bump depenedncies
- Add
ChainId.anvil
- Add support for detached technical indicators
- Web3 6.0 fixes
- Match dependencies and Python version pindowns with Web3.py 6.0
- Adding Ethereum Tester chain id
- Silence pandas warning in
PairGroupedUniverse.get_pair_ids()
- Rename "Binance Smart Chain" to "BNB Smart Chain"
- Add a new method
Client.fetch_all_lending_protocol_reserves()
for fetching data on supported decentralized lending protocols (only AAVE v3 at present). - Improve
validate_ohclv_dataframe()
to check for date/timestamp index as well as column
- Fixes for filtering by
chain_id
inExchangeUniverse
- Improve
resolve_pairs_based_on_ticker()
to be able to filter pairs with specified fee. Change default sorting criteriabuy_volume_all_time
to be function argument for more flexible filtering
- Add
GroupedCandleUniverse.get_last_entries_by_pair_and_timestamp(pair_id, timestamp)
for simplified candle data access - Add
PandasPairUniverse.get_pair(chain_id, exchange_id, base_token, quote_token)
for simplified pair access - Support passing
exchange_universe
inPandasPairUniverse
construction, so we have all metadata needed to look up pairs - Fixes to various token data accessor
- Same as 0.13.1 - fixing broken release
- Support Arbitrum L2 in
ChainId
class
A large impact optimisation update.
-
Optimise
PandasPairUniver.get_pair_by_id
to cache fullDEXPair
objects to speed up strategies using large number of trading pairs -
Make
DEXPair
Python__slots__
based to make the object property access faster -
Added
ResampledLiquidityUniverse
for faster backtesting with luidity data -
Allow different granularity of OHLCV and liquidity data in
Universe
- Release failed
- Add
LiquidityUniverse.get_liquidity_with_tolerance
- Quick fix on
get_pair_by_human_description
error message
- Improve
CandleSampleUnavailable
error messge further to offer friendly advises how to fix - Improve
ExchangeUniverse
interface with more helpful shorthand methods
- Add
ExchangeUniverse.from_collection()
- Pass
ExchangeUniverse
instance as a part ofUniverse.exchange_universe
instead just raw array of ofuniver.exchanges
- Better multipair lookup when typing out pair names by hand
- Add
tradingstrategy.pair.HumanReadableTradingPairDescription
- Add
PandasPairUniverse.get_pair_by_human_description
- Add default HTTP request retry policy to
Client
- Add default HTTP user agent to
Client
- More direct data feed infrastructure
- Fix
create_requests_client(add_exception_hook=True)
not working correctly - Add
GroupedCandleUniverse.create_from_multiple_candle_datafarames
- Add: Make
DEXPair
hashable - Fix: Historical candle download for JSONL endpoint - make time ranges to work correctly
- Change: Make JSONL cache filenames more descriptive
- Adding
Client.fetch_trading_data_availability
API - Moved
types.py
to properly Python 3.10 TypeAlias system
- Add
TradeSummary.show
to simplify usage in notebooks
- Fix missing dependencies because web3-ethereum-defi data extras
- Fix
make_candle_labels
not working correctly if some keys were not present in the OHCLV DataFrame - Add
VolumeBarMode
option tovisualise_ohlcv
to allow different rendering modes for volume bars, in-chart or outside chart - More implementation of direct-to-blockchain node data feeds
- Add the initial implementation for direct-to-blockchain node data feeds
- Add support for average duration statistic to be expressed in terms of
bars
- Framework for direct, real-time, date feeds directly from a blockchain node
- Add
uniswap_v2_incompatible
exchange type
- Make the default behavior not to return the current candle if asked by timestamp
- Switch to
tqdm-loggable
to have better download status behavior on headless configurations - Fine tune
visualise_ohlcv
label configuration
- Fix spelling
visualise_ohlcv
- Add candle charts with
visualise_ohclv
-
Optimize
groupeduniverse
class, specificallyget_timestamp_range()
method -
Optimize get pair speed
-
Remove the "no Content-Length header" warning if HTTP response lacks file size information
-
Fix
get_token()
not returning symbol information
- Added
Client.close()
andCachedHTTPTransport.close()
for explicit closing of streams - Fix
JUPYTER_PLATFORM_DIRS
warning when importing - Fixed bunch of Pandas warnings
- Add
pytest -Werror
to ensure the lib does not raise any warnings
- Escape hatch for interactive API key setup loop
- Added
Candle.generate_synthetic_sample
for mocking test data - Added
GroupedCandleUniverse.get_price_with_tolerance
to safely get the latest price in backtesting
- Make
matplotlib
optional inClient.setup_notebook
- Added
DEXPair.exchange_type
to support Uniswap v3 pairs
- Change: List
requests
as an explicit dependency for the client (Might have been causing issues with Pyodide builds)
- Change: Remove a lot of dependencies and cleaning up old code. The package with its dependencies should be now much more compact. Any old Backtrader or QSTrader code is behind an extra dependency in the Python package definition. There is no longer dependency to Ethereum or crypto packages that had C and were problematic install.
- Change: preparing for Pyodide support.
- Change: Bumped Python 3.10 because 3.10 is minimum for Pyodide
- Fix:
PairGroupedUniverse
did not have OHLCV data sorted bytimestamp
, but instead of waspair_id
,timestamp
causing some failures of managing expectations when accessing data. - Fix: Update tests to reflect new datasets from Trading Strategy API
- Added
Client.fetch_candles_by_pair_ids
that loads trading data for certain pairs
data over JSONL endpoint and avoids loading large Parquest candle and liquidity files. This makes it possible to run backtests on low memory environments. - Added
Client.fetch_candle_dataset
andread_parquest(filters)
to filter Parquest files when loading candle datasets to optimise memory usage. (At the moment this path is not used outside the tests.) - Change
ChainId
base class toIntEnum
instead ofEnum
for better type hinting - Change
PandasPairUniverse.build_index
to use Pandas DataFrame frame transpose, greatly speeding up the creation of the index - Fix:
get_closest_price
gets a closest price even if the timestamp and
and time bucket are not in the same internal - Added
environment/jupyterlite
for the upcoming WebAssembly integration
- Added
is_candle_green()
,is_candle_red()
helpers - Added
TimeBucket.to_pandas_timedelta()
helper - Added
upsample_candles()
helper - Added
unknown
andosmosis
blockchains
- Add
Token
presentation - Add
get_single_pair_data
shortcut - Add
PandasPairUniverse.get_by_symbols
shortcut - Add
PandasPairUniverse.get_all_tokens
shortcut - Add
get_exchange_by_id
shortcut - Add
summarydata.as_duration
Pandas summary table cell formatter - Fix
filter_for_quote_tokens
to be more strict (was checking either side of the pair, not quote token) - API change
create_single_pair_universe
now to acceptpick_by_highest_vol
- API change: Rename
Universe.time_frame
->Universe.time_bucket
to be consistent - Make download progress bars more human friendly
- Add
check_schema
option when creating PyArrow table exports for trading pairs - Fix type hint for
token1_decimals
- Better error message for
get_one_pair_from_pandas_universe
- Make
token0_symbol
andtoken1_symbol
optional as not all tokens have a symbol
- Patch the previous release to
token0_decimals
andtoken1_decimals
instead ofbase_token_decimals
to be more aligned with the other Uniswap pair data - Cleaning up API and API documentation
- Export
base_token_decimals
andquote_token_decimals
in trading pair datasets
- New time points for the time buckets
- Add
exchange_address
as a part of trading pair datasets - Add
get_by_chain_and_factory()
to decentralised exchange universe
- Add
buy_tax
,transfer_tax
,sell_tax
to trading pair datasets
- Fix download retries in live trading
- Add
stablecoin
module for upcoming stablecoin support fuctions - Add
DEXPair.convert_to_dataframe
- Add
filter_for_stablecoins
- Fix broken build
- Fix Macbook M1, macOS, arm64 compatibility. Updated Scipy, Pyarrow and Numpy dependencies.
- Renaming the package
tradingstrategy
->trading-strategy
to be consistent with the package naming practices. See the new Github repository.
- Fix download responses being buffered in CLI
- Test for
get_trading_pair_page_url()
in the downloaded dataset - Added support for Ganacher tester chain
- Added
Client.create_live_client
for live trading - More helper functions to help unit testing
tradingstrategy.utils.time
to check for incompatiblepandas.Timestamp
formats- Added
tradingstrategy.pair.filter_for_quote_tokens
- Added
get_all_samples_by_range
,iterate_samples_by_pair_range
shortcuts to consume trading pair data in strategies - Added
get_prior_timestamp
to calibrate your clock with the existing time index - Added
Client.clear_caches
to ensure fresh data downloads - Added
DEXPair.exchange_slug
andDEXPair.pair_slug
so we can point to web page URLs - Renamed
Sushiswap
->Sushi
as per their branding
- Adding chain id 61 for Ethereum Classic / Ethereum Tester
- Adding
GroupedCandleUniverse.create_empty()
andGroupedLiquidityUniverse.create_empty()
This is a release to get Trading Strategy client towards live trading.
- Created
tradingstrategy.universe.Universe
helper class to encapsulate trading universe - Added convenience method
PairUniverse.create_from_pyarrow_table_with_filters
so creating different trading universes is less lines of code - Added convenience method
tradingstrategy.utils.groupeduniverse.filter_for_pairs_on_exchanges
- Added helper methods to construct single trading pair universe, see
PandasPairUniverse.create_single_pair_universe
- Separate QSTrader to an optional dependency. Please install as
pip install tradingstrategy[qstrader]
. This is because QSTrader depends on Seaborn that depends on SciPy that does not work so good on Apple M1 macs. - Add the default connection and read timeout 15 seconds to all client downloads
- Reworked how QSTrader framework integration works. QSTrader was originally designed for stock markets, so it required few changes to make it more suitable for 24/7 cryptomarkets. Warning: QSTrader and its integration are both in beta. More work is needed to be done e.g. in fee calculations to make the integration smooth. See example on PancakeSwap momentum trading algorithm.
- Added portfolioanalyzer to make timeline of portfolio construction over the time. See example on PancakeSwap momentum trading algorithm.
- Include
seaborn
as a dependency as it is required forqstrader
plot output, otherwiseqstrader
was crashing. PairUniverse
supports indexed lookups to deal with the high pair count.- More convenience methods for candle and liquidity manipulation.
- Adding the preliminaty price impact analysis. See the example notebook. Read the blog post about the liquidity formation.
- Make fastquant dependency optional, as it was causing installation issues with its ccxt dependency
- Updated inline interactive setup from within Jupyter notebook
- Polish README, release process and docs
-
Multiple changes to make the multichain backtesting possible.
-
The documentation code examples will be updated to reflect multichain support over time and may work incorrectly at the moment. Getting Started tutorial is already updated.
-
This is a major release deprecating activity flags in the trading pair universe. The multichain trading pair data is too big to include inactivate trading pairs (800k+ total trading pairs). Thus, the pair universe set only contains active trading pairs after this release, making the trading pair universe less than 100k trading pairs again, making it more feasible to download the data.
-
ExchangeUniverse.get_by_chain_and_slug()
is now canonical way to refer to an exchange -
PairUniverse.get_pair_by_ticker_by_exchange()
is now canonical way to refer to a trading pair -
Clarify primary keys may not be stable and should no longer referred permanently
-
Exchange.homepage
andExchange.active_pair_count
fields added
- Make
ChainId
database more deterministic by loading all supported chains once and only once
- Add
chain_name
output field for exchange data
- Adding slug lookups for chains
- Add Binance Smart Chain and Polygon logos
- Fix the default API endpoint URL
- Adding embedded chain list repository
- Adding support for Binance Smart Chain
- Adding more metadata information on
ChainId
objects
- Adding
exchange_slug
andchain_slug
on theExchange
object
- Allow to customise color range for the trade success distribution diagram
-
Added custom
DEXTrader
base class, as the default logic with Backtrader was a bit insufficient -
Added trade analysis support for Backtrader strategies (earlier was QSTrader only)
-
Reworked trade analysis summaries and views
- Polish API key welcome setup
- Fixed not reading settings file from Google Drive