diff --git a/main.py b/main.py index de1c961..52af958 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,7 @@ schedule.every(setting.whaleAlert_minutes).minutes.do(lt.run) schedule.every().hour.at(":00").do(vegas.run, interval = '1h') schedule.every().hour.at(":00").do(vegas.run, interval = '4h') -print(f'Running...') +print(f'Running... V1.0') print(f'Pairs:') print(utils.get_top_binance_usdt_pairs(20)) while True: diff --git a/monitors/vegas.py b/monitors/vegas.py index 54681f4..d6edfe4 100644 --- a/monitors/vegas.py +++ b/monitors/vegas.py @@ -92,7 +92,7 @@ def check_signal(symbol, interval,df): if latest['longResut']==True: direction = '多' - message = f"⭐️信号提醒⭐️\r\n\r\n品种: {symbol}\r\n周期: {interval}\r\n信号: 【{direction}】\r\n当前价格:{latest['open']}\r\n\r\n{latest['timestamp']}" + message = f"⭐️信号提醒⭐️\r\n\r\n策略:【Vegas趋势跟踪V1.0】\r\n品种: {symbol}\r\n周期: {interval}\r\n信号: 【{direction}】\r\n当前价格:{latest['open']}\r\n\r\n{latest['timestamp']}" print(f"{symbol} - {interval} is checked!") if direction != "": telegram_sender.send_message(setting.chat_id, message) diff --git a/test.py b/test.py index fd56eac..17b0bd8 100644 --- a/test.py +++ b/test.py @@ -1,7 +1,21 @@ import requests -import utils +import pandas as pd -def main(): - print(utils.get_top_binance_usdt_pairs(30)) +api_url = "https://api.exness.com/v1/ohlc" +params = { + 'symbol': 'XAUUSDm', + 'interval': '1d', + 'start': '2020-01-01', + 'end': '2023-01-01' +} -main() \ No newline at end of file +# 发起HTTP请求 +response = requests.get(api_url, params=params) +data = response.json() + +# 转换为DataFrame +df = pd.DataFrame(data['ohlc'], columns=['timestamp', 'open', 'high', 'low', 'close', 'volume']) +df['timestamp'] = pd.to_datetime(df['timestamp'], unit='s') + +# 打印前五行数据 +print(df.head()) \ No newline at end of file