Commit Graph

63 Commits

Author SHA1 Message Date
TIANHE ffdd2ffbae V2.2.1: Membership & Billing, USDT TRC20 payment, VIP free indicators, AI Trading Radar, simplified strategy creation, system settings simplification, bug fixes and UI improvements 2026-02-27 01:57:04 +08:00
TIANHE 4c73439bd6 feat: Add System Overview tab to User Management page (admin only)
- Add backend API endpoint /api/users/system-strategies for system-wide strategy data
- Query all strategies across all users with positions, PnL, trade stats
- Add summary statistics (total strategies, running count, total capital, total PnL/ROI)
- Support filtering by status (running/stopped) and search by strategy/symbol/user
- Add System Overview tab with summary cards and detailed strategy table
- Display user, strategy name, status, symbol, capital, PnL/ROI, positions, trades, indicator, exchange, timeframe, leverage
- Add i18n translations for zh-CN and en-US
- Lazy-load strategy data when tab is first accessed
2026-02-13 02:46:59 +08:00
TIANHE f0a5af595d fix: Fix indicator parameter configuration and Docker build issues
- Fix indicator parameter values being reset after modification in indicator-analysis page
- Fix Docker build nginx image pull failure (use specific version tag)
- Add Docker build scripts (PowerShell and Bash versions)
- Revert call_indicator feature (temporarily removed to avoid affecting existing indicator execution)
2026-02-13 02:33:00 +08:00
TIANHE e5bb37bcbb fix: Improve decimal precision handling across all exchange clients
- Add strict_precision parameter to _dec_str methods
- Modify quantity normalization methods to return (Decimal, precision) tuple
- Infer precision from stepSize/lotSz/qtyStep for accurate formatting
- Update all order placement methods to use precision information
- Fix LOT_SIZE filter errors by strictly limiting decimal places

Affected exchanges:
- Binance Spot & Futures
- OKX
- Bybit
- Bitget Spot & Futures
- Deepcoin

This ensures order quantities are formatted with correct precision matching exchange requirements.
2026-02-11 18:28:06 +08:00
TIANHE a51184497d feat: Add cross-sectional strategy support
- Add cross-sectional strategy type (single vs cross-sectional)
- Support multi-symbol portfolio management with automatic ranking
- Add portfolio size, long ratio, and rebalance frequency configuration
- Implement parallel order execution for cross-sectional strategies
- Add frontend UI for strategy type selection and configuration
- Add i18n support (Chinese and English) for cross-sectional features
- Fix decimal precision issues in exchange order quantities
- Add last_rebalance_at field to database schema
- Add comprehensive documentation and examples

Database migration required: Add last_rebalance_at column to qd_strategies_trading table
2026-02-10 15:19:20 +08:00
TIANHE af8e46011e sss
Signed-off-by: TsssIANHE <TIANHE@GMAIL.COM>
2026-02-05 00:28:08 +08:00
TIANHE 8eb38bc6f8 feat: indicator parameterization support for kline chart 2026-02-01 15:02:14 +08:00
TIANHE 5818fbe725 fix: dashboard improvements - remove AI strategy count, fix pie chart, fix position user_id 2026-02-01 12:58:00 +08:00
TIANHE 70269c40c9 fix: AI analysis history user isolation & password change Turnstile bypass 2026-01-31 22:34:36 +08:00
TIANHE 0b37aa4a67 V2.1.1
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-31 02:59:49 +08:00
XSX-Milan 2bfbb88d74 feat: 持仓同步优化 + Binance 平仓/减仓安全增强
## 核心功能
1. **持仓自动同步与插入**
   - 修复策略状态查询条件 (active -> running)
   - 移除阻塞空持仓同步的早期返回逻辑
   - 自动检测交易所存在但本地不存在的持仓并插入数据库
   - 修复 INSERT 语句列匹配 (移除 created_at,添加 user_id)

2. **Binance 平仓/减仓优化**
   - 订单执行前强制同步持仓 (Pre-execution Sync)
   - Close/Reduce 订单自动数量修正:防止超额平仓
   - 当请求平仓数量 > 实际持仓时,自动调整为实际持有量
   - 当数据库无持仓记录时,强制设置 amount=0 阻止错误订单

3. **日志增强**
   - 每10秒输出实际持仓详情 (symbol, size, entry_price)
   - 常规同步日志降级为 debug,保留关键操作为 info
   - 同步失败日志升级为 ERROR 并附带 traceback
2026-01-28 14:15:04 +08:00
XSX-Milan 9faf48e53f 修复:Google搜索使用模糊匹配以避免无结果 2026-01-28 00:46:45 +08:00
XSX-Milan bc1c991645 feat: 添加 Binance 模拟交易支持
在 BinanceFuturesClient 和 BinanceSpotClient 中添加 enable_demo_trading 参数

根据 enable_demo_trading 自动设置正确的 demo base_url

Futures: https://demo-fapi.binance.com

Spot: https://demo-api.binance.com

在 factory.py 中从 exchange_config 读取 enable_demo_trading 配置并传递给客户端
2026-01-27 19:28:34 +08:00
TIANHE 53cadb5ab5 add deepcoin
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-26 20:32:34 +08:00
TIANHE 5df11e2491 new
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-25 01:14:54 +08:00
TIANHE 528be54fe8 new
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-25 01:03:46 +08:00
TIANHE 35d7ac5e1b Improve global market dashboard UX and settings
- Add global market dashboard APIs/assets and improve data robustness (incl. crypto heatmap by market cap)

- Enhance global market UI (map+heatmap layout, loading behavior, formatting, theme tweaks)

- Fix Settings LLM Provider select to render label/value options correctly

- Rename Indicator Community to Official Community and move it to the bottom

- Add search fallback when Google quota is exhausted
2026-01-24 23:26:26 +08:00
TIANHE f4e5a9f8e0 fix: Multiple bug fixes and improvements
- Fix Invalid Date display in Dashboard notifications
- Fix timezone offset (8 hours) in Trading Records time display
- Fix position closing failures due to commission discrepancies (fetch actual exchange position size for reduce_only orders)
- Fix IBKR connection error 'no current event loop in thread' by ensuring asyncio event loop exists
- Fix duplicate orders on same candle by extending signal deduplication to close signals
- Add responsive design for Profile page (mobile-friendly)
- Remove unused strategy_code module and database table
- Fix LLM service to support multiple providers (OpenRouter, OpenAI, DeepSeek, Grok, Google)
- Add auto-detection of configured LLM provider based on API key availability
- Fix AI code generation to use unified LLMService with proper provider selection
- Fix crypto symbol format handling (ETH/USDT no longer becomes ETH/USDT/USDT)
- Fix Commission display showing '0E-8' in Trading Records
- Fix P&L display for signal-only trades (show '--' for unrealized P&L)
- Fix OAuth login not updating last_login_at for new users
- Add migration script for notification_settings column
- Update env.example with new LLM provider configurations
- Remove ESLint rule that was not defined in config
2026-01-24 03:22:14 +08:00
guopengfa 433e966860 capture signal error. 2026-01-18 23:01:57 +08:00
guopengfa be8994c2d5 fix bug:html report direction right. 2026-01-18 20:26:46 +08:00
guopengfa cf4ce60ba5 fix bug: when same symbal and same code and same name create html report will can not open the on collection, add symbal code name and group name to unique id (当同一股票在不通分组,生成出来的html报告只能展开一个报告) 2026-01-18 18:55:41 +08:00
guopengfa b07ed7a9ee hide logging 2026-01-18 12:49:40 +08:00
PengfaGuo 4fbe871d2a Merge branch 'brokermr810:main' into main 2026-01-17 20:29:37 +08:00
guopengfa eae534af2e make manual positions can add same stock and symbal to difference group (使资金监控可以添加相同股票到不同分组) 2026-01-17 19:35:19 +08:00
Jinyu Xu f332cc62cb fix: Fix time display in dashboard recent trades
- Convert datetime to timestamp in backend dashboard API
- Improve formatTime function to handle ISO 8601 and RFC 2822 formats
2026-01-17 02:25:12 +07:00
Jinyu Xu c5d000e1c9 feat: Move notification settings to user profile and add i18n support
- Move notification config from system settings (.env) to user profile (database)
- Add user-specific notification settings API endpoints (GET/PUT /api/user/notification-settings)
- Add notification_settings column to qd_users table
- Update portfolio and trading-assistant to use profile notification settings
- Add notification settings UI in profile page with all channels (browser, telegram, email, phone, discord, webhook)
- Add i18n translations for notification settings in 10 languages
- Fix timestamp parsing in TradingRecords and portfolio (handle both ISO strings and Unix timestamps)
- Fix header icons alignment for mobile responsive layout
- Fix equity curve timestamp bug (handle datetime objects properly)
- Remove unused login.js exports and clean up user.js store
- Remove husky, commitlint and other dev dependencies
- Clean up env.example by removing user-specific notification params
- Update signal_notifier to prioritize user-specific tokens over global env vars
2026-01-17 01:37:32 +07:00
guopengfa b49e642066 hide logs 2026-01-17 01:26:25 +08:00
guopengfa b4a03a8e33 recovery decide_interval 2026-01-17 01:11:58 +08:00
guopengfa 36ddf09f84 delete before. 2026-01-17 00:38:40 +08:00
guopengfa 889e5acae5 fix bug: trade time is valid. (修复BUG:持仓时间为空的问题) 2026-01-17 00:31:44 +08:00
guopengfa ce11f7ad67 fix bug: trade time is valid. (修复BUG:持仓时间为空的问题) 2026-01-16 22:35:44 +08:00
guopengfa affbfd98da add log show strategy history kline number (增加log展示策略中获取的历史数据有多少) 2026-01-16 21:50:44 +08:00
guopengfa 086fe05c4d set trading code history data to config(策略执行时使用配置数量的历史数据) 2026-01-16 21:35:47 +08:00
guopengfa f25b2ebbe3 add config: get strategy history limit.(策略中的历史获取ticket数量可配置,当策略运行于分钟线的时候500条历史数据是不够的) 2026-01-16 13:28:26 +08:00
guopengfa 38d38ce162 add config: get strategy history limit.(策略中的历史获取ticket数量可配置,当策略运行于分钟线的时候500条历史数据是不够的) 2026-01-16 13:14:21 +08:00
guopengfa 0146a54851 add telegram notification configuration guide documents. 2026-01-16 12:53:09 +08:00
TIANHE 455786103a new
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-14 23:58:21 +08:00
TIANHE 6011ba4ce3 new
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-14 23:50:31 +08:00
TIANHE 445e7ac290 feat: improve authentication and user management
- Fix token missing issue after email code registration/login
- Add last login time update for code-based login
- Support email login in addition to username login
- Fix password login for code-registered users (allow setting password)
- Fix referral code parameter passing from URL hash
- Add email column to user management table
- Improve profile page layout (align card heights, reorganize layout)
- Add i18n support for Register Bonus, Referral Bonus, Code Lock Minutes, Code Max Attempts
- Fix billing service add_credits to support reference_id parameter
- Update password handling documentation
2026-01-14 20:42:10 +08:00
TIANHE fa721c034c new
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-14 05:58:08 +08:00
TIANHE 61a5e5e6aa feat: Multi-user system with PostgreSQL - WIP temporary save 2026-01-14 05:29:55 +08:00
TIANHE d17a1e8c67 new
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-13 04:16:42 +08:00
TIANHE e095f9be7e Supports MT5 and forex trading.
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-13 04:01:42 +08:00
TIANHE 7527d73f25 Supports Interactive Brokers, US and Hong Kong stocks.
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-13 02:35:48 +08:00
TIANHE 714dd47c86 feat: add real-time price fetching and fix data delays
- Add get_ticker() method for real-time quotes across all markets

