-
Notifications
You must be signed in to change notification settings - Fork 1
/
bot.py
71 lines (58 loc) · 1.54 KB
/
bot.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import os
import time
import datetime
###################### BinanceAPI ######################
import functionsLibrary
import stra
#################### Discord Logger ####################
# from discord_logger import DiscordLogger
######################## dotenv ########################
import dotenv
from dotenv import load_dotenv
from dotenv import dotenv_values
load_dotenv()
##################### Variables ########################
Symbol = os.getenv("Symbol")
moneyCount = os.getenv("tradingBalance")
# TpTargetPercent = os.getenv("TpTargetPercent")
# StpTargetPercent = os.getenv("StpTargetPercent")
(
checkbelow,
checkabove,
lastClosePrice,
StpTargetPercent,
TpTargetPercent,
) = stra.trend5MG()
timestamp = int(datetime.datetime.today().timestamp() * 1000)
for x in range(500):
while True:
(
checkbelow,
checkabove,
lastClosePrice,
StpTargetPercent,
TpTargetPercent,
) = stra.trend5MG()
if checkabove == True and checkbelow == False:
if TpTargetPercent >= 0.3:
break
else:
print("tp waiting")
time.sleep(60)
else:
time.sleep(1)
print("trend waiting")
trade = functionsLibrary.trade(
symbol=Symbol,
moneyCount=moneyCount,
TpTargetPercent=TpTargetPercent,
StpTargetPercent=StpTargetPercent,
timestamp=timestamp,
)
print(trade)
time.sleep(400)
# Prices Fetch
# Buy
# Sell
# Logging
# Status