FAkka.Mathnet.Symbolic.Backtest.Core
10.1.302-win2
dotnet add package FAkka.Mathnet.Symbolic.Backtest.Core --version 10.1.302-win2
NuGet\Install-Package FAkka.Mathnet.Symbolic.Backtest.Core -Version 10.1.302-win2
<PackageReference Include="FAkka.Mathnet.Symbolic.Backtest.Core" Version="10.1.302-win2" />
<PackageVersion Include="FAkka.Mathnet.Symbolic.Backtest.Core" Version="10.1.302-win2" />
<PackageReference Include="FAkka.Mathnet.Symbolic.Backtest.Core" />
paket add FAkka.Mathnet.Symbolic.Backtest.Core --version 10.1.302-win2
#r "nuget: FAkka.Mathnet.Symbolic.Backtest.Core, 10.1.302-win2"
#:package FAkka.Mathnet.Symbolic.Backtest.Core@10.1.302-win2
#addin nuget:?package=FAkka.Mathnet.Symbolic.Backtest.Core&version=10.1.302-win2&prerelease
#tool nuget:?package=FAkka.Mathnet.Symbolic.Backtest.Core&version=10.1.302-win2&prerelease
coldfar-symbolics
coldfar-symbolics 的目標是實作一套 可 lambda compile 的完備圖靈機策略語言與回測工具套件。
目前面貌: 一套以F#/.NET 10實作、API與package皆屬experimental、具可執行Formula/StrategyModule/Series/FSSTL structured-query/Backtest first slices的開發中SDK;目前release candidate為10.1.302-win2,公開可用性必須以NuGet V3 metadata與乾淨consumer restore為準,即使可取得仍是experimental preview而非GA。
本 repo 目前仍承接 Math.NET Symbolics fork、Excel formula DSL、技術分析原型與回測實驗等歷史內容;現行產品化主線已收斂為:
Excel 語法相容的 Formula AST。
Evaluate / Compile parity:正式語言功能不能只 runtime evaluate,也要能 compile。
IF/LET/LAMBDA的正式語義:lazy branch、lexical scope、first-class function、bounded recursion。.NET method invocation lowering:一般函數以
Expression.Call(MethodInfo, args)編譯。Legacy operator migration:runtime dispatch bridge 只保留相容證據;產品 compile 目標是 direct
MethodInfo、typed kernel 或 Proc IR,RuntimeEvaluate*call count 必須歸零。Strategy/backtesting extension:策略描述與編譯留在 SymbolicNet6;事件執行、訂單、成交、倉位與績效放在獨立 Backtest Engine。
Canonical data source:
SOURCE建立 IO-free descriptor,由 host preload 成具 fingerprint 的MarketFrame/MarketSeries,再以typed availability與single/multi-source aliases綁入compiled plan。Result publication gate:external Turtle result需以typed lineage回鏈profile、resolution、attestation、replay與deterministic result digest;
ReadyForPublication不是資料來源或獲利背書。Result transport document:ready process envelope可編為16 MiB上限的strict deterministic JSON,完整傳輸order/fill/trigger/statistics result與lineage identity;decoder不補造省略的Host evidence。
Result artifact composition:deterministic manifest把document、publication、result、run/profile/resolution與payload綁為單一identity;actor-neutral async port支援put-if-absent與revalidated lookup,bounded memory adapter只作reference implementation。
Artifact reference wire:strict 64 KiB四欄document只攜artifact fingerprint、run與publication routing hints;consumer載入後仍以stored manifest重新驗證,不在message傳完整result。
Raw-byte ingress:
resolveAsync先strict decode reference bytes,通過後才呼叫artifact store;Akka consumer可使用built-inByteArraySerializer,Host不引入Actor/Immutable package。
Current Docs
Canonical planning and engineering documents are under doc/:
doc/SA.md- system analysisdoc/SD.md- system designdoc/WBS.md- work breakdowndoc/Test.md- test matrixdoc/PLANNING.md- larger cleanup/productization plandoc/RFC/- RFC recordsdoc/DevLog.md- append-only development logdoc/LanguageDeveloperSDK.md- language/compiler/extension developer guidedoc/User_Manual.md- formula、indicator、strategy 與 data source 使用手冊doc/MNSymLang_in_Action.md- 面向策略作者的18章漸進式教材與完整案例doc/ReleasePlan.md- local readiness、NuGet.org publication與post-publish gatedoc_new/api/- build-generated language API manifest/OpenAPI projectionBacktestEngine/doc/- separate backtest Requirement/SA/SD/WBS/Test chainBacktestEngine/SymbolicNet6.Backtest.Core/- template validation and deterministic event-ordering first sliceSymbolicNet6.Test/- 唯一 Expecto test executable,含 language、legacy regression、strategy 與 backtest acceptance tests
Legacy upstream Math.NET docs and old agent/tool notes have been archived under doc/20260709/.
Package Quickstart
Current release-candidate line is 10.1.302-win2 and targets net10.0 / .NET 10. Availability contract:只有official NuGet V3 metadata列出exact version且乾淨consumer restore成功,才可視為公開可取得;在此之前下列命令只適用於已包含current four-package line的Local/private feed。即使公開可取得,本release line仍是experimental preview,不是GA承諾。
先按使用情境選top-level package;不要把四包全部列為 top-level dependency:
| 使用情境 | Top-level package | 說明 |
|---|---|---|
| 使用 Formula / StrategyModule與TorchSharp tensor public shape | FAkka.Mathnet.Symbolic |
核心AST、ProductLanguage、ProductCompiler、Series plan與官方managed TorchSharp 0.107.0 API |
| 需要TorchSharp physical backend contract | FAkka.Mathnet.Symbolic.Tensor.TorchSharp |
optional extension;transitive依賴Symbolic core;native libtorch由Host/deployment選擇 |
| 只使用 order/fill/result pure kernels | FAkka.Mathnet.Symbolic.Backtest.Core |
transitive依賴Symbolic core,不含Host lifecycle |
| 需要完整 bounded lifecycle / durability | FAkka.Mathnet.Symbolic.Backtest.Host |
transitive依賴Backtest Core與Symbolic core |
以下四條是package identity參考,不代表同一consumer應全部執行:
dotnet add package FAkka.Mathnet.Symbolic --version 10.1.302-win2
dotnet add package FAkka.Mathnet.Symbolic.Tensor.TorchSharp --version 10.1.302-win2
dotnet add package FAkka.Mathnet.Symbolic.Backtest.Core --version 10.1.302-win2
dotnet add package FAkka.Mathnet.Symbolic.Backtest.Host --version 10.1.302-win2
Formula compile path:
open MathNet.Symbolics
let artifact = ProductCompiler.compileTypedLambdaArtifactOrThrow "LAMBDA(x,x+1)"
match artifact.Invoke.Invoke [| Value.Approximation(Approximation.Real 41.0) |] with
| Value.Approximation(Approximation.Real 42.0) -> printfn "formula=42"
| value -> failwithf "Unexpected result: %A" value
Backtest result query compile path:
open MathNet.Symbolics
open MathNet.Symbolics.Backtest
let expression = ProductLanguage.Parser.parseExpressionOrThrow "COUNT(ORDERS(RESULT))"
let query = BacktestResultScalarQueryCompiler.compileExpressionOrThrow expression
printfn "%s" query.Lambda.Body.ToString()
Actor-neutral Host lifecycle begins with BacktestRunGateway.create policy; it does not create an ActorSystem or load strategy/data implicitly. Core與Tensor extension只引用官方managed TorchSharp 0.107.0;native libtorch provider、device與deployment由Host/deployment明示選擇。TensorSeriesBackend.create()只建立compile/API descriptor contract,不代表 native tensor runtime 已可執行。
Formal Turtle profile APIs include TurtleProductProfileAdmission、TurtleCapitalAdjustment、TurtleUnitExposure、TurtleSessionExecution、TurtlePhysicalContractSeries、TurtleExternalEvidenceResolver.resolve、TurtleHostExecutionAttestation.attest and TurtleStrategyModulePhysicalRoll.apply。它們分別驗證metadata evidence、20/10 capital、4/6/10/12 exposure、completed sessions、physical contract/roll evidence、explicit external resolution、deterministic Host attestation與StrategyModule atomic physical-roll ownership。Resolved evidence仍不具performance資格;只有matching run-owned typed attestation才可提升PerformanceEligible,production Turtle result不能由local fixture冒充。
| Package | Depends on | Intended surface | Stability |
|---|---|---|---|
FAkka.Mathnet.Symbolic |
no first-party package | Formula/ProductLanguage/StrategyModule | experimental |
FAkka.Mathnet.Symbolic.Tensor.TorchSharp |
Symbolic core、official managed TorchSharp 0.107.0 | optional TorchSharp physical Series backend contract;native provider由Host/deployment負責 | experimental |
FAkka.Mathnet.Symbolic.Backtest.Core |
Symbolic core | typed result and pure execution kernels | experimental |
FAkka.Mathnet.Symbolic.Backtest.Host |
Backtest Core | durable/application orchestration | experimental |
The package verifier uses four independent package-only F# consumers, exact top-level versions, isolated caches, and restore/build/run watchdogs. It does not publish packages, write nuget.config, or treat ProjectReference builds as install evidence.
dotnet fsi misc/verifyCommunityPackageReadiness.fsx
完整public release gate見doc/ReleasePlan.md。本機4/4 package consumer通過只代表package graph可用,不代表NuGet.org已公開、已簽章或已完成外部clean install。
Source Demo Quickstart
不需市場資料即可先執行語言/compile walkthrough:
dotnet run --project SymbolicNet6.Demo/SymbolicNet6.Demo.fsproj -- --command language
需要 YM 資料的feature/backtest workflows再傳入--data與明確--timestamp-offset;Demo不會替使用者下載、猜測session calendar或把固定offset冒充exchange timezone。完整command清單見SymbolicNet6.Demo/README.md。
Build
Current minimum smoke:
dotnet --version
dotnet build SymbolicNet6.slnx -v minimal
dotnet fsi --exec check.fsx -- --repo . --log-dir log --op-log-dir log --notes-dir notes --sa doc_new/SA.md --sd doc_new/SD.md --wbs doc_new/WBS.md --test doc_new/Test.md --devlog doc_new/DevLog.md --policy doc/Policy.md --action doc/Action.md --km MCP.KM.md --planning doc/PLANNING.md --rfc-dir doc_new/RFC --staging-content doc_new/StagingContent.md
SymbolicNet6.slnx是canonical solution entry,包含repo內全部九個active F#/C# projects;SymbolicNet6.sln保留舊Visual Studio與工具相容,兩者project set相同。The solution targets .NET 10. Immutable Formula/Series target composition、direct MethodInfo compile、typed top-level LAMBDA artifacts、extension-driven Array/Streaming plans、compiled pure ProcKernel、canonical MarketSeries/template binding、logical Series/rank/as-of/order contracts、decimal Power、Series-valued lexical LET、bounded Host、portfolio與typed replay/store已有可執行first slices。Current work與blockers以doc_new/WBS.md及doc_new/Test.md為準。
YM Series Feature Demo
以下命令把YM CSV載入canonical MarketFrame,將SMA(CLOSE,2)以Host-owned Series plan綁入declarative StrategyModule,並在下一根bar完成market order撮合:
dotnet run --project SymbolicNet6.Demo/SymbolicNet6.Demo.fsproj -- --command feature --data G:\coldfar_data\symbolics\raw-ta\YM.txt --timestamp-offset -05:00
輸出包含rows、signal timestamp、feature/module state、module/financial event counts、orders、fills及plan fingerprint。Warmup/missing的SkipTransition/RejectCommand、replay/checkpoint/restart contract見doc/User_Manual.md與RFC-SYMBOLIC-0014。
Repo root script policy: check.fsx is the only current root-level .fsx entry point. Legacy root scripts are staged under misc/staging/legacy-root-fsx/; new demos should live under SymbolicNet6/scripts/, experiments/, tests, or an explicit staging folder.
Data Policy
Large raw data, generated reports, notebooks and legacy tool archives are kept outside Git under:
G:\coldfar_data\symbolics\
Repo-side metadata is kept in misc/DataManifest.md. SharFTrade.Exp.bin/ is explicitly not cleaned in the current batch and needs a separate decision.
Agent Rules
See AGENTS.md. The project requires traceable work logs, UTF-8-safe editing, build/check validation, and closeout op_logs for cleanup/productization work.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FAkka.Argu (>= 10.1.302)
- FAkka.Mathnet.Symbolic (>= 10.1.302-win2)
- FSharp.Core (>= 10.1.302)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FAkka.Mathnet.Symbolic.Backtest.Core:
| Package | Downloads |
|---|---|
|
FAkka.Mathnet.Symbolic.Backtest.Host
Actor-neutral backtest lifecycle, durable orchestration, and compiled strategy host for FAkka.Mathnet.Symbolic. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.1.302-win2 | 38 | 8/5/2026 |
| 10.0.103-dgx75 | 61 | 7/21/2026 |