1
This commit is contained in:
parent
2cf07ccba9
commit
c19cee123e
3
main.py
3
main.py
@ -5,8 +5,7 @@ import time
|
||||
import signals.ma_arrangement as maa
|
||||
import monitors.large_transfer as lt
|
||||
|
||||
# 获取交易所交易对
|
||||
symbols = bn.symbols()
|
||||
symbols = ['BTCUSDT','ETHUSDT','FILUSDT','MASKUSDT','DOGEUSDT','CFXUSDT','LTCUSDT']
|
||||
|
||||
for s in symbols:
|
||||
#15m
|
||||
|
||||
@ -18,4 +18,4 @@ oklink_api_headers = {
|
||||
#whaleAlert
|
||||
whaleAlert_minutes=1
|
||||
whaleAlert_apikey='gPkElMPR8Hpe5LxjKisR4YSFzxRxMLj6'
|
||||
whaleAlert_max_limit = os.getenv('TQ_WHALEALERT_MAX_USD_AMOUNT',1000 * 10000)
|
||||
whaleAlert_max_limit = os.getenv('TQ_WHALEALERT_MAX_USD_AMOUNT',5000 * 10000)
|
||||
@ -5,9 +5,10 @@ import tg
|
||||
import datetime
|
||||
import settings
|
||||
|
||||
flags = {}
|
||||
|
||||
def check_ma_arrange(data):
|
||||
# 提取收盘价
|
||||
# 提取收盘价
|
||||
close_prices = np.array([float(entry[4]) for entry in data])
|
||||
|
||||
# 计算移动平均线
|
||||
@ -28,10 +29,13 @@ def run(symbol, interval):
|
||||
|
||||
bullish, bearish = check_ma_arrange(data)
|
||||
|
||||
text=""
|
||||
if bullish:
|
||||
flag_name = symbol + '_' + interval
|
||||
text = ""
|
||||
if bullish and (flag_name not in flags or flags[flag_name] == False):
|
||||
flags[flag_name] = True
|
||||
text = f'📶信号预警📶\r\n\r\n品种:【${symbol}】\r\n周期:{interval}\r\n信号:【多头】排列\r\n\r\n{datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}'
|
||||
if bearish:
|
||||
if bearish and (flag_name not in flags or flags[flag_name] == True):
|
||||
flags[flag_name] = False
|
||||
text = f'📶信号预警📶\r\n\r\n品种:【${symbol}】\r\n周期:{interval}\r\n信号:【空头】排列\r\n\r\n{datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}'
|
||||
|
||||
if text != "":
|
||||
|
||||
12
test.py
12
test.py
@ -3,13 +3,7 @@ import pandas as pd
|
||||
import mplfinance as mpf
|
||||
import datetime as dt
|
||||
import monitors.large_transfer as lt
|
||||
from binance.spot import Spot
|
||||
|
||||
|
||||
klines = bn.klines('BTCUSDT', '1h', limit=10)
|
||||
|
||||
# print(klines[0])
|
||||
|
||||
# print(klines[0][0])
|
||||
dt = dt.datetime.fromtimestamp((klines[-1][0]/1000))
|
||||
|
||||
print(dt)
|
||||
symbols = bn.symbols()
|
||||
print(symbols)
|
||||
Loading…
Reference in New Issue
Block a user