- llm_analyzer.py: change 5m filters from hard requirements to confidence
adjustments (volume, ADX<15, OBV direction now ±0.1 instead of blocking);
1h ADX<20 lowers confidence instead of preventing entry
- slack_notifier.py: when all symbols HOLD, show 1h-bullish symbols with
their HOLD reason instead of generic "no action" message
- main.py: log all 15 HOLD reasons instead of first 3
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix realized_pnl always being 0 on SELL (use amount*price instead of amount_usdt)
- Add debug logging for all-HOLD LLM cycles (log sample HOLD reasons)
- Fix nonce collision in Bitfinex API auth (add counter)
- Fix timezone to UTC+8 in main, trade_logger, sync_cost_basis, check_errors
- Fix stop-loss retry with longer delay after cancel
- Add min order amount check in trader before BUY
- Fix risk_manager to skip positions with amount <= 0
- Cap trade_history to 500 entries to prevent unbounded growth
- Fix greedy regex in LLM response parser
- Reset cost_tracking start dates to null
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- check_errors.py: on errors, call Claude CLI to diagnose and attempt auto-fix,
include fix report in Slack alert
- slack_notifier.py: show "LLM 分析失敗" when LLM fails instead of "All HOLD"
- main.py: track llm_ok flag and pass to Slack reporter
- setup.sh: restore ~/.local/bin in crontab PATH for claude CLI
- llm_analyzer.py: use shutil.which for robust claude binary lookup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add fetch_total_deposits() with hourly local cache (deposit_cache.json)
- Use deposit total as capital base for accurate total return calculation
- Add --no-session-persistence to claude CLI subprocess calls
- Show both total return (deposit-based) and change rate (cost-based) in reports
- Update portfolio summary with Total Return line
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- TAKE_PROFIT_PCT 5% → 15% (risk/reward 5:1 vs 3% stop-loss)
- SELL signal now requires ≥2 confirmations (was 1)
- Add 1h trend filter: hold if 1h still bullish even if 5m shows sell
- Sync cost_tracking.json and stop_orders.json after balance refresh
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- config.py: Add HTF_TIMEFRAME (1h) and HTF_CANDLE_LIMIT (50)
- data_fetcher.py: Fetch both 5m and 1h candles per symbol
- indicators.py: Add ADX, StochRSI, OBV+slope, CMF to 5m indicators;
new functions for HTF indicators, pivot points, and their summaries
- main.py: Wire up HTF data flow (1h indicators + pivots → LLM summary)
- llm_analyzer.py: Rewrite prompt with MTF filter (1h trend alignment),
require 2+ confirmations for BUY, confidence scoring guide
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Includes: Bitfinex API integration, technical indicators,
LLM signal generation, risk management, Slack notifications.
Recent fixes:
- SELL orders use position value instead of total balance
- SELL signals always close full position
- Failed orders added to rejected list for Slack reporting
- Position/exposure limits auto-cap to remaining room
- BUY order minimum raised to 10% of portfolio
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>