update project in
This commit is contained in:
parent
6dbfa2646c
commit
2cf07ccba9
12
main.py
12
main.py
@ -2,24 +2,24 @@ import schedule
|
||||
import bn
|
||||
import settings
|
||||
import time
|
||||
import strategy.ma_arrangement as maa
|
||||
import strategy.large_trans as lt
|
||||
import signals.ma_arrangement as maa
|
||||
import monitors.large_transfer as lt
|
||||
|
||||
# 获取交易所交易对
|
||||
symbols = bn.symbols()
|
||||
|
||||
for s in symbols:
|
||||
#15m
|
||||
schedule.every(15).minutes.do(maa.strategy_run, symbol=s, interval='15m')
|
||||
schedule.every(15).minutes.do(maa.run, symbol=s, interval='15m')
|
||||
|
||||
#1h
|
||||
schedule.every(1).hours.do(maa.strategy_run, symbol=s, interval='1h')
|
||||
schedule.every(1).hours.do(maa.run, symbol=s, interval='1h')
|
||||
|
||||
#4h
|
||||
schedule.every(4).hours.do(maa.strategy_run, symbol=s, interval='4h')
|
||||
schedule.every(4).hours.do(maa.run, symbol=s, interval='4h')
|
||||
|
||||
# 监控
|
||||
schedule.every(settings.whaleAlert_minutes).minutes.do(lt.strategy_run)
|
||||
schedule.every(settings.whaleAlert_minutes).minutes.do(lt.run)
|
||||
|
||||
print(f'Running... ChatID: {settings.chat_id}')
|
||||
while True:
|
||||
|
||||
@ -8,7 +8,7 @@ import traceback
|
||||
import logging
|
||||
|
||||
|
||||
def strategy_run():
|
||||
def run():
|
||||
try:
|
||||
start_time = datetime.now() - timedelta(minutes=settings.whaleAlert_minutes)
|
||||
start_ts = int(start_time.timestamp())
|
||||
@ -22,7 +22,7 @@ def check_ma_arrange(data):
|
||||
return bullish, bearish
|
||||
|
||||
|
||||
def strategy_run(symbol, interval):
|
||||
def run(symbol, interval):
|
||||
# 获取kline数据
|
||||
data = bn.klines(symbol, interval)
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import strategy.large_trans as lt
|
||||
import monitors.large_transfer as lt
|
||||
import bn
|
||||
import strategy.ma_arrangement as maa
|
||||
import signals.ma_arrangement as maa
|
||||
|
||||
# symbols = bn.symbols()
|
||||
|
||||
# for s in symbols:
|
||||
maa.strategy_run('LINKUSDT', '15m')
|
||||
maa.run('LINKUSDT', '15m')
|
||||
Loading…
Reference in New Issue
Block a user