-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
38 lines (31 loc) · 1.01 KB
/
config.py
File metadata and controls
38 lines (31 loc) · 1.01 KB
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
34
35
36
37
38
import os
from typing import Optional
class Config:
BINANCE_API_KEY: Optional[str] = os.getenv('BINANCE_API_KEY', None)
BINANCE_API_SECRET: Optional[str] = os.getenv('BINANCE_API_SECRET', None)
DEFAULT_LIMIT = 500
DEFAULT_TIMEFRAME = '1h'
DEFAULT_SYMBOL = 'BTCUSDT'
RSI_PERIOD = 14
STOCH_RSI_PERIOD = 14
SMA_SHORT_PERIOD = 20
SMA_LONG_PERIOD = 50
EMA_PERIOD = 20
BOLLINGER_PERIOD = 20
KDJ_PERIOD = 14
VOLUME_PERIOD = 20
RSI_OVERSOLD = 30
RSI_OVERBOUGHT = 70
STOCH_OVERSOLD = 20
STOCH_OVERBOUGHT = 80
DECIMAL_PLACES = 4
PERCENTAGE_PLACES = 2
@classmethod
def get_api_credentials(cls) -> tuple:
return cls.BINANCE_API_KEY, cls.BINANCE_API_SECRET
@classmethod
def set_api_credentials(cls, api_key: str, api_secret: str):
cls.BINANCE_API_KEY = api_key
cls.BINANCE_API_SECRET = api_secret
os.environ['BINANCE_API_KEY'] = api_key
os.environ['BINANCE_API_SECRET'] = api_secret