diff --git a/cryptoai/agents/__pycache__/crypto_agent.cpython-313.pyc b/cryptoai/agents/__pycache__/crypto_agent.cpython-313.pyc index 1676bab..d74572d 100644 Binary files a/cryptoai/agents/__pycache__/crypto_agent.cpython-313.pyc and b/cryptoai/agents/__pycache__/crypto_agent.cpython-313.pyc differ diff --git a/cryptoai/agents/crypto_agent.py b/cryptoai/agents/crypto_agent.py index b08a237..c5eb45b 100644 --- a/cryptoai/agents/crypto_agent.py +++ b/cryptoai/agents/crypto_agent.py @@ -212,7 +212,7 @@ class CryptoAgent: - support_levels: 基于斐波那契回调的支撑位列表(标明各个支撑位对应的斐波那契水平,例如0.382、0.5、0.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-5,1为最低紧迫性,5为最高紧迫性) + 1.5 建议原因 + 2. 对市场行情进行一句话总结(基本面,技术面,市场情绪等),不超过50字 以下是每个交易对的分析结果: {results} - 请以优美的Markdown格式输出,通过 emoji 标签来增加可读性。 + 请以优美的Markdown格式输出,不要使用表格,通过 emoji 标签来增加可读性。 """ system_prompt = """ diff --git a/cryptoai/config/config.yaml b/cryptoai/config/config.yaml index 810b16e..d198f37 100644 --- a/cryptoai/config/config.yaml +++ b/cryptoai/config/config.yaml @@ -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 diff --git a/cryptoai/monitor_endpoint.py b/cryptoai/monitor_endpoint.py index 6884d8a..7515315 100644 --- a/cryptoai/monitor_endpoint.py +++ b/cryptoai/monitor_endpoint.py @@ -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: diff --git a/cryptoai/monitors/volume_growup.py b/cryptoai/monitors/volume_growup.py index 4d1a322..0a1eed7 100644 --- a/cryptoai/monitors/volume_growup.py +++ b/cryptoai/monitors/volume_growup.py @@ -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: diff --git a/docker-compose.yml b/docker-compose.yml index f923fa1..c5909d5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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