Repository navigation
fix(grid): resolve orders missing from open orders on verify - #407
Closed
Mystery01092000 wants to merge 1 commit into
Closed
Mystery01092000 wants to merge 1 commit into
Mystery01092000 wants to merge 1 commit into
Conversation
The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes OpenByteInc#404
|
brokermr810
pushed a commit
that referenced
this pull request
Nov 25, 2026
Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 25, 2026
* feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 25, 2026
* feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 27, 2026
…ings (#411) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 27, 2026
…ory (#413) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 27, 2026
…overy (#414) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 27, 2026
#415) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 27, 2026
* feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 27, 2026
) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 27, 2026
* feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 28, 2026
* feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 28, 2026
* feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> * fix(streams): recover subscriptions and validate live feed readiness Signed-off-by: TIANHE <[email protected]> * fix(trading): reject unsafe sizing and invalid broker order values Signed-off-by: TIANHE <[email protected]> * fix(security): return fixed order validation error identifiers Signed-off-by: TIANHE <[email protected]> * chore: exclude local design and visual QA artifacts Signed-off-by: TIANHE <[email protected]> * fix(strategy): reject non-finite order sizing and arithmetic overflow Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 29, 2026
…ion (#430) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> * fix(streams): recover subscriptions and validate live feed readiness Signed-off-by: TIANHE <[email protected]> * fix(trading): reject unsafe sizing and invalid broker order values Signed-off-by: TIANHE <[email protected]> * fix(security): return fixed order validation error identifiers Signed-off-by: TIANHE <[email protected]> * chore: exclude local design and visual QA artifacts Signed-off-by: TIANHE <[email protected]> * fix(strategy): reject non-finite order sizing and arithmetic overflow Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): support native trailing stop protection (cherry picked from commit 76ea213) Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce and reconcile attached protection across order paths Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): retire protection waits for rejected entries Signed-off-by: TIANHE <[email protected]> * fix(trading): verify bracket children and preserve concurrent metadata Signed-off-by: TIANHE <[email protected]> * fix(security): return public protection validation codes Signed-off-by: TIANHE <[email protected]> * feat(trading): extend native protection and verify broker child orders Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]> Co-authored-by: Pranav <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 30, 2026
…es (#432) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> * fix(streams): recover subscriptions and validate live feed readiness Signed-off-by: TIANHE <[email protected]> * fix(trading): reject unsafe sizing and invalid broker order values Signed-off-by: TIANHE <[email protected]> * fix(security): return fixed order validation error identifiers Signed-off-by: TIANHE <[email protected]> * chore: exclude local design and visual QA artifacts Signed-off-by: TIANHE <[email protected]> * fix(strategy): reject non-finite order sizing and arithmetic overflow Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): support native trailing stop protection (cherry picked from commit 76ea213) Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce and reconcile attached protection across order paths Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): retire protection waits for rejected entries Signed-off-by: TIANHE <[email protected]> * fix(trading): verify bracket children and preserve concurrent metadata Signed-off-by: TIANHE <[email protected]> * fix(security): return public protection validation codes Signed-off-by: TIANHE <[email protected]> * feat(trading): extend native protection and verify broker child orders Signed-off-by: TIANHE <[email protected]> * fix(market-data): batch HK quotes and preserve Tencent timestamps Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]> Co-authored-by: Pranav <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 30, 2026
* feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> * fix(streams): recover subscriptions and validate live feed readiness Signed-off-by: TIANHE <[email protected]> * fix(trading): reject unsafe sizing and invalid broker order values Signed-off-by: TIANHE <[email protected]> * fix(security): return fixed order validation error identifiers Signed-off-by: TIANHE <[email protected]> * chore: exclude local design and visual QA artifacts Signed-off-by: TIANHE <[email protected]> * fix(strategy): reject non-finite order sizing and arithmetic overflow Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): support native trailing stop protection (cherry picked from commit 76ea213) Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce and reconcile attached protection across order paths Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): retire protection waits for rejected entries Signed-off-by: TIANHE <[email protected]> * fix(trading): verify bracket children and preserve concurrent metadata Signed-off-by: TIANHE <[email protected]> * fix(security): return public protection validation codes Signed-off-by: TIANHE <[email protected]> * feat(trading): extend native protection and verify broker child orders Signed-off-by: TIANHE <[email protected]> * fix(market-data): batch HK quotes and preserve Tencent timestamps Signed-off-by: TIANHE <[email protected]> * fix(runtime): skip unavailable quotes in daily equity orders Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]> Co-authored-by: Pranav <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 30, 2026
#434) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> * fix(streams): recover subscriptions and validate live feed readiness Signed-off-by: TIANHE <[email protected]> * fix(trading): reject unsafe sizing and invalid broker order values Signed-off-by: TIANHE <[email protected]> * fix(security): return fixed order validation error identifiers Signed-off-by: TIANHE <[email protected]> * chore: exclude local design and visual QA artifacts Signed-off-by: TIANHE <[email protected]> * fix(strategy): reject non-finite order sizing and arithmetic overflow Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): support native trailing stop protection (cherry picked from commit 76ea213) Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce and reconcile attached protection across order paths Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): retire protection waits for rejected entries Signed-off-by: TIANHE <[email protected]> * fix(trading): verify bracket children and preserve concurrent metadata Signed-off-by: TIANHE <[email protected]> * fix(security): return public protection validation codes Signed-off-by: TIANHE <[email protected]> * feat(trading): extend native protection and verify broker child orders Signed-off-by: TIANHE <[email protected]> * fix(market-data): batch HK quotes and preserve Tencent timestamps Signed-off-by: TIANHE <[email protected]> * fix(runtime): skip unavailable quotes in daily equity orders Signed-off-by: TIANHE <[email protected]> * fix(equities): harden lot sizing, catalog sync and quote diagnostics Signed-off-by: TIANHE <[email protected]> * feat(universes): add HK sector and crypto selection pools Signed-off-by: TIANHE <[email protected]> * fix(ci): extract broker diagnostics and align quote health tests Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]> Co-authored-by: Pranav <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Nov 30, 2026
…#435) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> * fix(streams): recover subscriptions and validate live feed readiness Signed-off-by: TIANHE <[email protected]> * fix(trading): reject unsafe sizing and invalid broker order values Signed-off-by: TIANHE <[email protected]> * fix(security): return fixed order validation error identifiers Signed-off-by: TIANHE <[email protected]> * chore: exclude local design and visual QA artifacts Signed-off-by: TIANHE <[email protected]> * fix(strategy): reject non-finite order sizing and arithmetic overflow Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): support native trailing stop protection (cherry picked from commit 76ea213) Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce and reconcile attached protection across order paths Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): retire protection waits for rejected entries Signed-off-by: TIANHE <[email protected]> * fix(trading): verify bracket children and preserve concurrent metadata Signed-off-by: TIANHE <[email protected]> * fix(security): return public protection validation codes Signed-off-by: TIANHE <[email protected]> * feat(trading): extend native protection and verify broker child orders Signed-off-by: TIANHE <[email protected]> * fix(market-data): batch HK quotes and preserve Tencent timestamps Signed-off-by: TIANHE <[email protected]> * fix(runtime): skip unavailable quotes in daily equity orders Signed-off-by: TIANHE <[email protected]> * fix(equities): harden lot sizing, catalog sync and quote diagnostics Signed-off-by: TIANHE <[email protected]> * feat(universes): add HK sector and crypto selection pools Signed-off-by: TIANHE <[email protected]> * fix(ci): extract broker diagnostics and align quote health tests Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): reconcile live positions and preserve account settings Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]> Co-authored-by: Pranav <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Dec 3, 2026
…zed asset names (#436) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> * fix(streams): recover subscriptions and validate live feed readiness Signed-off-by: TIANHE <[email protected]> * fix(trading): reject unsafe sizing and invalid broker order values Signed-off-by: TIANHE <[email protected]> * fix(security): return fixed order validation error identifiers Signed-off-by: TIANHE <[email protected]> * chore: exclude local design and visual QA artifacts Signed-off-by: TIANHE <[email protected]> * fix(strategy): reject non-finite order sizing and arithmetic overflow Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): support native trailing stop protection (cherry picked from commit 76ea213) Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce and reconcile attached protection across order paths Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): retire protection waits for rejected entries Signed-off-by: TIANHE <[email protected]> * fix(trading): verify bracket children and preserve concurrent metadata Signed-off-by: TIANHE <[email protected]> * fix(security): return public protection validation codes Signed-off-by: TIANHE <[email protected]> * feat(trading): extend native protection and verify broker child orders Signed-off-by: TIANHE <[email protected]> * fix(market-data): batch HK quotes and preserve Tencent timestamps Signed-off-by: TIANHE <[email protected]> * fix(runtime): skip unavailable quotes in daily equity orders Signed-off-by: TIANHE <[email protected]> * fix(equities): harden lot sizing, catalog sync and quote diagnostics Signed-off-by: TIANHE <[email protected]> * feat(universes): add HK sector and crypto selection pools Signed-off-by: TIANHE <[email protected]> * fix(ci): extract broker diagnostics and align quote health tests Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): reconcile live positions and preserve account settings Signed-off-by: TIANHE <[email protected]> * fix(forthright): calculate stock position PnL and log rejection details Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile broker allocations and suppress repeated exit failures Signed-off-by: TIANHE <[email protected]> * fix(ledger): group partial fills by order without changing accounting Signed-off-by: TIANHE <[email protected]> * fix(catalog): preserve localized asset names and search active aliases Signed-off-by: TIANHE <[email protected]> * fix(openapi): generate localized catalog and grouped trade documentation Signed-off-by: TIANHE <[email protected]> * refactor(catalog): simplify localized name return flow Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]> Co-authored-by: Pranav <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Dec 4, 2026
… protection (#439) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> * fix(streams): recover subscriptions and validate live feed readiness Signed-off-by: TIANHE <[email protected]> * fix(trading): reject unsafe sizing and invalid broker order values Signed-off-by: TIANHE <[email protected]> * fix(security): return fixed order validation error identifiers Signed-off-by: TIANHE <[email protected]> * chore: exclude local design and visual QA artifacts Signed-off-by: TIANHE <[email protected]> * fix(strategy): reject non-finite order sizing and arithmetic overflow Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): support native trailing stop protection (cherry picked from commit 76ea213) Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce and reconcile attached protection across order paths Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): retire protection waits for rejected entries Signed-off-by: TIANHE <[email protected]> * fix(trading): verify bracket children and preserve concurrent metadata Signed-off-by: TIANHE <[email protected]> * fix(security): return public protection validation codes Signed-off-by: TIANHE <[email protected]> * feat(trading): extend native protection and verify broker child orders Signed-off-by: TIANHE <[email protected]> * fix(market-data): batch HK quotes and preserve Tencent timestamps Signed-off-by: TIANHE <[email protected]> * fix(runtime): skip unavailable quotes in daily equity orders Signed-off-by: TIANHE <[email protected]> * fix(equities): harden lot sizing, catalog sync and quote diagnostics Signed-off-by: TIANHE <[email protected]> * feat(universes): add HK sector and crypto selection pools Signed-off-by: TIANHE <[email protected]> * fix(ci): extract broker diagnostics and align quote health tests Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): reconcile live positions and preserve account settings Signed-off-by: TIANHE <[email protected]> * fix(forthright): calculate stock position PnL and log rejection details Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile broker allocations and suppress repeated exit failures Signed-off-by: TIANHE <[email protected]> * fix(ledger): group partial fills by order without changing accounting Signed-off-by: TIANHE <[email protected]> * fix(catalog): preserve localized asset names and search active aliases Signed-off-by: TIANHE <[email protected]> * fix(openapi): generate localized catalog and grouped trade documentation Signed-off-by: TIANHE <[email protected]> * refactor(catalog): simplify localized name return flow Signed-off-by: TIANHE <[email protected]> * fix(trading): stabilize protection IDs and classify full ADL closes Signed-off-by: TIANHE <[email protected]> * fix(trading): throttle broker connection exit retries and alerts Signed-off-by: TIANHE <[email protected]> * fix(catalog): recognize Texas listings and skip test exchange codes Signed-off-by: TIANHE <[email protected]> * fix(ownership): read equity snapshots from the correct account bucket Signed-off-by: TIANHE <[email protected]> * docs(trading): document snapshot and order recovery safeguards Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]> Co-authored-by: Pranav <[email protected]>
brokermr810
added a commit
that referenced
this pull request
Dec 4, 2026
…ical funding (#442) * feat: expand factor research and quick trade depth Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): normalize derivative order book units Signed-off-by: TIANHE <[email protected]> * docs(api): refresh OpenAPI export Signed-off-by: TIANHE <[email protected]> * security: harden secret handling and webhooks Signed-off-by: TIANHE <[email protected]> * security: prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * ci: satisfy quick trade size guardrail Signed-off-by: TIANHE <[email protected]> * feat(research): add custom factor AI and crypto history paging Signed-off-by: TIANHE <[email protected]> * fix(research): avoid backtracking in factor JSON parsing Signed-off-by: TIANHE <[email protected]> * feat: harden research, trading, and deployment flows Signed-off-by: TIANHE <[email protected]> * fix(ci): restore backend quality gates Signed-off-by: TIANHE <[email protected]> * fix(market): preserve exact crypto product identity Signed-off-by: TIANHE <[email protected]> * security(api): hide internal exception details Signed-off-by: TIANHE <[email protected]> * feat(api): harden analysis reports and public errors Signed-off-by: TIANHE <[email protected]> * fix(ci): keep fast analysis within quality baseline Signed-off-by: TIANHE <[email protected]> * feat(ai): modernize scheduled monitor reports Signed-off-by: TIANHE <[email protected]> * feat(market): generate localized share drafts Signed-off-by: TIANHE <[email protected]> * fix(security): sanitize share generation errors Signed-off-by: TIANHE <[email protected]> * fix(market): satisfy share draft quality checks Signed-off-by: TIANHE <[email protected]> * fix(runtime): harden marketplace metrics and evaluator capacity Signed-off-by: TIANHE <[email protected]> * fix(security): prevent exception detail exposure Signed-off-by: TIANHE <[email protected]> * feat: harden asset identity and live recovery Signed-off-by: TIANHE <[email protected]> * fix: restore backend CI quality gates Signed-off-by: TIANHE <[email protected]> * fix: sanitize asset resolution errors Signed-off-by: TIANHE <[email protected]> * fix: align agent contracts and runtime tests Signed-off-by: TIANHE <[email protected]> * test: refresh hardened runtime fixtures Signed-off-by: TIANHE <[email protected]> * feat: harden strategy candle readiness and recovery Signed-off-by: TIANHE <[email protected]> * fix(backtest): align crypto candle coverage boundaries (#359) Signed-off-by: TIANHE <[email protected]> Co-authored-by: TIANHE <[email protected]> * fix(trading): normalize Binance protection orders Signed-off-by: TIANHE <[email protected]> * fix(trading): snap Bitget and Bybit native protection prices to the tick #362 normalized the Binance protection orders, but Bitget (UTA and classic) and Bybit still sent percentage-derived prices with str(), e.g. stopLoss=77951.14749999999 for a 2.5% stop on a 76049.9 short. Those are off the contract tick, so the venue rejects the protection order. Run the stop-loss, take-profit and trailing activation prices (and the Bybit trailingStop distance) through each client's _normalize_price, the same way #362 does for Binance, and raise when the result falls below the minimum. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: aliassar <[email protected]> * fix(trading): normalize protection orders across venues Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce run-scoped liquidation risk stops Signed-off-by: TIANHE <[email protected]> * fix(grid): support legacy recovery engines Signed-off-by: TIANHE <[email protected]> * fix(runtime): separate strategy lifecycle generations Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile protection fills and spot residuals Signed-off-by: TIANHE <[email protected]> * fix(db): prevent runtime lock convoys Signed-off-by: TIANHE <[email protected]> * fix(security): harden sandbox and credential redaction Signed-off-by: TIANHE <[email protected]> * fix(security): harden strategy execution boundaries Signed-off-by: TIANHE <[email protected]> * fix(ci): keep quick trade route within guardrail Signed-off-by: TIANHE <[email protected]> * fix(security): document isolated exec boundary Signed-off-by: TIANHE <[email protected]> * fix(security): prevent market data error disclosure Signed-off-by: TIANHE <[email protected]> * fix(sandbox): classify native loader memory failures Signed-off-by: TIANHE <[email protected]> * docs: align repository and sandbox architecture maps Signed-off-by: TIANHE <[email protected]> * fix(sandbox): accept decimal position values Signed-off-by: TIANHE <[email protected]> * fix(runtime): allow two-minute sandbox requests and preserve failures Signed-off-by: TIANHE <[email protected]> * fix(config): align packaged sandbox environment defaults Signed-off-by: TIANHE <[email protected]> * fix(research): support China equities in research reports Signed-off-by: TIANHE <[email protected]> * feat(protection): reconcile partial exits and native rule semantics Signed-off-by: TIANHE <[email protected]> * feat(library): publish indicator and Strategy API V2 examples Signed-off-by: TIANHE <[email protected]> * fix(protection): compare native exit fractions exactly Signed-off-by: TIANHE <[email protected]> * fix(research): report A-share evidence and data gaps accurately Signed-off-by: TIANHE <[email protected]> * fix(trading): suppress repeated residual exit orders and alerts Signed-off-by: TIANHE <[email protected]> * fix(grid): validate funded ladder before initial position Signed-off-by: TIANHE <[email protected]> * fix(notifications): unify strategy outcomes and branded multilingual emails Persist definitive order failure streaks and portfolio batch outcomes, send deduplicated alerts across opted-in channels, and render transactional emails using localized monochrome templates and configured branding. Signed-off-by: TIANHE <[email protected]> * fix(trading): correct stop and rebalance notification schema queries Use the canonical strategy_name column for automatic-stop and rebalance notifications, honor explicit stop-and-close requests, and exercise the production schema and notification delivery paths in regression tests. Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve lifetime equity and clear closing precision tails Keep order sizing aligned with the deployment ledger across restarts. Revalue positions atomically with fills and derive live floating PnL from current quantities so stale residual rows cannot inflate equity. Preserve real small holdings and add cross-path regression coverage. Signed-off-by: TIANHE <[email protected]> * fix(trading): reuse confirmed exchange order pnl without expiry Signed-off-by: TIANHE <[email protected]> * fix(runtime): acknowledge distributed startup before completing commands Signed-off-by: TIANHE <[email protected]> * test(runtime): align command fencing assertions with distributed claims Signed-off-by: TIANHE <[email protected]> * perf(runtime): reduce strategy history loading and health query overhead Signed-off-by: TIANHE <[email protected]> * fix(trading): preserve grid protection and reconcile uncertain submissions Signed-off-by: TIANHE <[email protected]> * fix(research): strengthen cross-market fundamentals and event evidence Signed-off-by: TIANHE <[email protected]> * test: align grid recovery regressions Signed-off-by: TIANHE <[email protected]> * fix(grid): resolve orders missing from open orders on verify The grid resting-order audit (verify / re-reconcile in the UI) only read the exchange open-orders snapshot. An order cancelled on the exchange was reported as "not_open" forever and its local row stayed open, because the worker fill poller only polls strategies with a live runner and the UI has no delete action. For rows absent from open orders, query the order itself (Binance GET /fapi/v1/order via query_grid_order_fill) and report its terminal status. An exchange-confirmed cancel with no fill is applied to the local row through a guarded update; orders with fills are left to the fill poller so no fill is dropped from the strategy ledger. Fixes #404 (cherry picked from commit 46ef975) Signed-off-by: TIANHE <[email protected]> * fix(grid): reconcile residual orders in bounded worker audits Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage. Co-authored-by: Pranav Tomar <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(marketplace): add author filters and balanced recommendations Signed-off-by: TIANHE <[email protected]> * fix(ai): keep ordinary crypto strategy generation venue independent Signed-off-by: TIANHE <[email protected]> * fix(reports): split oversized PDF table rows across pages Signed-off-by: TIANHE <[email protected]> * fix(indicators): align library scripts with safe runtime APIs Signed-off-by: TIANHE <[email protected]> * fix(trading): harden session execution and fill reconciliation Signed-off-by: TIANHE <[email protected]> * fix(api): keep generated OpenAPI contract in sync Signed-off-by: TIANHE <[email protected]> * fix(runtime): prevent rebalance replay after worker restart Signed-off-by: TIANHE <[email protected]> * fix(sandbox): warm NumPy modules before applying isolation Signed-off-by: TIANHE <[email protected]> * feat(platform): add Forthright integration and advertisement settings Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract. Signed-off-by: TIANHE <[email protected]> * fix(ci): declare Forthright API tags and escape encoding fixtures Signed-off-by: TIANHE <[email protected]> * fix(security): bound public inputs and document broker signature risks Signed-off-by: TIANHE <[email protected]> * fix(brokers): preserve equity identity and reconcile account fills Signed-off-by: TIANHE <[email protected]> * fix(brokers): normalize HK-prefixed securities and deduplicate search Signed-off-by: TIANHE <[email protected]> * fix(brokers): reconcile delayed Forthright execution fees Signed-off-by: TIANHE <[email protected]> * fix(strategy): unify HK pool and position identities Signed-off-by: TIANHE <[email protected]> * perf(strategy): vectorize causal Bollinger series Signed-off-by: TIANHE <[email protected]> * fix(runtime): improve equity warmup caching and quote diagnostics Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown. Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * feat(trading): configure equity execution quote freshness Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks. Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed. Signed-off-by: TIANHE <[email protected]> * test(settings): align curated equity quote policy contract Signed-off-by: TIANHE <[email protected]> * fix(trading): coordinate exchange REST limits and startup recovery Signed-off-by: TIANHE <[email protected]> * fix(ci): align readiness tests and harden exchange guard identifiers Signed-off-by: TIANHE <[email protected]> * fix(runtime): recover strategies after exchange cooldowns Signed-off-by: TIANHE <[email protected]> * fix(ws): use Binance USD-M /market stream path for swap feeds Signed-off-by: Prakash Jha <[email protected]> (cherry picked from commit a5c7b82) Signed-off-by: TIANHE <[email protected]> * fix(ws): migrate Binance futures private stream routing Signed-off-by: TIANHE <[email protected]> * fix(streams): recover subscriptions and validate live feed readiness Signed-off-by: TIANHE <[email protected]> * fix(trading): reject unsafe sizing and invalid broker order values Signed-off-by: TIANHE <[email protected]> * fix(security): return fixed order validation error identifiers Signed-off-by: TIANHE <[email protected]> * chore: exclude local design and visual QA artifacts Signed-off-by: TIANHE <[email protected]> * fix(strategy): reject non-finite order sizing and arithmetic overflow Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): support native trailing stop protection (cherry picked from commit 76ea213) Signed-off-by: TIANHE <[email protected]> * fix(trading): enforce and reconcile attached protection across order paths Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): retire protection waits for rejected entries Signed-off-by: TIANHE <[email protected]> * fix(trading): verify bracket children and preserve concurrent metadata Signed-off-by: TIANHE <[email protected]> * fix(security): return public protection validation codes Signed-off-by: TIANHE <[email protected]> * feat(trading): extend native protection and verify broker child orders Signed-off-by: TIANHE <[email protected]> * fix(market-data): batch HK quotes and preserve Tencent timestamps Signed-off-by: TIANHE <[email protected]> * fix(runtime): skip unavailable quotes in daily equity orders Signed-off-by: TIANHE <[email protected]> * fix(equities): harden lot sizing, catalog sync and quote diagnostics Signed-off-by: TIANHE <[email protected]> * feat(universes): add HK sector and crypto selection pools Signed-off-by: TIANHE <[email protected]> * fix(ci): extract broker diagnostics and align quote health tests Signed-off-by: TIANHE <[email protected]> * fix(quick-trade): reconcile live positions and preserve account settings Signed-off-by: TIANHE <[email protected]> * fix(forthright): calculate stock position PnL and log rejection details Signed-off-by: TIANHE <[email protected]> * fix(trading): reconcile broker allocations and suppress repeated exit failures Signed-off-by: TIANHE <[email protected]> * fix(ledger): group partial fills by order without changing accounting Signed-off-by: TIANHE <[email protected]> * fix(catalog): preserve localized asset names and search active aliases Signed-off-by: TIANHE <[email protected]> * fix(openapi): generate localized catalog and grouped trade documentation Signed-off-by: TIANHE <[email protected]> * refactor(catalog): simplify localized name return flow Signed-off-by: TIANHE <[email protected]> * fix(trading): stabilize protection IDs and classify full ADL closes Signed-off-by: TIANHE <[email protected]> * fix(trading): throttle broker connection exit retries and alerts Signed-off-by: TIANHE <[email protected]> * fix(catalog): recognize Texas listings and skip test exchange codes Signed-off-by: TIANHE <[email protected]> * fix(ownership): read equity snapshots from the correct account bucket Signed-off-by: TIANHE <[email protected]> * docs(trading): document snapshot and order recovery safeguards Signed-off-by: TIANHE <[email protected]> * fix(virtual): keep signal accounts marked, funded and liquidated Virtual (signal-mode) positions were marked only when their stored strategy_run_id matched the current runtime run. Every strategy restart (the trading worker restores runtimes on boot) orphaned the still-open positions: mark price, unrealized PnL and equity snapshots froze until a new fill overwrote the row. On the Raspberry Pi deployment strategies 71 and 72 stayed frozen for 28 and 3 days while BTC fell from ~76k/59.6k to ~52k, so the virtual account showed +34k/+569k equity instead of being liquidated. - mark every open virtual position for the strategy, regardless of which run opened it. - add maintenance-margin liquidation for virtual perpetual accounts (configurable via maintenance_margin_rate, default 0.5%), force close at the current mark, and floor the account equity at zero so paper losses can never exceed the initial capital. - accrue settled funding into qd_strategy_funding_fees using public Binance/Gate.io funding history and deduct it from the virtual account's realised PnL; runs from the strategy loop and from a worker sweep so a stopped runtime cannot leave a position unmarked. - wire the sweep into the pending-order worker (virtual ledgers only; the live execution path is untouched). Tests cover the run-scope regression, maintenance-margin bounds, settlement-price selection and the Binance->Gate funding fallback. Co-authored-by: multica-agent <[email protected]> Signed-off-by: TIANHE <[email protected]> * fix(virtual): bound funding backfill and reconcile liquidation ledger - Derive the funding start from the current position cycle by replaying the trade ledger, so a partial reduction no longer resets it and the accrual never falls back to the strategy creation time. - Cap every funding backfill window (default 7 days) so a first sweep or a long gap cannot back-charge months of settlements at today's size. - Gate settlements on 8h clock boundaries instead of holding duration. - Dedupe funding rows per (symbol, minute, side) and only among virtual rows so hedged long/short positions both accrue. - Cancel pending_orders and strategy_order_intents when liquidation cancels virtual orders, matching the normal cancellation path. - Book forgiven loss beyond initial capital as an explicit bad_debt adjustment so trade PnL keeps summing to the account's realized PnL. - Add regression tests for cycle replay, boundary gating, side split, three-table liquidation cancel and bad-debt reconciliation. Signed-off-by: TIANHE <[email protected]> * test(virtual): cover liquidation idempotency and entry margin guard Signed-off-by: TIANHE <[email protected]> * fix(virtual): reconcile historical funding and safely sweep signal accounts Signed-off-by: TIANHE <[email protected]> * fix(virtual): run initial maintenance regardless of host uptime Signed-off-by: TIANHE <[email protected]> * fix(virtual): protect margin checks and reconcile funding reporting Signed-off-by: TIANHE <[email protected]> --------- Signed-off-by: TIANHE <[email protected]> Signed-off-by: aliassar <[email protected]> Signed-off-by: Prakash Jha <[email protected]> Co-authored-by: TIANHE <[email protected]> Co-authored-by: aliassar <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Pranav Tomar <[email protected]> Co-authored-by: Prakash Jha <[email protected]> Co-authored-by: Pranav <[email protected]> Co-authored-by: mabaojinbj <[email protected]> Co-authored-by: multica-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
When the user clicks verify on the grid resting-orders panel, the frontend calls
GET /api/strategies/grid-resting-orders?sync=1. That route runsaudit_grid_orders, which only fetched the exchange's open-orders snapshot. Any localopenorder missing from that snapshot was labellednot_open("未在当前挂单中"), and nothing else happened. The audit never asked the exchange what became of the order, and it never touched the local row. So an order cancelled on Binance stayedopeninqd_grid_resting_ordersand came back asnot_openon every verify, as reported in #404.The worker's
GridFillPollerdoes query each order, but only for strategies whose runner is registered in that process (_select_ordersskips orders withoutget_runner(sid)). Orders left behind by a stopped, handed-off or restarted bot are never polled. The UI has no delete action for these rows either. The default listing only showspending/open/partialrows, so the only way to clear one is to move it to a terminal status.This PR changes the audit so an order missing from open orders gets a per-order status lookup. For Binance USDT-M that is
GET /fapi/v1/order, through the existing exchange-awarequery_grid_order_fill. The audit reports the real terminal state. A cancel confirmed by the exchange, on an order that never filled, is then applied to the local row.Related issue
Changes
app/services/grid/order_audit.py_reconcile_missing_order: for a row with anexchange_order_idthat is absent from the open-orders snapshot, it callsquery_grid_order_filland reportscancelled/filled/open/partial. If the lookup returnsunknown, the result staysnot_open.cancelled, the exchange-reported filled quantity is 0, the localfilled_quantityandprocessed_fill_qtyare 0, and the local status isopen. This mirrors the engine's existing_cancel_confirmed_orderrule. Orders with fills, including partially filled then cancelled or expired orders, are only reported. Posting their fills to the strategy ledger is still the fill poller's job.terminalcounter and no longer inunknown, so a verify that resolves every order no longer returnsgrid_exchange_orders_unverified.app/services/grid/resting_orders_repo.pymark_cancelled_if_unfilled(order_id, exchange_order_id). It is one guardedUPDATE ... WHERE status = 'open' AND exchange_order_id = %s AND filled_quantity = 0 AND processed_fill_qty = 0, so it does nothing if a fill poller or private stream updated the row first.app/routes/strategy_grid_routes.pyexchange_terminal_orders. The row'sstatusin the response already reflects the reconciled value, so the user seescancelledright away, and the row drops out of the default (open) list on the next refresh.tests/test_grid_order_audit.py: 8 new tests that use a stubbedBinanceFuturesClient(MagicMock(spec=...)) returningGET /fapi/v1/orderpayloads:CANCELEDwith no fill: the row is marked cancelled, the audit reports it as terminal and no error is returned (the 网格策略订单在币安已取消,但 QuantDinger 界面仍显示“未在当前挂单中”且无法删除 #404 regression).CANCELEDorEXPIREDwithexecutedQty > 0, andFILLED: the status is reported and no ledger write happens.not_open, nothing is written and the error staysgrid_exchange_orders_unverified.statusandexchange_terminal_orders.Behavior notes
GETper order that is missing from open orders. It does not place or cancel any order.CANCELED/EXPIRED, had no fill, and were created more than 3 days ago. This applies toGET /fapi/v1/orderandGET /fapi/v1/allOrdersalike, soallOrderswould not help with these either. If the reported orders are that old, the lookup returns "order does not exist" and the row staysnot_open. I deliberately did not treat "not found" as "cancelled": a changed API key or account could produce the same response for orders that are still live. If maintainers want that case covered, a follow-up could treat Binance error-2013plus absence from open orders as a zero-fill cancel.exchange_terminal_orderscount and thecancelled/filledvalues ofexchange_status, which before this change were onlyopen/partial/not_open/unverified.Test plan
docker compose up -d --build: not done. Reproducing this needs a live Binance futures account with cancelled grid orders, so I verified with stubbed exchange clients instead.python:3.12, dependencies installed as inbasic-ci.yml):tests/test_grid_order_audit.py: 18 passed. On the base commit, 7 of the 8 new tests fail. The 8th (lookup failure keepsnot_open) passes on both, as intended.tests/test_grid_*.py tests/test_exchange_cancel_audit.py: 383 passed.-m "not integration and not stress"without Postgres: 5473 passed, 87 skipped, 26 deselected, 0 failed (Postgres-backed tests skip withoutQD_TEST_POSTGRES_DSN).ruff check app scripts tests(ruff 0.16.10),py_compile run.py,compileall,scripts/backend_quality_check.pyandscripts/check_docs.pypass.API documentation (if routes/schemas changed)
docs/api/openapi.yaml: not needed. The route's response schema is the genericHumanSuccessEnvelope, and the change only adds a summary field.docs/agent/agent-openapi.json: not needed, no/api/agent/v1change.Screenshots (if UI change)
Backend only.