This commit is contained in:
aaron 2025-05-06 00:15:51 +08:00
parent 2ee68bd4a6
commit 52a6dc9880
6 changed files with 37 additions and 40 deletions

View File

@ -212,7 +212,7 @@ class CryptoAgent:
- support_levels: 基于斐波那契回调的支撑位列表标明各个支撑位对应的斐波那契水平例如0.3820.50.618
- resistance_levels: 基于斐波那契回调的阻力位列表同样标明对应水平
- volume_analysis: 交易量分析重点关注量价关系
- recommendation: 操作建议 (买入卖出或等待)
- recommendation: 操作建议 (做多做空或观望)
- entry_points: 推荐入场点位
- exit_points: 推荐出场点位
- stop_loss: 建议止损位
@ -243,21 +243,21 @@ class CryptoAgent:
"current_price": float(processed_data['close'].iloc[-1]),
# "price_change_24h": float(processed_data['close'].iloc[-1] - processed_data['close'].iloc[-24]),
# "price_change_percentage_24h": float((processed_data['close'].iloc[-1] - processed_data['close'].iloc[-24]) / processed_data['close'].iloc[-24] * 100),
"historical_prices": processed_data['close'].tail(100).tolist(),
"volumes": processed_data['volume'].tail(100).tolist(),
"technical_indicators": {
"rsi": float(processed_data['RSI'].iloc[-1]),
"macd": float(processed_data['MACD'].iloc[-1]),
"macd_signal": float(processed_data['MACD_Signal'].iloc[-1]),
"bollinger_upper": float(processed_data['Bollinger_Upper'].iloc[-1]),
"bollinger_lower": float(processed_data['Bollinger_Lower'].iloc[-1]),
"ma5": float(processed_data['MA5'].iloc[-1]),
"ma10": float(processed_data['MA10'].iloc[-1]),
"ma20": float(processed_data['MA20'].iloc[-1]),
"ma50": float(processed_data['MA50'].iloc[-1]),
"atr": float(processed_data['ATR'].iloc[-1])
},
"klines": processed_data[['open', 'high', 'low', 'close', 'volume']].tail(100).to_dict('records')
# "historical_prices": processed_data['close'].tail(100).tolist(),
# "volumes": processed_data['volume'].tail(100).tolist(),
# "technical_indicators": {
# "rsi": float(processed_data['RSI'].iloc[-1]),
# "macd": float(processed_data['MACD'].iloc[-1]),
# "macd_signal": float(processed_data['MACD_Signal'].iloc[-1]),
# "bollinger_upper": float(processed_data['Bollinger_Upper'].iloc[-1]),
# "bollinger_lower": float(processed_data['Bollinger_Lower'].iloc[-1]),
# "ma5": float(processed_data['MA5'].iloc[-1]),
# "ma10": float(processed_data['MA10'].iloc[-1]),
# "ma20": float(processed_data['MA20'].iloc[-1]),
# "ma50": float(processed_data['MA50'].iloc[-1]),
# "atr": float(processed_data['ATR'].iloc[-1])
# },
"klines": processed_data[['open', 'high', 'low', 'close', 'volume', 'RSI', 'MACD', 'MACD_Signal', 'Bollinger_Upper', 'Bollinger_Lower', 'MA5', 'MA10', 'MA20', 'MA50', 'ATR']].tail(100).to_dict('records')
}
# 将市场数据格式化为适合大模型的格式
@ -374,17 +374,17 @@ class CryptoAgent:
需要输出的内容包括
标题AI Agent 加密货币分析报告
1. 目标交易对行情进行总结
2. 对所有交易对给出操作建议
2.1 操作建议做多做空观望
2.2 操作点
2.3 止损止盈点位
2.4 操作评级
2.5 建议原因
1. 交易对给出操作建议
1.1 操作方向做多做空观望
1.2 操作价位
1.3 止损止盈价
1.4 操作评级1-51为最低紧迫性5为最高紧迫性
1.5 建议原因
2. 对市场行情进行一句话总结基本面技术面市场情绪等不超过50字
以下是每个交易对的分析结果:
{results}
请以优美的Markdown格式输出通过 emoji 标签来增加可读性
请以优美的Markdown格式输出不要使用表格通过 emoji 标签来增加可读性
"""
system_prompt = """

View File

@ -34,7 +34,8 @@ crypto:
- "ETH"
- "SOL"
- "SUI"
- "XRP"
- "DOGE"
- "LTC"
quote_currency: "USDT"
time_interval: "4h" # 可选: 1m, 5m, 15m, 30m, 1h, 4h, 1d
historical_days: 90

View File

@ -16,22 +16,18 @@ def run_monitor():
try:
print("☕️ 加密货币监控程序已启动")
# 5分钟监控交易量增长
for time in [":00", ":05", ":10", ":15", ":20", ":25", ":30", ":35", ":40", ":45", ":50", ":55"]:
schedule.every().hour.at(time).do(volume_growup_monitor.run, time_interval="5m")
# # 5分钟监控交易量增长
# for time in [":00", ":05", ":10", ":15", ":20", ":25", ":30", ":35", ":40", ":45", ":50", ":55"]:
# schedule.every().hour.at(time).do(volume_growup_monitor.run, time_interval="5m")
# # 15分钟监控,技术指标
# for time in [":00", ":15", ":30", ":45"]:
# schedule.every().hour.at(time).do(technical_indicators_monitor.run, time_interval="15m")
# # 每小时整点监控,技术指标
# for time in ["00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"]:
# schedule.every().hour.at(time).do(technical_indicators_monitor.run, time_interval="1h")
# 每小时整点监控,技术指标
for time in ["00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00"]:
schedule.every().day.at(time).do(technical_indicators_monitor.run, time_interval="1h")
# 4小时监控技术指标
for time in ["00:00", "04:00", "08:00", "12:00", "16:00", "20:00"]:
schedule.every().day.at(time).do(technical_indicators_monitor.run, time_interval="4h")
# # 4小时监控技术指标
# for time in ["00:00", "04:00", "08:00", "12:00", "16:00", "20:00"]:
# schedule.every().day.at(time).do(technical_indicators_monitor.run, time_interval="4h")
while True:

View File

@ -55,7 +55,7 @@ class VolumeGrowupMonitor:
# 计算交易金额
current_amount = processed_data['close'].iloc[-2] * processed_data['volume'].iloc[-2]
print(f"{symbol} 过去 30 根 K 线的平均交易量为 {average_volume:.2f},当前交易量为 {processed_data['volume'].iloc[-1]:.2f},增长率为 {volume_growth:.2%}")
# print(f"{symbol} 过去 30 根 K 线的平均交易量为 {average_volume:.2f},当前交易量为 {processed_data['volume'].iloc[-1]:.2f},增长率为 {volume_growth:.2%}")
# 如果增加 10倍以上则发送消息
if volume_growth >= 10 and current_amount > 1000000:

View File

@ -4,7 +4,7 @@ services:
cryptoai:
build: .
container_name: cryptoai-task
image: cryptoai:0.0.13
image: cryptoai:0.0.14
restart: always
volumes:
- ./cryptoai/data:/app/cryptoai/data