diff --git a/docs/evidence/native-daily-factor-replays-20260907/native-pit-intraday-20260907.json b/docs/evidence/native-daily-factor-replays-20260907/native-pit-intraday-20260907.json new file mode 100644 index 0000000..c868aeb --- /dev/null +++ b/docs/evidence/native-daily-factor-replays-20260907/native-pit-intraday-20260907.json @@ -0,0 +1,467 @@ +{ + "schemaVersion": "fidc-backtest-benchmark/v5", + "label": "native-pit-intraday", + "generatedAtUnixSeconds": 1788790043, + "requestSha256": "9dd420ae606878b90ff660fcd4efe520e04a237ec758ed974b87b6d9a72cab73", + "requestOrigin": { + "kind": "request_file" + }, + "baseline": null, + "baselineComparable": true, + "baselineComparison": null, + "bundleRefresh": null, + "baseUrl": "http://127.0.0.1:8081", + "runs": [ + { + "slot": 0, + "cacheClass": "restart_or_cold", + "runId": "btr_1788790021780_1150210_0", + "status": "succeeded", + "queueWaitSeconds": 0.0, + "executionSeconds": 8.994, + "totalSeconds": 8.994, + "runnerSeconds": 7.904, + "bundleValidationSeconds": 0.166, + "sourceEpochSeconds": 0.0, + "strategyContractSeconds": 0.001, + "terminalCalendarSeconds": 0.0, + "riskFreeRateSeconds": 0.031, + "riskFreeRateCacheHit": false, + "engineSeconds": 0.012, + "dataSeconds": 7.662, + "resultSeconds": 0.03, + "unattributedSeconds": 0.0, + "canonicalSeconds": 0.001, + "resultFinalization": { + "canonicalSeconds": 0.001, + "processEventStoreSeconds": 0.001, + "storePublishSeconds": 0.027, + "summarySeconds": 0.0 + }, + "dataPreparationTimings": { + "adjustmentValidationSeconds": 0.0, + "availableStockStDates": 0, + "benchmarkFetchSeconds": 0.344, + "candidatePlanBasePanelSeconds": 0.006, + "candidatePlanSelectionSeconds": 0.004, + "corporateActionSeconds": 0.605, + "datasetConstructSeconds": 0.0, + "externalFetchSeconds": 0.344, + "historyDateSeconds": 0.0, + "instrumentIndexBuildSeconds": 0.0, + "instrumentMetadataSeconds": 0.016, + "loopSeconds": 0.0, + "marketIndexBuildSeconds": 0.001, + "quotePlanSeconds": 0.935, + "riskSnapshotSeconds": 0.0, + "sourceQuerySeconds": 5.752, + "stockStLookupSeconds": 0.0, + "supplementalExecutionFetchSeconds": 0.0, + "totalSeconds": 7.659 + }, + "finalizationSeconds": 1.089, + "finalizationTimings": { + "artifactVerificationSeconds": 0.0, + "cacheRegistrationSeconds": 0.0, + "postgresClientAcquireSeconds": 0.216, + "postgresPersistSeconds": 0.872, + "preTerminalUpdateSeconds": 1.089, + "schemaCheckSeconds": 0.0, + "timingSource": "fidc-backtest-service-monotonic" + }, + "totalReturn": 0.011211658838299776, + "tradeCount": 104, + "riskDecisionCount": 11, + "resultStoreDigest": "5ed069a1f5999542e6da78b10797aa21aabe71e13dd79649cd11157cbc57d3b4", + "canonicalResultDigest": "5c8a110cc6f285b9d569e818a0472a8b5c76f14df853a1c2c42d1b5222c39b3a", + "terminalAudit": { + "cashReceivableCount": 0, + "cashReceivableTotalAmount": 0.0, + "earliestDeferredCashDate": null, + "futuresOpenOrderCount": 0, + "lastExecutionDate": "2025-09-12", + "omittedOpenOrderCount": 0, + "openOrderSamples": [], + "pendingCashFlowCount": 0, + "pendingCashFlowNetAmount": 0.0, + "status": "clean", + "stockOpenOrderCount": 0 + }, + "terminalAuditVerified": true, + "terminalAuditSha256": "5836794e260aa2cfd1a06d4568ae6577a37c9cbe09ec0f00995121ea5b2522d9", + "implementation": { + "buildManifestSha256": "fb4f7ac191c8ab8d8d39fc48014f84ce01d4c0731ffe986e7d5cb0107a3e5539", + "builtAt": "2026-09-07T22:06:18+08:00", + "engineCommit": "1b78186c4e37273c64c1f9e208c2e47021ee4fff", + "identitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "runnerBinarySha256": "7cddebf9ab5cbbd5d6f9bd5c7bf006c3895ee26967d23d80dc86b47c50fb761d", + "schemaVersion": "fidc-backtest-implementation/v1", + "serviceBinarySha256": "f09d121d73c34ad3cd5e2e0c24b0bdaf1974309c9ec3b93229cfb824b1e9f11a", + "serviceCommit": "c80a38b91a398fd713f1f1faaa19a581ea85efad", + "status": "verified" + }, + "implementationVerified": true, + "implementationIdentitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "artifactManifest": { + "canonicalResult": { + "algorithm": "sha256", + "ordering": "engine_fact_order_v2", + "schemaVersion": "fidc-canonical-backtest-result/v2", + "sections": { + "accountEvents": { + "rowCount": 104, + "sha256": "ea6bbbd55df3da0692dfd712f88ef6f8af510ada318641ede71884f5c5d14e7e" + }, + "equityFacts": { + "rowCount": 5, + "sha256": "96004e235e4603c0a7d1a5629a2f0d2b364258d562e1d397cdd6925718a7d060" + }, + "fillEvents": { + "rowCount": 104, + "sha256": "2c37f626b7de014f5638dc8edf33f3ca8d23126ab2e62f26f01fbcb33e8c4e48" + }, + "holdingSnapshots": { + "rowCount": 112, + "sha256": "50abab8a304d2e2a7de344538aff604c8bf96ef00283330d107916cc2e234f67" + }, + "orderEvents": { + "rowCount": 108, + "sha256": "f327f21151a5d7dbe53d2dcde9202be699f9672f758373eeb9c67985ca3826f5" + }, + "riskAudits": { + "rowCount": 11, + "sha256": "428a8d7395b54ec5a9523eb745d5007c64b9d9867615e870d95ea9ea176f536e" + } + }, + "sha256": "5c8a110cc6f285b9d569e818a0472a8b5c76f14df853a1c2c42d1b5222c39b3a", + "totalRows": 444 + }, + "processEventStore": { + "bytes": 44302, + "identitySha256": "1444075abea626e8d7d1b8c9c9cda984a2a687ff2b9465db5648e0f4525130e7", + "manifestBytes": 461, + "manifestSha256": "b43a818096d09648b809a46d12ad9eae39638d57ea52f7696906359036a80c52", + "schemaVersion": "fidc-backtest-process-event-manifest/v1", + "sections": { + "processEvents": { + "blockCount": 1, + "bytes": 43841, + "rowCount": 370, + "sha256": "8edb6dad95777e3eef5946acbbdfc4b9125df34a79ac716d8c3ff7835b552bf6" + } + }, + "sha256": "661d84b7b430ac25fb5c959df8e7fb309133784d85a7524375cd803e29e52094", + "totalEvents": 370 + }, + "resultStore": { + "bytes": 148006, + "identitySha256": "484b7a4a8d5cc77c6222ce01f2fe452c890995a476579f209d1d4ac43885d60a", + "manifestBytes": 2999, + "manifestSha256": "a0a7072f176db79d781846cc124d2e4794c5084c48c525876863751f709c4e7f", + "schemaVersion": "fidc-backtest-fact-manifest/v1", + "sections": { + "accountEvents": { + "blockCount": 1, + "bytes": 13313, + "rowCount": 104, + "sha256": "ab2f936c9072f80d58487b62a6f64553d279582ddfe6af0299afe20447e83424" + }, + "equityFacts": { + "blockCount": 1, + "bytes": 11009, + "rowCount": 5, + "sha256": "c40650f5b27cfff873194572ffe28a5412fe77730fe75492c7b5a575f8f5caae" + }, + "fillEvents": { + "blockCount": 1, + "bytes": 40541, + "rowCount": 104, + "sha256": "80a3f1d3a9c23db7dec2dc70f029280c0844370be6d87703cd396a234068f708" + }, + "holdingSnapshots": { + "blockCount": 1, + "bytes": 51338, + "rowCount": 112, + "sha256": "7684244dc8e7788f777309169be61b14fcb532abdd89fe93f0a7f2980a615ba9" + }, + "orderEvents": { + "blockCount": 1, + "bytes": 25768, + "rowCount": 108, + "sha256": "31ff15d2cf79b1eb9c333d19d8fb400c9c5a52c36b0f662330ec39aa9d0f805c" + }, + "riskAudits": { + "blockCount": 1, + "bytes": 3038, + "rowCount": 11, + "sha256": "5a7269219a21cf14c23d788a6a96ddf1d1ddf0ef1e3b57a8db4ae4b1da789aff" + } + }, + "sha256": "5ed069a1f5999542e6da78b10797aa21aabe71e13dd79649cd11157cbc57d3b4", + "totalEvents": 444 + }, + "schemaVersion": "fidc-backtest-artifacts/v4" + } + }, + { + "slot": 1, + "cacheClass": "process_hot", + "runId": "btr_1788790036494_1150210_1", + "status": "succeeded", + "queueWaitSeconds": 0.0, + "executionSeconds": 0.596, + "totalSeconds": 0.596, + "runnerSeconds": 0.026, + "bundleValidationSeconds": 0.0, + "sourceEpochSeconds": 0.0, + "strategyContractSeconds": 0.003, + "terminalCalendarSeconds": 0.0, + "riskFreeRateSeconds": 0.0, + "riskFreeRateCacheHit": true, + "engineSeconds": 0.012, + "dataSeconds": 0.007, + "resultSeconds": 0.002, + "unattributedSeconds": 0.0, + "canonicalSeconds": 0.001, + "resultFinalization": { + "canonicalSeconds": 0.001, + "processEventStoreSeconds": 0.001, + "storePublishSeconds": 0.0, + "summarySeconds": 0.0 + }, + "dataPreparationTimings": { + "adjustmentValidationSeconds": 0.0, + "availableStockStDates": 0, + "benchmarkFetchSeconds": 0.0, + "candidatePlanBasePanelSeconds": 0.0, + "candidatePlanSelectionSeconds": 0.0, + "corporateActionSeconds": 0.0, + "datasetConstructSeconds": 0.0, + "externalFetchSeconds": 0.0, + "historyDateSeconds": 0.0, + "instrumentIndexBuildSeconds": 0.0, + "instrumentMetadataSeconds": 0.0, + "loopSeconds": 0.0, + "marketIndexBuildSeconds": 0.0, + "quotePlanSeconds": 0.0, + "riskSnapshotSeconds": 0.0, + "sourceQuerySeconds": 0.0, + "stockStLookupSeconds": 0.0, + "supplementalExecutionFetchSeconds": 0.0, + "totalSeconds": 0.006 + }, + "finalizationSeconds": 0.569, + "finalizationTimings": { + "artifactVerificationSeconds": 0.001, + "cacheRegistrationSeconds": 0.0, + "postgresClientAcquireSeconds": 0.27, + "postgresPersistSeconds": 0.298, + "preTerminalUpdateSeconds": 0.569, + "schemaCheckSeconds": 0.0, + "timingSource": "fidc-backtest-service-monotonic" + }, + "totalReturn": 0.011211658838299776, + "tradeCount": 104, + "riskDecisionCount": 11, + "resultStoreDigest": "5ed069a1f5999542e6da78b10797aa21aabe71e13dd79649cd11157cbc57d3b4", + "canonicalResultDigest": "5c8a110cc6f285b9d569e818a0472a8b5c76f14df853a1c2c42d1b5222c39b3a", + "terminalAudit": { + "cashReceivableCount": 0, + "cashReceivableTotalAmount": 0.0, + "earliestDeferredCashDate": null, + "futuresOpenOrderCount": 0, + "lastExecutionDate": "2025-09-12", + "omittedOpenOrderCount": 0, + "openOrderSamples": [], + "pendingCashFlowCount": 0, + "pendingCashFlowNetAmount": 0.0, + "status": "clean", + "stockOpenOrderCount": 0 + }, + "terminalAuditVerified": true, + "terminalAuditSha256": "5836794e260aa2cfd1a06d4568ae6577a37c9cbe09ec0f00995121ea5b2522d9", + "implementation": { + "buildManifestSha256": "fb4f7ac191c8ab8d8d39fc48014f84ce01d4c0731ffe986e7d5cb0107a3e5539", + "builtAt": "2026-09-07T22:06:18+08:00", + "engineCommit": "1b78186c4e37273c64c1f9e208c2e47021ee4fff", + "identitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "runnerBinarySha256": "7cddebf9ab5cbbd5d6f9bd5c7bf006c3895ee26967d23d80dc86b47c50fb761d", + "schemaVersion": "fidc-backtest-implementation/v1", + "serviceBinarySha256": "f09d121d73c34ad3cd5e2e0c24b0bdaf1974309c9ec3b93229cfb824b1e9f11a", + "serviceCommit": "c80a38b91a398fd713f1f1faaa19a581ea85efad", + "status": "verified" + }, + "implementationVerified": true, + "implementationIdentitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "artifactManifest": { + "canonicalResult": { + "algorithm": "sha256", + "ordering": "engine_fact_order_v2", + "schemaVersion": "fidc-canonical-backtest-result/v2", + "sections": { + "accountEvents": { + "rowCount": 104, + "sha256": "ea6bbbd55df3da0692dfd712f88ef6f8af510ada318641ede71884f5c5d14e7e" + }, + "equityFacts": { + "rowCount": 5, + "sha256": "96004e235e4603c0a7d1a5629a2f0d2b364258d562e1d397cdd6925718a7d060" + }, + "fillEvents": { + "rowCount": 104, + "sha256": "2c37f626b7de014f5638dc8edf33f3ca8d23126ab2e62f26f01fbcb33e8c4e48" + }, + "holdingSnapshots": { + "rowCount": 112, + "sha256": "50abab8a304d2e2a7de344538aff604c8bf96ef00283330d107916cc2e234f67" + }, + "orderEvents": { + "rowCount": 108, + "sha256": "f327f21151a5d7dbe53d2dcde9202be699f9672f758373eeb9c67985ca3826f5" + }, + "riskAudits": { + "rowCount": 11, + "sha256": "428a8d7395b54ec5a9523eb745d5007c64b9d9867615e870d95ea9ea176f536e" + } + }, + "sha256": "5c8a110cc6f285b9d569e818a0472a8b5c76f14df853a1c2c42d1b5222c39b3a", + "totalRows": 444 + }, + "processEventStore": { + "bytes": 44302, + "identitySha256": "1444075abea626e8d7d1b8c9c9cda984a2a687ff2b9465db5648e0f4525130e7", + "manifestBytes": 461, + "manifestSha256": "b43a818096d09648b809a46d12ad9eae39638d57ea52f7696906359036a80c52", + "schemaVersion": "fidc-backtest-process-event-manifest/v1", + "sections": { + "processEvents": { + "blockCount": 1, + "bytes": 43841, + "rowCount": 370, + "sha256": "8edb6dad95777e3eef5946acbbdfc4b9125df34a79ac716d8c3ff7835b552bf6" + } + }, + "sha256": "661d84b7b430ac25fb5c959df8e7fb309133784d85a7524375cd803e29e52094", + "totalEvents": 370 + }, + "resultStore": { + "bytes": 148006, + "identitySha256": "484b7a4a8d5cc77c6222ce01f2fe452c890995a476579f209d1d4ac43885d60a", + "manifestBytes": 2999, + "manifestSha256": "a0a7072f176db79d781846cc124d2e4794c5084c48c525876863751f709c4e7f", + "schemaVersion": "fidc-backtest-fact-manifest/v1", + "sections": { + "accountEvents": { + "blockCount": 1, + "bytes": 13313, + "rowCount": 104, + "sha256": "ab2f936c9072f80d58487b62a6f64553d279582ddfe6af0299afe20447e83424" + }, + "equityFacts": { + "blockCount": 1, + "bytes": 11009, + "rowCount": 5, + "sha256": "c40650f5b27cfff873194572ffe28a5412fe77730fe75492c7b5a575f8f5caae" + }, + "fillEvents": { + "blockCount": 1, + "bytes": 40541, + "rowCount": 104, + "sha256": "80a3f1d3a9c23db7dec2dc70f029280c0844370be6d87703cd396a234068f708" + }, + "holdingSnapshots": { + "blockCount": 1, + "bytes": 51338, + "rowCount": 112, + "sha256": "7684244dc8e7788f777309169be61b14fcb532abdd89fe93f0a7f2980a615ba9" + }, + "orderEvents": { + "blockCount": 1, + "bytes": 25768, + "rowCount": 108, + "sha256": "31ff15d2cf79b1eb9c333d19d8fb400c9c5a52c36b0f662330ec39aa9d0f805c" + }, + "riskAudits": { + "blockCount": 1, + "bytes": 3038, + "rowCount": 11, + "sha256": "5a7269219a21cf14c23d788a6a96ddf1d1ddf0ef1e3b57a8db4ae4b1da789aff" + } + }, + "sha256": "5ed069a1f5999542e6da78b10797aa21aabe71e13dd79649cd11157cbc57d3b4", + "totalEvents": 444 + }, + "schemaVersion": "fidc-backtest-artifacts/v4" + } + } + ], + "summary": { + "resultConsistent": true, + "resultStoreDigest": "5ed069a1f5999542e6da78b10797aa21aabe71e13dd79649cd11157cbc57d3b4", + "canonicalResultDigest": "5c8a110cc6f285b9d569e818a0472a8b5c76f14df853a1c2c42d1b5222c39b3a", + "totalReturn": 0.011211658838299776, + "tradeCount": 104, + "terminalAudit": { + "cashReceivableCount": 0, + "cashReceivableTotalAmount": 0.0, + "earliestDeferredCashDate": null, + "futuresOpenOrderCount": 0, + "lastExecutionDate": "2025-09-12", + "omittedOpenOrderCount": 0, + "openOrderSamples": [], + "pendingCashFlowCount": 0, + "pendingCashFlowNetAmount": 0.0, + "status": "clean", + "stockOpenOrderCount": 0 + }, + "terminalAuditSha256": "5836794e260aa2cfd1a06d4568ae6577a37c9cbe09ec0f00995121ea5b2522d9", + "implementation": { + "buildManifestSha256": "fb4f7ac191c8ab8d8d39fc48014f84ce01d4c0731ffe986e7d5cb0107a3e5539", + "builtAt": "2026-09-07T22:06:18+08:00", + "engineCommit": "1b78186c4e37273c64c1f9e208c2e47021ee4fff", + "identitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "runnerBinarySha256": "7cddebf9ab5cbbd5d6f9bd5c7bf006c3895ee26967d23d80dc86b47c50fb761d", + "schemaVersion": "fidc-backtest-implementation/v1", + "serviceBinarySha256": "f09d121d73c34ad3cd5e2e0c24b0bdaf1974309c9ec3b93229cfb824b1e9f11a", + "serviceCommit": "c80a38b91a398fd713f1f1faaa19a581ea85efad", + "status": "verified" + }, + "implementationIdentitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "restartOrCold": { + "queueWaitSeconds": 0.0, + "executionSeconds": 8.994, + "totalSeconds": 8.994, + "runnerSeconds": 7.904, + "bundleValidationSeconds": 0.166, + "sourceEpochSeconds": 0.0, + "strategyContractSeconds": 0.001, + "terminalCalendarSeconds": 0.0, + "riskFreeRateSeconds": 0.031, + "riskFreeRateCacheHit": false, + "engineSeconds": 0.012, + "dataSeconds": 7.662, + "resultSeconds": 0.03, + "unattributedSeconds": 0.0, + "canonicalSeconds": 0.001, + "finalizationSeconds": 1.089 + }, + "processHotMedian": { + "queueWaitSeconds": 0.0, + "executionSeconds": 0.596, + "totalSeconds": 0.596, + "runnerSeconds": 0.026, + "bundleValidationSeconds": 0.0, + "sourceEpochSeconds": 0.0, + "strategyContractSeconds": 0.003, + "terminalCalendarSeconds": 0.0, + "riskFreeRateSeconds": 0.0, + "riskFreeRateCacheHit": true, + "engineSeconds": 0.012, + "dataSeconds": 0.007, + "resultSeconds": 0.002, + "unattributedSeconds": 0.0, + "canonicalSeconds": 0.001, + "finalizationSeconds": 0.569 + } + } +} diff --git a/docs/evidence/native-daily-factor-replays-20260907/native-pit-intraday-request-20260907.json b/docs/evidence/native-daily-factor-replays-20260907/native-pit-intraday-request-20260907.json new file mode 100644 index 0000000..6bcf4de --- /dev/null +++ b/docs/evidence/native-daily-factor-replays-20260907/native-pit-intraday-request-20260907.json @@ -0,0 +1,531 @@ +{ + "strategy_id": "benchmark-native-factor-overlay", + "strategy_version_id": "1.0.0", + "user_id": "2d84120b-567a-417e-b6a4-6ffedceb132f", + "runtime": { + "start_date": "2025-09-08", + "end_date": "2025-09-12", + "frequency": "1d", + "source_table": "strategy_factory_source_lake.daily_source_rows_v1", + "signal_symbol": "000300.SH", + "benchmark_symbol": "000300.SH", + "initial_cash": 10000000.0, + "backtestDataBundleId": "bt_bundle_85825809f940ce489825", + "backtestDataBundleHash": "c83203674aa4ba23eed0bbc043c2a53f13bcbc37f45c395b3fb8d560a4d14991" + }, + "execution": { + "matchingType": "current_bar_close", + "rebalanceCashMode": "sell_then_buy", + "sellThenBuyDelaySlippageRate": 0, + "slippageModel": "price_ratio", + "slippageValue": 0.002, + "commissionRate": 0.0001, + "minimumCommission": 0.0, + "stampTaxRateBeforeChange": 0.001, + "stampTaxRateAfterChange": 0.0005, + "stampTaxChangeDate": "2023-08-28", + "volumeLimit": true, + "liquidityLimit": false, + "volumePercent": 0.25, + "riskPolicy": { + "allowMarketOrders": true, + "blacklistEnabled": true, + "blacklistedSymbols": [], + "commissionRate": 0.0001, + "forbidSameDayRebuyAfterSell": false, + "liquidityLimitEnabled": false, + "liveTradingEnabled": false, + "maxOrderNotional": 100000000, + "maxOrderQuantity": 1000000, + "maxSymbolPosition": 10000000, + "minimumCommission": 0, + "rejectBjseBuy": true, + "rejectBjseSelection": false, + "rejectInactiveBuy": true, + "rejectInactiveSelection": false, + "rejectInactiveSell": true, + "rejectKcbBuy": false, + "rejectKcbSelection": false, + "rejectLowerLimitSelection": false, + "rejectLowerLimitSell": true, + "rejectNewListingBuy": true, + "rejectNewListingSelection": false, + "rejectOneYuanBuy": true, + "rejectOneYuanSelection": false, + "rejectPausedBuy": true, + "rejectPausedSelection": false, + "rejectPausedSell": true, + "rejectStBuy": true, + "rejectStSelection": false, + "rejectStarStBuy": true, + "rejectStarStSelection": false, + "rejectUpperLimitBuy": true, + "rejectUpperLimitSelection": false, + "respectAllowBuySell": true, + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "volumeLimitEnabled": true, + "volumePercent": 0.25 + } + }, + "strategy_source": { + "source_type": "platform-strategy", + "language": "engine-script", + "parser": "omniquant-engine-script-v2", + "source_code": "strategy(\"许总_组合_backtest\") {\n mode(\"rotation\")\n market(\"CN_A\")\n benchmark(\"000300.SH\")\n signal(\"000300.SH\")\n rebalance.every_days(1).at([\"09:30\"])\n universe.include([\"688116.SH\", \"603200.SH\", \"300395.SZ\", \"600732.SH\", \"000063.SZ\", \"002625.SZ\", \"300811.SZ\", \"002851.SZ\", \"000988.SZ\", \"002281.SZ\", \"300205.SZ\", \"002239.SZ\", \"600079.SH\", \"600276.SH\", \"600909.SH\", \"002169.SZ\", \"603156.SH\", \"002654.SZ\", \"000999.SZ\", \"601066.SH\", \"603345.SH\", \"000333.SZ\", \"603726.SH\", \"688012.SH\"])\n selection.limit(24)\n selection.candidate_limit(24)\n selection.market_cap_band(field=\"close\", lower=0, upper=1000000000000)\n filter.stock_expr((close > 0)) && (ths_up_days_stock >= 1)\n ordering.rank_expr((((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) || (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") || ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") || symbol == \"002239.SZ\"))) || ((((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") || ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") || symbol == \"002654.SZ\")) || (((symbol == \"000999.SZ\" || symbol == \"601066.SH\") || symbol == \"603345.SH\") || ((symbol == \"000333.SZ\" || symbol == \"603726.SH\") || symbol == \"688012.SH\")))) ? (((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) || (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") || ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") || symbol == \"002239.SZ\"))) ? ((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) ? (((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") ? ((symbol == \"688116.SH\" || symbol == \"603200.SH\") ? (symbol == \"688116.SH\" ? (0) : (1)) : (2)) : ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") ? (symbol == \"600732.SH\" ? (3) : (4)) : (5))) : (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") ? ((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") ? (symbol == \"300811.SZ\" ? (6) : (7)) : (8)) : ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") ? (symbol == \"002281.SZ\" ? (9) : (10)) : (11)))) : ((((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") || ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") || symbol == \"002654.SZ\")) ? (((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") ? ((symbol == \"600079.SH\" || symbol == \"600276.SH\") ? (symbol == \"600079.SH\" ? (12) : (13)) : (14)) : ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") ? (symbol == \"002169.SZ\" ? (15) : (16)) : (17))) : (((symbol == \"000999.SZ\" || symbol == \"601066.SH\") || symbol == \"603345.SH\") ? ((symbol == \"000999.SZ\" || symbol == \"601066.SH\") ? (symbol == \"000999.SZ\" ? (18) : (19)) : (20)) : ((symbol == \"000333.SZ\" || symbol == \"603726.SH\") ? (symbol == \"000333.SZ\" ? (21) : (22)) : (23))))) : 24, \"asc\")\n risk.index_exposure(max(0.0, 0.9000000000 - 0.0000 / max(total_equity, 1.0)))\n allocation.buy_scale((((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) || (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") || ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") || symbol == \"002239.SZ\"))) || ((((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") || ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") || symbol == \"002654.SZ\")) || (((symbol == \"000999.SZ\" || symbol == \"601066.SH\") || symbol == \"603345.SH\") || ((symbol == \"000333.SZ\" || symbol == \"603726.SH\") || symbol == \"688012.SH\")))) ? (((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || (symbol == \"300395.SZ\" || symbol == \"600732.SH\")) || ((symbol == \"000063.SZ\" || symbol == \"002625.SZ\") || (symbol == \"300811.SZ\" || symbol == \"002851.SZ\"))) || (((symbol == \"000988.SZ\" || symbol == \"002281.SZ\") || (symbol == \"300205.SZ\" || symbol == \"002239.SZ\")) || ((symbol == \"600079.SH\" || symbol == \"600276.SH\") || (symbol == \"600909.SH\" || symbol == \"002169.SZ\")))) ? (1.0008000000) : (0.9984000000)) : 0.0)\n risk.stop_loss(holding_return <= -0.0800000000)\n risk.take_profit(holding_return >= 0.1600000000)\n risk.reference_price_mode(\"position_average_entry_price\")\n trading.daily_top_up(true)\n trading.daily_position_target_adjust(true)\n trading.target_portfolio_daily(true)\n trading.rebalance_existing_positions(true)\n trading.hold_until_exit(true)\n trading.retry_empty_rebalance(true)\n trading.release_slot_on_exit_signal(true)\n trading.redistribute_target_weights_after_exit(true)\n trading.reenter_exited_targets(true)\n execution.matching_type(\"current_bar_close\")\n}" + }, + "strategy_spec": { + "benchmark": { + "fallbackInstrumentId": "000300.SH", + "instrumentId": "000300.SH", + "note": "必须使用真实指数链路;若 000852.SH 不可用,应直接报错而不是退化到其他标的。" + }, + "engineConfig": { + "benchmarkSymbol": "000300.SH", + "commissionRate": 0.0001, + "dividendReinvestment": false, + "dynamicRange": { + "baseCapFloor": 7, + "baseIndexLevel": 2000, + "capSpan": 1000000000000, + "xs": 0.008 + }, + "frequency": "1d", + "indexThrottle": { + "defensiveExposure": 0.5, + "fullExposure": 1, + "longDays": 10, + "rsiRate": 1.0001, + "shortDays": 5 + }, + "liquidityLimit": false, + "matchingType": "current_bar_close", + "minimumCommission": 0.0, + "rankLimit": 24, + "rebalanceCashMode": "sell_then_buy", + "rebalanceSchedule": { + "frequency": "daily", + "time": "09:30" + }, + "refreshRate": 1, + "riskPolicy": { + "allowMarketOrders": true, + "blacklistEnabled": true, + "blacklistedSymbols": [], + "commissionRate": 0.0001, + "forbidSameDayRebuyAfterSell": false, + "liquidityLimitEnabled": false, + "liveTradingEnabled": false, + "maxOrderNotional": 100000000, + "maxOrderQuantity": 1000000, + "maxSymbolPosition": 10000000, + "minimumCommission": 0, + "rejectBjseBuy": true, + "rejectBjseSelection": false, + "rejectInactiveBuy": true, + "rejectInactiveSelection": false, + "rejectInactiveSell": true, + "rejectKcbBuy": false, + "rejectKcbSelection": false, + "rejectLowerLimitSelection": false, + "rejectLowerLimitSell": true, + "rejectNewListingBuy": true, + "rejectNewListingSelection": false, + "rejectOneYuanBuy": true, + "rejectOneYuanSelection": false, + "rejectPausedBuy": true, + "rejectPausedSelection": false, + "rejectPausedSell": true, + "rejectStBuy": true, + "rejectStSelection": false, + "rejectStarStBuy": true, + "rejectStarStSelection": false, + "rejectUpperLimitBuy": true, + "rejectUpperLimitSelection": false, + "respectAllowBuySell": true, + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "volumeLimitEnabled": true, + "volumePercent": 0.25 + }, + "rsiRate": 1.0001, + "sellThenBuyDelaySlippageRate": 0, + "signalSymbol": "000300.SH", + "skipWindows": [], + "slippageModel": "price_ratio", + "slippageValue": 0.002, + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "stockMaFilter": { + "longDays": 20, + "midDays": 10, + "rsiRate": 1.0001, + "shortDays": 5, + "volumeLongDays": 60, + "volumeShortDays": 5 + }, + "stopLossMultiplier": 0.93, + "strictValueBudget": true, + "takeProfitMultiplier": 1.07, + "templateId": "许总_组合_backtest", + "volumeLimit": true, + "volumePercent": 0.25 + }, + "execution": { + "commissionRate": 0.0001, + "executionGranularity": "daily_or_minute_bar", + "extractor": "omniquant-engine-script-v2", + "frequency": "1d", + "liquidityLimit": false, + "matchingType": "current_bar_close", + "minimumCommission": 0.0, + "priceSource": "current_bar_close_or_next_bar_open_or_minute_bar", + "rebalanceCashMode": "sell_then_buy", + "riskPolicy": { + "allowMarketOrders": true, + "blacklistEnabled": true, + "blacklistedSymbols": [], + "commissionRate": 0.0001, + "forbidSameDayRebuyAfterSell": false, + "liquidityLimitEnabled": false, + "liveTradingEnabled": false, + "maxOrderNotional": 100000000, + "maxOrderQuantity": 1000000, + "maxSymbolPosition": 10000000, + "minimumCommission": 0, + "rejectBjseBuy": true, + "rejectBjseSelection": false, + "rejectInactiveBuy": true, + "rejectInactiveSelection": false, + "rejectInactiveSell": true, + "rejectKcbBuy": false, + "rejectKcbSelection": false, + "rejectLowerLimitSelection": false, + "rejectLowerLimitSell": true, + "rejectNewListingBuy": true, + "rejectNewListingSelection": false, + "rejectOneYuanBuy": true, + "rejectOneYuanSelection": false, + "rejectPausedBuy": true, + "rejectPausedSelection": false, + "rejectPausedSell": true, + "rejectStBuy": true, + "rejectStSelection": false, + "rejectStarStBuy": true, + "rejectStarStSelection": false, + "rejectUpperLimitBuy": true, + "rejectUpperLimitSelection": false, + "respectAllowBuySell": true, + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "volumeLimitEnabled": true, + "volumePercent": 0.25 + }, + "selectionGranularity": "strategy_factory_source_lake.daily_source_rows_v1", + "sellThenBuyDelaySlippageRate": 0, + "slippageModel": "price_ratio", + "slippageValue": 0.002, + "sourceKind": "platform-strategy", + "sourceLanguage": "engine-script", + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "strictValueBudget": true, + "volumeLimit": true, + "volumePercent": 0.25 + }, + "factorRefs": [ + "close", + "ths_up_days_stock" + ], + "factorValueBindings": [], + "market": "CN_A", + "metadata": { + "backtestDataBundle": { + "sourceTable": "strategy_factory_source_lake.daily_source_rows_v1", + "backtestDataBundleId": "bt_bundle_85825809f940ce489825", + "backtestDataBundleHash": "c83203674aa4ba23eed0bbc043c2a53f13bcbc37f45c395b3fb8d560a4d14991" + }, + "backtestDataBundleHash": "c83203674aa4ba23eed0bbc043c2a53f13bcbc37f45c395b3fb8d560a4d14991", + "backtestDataBundleId": "bt_bundle_85825809f940ce489825", + "sourceTable": "strategy_factory_source_lake.daily_source_rows_v1", + "strategyExecutionContract": { + "commissionRate": "0.0001", + "dynamicSlippageImpact": "0", + "dynamicSlippageMax": "0", + "dynamicSlippageVolatility": "0", + "frequency": "1d", + "hash": "fnv1a-66a4a68e", + "liquidityLimitEnabled": false, + "matchingType": "current_bar_close", + "minimumCommission": "0", + "rebalanceCashMode": "sell_then_buy", + "riskPolicy": { + "allowMarketOrders": true, + "blacklistEnabled": true, + "blacklistedSymbols": [], + "commissionRate": 0.0001, + "forbidSameDayRebuyAfterSell": false, + "liquidityLimitEnabled": false, + "liveTradingEnabled": false, + "maxOrderNotional": 100000000, + "maxOrderQuantity": 1000000, + "maxSymbolPosition": 10000000, + "minimumCommission": 0, + "rejectBjseBuy": true, + "rejectBjseSelection": false, + "rejectInactiveBuy": true, + "rejectInactiveSelection": false, + "rejectInactiveSell": true, + "rejectKcbBuy": false, + "rejectKcbSelection": false, + "rejectLowerLimitSelection": false, + "rejectLowerLimitSell": true, + "rejectNewListingBuy": true, + "rejectNewListingSelection": false, + "rejectOneYuanBuy": true, + "rejectOneYuanSelection": false, + "rejectPausedBuy": true, + "rejectPausedSelection": false, + "rejectPausedSell": true, + "rejectStBuy": true, + "rejectStSelection": false, + "rejectStarStBuy": true, + "rejectStarStSelection": false, + "rejectUpperLimitBuy": true, + "rejectUpperLimitSelection": false, + "respectAllowBuySell": true, + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "volumeLimitEnabled": true, + "volumePercent": 0.25 + }, + "sellThenBuyDelaySlippageRate": "0", + "slippageMode": "fixed", + "slippageRate": "0.002", + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": "0.0005", + "stampTaxRateBeforeChange": "0.001", + "version": "fidc-strategy-execution-v1", + "volumeLimitEnabled": true, + "volumePercent": "0.25" + }, + "strategyExecutionContractHash": "fnv1a-66a4a68e", + "strategyExecutionContractVersion": "fidc-strategy-execution-v1", + "strategyRiskPolicyVersion": "fidc-risk-policy-v2" + }, + "mode": "rotation", + "rebalance": { + "dailyApproximation": "日线回测按 matching_type 撮合;分钟线回测按交易时刻分钟价格撮合", + "frequencyDays": 1, + "schedule": { + "frequency": "daily", + "time": "09:30" + }, + "tradeTimes": [ + "09:30" + ] + }, + "risk": { + "indexThrottleExpr": "max(0.0, 0.9000000000 - 0.0000 / max(total_equity, 1.0))", + "stopLossExpr": "holding_return <= -0.0800000000", + "stopTakeReferencePriceMode": "position_average_entry_price", + "takeProfitExpr": "holding_return >= 0.1600000000" + }, + "runtimeExpressions": { + "allocation": { + "buyScaleExpr": "(((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) || (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") || ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") || symbol == \"002239.SZ\"))) || ((((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") || ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") || symbol == \"002654.SZ\")) || (((symbol == \"000999.SZ\" || symbol == \"601066.SH\") || symbol == \"603345.SH\") || ((symbol == \"000333.SZ\" || symbol == \"603726.SH\") || symbol == \"688012.SH\")))) ? (((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || (symbol == \"300395.SZ\" || symbol == \"600732.SH\")) || ((symbol == \"000063.SZ\" || symbol == \"002625.SZ\") || (symbol == \"300811.SZ\" || symbol == \"002851.SZ\"))) || (((symbol == \"000988.SZ\" || symbol == \"002281.SZ\") || (symbol == \"300205.SZ\" || symbol == \"002239.SZ\")) || ((symbol == \"600079.SH\" || symbol == \"600276.SH\") || (symbol == \"600909.SH\" || symbol == \"002169.SZ\")))) ? (1.0008000000) : (0.9984000000)) : 0.0" + }, + "ordering": { + "rankBy": "market_cap", + "rankExpr": "(((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) || (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") || ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") || symbol == \"002239.SZ\"))) || ((((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") || ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") || symbol == \"002654.SZ\")) || (((symbol == \"000999.SZ\" || symbol == \"601066.SH\") || symbol == \"603345.SH\") || ((symbol == \"000333.SZ\" || symbol == \"603726.SH\") || symbol == \"688012.SH\")))) ? (((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) || (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") || ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") || symbol == \"002239.SZ\"))) ? ((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) ? (((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") ? ((symbol == \"688116.SH\" || symbol == \"603200.SH\") ? (symbol == \"688116.SH\" ? (0) : (1)) : (2)) : ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") ? (symbol == \"600732.SH\" ? (3) : (4)) : (5))) : (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") ? ((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") ? (symbol == \"300811.SZ\" ? (6) : (7)) : (8)) : ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") ? (symbol == \"002281.SZ\" ? (9) : (10)) : (11)))) : ((((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") || ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") || symbol == \"002654.SZ\")) ? (((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") ? ((symbol == \"600079.SH\" || symbol == \"600276.SH\") ? (symbol == \"600079.SH\" ? (12) : (13)) : (14)) : ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") ? (symbol == \"002169.SZ\" ? (15) : (16)) : (17))) : (((symbol == \"000999.SZ\" || symbol == \"601066.SH\") || symbol == \"603345.SH\") ? ((symbol == \"000999.SZ\" || symbol == \"601066.SH\") ? (symbol == \"000999.SZ\" ? (18) : (19)) : (20)) : ((symbol == \"000333.SZ\" || symbol == \"603726.SH\") ? (symbol == \"000333.SZ\" ? (21) : (22)) : (23))))) : 24", + "rankOrder": "asc" + }, + "prelude": "", + "risk": { + "exposureExpr": "max(0.0, 0.9000000000 - 0.0000 / max(total_equity, 1.0))", + "stopLossExpr": "holding_return <= -0.0800000000", + "stopTakeReferencePriceMode": "position_average_entry_price", + "takeProfitExpr": "holding_return >= 0.1600000000" + }, + "schedule": { + "frequency": "daily", + "time": "09:30" + }, + "selection": { + "candidateLimitExpr": "24", + "limitExpr": "24", + "marketCapField": "close", + "marketCapLowerExpr": "0", + "marketCapUpperExpr": "1000000000000", + "stockFilterExpr": "((close > 0)) && (ths_up_days_stock >= 1)" + }, + "trading": { + "actions": [], + "dailyPositionTargetAdjust": true, + "dailyTopUp": true, + "holdUntilExit": true, + "rebalanceExistingPositions": true, + "redistributeTargetWeightsAfterExit": true, + "reenterExitedTargets": true, + "releaseSlotOnExitSignal": true, + "retryEmptyRebalance": true, + "rotationEnabled": true, + "stage": "on_day", + "subscriptionGuardRequired": false, + "targetPortfolioDaily": true + } + }, + "seasonality": { + "skipWindows": [] + }, + "selectors": [ + { + "field": "market_cap", + "lowerExpr": "0", + "mapping": "close -> strategy_factory_source_lake.runtime_fields.close", + "type": "dynamicRange", + "upperExpr": "1000000000000" + }, + { + "expr": "((close > 0)) && (ths_up_days_stock >= 1)", + "type": "filter" + }, + { + "limitExpr": "24", + "orderBy": [ + "market_cap asc" + ], + "type": "rank" + } + ], + "signalSymbol": "000300.SH", + "sourceCode": "strategy(\"许总_组合_backtest\") {\n mode(\"rotation\")\n market(\"CN_A\")\n benchmark(\"000300.SH\")\n signal(\"000300.SH\")\n rebalance.every_days(1).at([\"09:30\"])\n universe.include([\"688116.SH\", \"603200.SH\", \"300395.SZ\", \"600732.SH\", \"000063.SZ\", \"002625.SZ\", \"300811.SZ\", \"002851.SZ\", \"000988.SZ\", \"002281.SZ\", \"300205.SZ\", \"002239.SZ\", \"600079.SH\", \"600276.SH\", \"600909.SH\", \"002169.SZ\", \"603156.SH\", \"002654.SZ\", \"000999.SZ\", \"601066.SH\", \"603345.SH\", \"000333.SZ\", \"603726.SH\", \"688012.SH\"])\n selection.limit(24)\n selection.candidate_limit(24)\n selection.market_cap_band(field=\"close\", lower=0, upper=1000000000000)\n filter.stock_expr((close > 0)) && (ths_up_days_stock >= 1)\n ordering.rank_expr((((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) || (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") || ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") || symbol == \"002239.SZ\"))) || ((((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") || ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") || symbol == \"002654.SZ\")) || (((symbol == \"000999.SZ\" || symbol == \"601066.SH\") || symbol == \"603345.SH\") || ((symbol == \"000333.SZ\" || symbol == \"603726.SH\") || symbol == \"688012.SH\")))) ? (((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) || (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") || ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") || symbol == \"002239.SZ\"))) ? ((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) ? (((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") ? ((symbol == \"688116.SH\" || symbol == \"603200.SH\") ? (symbol == \"688116.SH\" ? (0) : (1)) : (2)) : ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") ? (symbol == \"600732.SH\" ? (3) : (4)) : (5))) : (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") ? ((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") ? (symbol == \"300811.SZ\" ? (6) : (7)) : (8)) : ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") ? (symbol == \"002281.SZ\" ? (9) : (10)) : (11)))) : ((((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") || ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") || symbol == \"002654.SZ\")) ? (((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") ? ((symbol == \"600079.SH\" || symbol == \"600276.SH\") ? (symbol == \"600079.SH\" ? (12) : (13)) : (14)) : ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") ? (symbol == \"002169.SZ\" ? (15) : (16)) : (17))) : (((symbol == \"000999.SZ\" || symbol == \"601066.SH\") || symbol == \"603345.SH\") ? ((symbol == \"000999.SZ\" || symbol == \"601066.SH\") ? (symbol == \"000999.SZ\" ? (18) : (19)) : (20)) : ((symbol == \"000333.SZ\" || symbol == \"603726.SH\") ? (symbol == \"000333.SZ\" ? (21) : (22)) : (23))))) : 24, \"asc\")\n risk.index_exposure(max(0.0, 0.9000000000 - 0.0000 / max(total_equity, 1.0)))\n allocation.buy_scale((((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || symbol == \"300395.SZ\") || ((symbol == \"600732.SH\" || symbol == \"000063.SZ\") || symbol == \"002625.SZ\")) || (((symbol == \"300811.SZ\" || symbol == \"002851.SZ\") || symbol == \"000988.SZ\") || ((symbol == \"002281.SZ\" || symbol == \"300205.SZ\") || symbol == \"002239.SZ\"))) || ((((symbol == \"600079.SH\" || symbol == \"600276.SH\") || symbol == \"600909.SH\") || ((symbol == \"002169.SZ\" || symbol == \"603156.SH\") || symbol == \"002654.SZ\")) || (((symbol == \"000999.SZ\" || symbol == \"601066.SH\") || symbol == \"603345.SH\") || ((symbol == \"000333.SZ\" || symbol == \"603726.SH\") || symbol == \"688012.SH\")))) ? (((((symbol == \"688116.SH\" || symbol == \"603200.SH\") || (symbol == \"300395.SZ\" || symbol == \"600732.SH\")) || ((symbol == \"000063.SZ\" || symbol == \"002625.SZ\") || (symbol == \"300811.SZ\" || symbol == \"002851.SZ\"))) || (((symbol == \"000988.SZ\" || symbol == \"002281.SZ\") || (symbol == \"300205.SZ\" || symbol == \"002239.SZ\")) || ((symbol == \"600079.SH\" || symbol == \"600276.SH\") || (symbol == \"600909.SH\" || symbol == \"002169.SZ\")))) ? (1.0008000000) : (0.9984000000)) : 0.0)\n risk.stop_loss(holding_return <= -0.0800000000)\n risk.take_profit(holding_return >= 0.1600000000)\n risk.reference_price_mode(\"position_average_entry_price\")\n trading.daily_top_up(true)\n trading.daily_position_target_adjust(true)\n trading.target_portfolio_daily(true)\n trading.rebalance_existing_positions(true)\n trading.hold_until_exit(true)\n trading.retry_empty_rebalance(true)\n trading.release_slot_on_exit_signal(true)\n trading.redistribute_target_weights_after_exit(true)\n trading.reenter_exited_targets(true)\n execution.matching_type(\"current_bar_close\")\n}", + "strategyId": "许总_组合_backtest", + "universe": { + "exclude": [], + "implementationNotes": [ + "ST、停牌、退市、新股、科创、一元、涨跌停、同日卖出禁买、成交量和费用由 riskPolicy / RiskLimits 统一执行", + "上市日期与退市日期取自 instrument 结构化字段,不再使用股票名称做 ST/退市判断", + "盘中 current_price / last_price 由策略交易时刻批量 tick 查询驱动" + ], + "include": [ + "688116.SH", + "603200.SH", + "300395.SZ", + "600732.SH", + "000063.SZ", + "002625.SZ", + "300811.SZ", + "002851.SZ", + "000988.SZ", + "002281.SZ", + "300205.SZ", + "002239.SZ", + "600079.SH", + "600276.SH", + "600909.SH", + "002169.SZ", + "603156.SH", + "002654.SZ", + "000999.SZ", + "601066.SH", + "603345.SH", + "000333.SZ", + "603726.SH", + "688012.SH" + ] + }, + "version": "1.0.0", + "stockPoolFactorContract": { + "schemaVersion": 1, + "entryLogic": "all", + "exitLogic": "any", + "conditions": [ + { + "factorRef": "up_days_stock", + "label": "连涨天数", + "role": "selection", + "registryRole": "selection_feature", + "roleRegistrySha256": "1d0b307c168feda08d5fbe20f0e88964230553f8ceb2017b66aec48dbd5a5b57", + "roleEvidence": { + "role": "selection_feature", + "polarity": "trend_persistence_positive", + "signalShape": "state", + "holdingStates": [ + "flat" + ], + "requiredConfirmations": [], + "cooldownTradingDays": 0, + "windowTradingDays": 1, + "recommendedParameters": { + "inputUnit": "days", + "minimum": 0 + } + }, + "operator": ">=", + "threshold": 1, + "semantic": { + "ref": "up_days_stock", + "label": "连涨天数", + "status": "available", + "queryable": true, + "source": "strategy-factory-source-lake:indicator", + "schema": "strategy-factory.value-semantics/v1", + "valueType": "integer", + "semanticType": "count", + "comparisonGroup": "count", + "storageUnit": "days", + "inputUnit": "days", + "inputScale": 1.0, + "allowedOperators": [ + ">", + ">=", + "<", + "<=", + "==", + "!=", + "between", + "in" + ], + "nullable": true, + "declared": true, + "metadataStatus": "declared", + "semanticProvenance": "explicit_manifest", + "businessSemanticDeclared": true, + "minimum": 0, + "backtestBinding": { + "field": "ths_up_days_stock", + "sourceDataset": "indicators_up_days_stock" + }, + "tradingRoles": [ + { + "role": "selection_feature", + "polarity": "trend_persistence_positive", + "signalShape": "state", + "holdingStates": [ + "flat" + ], + "requiredConfirmations": [], + "cooldownTradingDays": 0, + "windowTradingDays": 1, + "recommendedParameters": { + "inputUnit": "days", + "minimum": 0 + } + } + ], + "tradingRoleTradable": true, + "tradingRoleEvidenceStatus": "source_lake_registered_indicator", + "tradingRoleRegistrySha256": "1d0b307c168feda08d5fbe20f0e88964230553f8ceb2017b66aec48dbd5a5b57" + } + } + ] + } + } +} diff --git a/docs/evidence/native-daily-factor-replays-20260907/native-pit-nextopen-20260907.json b/docs/evidence/native-daily-factor-replays-20260907/native-pit-nextopen-20260907.json new file mode 100644 index 0000000..5fbd2d8 --- /dev/null +++ b/docs/evidence/native-daily-factor-replays-20260907/native-pit-nextopen-20260907.json @@ -0,0 +1,276 @@ +{ + "schemaVersion": "fidc-backtest-benchmark/v5", + "label": "native-pit-nextopen", + "generatedAtUnixSeconds": 1788790370, + "requestSha256": "7948497bfa966eb118e56438e7c261869a26ab70a62186b92f761719f85e91c7", + "requestOrigin": { + "kind": "request_file" + }, + "baseline": null, + "baselineComparable": true, + "baselineComparison": null, + "bundleRefresh": null, + "baseUrl": "http://127.0.0.1:8081", + "runs": [ + { + "slot": 0, + "cacheClass": "restart_or_cold", + "runId": "btr_1788790344805_1150210_2", + "status": "succeeded", + "queueWaitSeconds": 0.0, + "executionSeconds": 21.61, + "totalSeconds": 21.61, + "runnerSeconds": 21.294, + "bundleValidationSeconds": 0.004, + "sourceEpochSeconds": 0.0, + "strategyContractSeconds": 0.003, + "terminalCalendarSeconds": 0.0, + "riskFreeRateSeconds": 0.017, + "riskFreeRateCacheHit": false, + "engineSeconds": 5.566, + "dataSeconds": 15.305, + "resultSeconds": 0.395, + "unattributedSeconds": 0.0, + "canonicalSeconds": 0.206, + "resultFinalization": { + "canonicalSeconds": 0.206, + "processEventStoreSeconds": 0.168, + "storePublishSeconds": 0.005, + "summarySeconds": 0.003 + }, + "dataPreparationTimings": { + "adjustmentValidationSeconds": 0.0, + "availableStockStDates": 0, + "benchmarkFetchSeconds": 0.023, + "candidatePlanBasePanelSeconds": 0.0, + "candidatePlanSelectionSeconds": 0.0, + "corporateActionSeconds": 0.017, + "datasetConstructSeconds": 2.943, + "externalFetchSeconds": 0.025, + "historyDateSeconds": 0.0, + "instrumentIndexBuildSeconds": 0.269, + "instrumentMetadataSeconds": 0.006, + "loopSeconds": 0.925, + "marketIndexBuildSeconds": 1.846, + "quotePlanSeconds": 0.0, + "riskSnapshotSeconds": 0.0, + "sourceQuerySeconds": 9.0, + "stockStLookupSeconds": 0.0, + "supplementalExecutionFetchSeconds": 0.0, + "totalSeconds": 15.3 + }, + "finalizationSeconds": 0.307, + "finalizationTimings": { + "artifactVerificationSeconds": 0.008, + "cacheRegistrationSeconds": 0.0, + "postgresClientAcquireSeconds": 0.0, + "postgresPersistSeconds": 0.299, + "preTerminalUpdateSeconds": 0.307, + "schemaCheckSeconds": 0.0, + "timingSource": "fidc-backtest-service-monotonic" + }, + "totalReturn": 0.9857987122635, + "tradeCount": 25408, + "riskDecisionCount": 113, + "resultStoreDigest": "1eab5a5ffe59efeaba6b2048a33760aab31d42efa0fc10e35a4a7048db853235", + "canonicalResultDigest": "b29b085d43bcc0f8f1712767421781c70570a24112933623d4bbbef46508d710", + "terminalAudit": { + "cashReceivableCount": 0, + "cashReceivableTotalAmount": 0.0, + "earliestDeferredCashDate": null, + "futuresOpenOrderCount": 0, + "lastExecutionDate": "2026-08-28", + "omittedOpenOrderCount": 0, + "openOrderSamples": [], + "pendingCashFlowCount": 0, + "pendingCashFlowNetAmount": 0.0, + "status": "clean", + "stockOpenOrderCount": 0 + }, + "terminalAuditVerified": true, + "terminalAuditSha256": "0e8503c2bfe9ecfd93bab3a95f79461830886eb693cfe6f477279908c0d95bd5", + "implementation": { + "buildManifestSha256": "fb4f7ac191c8ab8d8d39fc48014f84ce01d4c0731ffe986e7d5cb0107a3e5539", + "builtAt": "2026-09-07T22:06:18+08:00", + "engineCommit": "1b78186c4e37273c64c1f9e208c2e47021ee4fff", + "identitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "runnerBinarySha256": "7cddebf9ab5cbbd5d6f9bd5c7bf006c3895ee26967d23d80dc86b47c50fb761d", + "schemaVersion": "fidc-backtest-implementation/v1", + "serviceBinarySha256": "f09d121d73c34ad3cd5e2e0c24b0bdaf1974309c9ec3b93229cfb824b1e9f11a", + "serviceCommit": "c80a38b91a398fd713f1f1faaa19a581ea85efad", + "status": "verified" + }, + "implementationVerified": true, + "implementationIdentitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "artifactManifest": { + "canonicalResult": { + "algorithm": "sha256", + "ordering": "engine_fact_order_v2", + "schemaVersion": "fidc-canonical-backtest-result/v2", + "sections": { + "accountEvents": { + "rowCount": 25572, + "sha256": "da7576c1cbade9b48f1a154d07e870f1472924f4e0054cba0ef06739585ce380" + }, + "equityFacts": { + "rowCount": 1216, + "sha256": "13db0a6d484cdf871e4f1dc1a4bc8db1e809d2808b21cf4fcab3961e6ad9e6fe" + }, + "fillEvents": { + "rowCount": 25408, + "sha256": "92e0d103bbb487af45d27b720cdc92ef398d16e11655a6d0bcff8046013335db" + }, + "holdingSnapshots": { + "rowCount": 33164, + "sha256": "97e3d60230a167a960bd2f615adfa33a9171527b62f1a181e2d5af694090e492" + }, + "orderEvents": { + "rowCount": 25541, + "sha256": "635fe79eab9b1db0c116da2860ded66c350c051f44751d36306d158777039744" + }, + "riskAudits": { + "rowCount": 113, + "sha256": "17bc940bcac18b050235ae3f17195f12586d1e29cd7bc64b6189edf2e07d1406" + } + }, + "sha256": "b29b085d43bcc0f8f1712767421781c70570a24112933623d4bbbef46508d710", + "totalRows": 111014 + }, + "processEventStore": { + "bytes": 10115947, + "identitySha256": "e89d00ea1c2525c2ab1b57a29f2447047f2523083a953869ea2e25a488986565", + "manifestBytes": 9757, + "manifestSha256": "9bff5b97488c8804275ee65a717f01dca9ac68443b9766d4aab8d36189b1d8a1", + "schemaVersion": "fidc-backtest-process-event-manifest/v1", + "sections": { + "processEvents": { + "blockCount": 61, + "bytes": 10106190, + "rowCount": 83859, + "sha256": "f436a32403aaa74b3068a0d8c74bfb7c429523d3f78617234eec82a009ab3da2" + } + }, + "sha256": "aa7488614a85f1527713332039b0fa212d1807f11b03e0e701480bf5d8ede1a4", + "totalEvents": 83859 + }, + "resultStore": { + "bytes": 35831197, + "identitySha256": "a238986d82354e802d2c73526d035021b38e1eed0a2b0b0f1eb6ce41ed4f321b", + "manifestBytes": 54237, + "manifestSha256": "0991f096db161fd16da00a7529ece54a8cf68643d88aeec8f4d3fedc6c740d03", + "schemaVersion": "fidc-backtest-fact-manifest/v1", + "sections": { + "accountEvents": { + "blockCount": 61, + "bytes": 3303444, + "rowCount": 25572, + "sha256": "276fd3edd7e60afbb05fa32c111db3e1df2025637887509b6353b24c7f127a48" + }, + "equityFacts": { + "blockCount": 61, + "bytes": 3761920, + "rowCount": 1216, + "sha256": "42c22c70bad16b01d8f70fa80977028b2789381772e4eff7bb231701e18293a1" + }, + "fillEvents": { + "blockCount": 61, + "bytes": 7731746, + "rowCount": 25408, + "sha256": "c59a4a1e70195bd8a2421941e11b7fbb138d658796ef4d42466c44505b8353d8" + }, + "holdingSnapshots": { + "blockCount": 61, + "bytes": 15176388, + "rowCount": 33164, + "sha256": "6e40d3f1d43005dc4f0c492662c4fdf600ca96e9abe874db4b56b9bd51e89cd4" + }, + "orderEvents": { + "blockCount": 61, + "bytes": 5775840, + "rowCount": 25541, + "sha256": "14fa27db9328c4c6337157af4fc1efc1c4bc9f239a4605bf92439b0f3f426200" + }, + "riskAudits": { + "blockCount": 36, + "bytes": 27622, + "rowCount": 113, + "sha256": "2f6d9a01ec568ed13943b9590e21d73bf614ce2c777302764533d2da0168b2d5" + } + }, + "sha256": "1eab5a5ffe59efeaba6b2048a33760aab31d42efa0fc10e35a4a7048db853235", + "totalEvents": 111014 + }, + "schemaVersion": "fidc-backtest-artifacts/v4" + } + } + ], + "summary": { + "resultConsistent": true, + "resultStoreDigest": "1eab5a5ffe59efeaba6b2048a33760aab31d42efa0fc10e35a4a7048db853235", + "canonicalResultDigest": "b29b085d43bcc0f8f1712767421781c70570a24112933623d4bbbef46508d710", + "totalReturn": 0.9857987122635, + "tradeCount": 25408, + "terminalAudit": { + "cashReceivableCount": 0, + "cashReceivableTotalAmount": 0.0, + "earliestDeferredCashDate": null, + "futuresOpenOrderCount": 0, + "lastExecutionDate": "2026-08-28", + "omittedOpenOrderCount": 0, + "openOrderSamples": [], + "pendingCashFlowCount": 0, + "pendingCashFlowNetAmount": 0.0, + "status": "clean", + "stockOpenOrderCount": 0 + }, + "terminalAuditSha256": "0e8503c2bfe9ecfd93bab3a95f79461830886eb693cfe6f477279908c0d95bd5", + "implementation": { + "buildManifestSha256": "fb4f7ac191c8ab8d8d39fc48014f84ce01d4c0731ffe986e7d5cb0107a3e5539", + "builtAt": "2026-09-07T22:06:18+08:00", + "engineCommit": "1b78186c4e37273c64c1f9e208c2e47021ee4fff", + "identitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "runnerBinarySha256": "7cddebf9ab5cbbd5d6f9bd5c7bf006c3895ee26967d23d80dc86b47c50fb761d", + "schemaVersion": "fidc-backtest-implementation/v1", + "serviceBinarySha256": "f09d121d73c34ad3cd5e2e0c24b0bdaf1974309c9ec3b93229cfb824b1e9f11a", + "serviceCommit": "c80a38b91a398fd713f1f1faaa19a581ea85efad", + "status": "verified" + }, + "implementationIdentitySha256": "14e7ff10848d64ffcec232dea8cff23a032702301b81ae036bb0b26b4b0b5e33", + "restartOrCold": { + "queueWaitSeconds": 0.0, + "executionSeconds": 21.61, + "totalSeconds": 21.61, + "runnerSeconds": 21.294, + "bundleValidationSeconds": 0.004, + "sourceEpochSeconds": 0.0, + "strategyContractSeconds": 0.003, + "terminalCalendarSeconds": 0.0, + "riskFreeRateSeconds": 0.017, + "riskFreeRateCacheHit": false, + "engineSeconds": 5.566, + "dataSeconds": 15.305, + "resultSeconds": 0.395, + "unattributedSeconds": 0.0, + "canonicalSeconds": 0.206, + "finalizationSeconds": 0.307 + }, + "processHotMedian": { + "queueWaitSeconds": 0.0, + "executionSeconds": 21.61, + "totalSeconds": 21.61, + "runnerSeconds": 21.294, + "bundleValidationSeconds": 0.004, + "sourceEpochSeconds": 0.0, + "strategyContractSeconds": 0.003, + "terminalCalendarSeconds": 0.0, + "riskFreeRateSeconds": 0.017, + "riskFreeRateCacheHit": false, + "engineSeconds": 5.566, + "dataSeconds": 15.305, + "resultSeconds": 0.395, + "unattributedSeconds": 0.0, + "canonicalSeconds": 0.206, + "finalizationSeconds": 0.307 + } + } +} diff --git a/docs/evidence/native-daily-factor-replays-20260907/native-pit-nextopen-request-20260907.json b/docs/evidence/native-daily-factor-replays-20260907/native-pit-nextopen-request-20260907.json new file mode 100644 index 0000000..5034e40 --- /dev/null +++ b/docs/evidence/native-daily-factor-replays-20260907/native-pit-nextopen-request-20260907.json @@ -0,0 +1,424 @@ +{ + "strategy_id": "benchmark-native-factor-overlay", + "strategy_version_id": "goal-five-year-semantics-v1", + "user_id": "boris", + "runtime": { + "start_date": "2021-08-23", + "end_date": "2026-08-28", + "frequency": "1d", + "source_table": "strategy_factory_source_lake.daily_source_rows_v1", + "signal_symbol": "000852.SH", + "benchmark_symbol": "000852.SH", + "initial_cash": 10000000.0, + "backtestDataBundleId": "bt_bundle_b44e03990c76064f54a9", + "backtestDataBundleHash": "d7c1461131edaecb5981e207852782d92e636dbfee9fd7c44063605d96eb2b4f" + }, + "execution": { + "matchingType": "next_bar_open", + "rebalanceCashMode": "same_point_net", + "slippageModel": "price_ratio", + "slippageValue": 0.0001, + "commissionRate": 0.0001, + "minimumCommission": 5.0, + "stampTaxRateBeforeChange": 0.001, + "stampTaxRateAfterChange": 0.0005, + "stampTaxChangeDate": "2023-08-28", + "volumeLimit": true, + "liquidityLimit": false, + "volumePercent": 0.25, + "riskPolicy": { + "allowMarketOrders": true, + "blacklistEnabled": false, + "blacklistedSymbols": [], + "commissionRate": 0.0001, + "forbidSameDayRebuyAfterSell": true, + "liquidityLimitEnabled": false, + "liveTradingEnabled": false, + "minimumCommission": 5.0, + "rejectBjseBuy": false, + "rejectBjseSelection": false, + "rejectInactiveBuy": true, + "rejectInactiveSelection": false, + "rejectInactiveSell": true, + "rejectKcbBuy": true, + "rejectKcbSelection": false, + "rejectLowerLimitSelection": false, + "rejectLowerLimitSell": true, + "rejectNewListingBuy": true, + "rejectNewListingSelection": false, + "rejectOneYuanBuy": true, + "rejectOneYuanSelection": false, + "rejectPausedBuy": true, + "rejectPausedSelection": false, + "rejectPausedSell": true, + "rejectStBuy": true, + "rejectStSelection": false, + "rejectStarStBuy": true, + "rejectStarStSelection": false, + "rejectUpperLimitBuy": true, + "rejectUpperLimitSelection": false, + "respectAllowBuySell": true, + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "volumeLimitEnabled": true, + "volumePercent": 0.25 + } + }, + "strategy_source": { + "source_type": "platform-strategy", + "language": "engine-script", + "parser": "omniquant-engine-script-v2", + "source_code": "strategy(\"xiaoshizhi_1_06_dynamic_small_cap_csi2000_signal_day_exposure\") {\n market(\"CN_A\");\n benchmark(\"000300.SH\");\n signal(\"932000.CSI\");\n\n let stocknum = 30;\n let candidate_pool_size = 50;\n let position_denominator_extra = 1;\n let signal_close_t = rolling_mean_current(\"signal_close\", 1);\n let signal_ma10_t = rolling_mean_current(\"signal_close\", 10);\n let signal_ma30_t = rolling_mean_current(\"signal_close\", 30);\n let signal_vol20_t = rolling_return_stddev_current(\"signal_close\", 20);\n let signal_high60_t = rolling_max_current(\"signal_close\", 60);\n let signal_drawdown60_t = 1.0 - safe_div(signal_close_t, signal_high60_t);\n let signal_range_t = safe_div(clamp(signal_close_t, 2000.0, 3000.0) - 2000.0, 1000.0);\n let market_cap_lower_t = 12.0 + signal_range_t * 5.0;\n let market_cap_upper_t = 40.0 + signal_range_t * 5.0;\n let base_exposure_t = signal_ma10_t > signal_ma30_t ? 1.0 : 0.3;\n let volatility_exposure_t = signal_vol20_t >= 0.025 ? 0.3 : 1.0;\n let drawdown_exposure_t = signal_drawdown60_t >= 0.08 ? 0.2 : 1.0;\n let final_exposure_t =\n signal_close_t > 0.0 &&\n signal_ma10_t > 0.0 &&\n signal_ma30_t > 0.0 &&\n signal_high60_t > 0.0\n ? min(min(base_exposure_t, volatility_exposure_t), drawdown_exposure_t)\n : 0.0;\n\n rebalance.every_days(1).at([\"15:00\"]);\n\n selection.market_cap_band(\n field=\"market_cap\",\n lower=market_cap_lower_t,\n upper=market_cap_upper_t\n );\n\n filter.stock_expr(((!is_star_st && !is_kcb && !is_bjse && rolling_mean_current(\"close\", 5) > rolling_mean_current(\"close\", 10) && rolling_mean_current(\"close\", 10) > rolling_mean_current(\"close\", 30) && rolling_mean_current(\"volume\", 5) < rolling_mean_current(\"volume\", 100)) && (!is_st))) && (ths_up_days_stock >= 1);\n\n ordering.rank_by(\"market_cap\", \"asc\");\n selection.candidate_limit(50);\n selection.limit(stocknum);\n\n allocation.buy_scale(30.0 / 31.0);\n execution.strict_value_budget(true)\n\n trading.hold_until_exit(true);\n trading.max_holding_days(90);\n trading.daily_top_up(true);\n trading.daily_position_target_adjust(true);\n trading.target_portfolio_daily(true);\n trading.rebalance_existing_positions(true);\n trading.retry_empty_rebalance(true);\n trading.release_slot_on_exit_signal(true);\n\n risk.stop_loss(0.08);\n risk.take_profit(0.16);\n risk.reference_price_mode(\"signal_day_post_adjusted_close\");\n risk.index_exposure(final_exposure_t);\n\n risk.policy(reject_st_selection=false, reject_st_buy=true, reject_star_st_selection=false, reject_star_st_buy=true, reject_paused_selection=false, reject_paused_buy=true, reject_paused_sell=true, reject_inactive_selection=false, reject_inactive_buy=true, reject_inactive_sell=true, reject_new_listing_selection=false, reject_new_listing_buy=true, reject_kcb_selection=false, reject_kcb_buy=true, reject_bjse_selection=false, reject_bjse_buy=false, reject_one_yuan_selection=false, reject_one_yuan_buy=true, respect_allow_buy_sell=true, reject_upper_limit_selection=false, reject_lower_limit_selection=false, reject_upper_limit_buy=true, reject_lower_limit_sell=true, forbid_same_day_rebuy_after_sell=true, blacklist_enabled=false, blacklisted_symbols=[], allow_market_orders=true, live_trading_enabled=false, volume_limit_enabled=true, liquidity_limit_enabled=false, volume_percent=0.25, commission_rate=0.0001, minimum_commission=5.0, stamp_tax_rate_before_change=0.001, stamp_tax_rate_after_change=0.0005, stamp_tax_change_date=\"2023-08-28\");\n\n execution.matching_type(\"next_bar_open\");\n execution.slippage(\"price_ratio\", 0.0001);\n execution.rebalance_cash_mode(\"same_point_net\");\n}" + }, + "strategy_spec": { + "benchmark": { + "fallbackInstrumentId": "000852.SH", + "instrumentId": "000852.SH" + }, + "engineConfig": { + "benchmarkSymbol": "000852.SH", + "commissionRate": 0.0001, + "dividendReinvestment": false, + "dynamicRange": { + "baseCapFloor": 7, + "baseIndexLevel": 2000, + "capSpan": 10, + "xs": 0.008 + }, + "frequency": "1d", + "indexThrottle": { + "defensiveExposure": 0.5, + "fullExposure": 1, + "longDays": 130, + "rsiRate": 1.0001, + "shortDays": 1 + }, + "liquidityLimit": false, + "matchingType": "next_bar_open", + "minimumCommission": 5.0, + "rankLimit": 30, + "rebalanceCashMode": "same_point_net", + "rebalanceSchedule": { + "frequency": "daily", + "time": "15:00" + }, + "refreshRate": 1, + "riskPolicy": { + "allowMarketOrders": true, + "blacklistEnabled": false, + "blacklistedSymbols": [], + "commissionRate": 0.0001, + "forbidSameDayRebuyAfterSell": true, + "liquidityLimitEnabled": false, + "liveTradingEnabled": false, + "minimumCommission": 5.0, + "rejectBjseBuy": false, + "rejectBjseSelection": false, + "rejectInactiveBuy": true, + "rejectInactiveSelection": false, + "rejectInactiveSell": true, + "rejectKcbBuy": true, + "rejectKcbSelection": false, + "rejectLowerLimitSelection": false, + "rejectLowerLimitSell": true, + "rejectNewListingBuy": true, + "rejectNewListingSelection": false, + "rejectOneYuanBuy": true, + "rejectOneYuanSelection": false, + "rejectPausedBuy": true, + "rejectPausedSelection": false, + "rejectPausedSell": true, + "rejectStBuy": true, + "rejectStSelection": false, + "rejectStarStBuy": true, + "rejectStarStSelection": false, + "rejectUpperLimitBuy": true, + "rejectUpperLimitSelection": false, + "respectAllowBuySell": true, + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "volumeLimitEnabled": true, + "volumePercent": 0.25 + }, + "rsiRate": 1.0001, + "signalSymbol": "000852.SH", + "skipWindows": [], + "slippageModel": "price_ratio", + "slippageValue": 0.0001, + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "stockMaFilter": { + "longDays": 30, + "midDays": 10, + "rsiRate": 1.0001, + "shortDays": 5, + "volumeLongDays": 100, + "volumeShortDays": 5 + }, + "stopLossMultiplier": 0.08, + "strictValueBudget": true, + "takeProfitMultiplier": 0.16, + "templateId": "xiaoshizhi_1_06_dynamic_small_cap_csi2000_signal_day_exposure", + "volumeLimit": true, + "volumePercent": 0.25 + }, + "execution": { + "commissionRate": 0.0001, + "executionGranularity": "daily_or_minute_bar", + "extractor": "omniquant-engine-script-v2", + "frequency": "1d", + "liquidityLimit": false, + "matchingType": "next_bar_open", + "minimumCommission": 5.0, + "priceSource": "current_bar_close_or_next_bar_open_or_minute_bar", + "rebalanceCashMode": "same_point_net", + "riskPolicy": { + "allowMarketOrders": true, + "blacklistEnabled": false, + "blacklistedSymbols": [], + "commissionRate": 0.0001, + "forbidSameDayRebuyAfterSell": true, + "liquidityLimitEnabled": false, + "liveTradingEnabled": false, + "minimumCommission": 5.0, + "rejectBjseBuy": false, + "rejectBjseSelection": false, + "rejectInactiveBuy": true, + "rejectInactiveSelection": false, + "rejectInactiveSell": true, + "rejectKcbBuy": true, + "rejectKcbSelection": false, + "rejectLowerLimitSelection": false, + "rejectLowerLimitSell": true, + "rejectNewListingBuy": true, + "rejectNewListingSelection": false, + "rejectOneYuanBuy": true, + "rejectOneYuanSelection": false, + "rejectPausedBuy": true, + "rejectPausedSelection": false, + "rejectPausedSell": true, + "rejectStBuy": true, + "rejectStSelection": false, + "rejectStarStBuy": true, + "rejectStarStSelection": false, + "rejectUpperLimitBuy": true, + "rejectUpperLimitSelection": false, + "respectAllowBuySell": true, + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "volumeLimitEnabled": true, + "volumePercent": 0.25 + }, + "selectionGranularity": "strategy_factory_source_lake.daily_source_rows_v1", + "slippageModel": "price_ratio", + "slippageValue": 0.0001, + "sourceKind": "platform-strategy", + "sourceLanguage": "engine-script", + "stampTaxChangeDate": "2023-08-28", + "stampTaxRateAfterChange": 0.0005, + "stampTaxRateBeforeChange": 0.001, + "strictValueBudget": true, + "volumeLimit": true, + "volumePercent": 0.25 + }, + "factorRefs": [ + "market_cap", + "ths_up_days_stock" + ], + "market": "CN_A", + "metadata": { + "backtestDataBundle": { + "sourceTable": "strategy_factory_source_lake.daily_source_rows_v1", + "backtestDataBundleId": "bt_bundle_b44e03990c76064f54a9", + "backtestDataBundleHash": "d7c1461131edaecb5981e207852782d92e636dbfee9fd7c44063605d96eb2b4f" + }, + "backtestDataBundleHash": "d7c1461131edaecb5981e207852782d92e636dbfee9fd7c44063605d96eb2b4f", + "backtestDataBundleId": "bt_bundle_b44e03990c76064f54a9", + "sourceTable": "strategy_factory_source_lake.daily_source_rows_v1" + }, + "rebalance": { + "dailyApproximation": "日线回测按 matching_type 撮合;分钟线回测按交易时刻分钟价格撮合", + "frequencyDays": 1, + "schedule": { + "frequency": "daily", + "time": "15:00" + }, + "tradeTimes": [ + "15:00" + ] + }, + "risk": { + "indexThrottleExpr": "final_exposure_t", + "stopLossExpr": "0.08", + "stopTakeReferencePriceMode": "signal_day_post_adjusted_close", + "takeProfitExpr": "0.16" + }, + "runtimeExpressions": { + "allocation": { + "buyScaleExpr": "30.0 / 31.0" + }, + "ordering": { + "rankBy": "market_cap", + "rankExpr": "", + "rankOrder": "asc" + }, + "prelude": "let stocknum = 30;\nlet candidate_pool_size = 50;\nlet position_denominator_extra = 1;\nlet signal_close_t = rolling_mean_current(\"signal_close\", 1);\nlet signal_ma10_t = rolling_mean_current(\"signal_close\", 10);\nlet signal_ma30_t = rolling_mean_current(\"signal_close\", 30);\nlet signal_vol20_t = rolling_return_stddev_current(\"signal_close\", 20);\nlet signal_high60_t = rolling_max_current(\"signal_close\", 60);\nlet signal_drawdown60_t = 1.0 - safe_div(signal_close_t, signal_high60_t);\nlet signal_range_t = safe_div(clamp(signal_close_t, 2000.0, 3000.0) - 2000.0, 1000.0);\nlet market_cap_lower_t = 12.0 + signal_range_t * 5.0;\nlet market_cap_upper_t = 40.0 + signal_range_t * 5.0;\nlet base_exposure_t = signal_ma10_t > signal_ma30_t ? 1.0 : 0.3;\nlet volatility_exposure_t = signal_vol20_t >= 0.025 ? 0.3 : 1.0;\nlet drawdown_exposure_t = signal_drawdown60_t >= 0.08 ? 0.2 : 1.0;\nlet final_exposure_t = signal_close_t > 0.0 && signal_ma10_t > 0.0 && signal_ma30_t > 0.0 && signal_high60_t > 0.0 ? min(min(base_exposure_t, volatility_exposure_t), drawdown_exposure_t) : 0.0;\nlet warmup_probe = rolling_sum(\"amount\", 125);", + "risk": { + "exposureExpr": "final_exposure_t", + "stopLossExpr": "0.08", + "stopTakeReferencePriceMode": "signal_day_post_adjusted_close", + "takeProfitExpr": "0.16" + }, + "schedule": { + "frequency": "daily", + "time": "15:00" + }, + "selection": { + "candidateLimitExpr": "50", + "limitExpr": "stocknum", + "marketCapField": "market_cap", + "marketCapLowerExpr": "market_cap_lower_t", + "marketCapUpperExpr": "market_cap_upper_t", + "stockFilterExpr": "(((!is_star_st && !is_kcb && !is_bjse && rolling_mean_current(\"close\", 5) > rolling_mean_current(\"close\", 10) && rolling_mean_current(\"close\", 10) > rolling_mean_current(\"close\", 30) && rolling_mean_current(\"volume\", 5) < rolling_mean_current(\"volume\", 100)) && (!is_st))) && (ths_up_days_stock >= 1)" + }, + "trading": { + "actions": [], + "dailyPositionTargetAdjust": true, + "dailyTopUp": true, + "holdUntilExit": true, + "maxHoldingDays": 90, + "rebalanceExistingPositions": true, + "releaseSlotOnExitSignal": true, + "retryEmptyRebalance": true, + "rotationEnabled": true, + "stage": "on_day", + "subscriptionGuardRequired": false, + "targetPortfolioDaily": true + } + }, + "seasonality": { + "skipWindows": [] + }, + "selectors": [ + { + "field": "market_cap", + "lowerExpr": "market_cap_lower_t", + "mapping": "market_cap -> strategy_factory_source_lake.runtime_fields.market_cap", + "type": "dynamicRange", + "upperExpr": "market_cap_upper_t" + }, + { + "expr": "(((!is_star_st && !is_kcb && !is_bjse && rolling_mean_current(\"close\", 5) > rolling_mean_current(\"close\", 10) && rolling_mean_current(\"close\", 10) > rolling_mean_current(\"close\", 30) && rolling_mean_current(\"volume\", 5) < rolling_mean_current(\"volume\", 100)) && (!is_st))) && (ths_up_days_stock >= 1)", + "type": "filter" + }, + { + "limitExpr": "stocknum", + "orderBy": [ + "market_cap asc" + ], + "type": "rank" + } + ], + "signalSymbol": "000852.SH", + "sourceCode": "strategy(\"xiaoshizhi_1_06_dynamic_small_cap_csi2000_signal_day_exposure\") {\n market(\"CN_A\");\n benchmark(\"000300.SH\");\n signal(\"932000.CSI\");\n\n let stocknum = 30;\n let candidate_pool_size = 50;\n let position_denominator_extra = 1;\n let signal_close_t = rolling_mean_current(\"signal_close\", 1);\n let signal_ma10_t = rolling_mean_current(\"signal_close\", 10);\n let signal_ma30_t = rolling_mean_current(\"signal_close\", 30);\n let signal_vol20_t = rolling_return_stddev_current(\"signal_close\", 20);\n let signal_high60_t = rolling_max_current(\"signal_close\", 60);\n let signal_drawdown60_t = 1.0 - safe_div(signal_close_t, signal_high60_t);\n let signal_range_t = safe_div(clamp(signal_close_t, 2000.0, 3000.0) - 2000.0, 1000.0);\n let market_cap_lower_t = 12.0 + signal_range_t * 5.0;\n let market_cap_upper_t = 40.0 + signal_range_t * 5.0;\n let base_exposure_t = signal_ma10_t > signal_ma30_t ? 1.0 : 0.3;\n let volatility_exposure_t = signal_vol20_t >= 0.025 ? 0.3 : 1.0;\n let drawdown_exposure_t = signal_drawdown60_t >= 0.08 ? 0.2 : 1.0;\n let final_exposure_t =\n signal_close_t > 0.0 &&\n signal_ma10_t > 0.0 &&\n signal_ma30_t > 0.0 &&\n signal_high60_t > 0.0\n ? min(min(base_exposure_t, volatility_exposure_t), drawdown_exposure_t)\n : 0.0;\n\n rebalance.every_days(1).at([\"15:00\"]);\n\n selection.market_cap_band(\n field=\"market_cap\",\n lower=market_cap_lower_t,\n upper=market_cap_upper_t\n );\n\n filter.stock_expr(((!is_star_st && !is_kcb && !is_bjse && rolling_mean_current(\"close\", 5) > rolling_mean_current(\"close\", 10) && rolling_mean_current(\"close\", 10) > rolling_mean_current(\"close\", 30) && rolling_mean_current(\"volume\", 5) < rolling_mean_current(\"volume\", 100)) && (!is_st))) && (ths_up_days_stock >= 1);\n\n ordering.rank_by(\"market_cap\", \"asc\");\n selection.candidate_limit(50);\n selection.limit(stocknum);\n\n allocation.buy_scale(30.0 / 31.0);\n execution.strict_value_budget(true)\n\n trading.hold_until_exit(true);\n trading.max_holding_days(90);\n trading.daily_top_up(true);\n trading.daily_position_target_adjust(true);\n trading.target_portfolio_daily(true);\n trading.rebalance_existing_positions(true);\n trading.retry_empty_rebalance(true);\n trading.release_slot_on_exit_signal(true);\n\n risk.stop_loss(0.08);\n risk.take_profit(0.16);\n risk.reference_price_mode(\"signal_day_post_adjusted_close\");\n risk.index_exposure(final_exposure_t);\n\n risk.policy(reject_st_selection=false, reject_st_buy=true, reject_star_st_selection=false, reject_star_st_buy=true, reject_paused_selection=false, reject_paused_buy=true, reject_paused_sell=true, reject_inactive_selection=false, reject_inactive_buy=true, reject_inactive_sell=true, reject_new_listing_selection=false, reject_new_listing_buy=true, reject_kcb_selection=false, reject_kcb_buy=true, reject_bjse_selection=false, reject_bjse_buy=false, reject_one_yuan_selection=false, reject_one_yuan_buy=true, respect_allow_buy_sell=true, reject_upper_limit_selection=false, reject_lower_limit_selection=false, reject_upper_limit_buy=true, reject_lower_limit_sell=true, forbid_same_day_rebuy_after_sell=true, blacklist_enabled=false, blacklisted_symbols=[], allow_market_orders=true, live_trading_enabled=false, volume_limit_enabled=true, liquidity_limit_enabled=false, volume_percent=0.25, commission_rate=0.0001, minimum_commission=5.0, stamp_tax_rate_before_change=0.001, stamp_tax_rate_after_change=0.0005, stamp_tax_change_date=\"2023-08-28\");\n\n execution.matching_type(\"next_bar_open\");\n execution.slippage(\"price_ratio\", 0.0001);\n execution.rebalance_cash_mode(\"same_point_net\");\n}", + "strategyId": "warmup-expression-contract-acceptance", + "universe": { + "exclude": [], + "implementationNotes": [ + "ST、停牌、退市、新股、科创、一元、涨跌停、同日卖出禁买、成交量和费用由 riskPolicy / RiskLimits 统一执行", + "上市日期与退市日期取自 instrument 结构化字段,不再使用股票名称做 ST/退市判断", + "盘中 current_price / last_price 由策略交易时刻批量 tick 查询驱动" + ] + }, + "version": "1.0.0", + "stockPoolFactorContract": { + "schemaVersion": 1, + "entryLogic": "all", + "exitLogic": "any", + "conditions": [ + { + "factorRef": "up_days_stock", + "label": "连涨天数", + "role": "selection", + "registryRole": "selection_feature", + "roleRegistrySha256": "1d0b307c168feda08d5fbe20f0e88964230553f8ceb2017b66aec48dbd5a5b57", + "roleEvidence": { + "role": "selection_feature", + "polarity": "trend_persistence_positive", + "signalShape": "state", + "holdingStates": [ + "flat" + ], + "requiredConfirmations": [], + "cooldownTradingDays": 0, + "windowTradingDays": 1, + "recommendedParameters": { + "inputUnit": "days", + "minimum": 0 + } + }, + "operator": ">=", + "threshold": 1, + "semantic": { + "ref": "up_days_stock", + "label": "连涨天数", + "status": "available", + "queryable": true, + "source": "strategy-factory-source-lake:indicator", + "schema": "strategy-factory.value-semantics/v1", + "valueType": "integer", + "semanticType": "count", + "comparisonGroup": "count", + "storageUnit": "days", + "inputUnit": "days", + "inputScale": 1.0, + "allowedOperators": [ + ">", + ">=", + "<", + "<=", + "==", + "!=", + "between", + "in" + ], + "nullable": true, + "declared": true, + "metadataStatus": "declared", + "semanticProvenance": "explicit_manifest", + "businessSemanticDeclared": true, + "minimum": 0, + "backtestBinding": { + "field": "ths_up_days_stock", + "sourceDataset": "indicators_up_days_stock" + }, + "tradingRoles": [ + { + "role": "selection_feature", + "polarity": "trend_persistence_positive", + "signalShape": "state", + "holdingStates": [ + "flat" + ], + "requiredConfirmations": [], + "cooldownTradingDays": 0, + "windowTradingDays": 1, + "recommendedParameters": { + "inputUnit": "days", + "minimum": 0 + } + } + ], + "tradingRoleTradable": true, + "tradingRoleEvidenceStatus": "source_lake_registered_indicator", + "tradingRoleRegistrySha256": "1d0b307c168feda08d5fbe20f0e88964230553f8ceb2017b66aec48dbd5a5b57" + } + } + ] + } + } +} diff --git a/docs/evidence/native-daily-factor-visibility-20260907.json b/docs/evidence/native-daily-factor-visibility-20260907.json index d5e6b44..904b803 100644 --- a/docs/evidence/native-daily-factor-visibility-20260907.json +++ b/docs/evidence/native-daily-factor-visibility-20260907.json @@ -16,11 +16,42 @@ "stock state with prior value 2 and current value 999 reads 2 intraday and 999 at close", "unbound factor value remains unchanged" ], - "productionDeployed": false, + "backtestServiceDeployed": true, + "paperLiveRuntimeDeployed": false, "realBacktestAcceptanceComplete": false, + "scopedBacktestEvidence": { + "intraday": { + "range": "2025-09-08..2025-09-12", + "time": "09:30", + "runIds": ["btr_1788790021780_1150210_0", "btr_1788790036494_1150210_1"], + "seconds": [8.994, 0.596], + "tradeCount": 104, + "riskDecisionCount": 11, + "canonical": "5c8a110cc6f285b9d569e818a0472a8b5c76f14df853a1c2c42d1b5222c39b3a", + "identical": true, + "persistedFactorBindingVerified": true, + "rawParquetAudit": { + "buyFills": 60, + "priorPassCurrentFailExamples": 21, + "existingPositionTopUpsBelowCurrentSelectionThreshold": 23, + "retainedTargetReentryBelowCurrentSelectionThreshold": {"symbol": "600276.SH", "date": "2025-09-12", "priorExit": "2025-09-11 stop_loss_exit", "configuration": "reenterExitedTargets=true", "reason": "model_target_portfolio_daily"}, + "note": "Selection-only conditions are not an execution-time buy veto. Position adjustment and explicit retained-target reentry must be audited separately from fresh candidate selection." + } + }, + "nextOpen": { + "range": "2021-08-23..2026-08-28", + "runId": "btr_1788790344805_1150210_2", + "seconds": 21.610, + "tradeCount": 25408, + "canonical": "b29b085d43bcc0f8f1712767421781c70570a24112933623d4bbbef46508d710", + "matchesPreFixBaseline": true + }, + "terminalAudits": "clean", + "rawEvidenceDirectory": "native-daily-factor-replays-20260907" + }, "limitations": [ "This is not a generic per-field publication-timestamp model for all factor datasets.", "Raw dynamic fields used without a stock-pool native binding need separate availability-contract review.", - "Saved-version browser handoff and real same-sample intraday/next-open replay are still required." + "Saved-version browser handoff, all runtime deployment and broader factor/PIT acceptance remain required; these replays use isolated API research fixtures." ] }