update
This commit is contained in:
parent
56679a2b81
commit
69dac8e5c2
18
main.py
18
main.py
@ -5,20 +5,24 @@ import monitors.large_transfer as lt
|
||||
import telegram_sender,setting
|
||||
import dingding
|
||||
|
||||
# 监控大额转账
|
||||
# schedule.every(1).minutes.do(lt.run)
|
||||
#vegas
|
||||
schedule.every().hour.at(":00").do(vegas.run_crypto, interval = '15m')
|
||||
schedule.every().hour.at(":30").do(vegas.run_crypto, interval = '15m')
|
||||
schedule.every().hour.at(":15").do(vegas.run_crypto, interval = '15m')
|
||||
schedule.every().hour.at(":45").do(vegas.run_crypto, interval = '15m')
|
||||
|
||||
schedule.every().hour.at(":00").do(vegas.run_crypto, interval = '30m')
|
||||
schedule.every().hour.at(":30").do(vegas.run_crypto, interval = '30m')
|
||||
|
||||
schedule.every().hour.at(":00").do(vegas.run_crypto, interval = '1h')
|
||||
|
||||
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.4'
|
||||
|
||||
|
||||
version = 'V1.5'
|
||||
print(f'Running... {version}')
|
||||
text = f'☕️ 策略已更新 - Version: {version}'
|
||||
print(text)
|
||||
dingding.send_message(text)
|
||||
while True:
|
||||
schedule.run_pending()
|
||||
time.sleep(1)
|
||||
|
||||
@ -50,7 +50,6 @@ def stratergy_run(symbol, interval, df, debug):
|
||||
|
||||
|
||||
def run_crypto(interval, debug=False):
|
||||
|
||||
symbols = ['BTCUSDT',"ETHUSDT",'LTCUSDT','DOGEUSDT','FTMUSDT','FILUSDT','OPUSDT','SOLUSDT','BNBUSDT','BCHUSDT','ETCUSDT','ARUSDT']
|
||||
for s in symbols:
|
||||
df = crypto.get_klines(s, interval)
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
import tweepy
|
||||
import time
|
||||
|
||||
# 替换为你的 Twitter API 密钥
|
||||
API_KEY = 'PvmpsQ03urOzrZLxFRaTlq1e2'
|
||||
API_KEY_SECRET = 'SY2xcGOJBVRO8pStF23Al5lHgXRJ95b9gzHuOdX6sI40D9IZ0Z'
|
||||
ACCESS_TOKEN = '209453217-1TBd7HtWSrzVc24ZYVzb3JwbOtxPxGuqRwq4bXuW'
|
||||
ACCESS_TOKEN_SECRET = 'oU39wnIOCwILHZ2RXbzHSGnS9e0SAsvtwF6PhyhDU0Hra'
|
||||
BEARER_TOKEN = 'AAAAAAAAAAAAAAAAAAAAAN3VtQEAAAAAKSMZ3VcPmGVwMgxIjX8yeb9Fbow%3DXl2BW9tUi5vn1y6uFpcA8DsyXp56yd0MQnmGhheWK04tFKPxDf'
|
||||
|
||||
# 认证到 Twitter API
|
||||
client = tweepy.Client(bearer_token=BEARER_TOKEN,
|
||||
consumer_key=API_KEY,
|
||||
consumer_secret=API_KEY_SECRET,
|
||||
access_token=ACCESS_TOKEN,
|
||||
access_token_secret=ACCESS_TOKEN_SECRET)
|
||||
|
||||
# 指定要监控的 Twitter 账号
|
||||
twitter_username = 'whale_alert'
|
||||
|
||||
# 获取用户ID
|
||||
user = client.get_user(username=twitter_username)
|
||||
user_id = user.data.id
|
||||
|
||||
# 已处理推文的ID集合
|
||||
processed_tweet_ids = set()
|
||||
|
||||
def monitor_tweets(user_id):
|
||||
# 获取该用户最新的推文
|
||||
response = client.get_users_tweets(id=user_id, max_results=5)
|
||||
tweets = response.data
|
||||
|
||||
# 处理和打印新的推文
|
||||
for tweet in tweets:
|
||||
if tweet.id not in processed_tweet_ids:
|
||||
print(f'{tweet.id} - {tweet.text}')
|
||||
processed_tweet_ids.add(tweet.id)
|
||||
|
||||
# 定期监控推文(例如每隔 60 秒)
|
||||
while True:
|
||||
monitor_tweets(user_id)
|
||||
time.sleep(60)
|
||||
@ -51,23 +51,18 @@ def stratergy_run(symbol, interval, df, debug):
|
||||
if latest['longResut']==True:
|
||||
direction = '多'
|
||||
|
||||
message = f"⭐️信号提醒⭐️\r\n\r\n"
|
||||
message += f"策略:【Vegas趋势跟踪V1.0】\r\n"
|
||||
message = f"🌟信号提醒⭐️\r\n\r\n"
|
||||
message += f"策略:【Vegas趋势跟踪策略】\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 != "":
|
||||
if debug == False:
|
||||
telegram_sender.send_message(setting.chat_id, message)
|
||||
dingding.send_message(message)
|
||||
print(f"【{symbol} - {interval}】 is singaled!")
|
||||
print(f"【{symbol} - {interval}】 is singal fired!")
|
||||
else:
|
||||
print(message)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user