-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.py
25 lines (19 loc) · 660 Bytes
/
demo.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
# this file is going to be a working bot which uses all the
# minimal trading features to create a functional trading bot.
import ccxt
import os
from dotenv import load_dotenv
load_dotenv()
# set defaults to prevent errors
key = os.getenv('BYBIT_KEY')
secret = os.getenv('BYBIT_SECRET')
# Variable exchange so universal functions can be used
EXCHANGE = 'bybit'
# Get correct API Keys
if (EXCHANGE == 'bybit') :
key = os.getenv('BYBIT_KEY')
secret = os.getenv('BYBIT_SECRET')
# exchange = ccxt.bybit({'apiKey': key, 'secret': secret}).api
exchange = getattr(ccxt, EXCHANGE)({'apiKey': key, 'secret': secret})
session = exchange.api
print(session)