1
This commit is contained in:
parent
6a7d1253c3
commit
73caaffef8
2
main.py
2
main.py
@ -13,7 +13,7 @@ times = ["00:00", "04:00", "08:00", "12:00", "16:00", "20:00"]
|
||||
for t in times:
|
||||
schedule.every().day.at(t).do(vegas.run_crypto, interval = '4h')
|
||||
|
||||
version = 'V1.2'
|
||||
version = 'V1.3'
|
||||
print(f'Running... {version}')
|
||||
telegram_sender.send_message(setting.chat_id, f'☕️ Strategy is updated!\r\n\r\nVersion: {version}')
|
||||
while True:
|
||||
|
||||
@ -6,6 +6,8 @@ import datasource.crypto
|
||||
import time,setting
|
||||
import telegram_sender
|
||||
from datasource import crypto
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
# crossover 函数:检测上穿信号
|
||||
def crossover(series1, series2):
|
||||
@ -48,23 +50,21 @@ def stratergy_run(symbol, interval,df):
|
||||
if latest['longResut']==True:
|
||||
direction = '多'
|
||||
|
||||
message = f"⭐️信号提醒⭐️\r\n\
|
||||
\r\n\
|
||||
策略:【Vegas趋势跟踪V1.0】\r\n\
|
||||
品种: {symbol}\r\n\
|
||||
周期: {interval}\r\n\
|
||||
信号: 【{direction}】\r\n\
|
||||
r\n\
|
||||
当前价格:{latest['open']}\r\n\
|
||||
EMA13:{latest['ema13']}\r\n\
|
||||
EMA144:{latest['ema144']}\r\n\
|
||||
EMA169:{latest['ema169']}\r\n\
|
||||
\r\n\
|
||||
{latest['timestamp']}"
|
||||
print(f"{symbol} - {interval} is checked!")
|
||||
message = f"⭐️信号提醒⭐️\r\n\r\n"
|
||||
message += f"策略:【Vegas趋势跟踪V1.0】\r\n"
|
||||
message += f"品种: {symbol}\r\n"
|
||||
message += f"周期: {interval}\r\n\r\n"
|
||||
message += f"信号: 【{direction}】\r\n\r\n"
|
||||
message += f"当前价格: {round(latest['open'],5)}\r\n"
|
||||
message += f"EMA13: {round(latest['ema13'],5)}\r\n"
|
||||
message += f"EMA144: {round(latest['ema144'],5)}\r\n"
|
||||
message += f"EMA169: {round(latest['ema169'],5)}\r\n\r\n"
|
||||
message += f"{latest['timestamp'].strftime('%Y/%m/%d %H:%M:%S')}"
|
||||
|
||||
print(f"【{symbol} - {interval}】 is checked!")
|
||||
if direction != "":
|
||||
telegram_sender.send_message(setting.chat_id, message)
|
||||
|
||||
print(f"【{symbol} - {interval}】 is singaled!")
|
||||
|
||||
def run_crypto(interval):
|
||||
print('Vegas策略运行.')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user