client to communicate with alphaticks
Project description
alpha-data-py
A client to fetch data from the alphaticks data base
Installation
You can install alpha-data-py using the following command:
pip install alpha-data-py
Usage
In order to use the library, you need an API key from alphaticks. Go to alphaticks.io, Account -> Licenses -> AlphaData and click on Add credentials.
Now that you have your credentials ready, you can create a client, fetch a security, and fetch the data you need for that security.
import datetime
from adata import Client, FREQ_1M
c = Client(API_KEY, API_SECRET)
secs = c.get_securities()
for s in secs:
if s.symbol == "BTCUSDT" and s.exchange == "fbinance":
sec = s
start = datetime.datetime(2022, 1, 1)
end = datetime.datetime(2022, 1, 5)
it = c.get_historical_ohlcv(sec, FREQ_1M, start, end)
while it.next():
print(it.o, it.h, it.l, it.c, it.v)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
alpha-data-py-1.0.12.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for alpha_data_py-1.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42226a2c4124ce179d0688edd890dd1726b2aa7911ba419f1e0470ce34be24dc |
|
MD5 | a989c644b43a52c0702ea2cd5e94ad8b |
|
BLAKE2b-256 | 220de3f5efc1ee3a3274d62b055a43e8e97ff1e7dd28865175328785daa6301d |