-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
52 lines (36 loc) · 1.22 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
from binance import Binance
from alert import DiscordAlertBot
from constants import constants
from util import util
import json
import time
import traceback
binance = Binance.Binance()
balance = binance.get_balance()
SETTING = constants.SETTING
# get positioned list by json file
positioned_list = list()
POSITIONED_FILE_PATH = SETTING['PATH']['LOCAL']
try:
with open(POSITIONED_FILE_PATH, 'r') as json_file:
positioned_list = json.load(json_file)
except Exception as e:
print("\n| Exception by First | Not Positioned\n")
try:
TICKER_COUNT = SETTING['TICKER']['COUNT']
ticker_list = binance.get_top_volume_ticker_list(TICKER_COUNT)
for positioned_ticker_data in positioned_list:
positioned_ticker = positioned_ticker_data[0]
if positioned_ticker not in ticker_list:
ticker_list.append(positioned_ticker)
time.sleep(0.1)
# ----------------------------------
ticker_order = 1
for ticker in ticker_list:
print(ticker)
candle_5m = binance.get_ohlcv(ticker, "5m")
time.sleep(0.02)
print(util.get_supertrend_cloud(candle_5m, "5m"))
except Exception as e:
print("Exception :", e)
print(traceback.format_exc())