-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
57 lines (50 loc) · 2.41 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from CoreData.TAAPI import TAAPI
from CoreData.IEXCloud import IEXCloud
from Strategy.CCI import CCI
from Notification.Telegram import Telegram
from secrets import TAAPI_API_TOKEN
from secrets import TAAPI_API_TOKEN_2
from secrets import IEX_CLOUD_API_TOKEN
from secrets import TELEGRAM_CHANNEL_ID
from secrets import TELEGRAM_BOT_API_TOKEN
from Exchange.KuCoin import KuCoin
from Release.Heisen import Heisen
from secrets import Heisen_API_NAME
from secrets import Heisen_API_KEY
from secrets import Heisen_API_SECRET
from secrets import Heisen_API_PASSPHARSE
from Signal.Bva import Bva
from Strategy.SqueezeMomentum import SqueezeMomentum
# --------------------------------------------- Create Objects ---------------------------------------------
iex_obj = IEXCloud(IEX_CLOUD_API_TOKEN) # Create IEXCloud object that gives the bot last crypto price
taapi_obj = TAAPI(TAAPI_API_TOKEN) # Create TAAPI object that gives the bot indicators values
taapi_obj2 = TAAPI(TAAPI_API_TOKEN_2)
kucoin_obj = KuCoin(API_NAME=Heisen_API_NAME,
API_KEY=Heisen_API_KEY,
API_SECRETS=Heisen_API_SECRET,
API_PASSPHRASE=Heisen_API_PASSPHARSE)
telegram_obj = Telegram(token=TELEGRAM_BOT_API_TOKEN,
channel_id=TELEGRAM_CHANNEL_ID,
kucoin_obj=kucoin_obj) # Create Telegram object that gives the bot the ability
# of sending logs to telegram channel
cci_obj = CCI(IEXCloud_obj=iex_obj,
TAAPI_obj=taapi_obj,
TAAPI_obj2=taapi_obj2,
Telegram_obj=telegram_obj,
KuCoin_connection=kucoin_obj,
size=35) # Create CCI object that gives the bot the ability of technical
# analysis and get along with cci indicator
bva_obj = Bva(2028)
sqz_obj = SqueezeMomentum(bva_obj, kucoin_obj, telegram_obj)
# --------------------------------------------- Define Bot Functions ---------------------------------------------
def exec_heisen_bot():
heisen_obj = Heisen(KCConnection=kucoin_obj,
Telegram_obj=telegram_obj,
CCI_obj=cci_obj)
heisen_obj.exec()
# --------------------------------------------- Define Emergencies ---------------------------------------------
def emergency_close():
telegram_obj.start_polling()
# --------------------------------------------- Execute ---------------------------------------------
# exec_heisen_bot()
sqz_obj.start(verbose=True)