forked from pattty847/Crypto-Market-Watch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (24 loc) · 891 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import asyncio
import logging
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from sklearn.preprocessing import StandardScaler
from app.api.watch_trades import Trades
from app.api.fetch_candles import Candles
from app.machine_learning.trading import TradingBot
logging.basicConfig(level=logging.INFO)
exchanges = ['coinbasepro']
charts = [{"exchange":"coinbasepro", "symbol":"BTC/USD", "timeframe": "1d"}]
async def main():
async with Candles(local_database=True, exchanges=exchanges) as manager:
# await manager.watch_trades(['1INCH/USD'])
candles = await manager.fetch_candles(
charts=charts,
from_date='2021-04-09T00:00:00.000Z',
limit=1000
)
for a, b, c, df in candles:
print(df)
if __name__ == "__main__":
asyncio.run(main())