Skip to content

fix(backtest): align crypto candle coverage boundaries - #359

Merged
brokermr810 merged 1 commit into
testfrom
fix/crypto-backtest-candle-boundary
Nov 8, 2026
Merged

brokermr810 merged 1 commit into
testfrom
fix/crypto-backtest-candle-boundary

Conversation

@brokermr810

Copy link
Copy Markdown
Collaborator

Summary

  • align closed-candle coverage validation with each venue candle calendar
  • preserve strict rejection of missing, gapped, and unconfirmed history
  • add regression coverage for date-only, long-range, daily, and weekly boundaries

Validation

  • Ruff passed for the changed source and test files
  • relevant backend suite: 346 passed
  • local Docker/UI backtest completed with 3,265 BTC/USDT 15m candles

@sonarqubecloud

sonarqubecloud Bot commented Nov 8, 2026

Copy link
Copy Markdown

@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@brokermr810
brokermr810 merged commit bf5b56c into test Nov 8, 2026
3 checks passed
brokermr810 added a commit that referenced this pull request Nov 8, 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]>

---------

Signed-off-by: TIANHE <[email protected]>
Co-authored-by: TIANHE <[email protected]>
@brokermr810
brokermr810 deleted the fix/crypto-backtest-candle-boundary branch November 8, 2026 08:17
brokermr810 added a commit that referenced this pull request Nov 10, 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]>

---------

Signed-off-by: TIANHE <[email protected]>
Co-authored-by: TIANHE <[email protected]>
brokermr810 added a commit that referenced this pull request Nov 11, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 11, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 11, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 13, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 14, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 15, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 19, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 19, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 19, 2026
…#391)

* 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 19, 2026
… library (#392)

* 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 19, 2026
…393)

* 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 21, 2026
…its (#396)

* 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 21, 2026
…ons (#397)

* 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 21, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 21, 2026
…ils (#399)

* 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 21, 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 22, 2026
#401)

* 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]>

---------

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]>
brokermr810 added a commit that referenced this pull request Nov 22, 2026
…eads (#403)

* 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]>

---------

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]>
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants