- Add historical trading statistics to AI decision context with language detection
- Remove win rate from metrics, focus on profit factor, sharpe ratio, win/loss ratio
- Add option to clear trading data tables during one-click deployment
- Add sqlite to Docker runtime for container-based data clearing
- Add /positions/history API endpoint
- Add position history types and API client
- Add translations for position history page
- Integrate PositionHistory component in App
- Remove leverage column from position history table
- Fix max drawdown calculation using virtual starting equity
- Add formula tooltips for all statistics metrics
- Remove leverage parameter from pnlPct calculation
- Switch to coinank free/open kline API (no authentication required)
- Add exchange badge display with brand colors (Binance/Bybit/OKX/Hyperliquid/Aster)
- Auto-convert OKX symbol format (BTCUSDT -> BTC-USDT-SWAP)
- Fallback to Binance data for unsupported exchanges (Bitget/Lighter)
- Pass exchange prop from trader account to chart component
- Parse mgnMode field from OKX positions API response
- Use position's mgnMode (cross/isolated) in close orders instead of hardcoding cross
- This fixes 'no position in this direction' error when closing isolated margin positions
- Use binary search to find exact kline candle for each order
- Sort markers by time as required by lightweight-charts
- Filter orders outside kline data range
- Based on lightweight-charts issue #1182 recommendation
- Add order sync support for Binance, Hyperliquid, Bybit, OKX, Bitget, Aster exchanges
- Fix weighted average exit price calculation for partial closes
- Handle position flip (翻仓) scenarios correctly
- Fix symbol normalization (ETH vs ETHUSDT)
- Skip order recording for exchanges with OrderSync to avoid duplicates
- Add chart timezone localization
- Fix CreateOpenPosition to accumulate into existing position when same
exchange_position_id exists, instead of silently skipping
- Add GetOpenPositionByExchangePositionID method for lookup by exchange ID
- Update UpdatePositionQuantityAndPrice to also update entry_quantity
- This fixes the issue where split orders (same millisecond) only recorded
the first order's quantity instead of the total position size
- implement coinank free kline api in coinank_api.Kline
- implement coinank free kline ws in coinank_api.KlineWs. if needKline is true, kline data read from KlineCh. if needTicker is true, tickers data read from TickersCh.
Use market.Normalize() for both position and candidate symbols to handle
different formats (ETH vs ETHUSDT), ensuring positions are correctly
excluded from candidate list.
Backend changes:
- Add symbol headers to market data sections for clarity
- Add symbol labels to quantitative data output
- Skip position coins in candidate list to avoid duplicate data
Frontend changes:
- Add B/S toggle button to show/hide order markers
- Remove bottom legend (B BUY S SELL)
- Fix chart position reset on data refresh
- Separate marker toggle logic from data loading
- Add Chinese version: AGPL-VIOLATION-REPORT-ChainOpera.md
- Add English version: AGPL-VIOLATION-REPORT-ChainOpera-EN.md
- Document timeline evidence, technical comparison, and legal analysis
- Address "Python rewrite" defense with AGPL and copyright law references
- Add BOLL to frontend indicator grid with period selection
- Add BOLL calculation (upper/middle/lower bands) in market data
- Add BOLL fields to TimeframeSeriesData struct
- Integrate BOLL into AI decision engine prompts
- Support multi-timeframe BOLL analysis
- Fixed ExchangeConfigModal to use allExchanges for editing
- Improved wallet address display layout (moved to right side)
- Added privacy toggle and copy button for addresses
- Enhanced usage status for both AI models and exchanges:
- Shows '2/3 Running' when traders are active (green badge)
- Shows '2 Traders' when assigned but stopped (yellow badge)
- Shows 'Idle' when enabled but not used
- Shows 'Configured' when not enabled
Fixed ExchangeConfigModal to receive allExchanges (user's configured accounts)
instead of supportedExchanges (templates only), so editing an exchange now
properly displays account name and other non-sensitive information.
- Change default MaxUsers from 5 to 10 in config
- Add update reminder section in install.sh output
- Add 'Keeping Updated' section in all README translations
- Add real-time position display with unrealized P&L during backtest
- Fix P&L calculation by tracking accumulated opening fees
- Add strategy coin source resolution (AI500, OI Top, mixed)
- Infer AI provider from model name for better compatibility
- Cap position size to available margin to prevent insufficient cash errors
- Fix trade markers on K-line chart (long/short instead of buy/sell)
- Add QuantData and OI ranking to backtest decision context
- implement LiquidationExchangeStatistics,LiquidationCoinAggHistory in provider/coinank/liquidation.go
- implement LiquidationHistory,LiquidationOrders in provider/coinank/liquidation.go
- implement OpenInterestAll,OpenInterestChartV2,OpenInterestSymbolChart,OpenInterestKline in provider/coinank/open_interest.go
- implement OpenInterestAggKline,TickersTopOIByEx,InstrumentsOiVsMc in provider/coinank/open_interest.go
- Fix hardcoded 5x position ratio in AI prompt example, now uses configured ratio
- Add position sizing guidance section for AI to calculate proper position size
- Add sub_accounts support for Lighter account API
Lighter SDK validates that StopLossOrder (type=2) and TakeProfitOrder (type=4)
must have TimeInForce=0 (ImmediateOrCancel), not TimeInForce=1 (GoodTillTime).
This was causing stop-loss and take-profit orders to fail validation and not
be submitted to Lighter exchange.
- Upgrade go-binance to v2.8.9 with new Algo Order API
- Migrate SetStopLoss/SetTakeProfit to use AlgoOrderTypeStopMarket/TakeProfitMarket
- Update cancel functions to handle both legacy and Algo orders
- Fix Lighter stop orders using correct order types (type=2/4) with TriggerPrice
- Add CancelAllOrders before opening positions for Bybit and Lighter
- Fix decision limit selector in API handler
- Add stop_loss/take_profit/confidence fields to DecisionAction
- Store decisions array in database with proper serialization
- Redesign DecisionCard with beautiful entry/SL/TP display
- Complete data flow from coin selection to execution
- System/user prompt construction details
- AI response parsing and validation
- Risk control enforcement
- Code file references with line numbers