-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Note: set AGENT_I am using Binance and GPT API but cannot connect. I am in China and have used a proxy. The logs also show: RedrawEventsCleared emitted without explicit MainEventsCleared [2026-01-04][14:59:42][tao::platform_impl::platform::event_loop::runner][WARN] NewEvents emitted without explicit RedrawEventsCleared [2026-01-04][14:59:42][tao::platform_impl::platform::event_loop::runner][WARN] RedrawEventsCleared emitted without explicit MainEventsCleared [2026-01-04][15:30:39][tao::platform_impl::platform::event_loop::runner][WARN] NewEvents emitted without explicit RedrawEventsCleared [2026-01-04][15:30:39][tao::platform_impl::platform::event_loop::runner][WARN] RedrawEventsCleared emitted without explicit MainEventsCleared [2026-01-04][15:30:57][tao::platform_impl::platform::event_loop::runner][WARN] NewEvents emitted without explicit RedrawEventsCleared [2026-01-04][15:30:57][tao::platform_impl::platform::event_loop::runner][WARN] RedrawEventsCleared emitted without explicit MainEventsCleared [2026-01-04][15:31:42][tao::platform_impl::platform::event_loop::runner][WARN] NewEvents emitted without explicit RedrawEventsCleared [2026-01-04][15:31:42][tao::platform_impl::platform::event_loop::runner][WARN] RedrawEventsCleared emitted without explicit MainEventsClearedDEBUG_MODE=true to trace model behavior locally.
and
backend.log
Start your response with `{` and end it with `}`.
Your output will be passed to json.loads() to convert it to a Python
object.
Make sure it only contains valid JSON.
DEBUG =========================== user ===========================
DEBUG Read Context and decide. features.1m = structural trends (240 periods),
features.1s = realtime signals (180 periods). market.funding_rate:
positive = longs pay shorts. Respect constraints and risk_flags. Prefer
NOOP when edge unclear. Always include a concise top-level 'rationale'.
If you choose NOOP (items is empty), set 'rationale' to explain why:
reference current prices and 'price.change_pct' vs thresholds, and any
constraints or risk flags that led to NOOP. Output JSON with items array.
Context:
{"strategy_prompt": "Goal\nProduce steady, risk‑aware crypto trading
decisions that aim for consistent small gains while protecting
capital.\n\nStyle & constraints\n- Focus on liquid majors (e.g., BTC-USD,
ETH-USD). Avoid low-liquidity altcoins.\n- Size conservatively: target at
most 1–2% of NAV per new trade (respect cap_factor).\n- Limit concurrent
open positions (respect max_positions from constraints/config).\n- Prefer
market or tight-limit entries on pullbacks; avoid chasing large, fast
moves.\n- Favor trend‑aligned entries; if the mid‑term trend is unclear,
sit out.\n- Avoid entries during maintenance windows or very low volume
periods.\n\nSignals & decision heuristics\n- Trend detection: short EMA
(e.g., 20) vs long EMA (e.g., 100); bias with the trend.\n- Momentum
confirmation: avoid overbought entries; prefer RSI turning up from
balanced/oversold zones.\n- Volatility filter: when realized volatility
is high, reduce size or skip.\n- Pullbacks: enter nearer to moving
averages or support zones; reduce chasing breakouts.\n- Confluence:
require at least two agreeing signals (trend +
momentum/volume/structure).\n\nOrder sizing & execution\n- Notional =
min(cap_factor * equity, available buying power, venue caps).\n- Convert
notional → quantity using mark price; clamp to min_trade_qty,
max_order_qty, and quantity_step.\n- Use market orders for small
rebalances; prefer tight-limit for larger orders to control slippage.\n-
If partial fills occur, retry briefly; then treat as partial and update
portfolio.\n\nRisk management (mandatory)\n- Stops: place below recent
support/ATR multiples for longs; above resistance for shorts.\n- Targets:
risk:reward at least 1:1.5 by default (configurable).\n- Trailing:
consider converting to trailing after ~1x risk achieved.\n- Portfolio
risk cap: aggregated potential loss should not exceed a fraction of
NAV.\n- Fees: include estimated fees when sizing and evaluating
P/L.\n\nPosition management & lifecycle\n- On open: record entry price,
notional, leverage, and planned stop/target in trade meta.\n- Re-evaluate
each cycle: close on stop/target hit or regime flip; avoid frequent
flip-flopping.\n- Flip-by-flat: fully close before reversing direction on
the same symbol.\n- cautious full deployment\n - Purpose: staged
scale‑in for high‑conviction, well‑liquid opportunities.\n - Entry
criteria: high digest/win_rate + strong multi‑factor confluence;
sufficient buying_power; no blocking risk_flags.\n - Execution: scale
in 2–3 tranches (e.g., 50/30/20); require confirmation between tranches;
start with lower leverage.\n - Safety: ensure liquidation distance >
configured margin; abort remaining tranches on large slippage or failed
fills.\n - Post‑deploy: enable trailing stops and de‑risk if
risk_flags flip.\n\nEdge cases & guards\n- If computed quantity <
min_trade_qty, skip.\n- If spread/slippage estimate is large, skip or
reduce size.\n- If data is stale (last candle older than 2× interval),
skip for that symbol.\n\nRationale and explainability\n- For each action,
include a short rationale: which signals agreed and the stop/target
idea.\n- For skipped signals, include a brief reason (e.g., volatility
too high, below min_notional).\n\nTelemetry & meta\n- Attach: compose_id,
strategy_id, timestamp, estimated_fee, estimated_notional,
confidence_score.\n- Confidence: normalize to [0,1]; proportionally
reduce size when confidence is low (< 0.5).\n\nSummary (one sentence)\nBe
conservative and trend‑aware: take small, well‑sized positions on
pullbacks or confirmed breakouts, protect capital with explicit stops,
and favor repeatable gains over risky bets.\n\n", "summary":
{"active_positions": 0, "total_value": 1000.0, "account_balance": 1000.0,
"free_cash": 1000.0, "unrealized_pnl": 0.0}, "constraints":
{"max_positions": 5, "max_leverage": 2.0}}
INFO:httpx:HTTP Request: POST https://api.deepseek.com/v1/chat/completions "HTTP/1.1 402 Payment Required"
ERROR API status error from OpenAI API: Error code: 402 - {'error':
{'message': 'Insufficient Balance', 'type': 'unknown_error', 'param':
None, 'code': 'invalid_request_error'}}
2026-01-04 23:53:22.795 | ERROR | valuecell.agents.common.trading.decision.prompt_based.composer:compose:102 - LLM invocation failed: Insufficient Balance
2026-01-04 23:53:22.795 | INFO | valuecell.agents.common.trading._internal.coordinator:run_once:182 - \U0001f50d Composer returned 0 instructions
2026-01-04 23:53:22.795 | INFO | valuecell.agents.common.trading._internal.coordinator:run_once:189 - \U0001f680 Calling execution_gateway.execute() with 0 instructions
2026-01-04 23:53:22.795 | INFO | valuecell.agents.common.trading._internal.coordinator:run_once:192 - ExecutionGateway type: PaperExecutionGateway
2026-01-04 23:53:22.795 | INFO | valuecell.agents.common.trading._internal.coordinator:run_once:198 - \u2705 ExecutionGateway returned 0 results
2026-01-04 23:53:22.796 | INFO | valuecell.agents.common.trading.base_agent:_run_background_decision:261 - Run cycle completed for strategy=strategy-27a6a01d521243c1981d5f7e443825d5 trades_count=0
2026-01-04 23:53:22.812 | INFO | valuecell.agents.common.trading._internal.stream_controller:persist_cycle_results:270 - Persisted portfolio view for strategy=strategy-27a6a01d521243c1981d5f7e443825d5
2026-01-04 23:53:22.820 | INFO | valuecell.agents.common.trading._internal.stream_controller:persist_cycle_results:276 - Persisted strategy summary for strategy=strategy-27a6a01d521243c1981d5f7e443825d5
2026-01-04 23:53:22.820 | INFO | valuecell.agents.common.trading.base_agent:_run_background_decision:278 - Waiting for next decision cycle for strategy_id=strategy-27a6a01d521243c1981d5f7e443825d5, interval=12seconds
INFO: ::1:54301 - "GET /api/v1/strategies/holding?id=strategy-27a6a01d521243c1981d5f7e443825d5 HTTP/1.1" 200 OK
INFO: ::1:54301 - "GET /api/v1/strategies/portfolio_summary?id=strategy-27a6a01d521243c1981d5f7e443825d5 HTTP/1.1" 200 OK
INFO: ::1:54301 - "GET /api/v1/strategies/detail?id=strategy-27a6a01d521243c1981d5f7e443825d5 HTTP/1.1" 200 OK
INFO: ::1:54301 - "GET /api/v1/strategies/holding_price_curve?id=strategy-27a6a01d521243c1981d5f7e443825d5 HTTP/1.1" 200 OK
INFO: ::1:54301 - "GET /api/v1/strategies/ HTTP/1.1" 200 OK
INFO: ::1:54301 - "GET /api/v1/healthz HTTP/1.1" 200 OK