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.futures import Exchange
exchange = Exchange()
async with exchange.candle_stream('btcusdt', '3m') as stream:
for _ in range(10):
candle = await stream.read()
log.info(candle)
Sample output of this code example is:
2021-01-16 00:19:48,696-INFO: creating exchange: binance-futures
2021-01-16 00:19:48,697-INFO: opening canlde stream: btcusdt, 3m
2021-01-16 00:19:50,718-INFO: o:37343.16, h:37345.91, l:37250.00, c:37256.14, v:270.707
2021-01-16 00:19:51,129-INFO: o:37343.16, h:37345.91, l:37250.00, c:37259.07, v:270.712
2021-01-16 00:19:51,515-INFO: o:37343.16, h:37345.91, l:37250.00, c:37259.08, v:270.789
2021-01-16 00:19:51,806-INFO: o:37343.16, h:37345.91, l:37250.00, c:37255.81, v:271.064
2021-01-16 00:19:52,209-INFO: o:37343.16, h:37345.91, l:37250.00, c:37255.23, v:271.158
2021-01-16 00:19:52,452-INFO: o:37343.16, h:37345.91, l:37250.00, c:37255.61, v:271.191
2021-01-16 00:19:52,705-INFO: o:37343.16, h:37345.91, l:37250.00, c:37250.00, v:284.017
2021-01-16 00:19:53,074-INFO: o:37343.16, h:37345.91, l:37249.74, c:37249.74, v:284.722
2021-01-16 00:19:53,378-INFO: o:37343.16, h:37345.91, l:37249.74, c:37250.03, v:284.819
2021-01-16 00:19:53,960-INFO: o:37343.16, h:37345.91, l:37249.74, c:37250.03, v:285.049
2021-01-16 00:19:53,962-INFO: closing canlde stream: btcusdt, 3m
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
Built Distribution
File details
Details for the file aiotrading-0.0.2.tar.gz
.
File metadata
- Download URL: aiotrading-0.0.2.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ed7fb5381b1e35f85d9e32d500f558959454cd0378b02a76c00a79e52d918dc |
|
MD5 | 50a371a6c7c55c7f176d02df7bfe963f |
|
BLAKE2b-256 | 51765f524b2cc991546d0ccb7d513d5ffefd36325d25685e10e5c9aa3609c822 |
File details
Details for the file aiotrading-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: aiotrading-0.0.2-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a62d58ca579087874ce3b6380d2dd1684ddc2638b3688941c2031ea1264c9cac |
|
MD5 | 4c9180d81d13f38dfd39193463e4a08c |
|
BLAKE2b-256 | f685d1f078109475f8a72f660c151efcc63c60a6c5e819a008facddef5f7e749 |