Async trading library based on asyncio
Project description
Introduction
Crypto exchange APIs are often callback-oriented. This makes coding a nightmare and will distract you from your most important goal of developing a winning strategy.
aiotrading is here to solve this problem. Using it, interacting with exchanges will be as much fun as the following example:
from aiotrading.exchanges.binance import BinanceFutures
async with BinanceFutures() as exchange:
async with exchange.candle_stream('btcusdt', '3m') as stream:
for i in range(10):
candle = await stream.read()
log.info(candle)
Sample output of this code example is:
connecting to exchange: binance-futures
opening candle stream btcusdt@3m
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32388.45, v:410.773
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32383.49, v:410.948
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32380.14, v:411.627
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32380.43, v:414.070
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32382.41, v:414.448
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32377.47, v:415.138
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32376.50, v:416.437
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32374.96, v:417.523
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32373.64, v:417.749
btcusdt, 3m, t:2021-01-28 16:54:00, o:32340.44, h:32437.67, l:32324.00, c:32382.07, v:422.761
closing candle stream btcusdt@3m
disconnecting from exchange: binance-futures
Installation
pip3 install aiotrading
Status
aiotrading is at its early stage of development. It currently supports a subset of Binance exchange API services. More services will be supported in the future. It is designed in a way that other exchanges can be supported easily.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiotrading-0.0.3.tar.gz
(9.5 kB
view hashes)
Built Distribution
aiotrading-0.0.3-py3-none-any.whl
(24.1 kB
view hashes)
Close
Hashes for aiotrading-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a46ad9c99994cea47bdd1094677a6a31124ca344881c66f9e9901323095c14a3 |
|
MD5 | bd9dc0cf13b219ed23c5c6ab44be47a8 |
|
BLAKE2b-256 | 90001196ce49226152f3caede9cd53301a617b03778510e6e62aeafff8d20a33 |