-
Notifications
You must be signed in to change notification settings - Fork 2
/
main_server_instantly.py
250 lines (228 loc) · 10 KB
/
main_server_instantly.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
from tempfile import TemporaryDirectory
import schedule
import time
import os
from test import get_data
from ramin_cmo_for_instant import analyze
import pandas as pd
pairs=['BTC-USDT','ETH-USDT']
first_run = True
def every_10_second():
global ohlc
global first_run
print("start 15min")
if(first_run == True):
for pair in pairs:
ohlc = get_data(pair,timeframe='15m',limit=500)
ohlc.to_csv(f'ohlc_data/{pair}_15m.csv')
analyze(ohlc,timeframe='15m')
first_run = False
else:
for pair in pairs:
print('\n')
print('\n')
print('\n')
ohlc = pd.read_csv(f'ohlc_data/{pair}_15m.csv')
ohlc = ohlc.set_index('date')
print(ohlc)
temp_ohlc = get_data(pair,timeframe='15m',limit=1)
ohlc = ohlc.iloc[:-1,:]
ohlc = pd.concat([ohlc, temp_ohlc])
print(ohlc)
analyze(ohlc,timeframe='15m')
return
def start_15m():
global ohlc
for pair in pairs:
ohlc = get_data(pair,timeframe='15m',limit=500)
ohlc.to_csv(f'ohlc_data/{pair}_15m.csv')
# os.system('.\Scripts\python.exe mina_ichi_macd_ema.py 30m')
return
# def start_1h():
# os.system('.\Scripts\python.exe ramin_cmo.py 1h')
# os.system('.\Scripts\python.exe rsi+ema200+sar.py')
# return
# def start_4h():
# os.system('.\Scripts\python.exe ramin_cmo.py 4h')
# # os.system('.\Scripts\python.exe mina_ichi_macd_ema.py 4h')
return
schedule.every(10).seconds.do(every_10_second)
# 15 minutes
schedule.every().day.at("00:12").do(start_15m)
schedule.every().day.at("00:27").do(start_15m)
schedule.every().day.at("00:42").do(start_15m)
schedule.every().day.at("00:57").do(start_15m)
schedule.every().day.at("01:12").do(start_15m)
schedule.every().day.at("01:27").do(start_15m)
schedule.every().day.at("01:42").do(start_15m)
schedule.every().day.at("01:57").do(start_15m)
schedule.every().day.at("02:12").do(start_15m)
schedule.every().day.at("02:27").do(start_15m)
schedule.every().day.at("02:42").do(start_15m)
schedule.every().day.at("02:57").do(start_15m)
schedule.every().day.at("03:12").do(start_15m)
schedule.every().day.at("03:27").do(start_15m)
schedule.every().day.at("03:42").do(start_15m)
schedule.every().day.at("03:57").do(start_15m)
schedule.every().day.at("04:12").do(start_15m)
schedule.every().day.at("04:27").do(start_15m)
schedule.every().day.at("04:42").do(start_15m)
schedule.every().day.at("04:57").do(start_15m)
schedule.every().day.at("05:12").do(start_15m)
schedule.every().day.at("05:27").do(start_15m)
schedule.every().day.at("05:42").do(start_15m)
schedule.every().day.at("05:57").do(start_15m)
schedule.every().day.at("06:12").do(start_15m)
schedule.every().day.at("06:27").do(start_15m)
schedule.every().day.at("06:42").do(start_15m)
schedule.every().day.at("06:57").do(start_15m)
schedule.every().day.at("07:12").do(start_15m)
schedule.every().day.at("07:27").do(start_15m)
schedule.every().day.at("07:42").do(start_15m)
schedule.every().day.at("07:57").do(start_15m)
schedule.every().day.at("08:12").do(start_15m)
schedule.every().day.at("08:27").do(start_15m)
schedule.every().day.at("08:42").do(start_15m)
schedule.every().day.at("08:57").do(start_15m)
schedule.every().day.at("09:12").do(start_15m)
schedule.every().day.at("09:27").do(start_15m)
schedule.every().day.at("09:42").do(start_15m)
schedule.every().day.at("09:57").do(start_15m)
schedule.every().day.at("10:12").do(start_15m)
schedule.every().day.at("10:27").do(start_15m)
schedule.every().day.at("10:42").do(start_15m)
schedule.every().day.at("10:57").do(start_15m)
schedule.every().day.at("11:12").do(start_15m)
schedule.every().day.at("11:27").do(start_15m)
schedule.every().day.at("11:42").do(start_15m)
schedule.every().day.at("11:57").do(start_15m)
schedule.every().day.at("12:12").do(start_15m)
schedule.every().day.at("12:27").do(start_15m)
schedule.every().day.at("12:42").do(start_15m)
schedule.every().day.at("12:57").do(start_15m)
schedule.every().day.at("13:12").do(start_15m)
schedule.every().day.at("13:27").do(start_15m)
schedule.every().day.at("13:42").do(start_15m)
schedule.every().day.at("13:57").do(start_15m)
schedule.every().day.at("14:12").do(start_15m)
schedule.every().day.at("14:27").do(start_15m)
schedule.every().day.at("14:42").do(start_15m)
schedule.every().day.at("14:57").do(start_15m)
schedule.every().day.at("15:12").do(start_15m)
schedule.every().day.at("15:27").do(start_15m)
schedule.every().day.at("15:42").do(start_15m)
schedule.every().day.at("15:57").do(start_15m)
schedule.every().day.at("16:12").do(start_15m)
schedule.every().day.at("16:27").do(start_15m)
schedule.every().day.at("16:42").do(start_15m)
schedule.every().day.at("16:57").do(start_15m)
schedule.every().day.at("17:12").do(start_15m)
schedule.every().day.at("17:27").do(start_15m)
schedule.every().day.at("17:42").do(start_15m)
schedule.every().day.at("17:57").do(start_15m)
schedule.every().day.at("18:12").do(start_15m)
schedule.every().day.at("18:27").do(start_15m)
schedule.every().day.at("18:42").do(start_15m)
schedule.every().day.at("18:57").do(start_15m)
schedule.every().day.at("19:12").do(start_15m)
schedule.every().day.at("19:27").do(start_15m)
schedule.every().day.at("19:42").do(start_15m)
schedule.every().day.at("19:57").do(start_15m)
schedule.every().day.at("20:12").do(start_15m)
schedule.every().day.at("20:27").do(start_15m)
schedule.every().day.at("20:42").do(start_15m)
schedule.every().day.at("20:57").do(start_15m)
schedule.every().day.at("21:12").do(start_15m)
schedule.every().day.at("21:27").do(start_15m)
schedule.every().day.at("21:42").do(start_15m)
schedule.every().day.at("21:57").do(start_15m)
schedule.every().day.at("22:12").do(start_15m)
schedule.every().day.at("22:27").do(start_15m)
schedule.every().day.at("22:42").do(start_15m)
schedule.every().day.at("22:57").do(start_15m)
schedule.every().day.at("23:12").do(start_15m)
schedule.every().day.at("23:27").do(start_15m)
schedule.every().day.at("23:42").do(start_15m)
schedule.every().day.at("23:57").do(start_15m)
# #30 minutes
# schedule.every().day.at("00:25").do(start_30m)
# schedule.every().day.at("00:55").do(start_30m)
# schedule.every().day.at("01:25").do(start_30m)
# schedule.every().day.at("01:55").do(start_30m)
# schedule.every().day.at("02:25").do(start_30m)
# schedule.every().day.at("02:55").do(start_30m)
# schedule.every().day.at("03:25").do(start_30m)
# schedule.every().day.at("03:55").do(start_30m)
# schedule.every().day.at("04:25").do(start_30m)
# schedule.every().day.at("04:55").do(start_30m)
# schedule.every().day.at("05:25").do(start_30m)
# schedule.every().day.at("05:55").do(start_30m)
# schedule.every().day.at("06:25").do(start_30m)
# schedule.every().day.at("06:55").do(start_30m)
# schedule.every().day.at("07:25").do(start_30m)
# schedule.every().day.at("07:55").do(start_30m)
# schedule.every().day.at("08:25").do(start_30m)
# schedule.every().day.at("08:55").do(start_30m)
# schedule.every().day.at("09:25").do(start_30m)
# schedule.every().day.at("09:55").do(start_30m)
# schedule.every().day.at("10:25").do(start_30m)
# schedule.every().day.at("10:55").do(start_30m)
# schedule.every().day.at("11:25").do(start_30m)
# schedule.every().day.at("11:55").do(start_30m)
# schedule.every().day.at("12:25").do(start_30m)
# schedule.every().day.at("12:55").do(start_30m)
# schedule.every().day.at("13:25").do(start_30m)
# schedule.every().day.at("13:55").do(start_30m)
# schedule.every().day.at("14:25").do(start_30m)
# schedule.every().day.at("14:55").do(start_30m)
# schedule.every().day.at("15:25").do(start_30m)
# schedule.every().day.at("15:55").do(start_30m)
# schedule.every().day.at("16:25").do(start_30m)
# schedule.every().day.at("16:55").do(start_30m)
# schedule.every().day.at("17:25").do(start_30m)
# schedule.every().day.at("17:55").do(start_30m)
# schedule.every().day.at("18:25").do(start_30m)
# schedule.every().day.at("18:55").do(start_30m)
# schedule.every().day.at("19:25").do(start_30m)
# schedule.every().day.at("19:55").do(start_30m)
# schedule.every().day.at("20:25").do(start_30m)
# schedule.every().day.at("20:55").do(start_30m)
# schedule.every().day.at("21:25").do(start_30m)
# schedule.every().day.at("21:55").do(start_30m)
# schedule.every().day.at("22:25").do(start_30m)
# schedule.every().day.at("22:55").do(start_30m)
# schedule.every().day.at("23:25").do(start_30m)
# schedule.every().day.at("23:55").do(start_30m)
# schedule.every().day.at("00:25").do(start_1h)
# schedule.every().day.at("01:25").do(start_1h)
# schedule.every().day.at("02:25").do(start_1h)
# schedule.every().day.at("03:25").do(start_1h)
# schedule.every().day.at("04:25").do(start_1h)
# schedule.every().day.at("05:25").do(start_1h)
# schedule.every().day.at("06:25").do(start_1h)
# schedule.every().day.at("07:25").do(start_1h)
# schedule.every().day.at("08:25").do(start_1h)
# schedule.every().day.at("09:25").do(start_1h)
# schedule.every().day.at("10:25").do(start_1h)
# schedule.every().day.at("11:25").do(start_1h)
# schedule.every().day.at("12:25").do(start_1h)
# schedule.every().day.at("13:25").do(start_1h)
# schedule.every().day.at("14:25").do(start_1h)
# schedule.every().day.at("15:25").do(start_1h)
# schedule.every().day.at("16:25").do(start_1h)
# schedule.every().day.at("17:25").do(start_1h)
# schedule.every().day.at("18:25").do(start_1h)
# schedule.every().day.at("19:25").do(start_1h)
# schedule.every().day.at("20:25").do(start_1h)
# schedule.every().day.at("21:25").do(start_1h)
# schedule.every().day.at("22:25").do(start_1h)
# schedule.every().day.at("23:25").do(start_1h)
# schedule.every().day.at("03:20").do(start_4h)
# schedule.every().day.at("07:20").do(start_4h)
# schedule.every().day.at("11:20").do(start_4h)
# schedule.every().day.at("15:20").do(start_4h)
# schedule.every().day.at("19:20").do(start_4h)
# schedule.every().day.at("23:20").do(start_4h)
while True:
schedule.run_pending()
time.sleep(10) # wait ten second