update
This commit is contained in:
parent
9eacb2243c
commit
2d50d9a990
@ -198,30 +198,29 @@ async def get_statistics_by_symbol():
|
||||
async def get_monitor_status():
|
||||
"""获取价格监控状态和实时价格"""
|
||||
try:
|
||||
monitor = get_price_monitor_service()
|
||||
paper_trading = get_paper_trading_service()
|
||||
from app.config import get_settings
|
||||
|
||||
# 获取活跃订单的交易对
|
||||
active_orders = paper_trading.get_active_orders()
|
||||
symbols_needed = set(order.get('symbol') for order in active_orders if order.get('symbol'))
|
||||
monitor = get_price_monitor_service()
|
||||
settings = get_settings()
|
||||
|
||||
# 始终显示配置的交易对价格
|
||||
configured_symbols = settings.crypto_symbols.split(',')
|
||||
|
||||
# 获取价格 - 优先使用监控服务的缓存价格
|
||||
latest_prices = dict(monitor.latest_prices)
|
||||
|
||||
# 如果监控服务没有价格数据,直接从 Binance 获取
|
||||
for symbol in symbols_needed:
|
||||
# 获取所有配置的交易对价格
|
||||
for symbol in configured_symbols:
|
||||
symbol = symbol.strip()
|
||||
if symbol not in latest_prices or latest_prices[symbol] is None:
|
||||
price = binance_service.get_current_price(symbol)
|
||||
if price:
|
||||
latest_prices[symbol] = price
|
||||
|
||||
# 注意:止盈止损检查由后台任务 (main.py price_monitor_loop) 处理
|
||||
# 这里只返回价格数据供前端显示
|
||||
|
||||
return {
|
||||
"success": True,
|
||||
"running": True, # 后台任务始终运行
|
||||
"subscribed_symbols": list(symbols_needed),
|
||||
"running": True,
|
||||
"subscribed_symbols": configured_symbols,
|
||||
"latest_prices": latest_prices
|
||||
}
|
||||
except Exception as e:
|
||||
|
||||
@ -103,7 +103,7 @@ class Settings(BaseSettings):
|
||||
telegram_enabled: bool = True # 是否启用 Telegram 通知
|
||||
|
||||
# 加密货币交易智能体配置
|
||||
crypto_symbols: str = "BTCUSDT,ETHUSDT,BNBUSDT,SOLUSDT" # 监控的交易对,逗号分隔
|
||||
crypto_symbols: str = "BTCUSDT,ETHUSDT" # 监控的交易对,逗号分隔
|
||||
crypto_analysis_interval: int = 60 # 分析间隔(秒)
|
||||
crypto_llm_threshold: float = 0.7 # 触发 LLM 分析的置信度阈值
|
||||
|
||||
|
||||
@ -352,7 +352,7 @@ class CryptoAgent:
|
||||
return False
|
||||
|
||||
confidence = signal.get('confidence', 0)
|
||||
if confidence < 50:
|
||||
if confidence < 70:
|
||||
return False
|
||||
|
||||
# 检查冷却时间(30分钟内不重复发送相同方向的信号)
|
||||
|
||||
@ -6,6 +6,15 @@
|
||||
<title>模拟交易 - Tradus</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<style>
|
||||
/* 覆盖全局 #app 样式 */
|
||||
#app {
|
||||
height: auto;
|
||||
display: block;
|
||||
align-items: initial;
|
||||
justify-content: initial;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.trading-page {
|
||||
min-height: 100vh;
|
||||
background: var(--bg-primary);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user