- Add get_realtime_price() service with ticker/kline fallback chain

- Fix yfinance end date issue for US stocks and futures

- Fix forex timezone parsing for Tiingo UTC timestamps

- Add retry mechanism with exponential backoff for Tiingo API

- Add API rate limiting for portfolio (3 concurrent, 0.3s interval)

- Add force refresh option to bypass price cache on manual refresh
2026-01-13 00:21:33 +08:00
TIANHE 63f0b118a1 new
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-01-12 23:10:47 +08:00
TIANHE ec56b59530 feat: add Portfolio Management module with AI monitoring 2026-01-12 22:36:10 +08:00
TIANHE 43523d4796 fix: Forex data source improvements and Tiingo subscription hints 2026-01-12 04:28:42 +08:00
TIANHE bd5db753df feat: improve backtest system and add OpenRouter balance query 2026-01-12 04:01:17 +08:00
TIANHE 5a4c770279 feat: Refactor settings UI and fix commission fee recording
Settings improvements:
- Reorganize config groups with logical ordering (server, auth, ai, trading, etc.)
- Add description/tooltip for each config item with question mark icon
- Add icon to each group header
- Support i18n for descriptions (zh-CN, zh-TW, en-US)
- Move order execution config (ORDER_MODE, MAKER_WAIT_SEC, MAKER_OFFSET_BPS) to env

Commission fee fixes:
- Fix fee extraction in exchange clients: Bybit, Coinbase, Kraken, Gate, Kucoin, Bitfinex
- Properly accumulate and record commission fees in pending_order_worker
- Add fee/fee_ccy fields to wait_for_fill returns

Frontend updates:
- Remove order_mode config from trading-assistant frontend (now uses env config)
- Add sorted schema display by order field
- Add tooltip with description on hover
2026-01-12 00:15:52 +08:00