1
This commit is contained in:
parent
44ffcfdcca
commit
150d25e7a2
@ -1,6 +1,7 @@
|
|||||||
# 突然放量策略
|
# 突然放量策略
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import datasource,time, dingding
|
from datasource import crypto
|
||||||
|
import time, dingding
|
||||||
|
|
||||||
def stratergy_run(symbol, interval, df, debug):
|
def stratergy_run(symbol, interval, df, debug):
|
||||||
# 计算过去 30 根 K 线的平均交易量
|
# 计算过去 30 根 K 线的平均交易量
|
||||||
@ -13,7 +14,13 @@ def stratergy_run(symbol, interval, df, debug):
|
|||||||
|
|
||||||
rate = current_volume / average_volume
|
rate = current_volume / average_volume
|
||||||
|
|
||||||
if rate > 10:
|
rate_limit = 10
|
||||||
|
if interval == '15m':
|
||||||
|
rate_limit = 5
|
||||||
|
if interval == '1h':
|
||||||
|
rate_limit = 3
|
||||||
|
|
||||||
|
if rate > rate_limit:
|
||||||
message = "📢Signals Notificaiton📢\r\n\r\n"
|
message = "📢Signals Notificaiton📢\r\n\r\n"
|
||||||
message += f"{symbol} 在 {interval} 出现放量 {round(rate, 2)}倍 !\r\n\r\n"
|
message += f"{symbol} 在 {interval} 出现放量 {round(rate, 2)}倍 !\r\n\r\n"
|
||||||
message += f"{timestamp}"
|
message += f"{timestamp}"
|
||||||
@ -25,11 +32,11 @@ def stratergy_run(symbol, interval, df, debug):
|
|||||||
print(message)
|
print(message)
|
||||||
|
|
||||||
def run_crypto(interval, debug=False):
|
def run_crypto(interval, debug=False):
|
||||||
print('Vols-up strategy is running...')
|
print(f"Vols-up strategy {interval} is running...")
|
||||||
|
|
||||||
symbols = datasource.crypto.get_future_symbols()
|
symbols = crypto.get_future_symbols()
|
||||||
for s in symbols:
|
for s in symbols:
|
||||||
df = datasource.crypto.get_klines(s, interval, True,limit=50)
|
df = crypto.get_klines(s, interval, True,limit=50)
|
||||||
stratergy_run(s,interval, df, debug)
|
stratergy_run(s,interval, df, debug)
|
||||||
|
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
4
test.py
4
test.py
@ -20,7 +20,7 @@ import redis,dingding
|
|||||||
|
|
||||||
# print(r.get('r_symbols'))
|
# print(r.get('r_symbols'))
|
||||||
|
|
||||||
# print(datasource.crypto.get_future_symbols())
|
print(datasource.crypto.get_future_symbols())
|
||||||
|
|
||||||
# macd_boll.run_crypto('15m', debug=True)
|
# macd_boll.run_crypto('15m', debug=True)
|
||||||
|
|
||||||
@ -51,4 +51,4 @@ import redis,dingding
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
dingding.send_message('信号 测试')
|
# dingding.send_message('信号 测试')
|
||||||
Loading…
Reference in New Issue
Block a user