Quant.Infra.Net.Backtest
1.6.0
dotnet add package Quant.Infra.Net.Backtest --version 1.6.0
NuGet\Install-Package Quant.Infra.Net.Backtest -Version 1.6.0
<PackageReference Include="Quant.Infra.Net.Backtest" Version="1.6.0" />
<PackageVersion Include="Quant.Infra.Net.Backtest" Version="1.6.0" />
<PackageReference Include="Quant.Infra.Net.Backtest" />
paket add Quant.Infra.Net.Backtest --version 1.6.0
#r "nuget: Quant.Infra.Net.Backtest, 1.6.0"
#:package Quant.Infra.Net.Backtest@1.6.0
#addin nuget:?package=Quant.Infra.Net.Backtest&version=1.6.0
#tool nuget:?package=Quant.Infra.Net.Backtest&version=1.6.0
Quant.Infra.Net
Quant.Infra.Net is a .NET quantitative trading infrastructure library — data acquisition, statistical analysis, broker integration, portfolio analytics, and notifications in one package.
Languages / 语言
What Is This? / 这是什么?
Quant.Infra.Net abstracts the complexity of connecting to financial data sources, brokers, and notification channels behind a unified C# API. You write strategy logic once — the library handles the rest.
Core Capabilities / 核心基础设施:
| Module | What It Does / 能力说明 |
|---|---|
| Data Source / 数据源 | Unified market data ingestion from Yahoo Finance & Binance (Spot/Futures), with local CSV/SQL persistence. <br>聚合多源行情(Yahoo/Binance),并支持本地持久化。 |
| Broker & Orders / 订单执行 | Standardized trading interfaces for Binance Futures, seamlessly switching between testnet simulation and live execution. <br>币安合约标准化交易接口,无缝切换测试网模拟与实盘下单。 |
| Notification / 通知推送 | Real-time strategy alerts via DingTalk bots, WeChat Work webhooks, and SMTP/Brevo email pipelines. <br>内置钉钉、企业微信及邮件通道,实现策略信号的即时触达。 |
For full module details and usage examples, see User Manual and Architecture Overview.
Architecture / 架构
┌─────────────────────────────────────────────────────────────────┐
│ Your Strategy Logic │
│ (Write once, run anywhere) │
└──────────────────────┬──────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────┐
│ UNIFIED RUNTIME / 统一运行时层 (Quant.Infra.Net.Runtime) │
│ One entry: AddQuantInfraNet + ONE switch: appsettings "RunMode" │
│ 单入口 + 一个开关:Backtest / Paper / Testnet / Live │
│ ─────────────────────────────────────────────────────────────── │
│ Orchestration Layer (Quant.Infra.Net.Orchestration) / 编排层 │
│ DataIngest → Analysis → Signal → TargetPosition → Risk │
│ → Execution (Paper broker, zero network) → PortfolioState │
│ → Notification PipelineRunner + AddQuantInfraNetOrchestration │
│ 数据采集→分析→信号→目标仓位→风控→执行(Paper零网络)→组合状态→通知 │
│ ─────────────────────────────────────────────────────────────── │
│ Backtest Layer (Quant.Infra.Net.Backtest) / 回测层 │
│ Same 8 stages, replay clock: bar-by-bar, zero look-ahead by design│
│ 同样的八个阶段、逐 bar 回放时钟——架构级零前视 │
└───────────────────────────────┬──────────────────────────────────┘
│ IQuantInfraNet API
┌───────────────────┼──────────────────────────────────────────┐
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────────┐ ┌──────────────┐
│ Source │ │ Broker │ │ Notification │
│ Data │ │ & Orders │ │ │
│ │ │ │ │ │
│ Yahoo │ │ Binance │ │ DingTalk │
│ Finance │ │ Futures │ │ WeChat Work │
│ Binance │ │ Alpaca │ │ Email (SMTP) │
│ Spot/Perp│ │ Schwab │ │ Brevo │
│ CSV/SQL │ │ Interactive │ │ │
└──────────┘ │ Brokers │ └──────────────┘
│ (Testnet/Live)│
└──────────────┘
Why this matters / 为什么重要:
- One NuGet package — no juggling multiple SDKs from different vendors
- Unified interfaces —
ITraditionalFinanceSourceDataService,IBrokerService,IEmailService— swap implementations without changing your strategy code - Out-of-the-box analysis — ADF test, OLS regression, Z-Score, Sharpe ratio — all included
Quick Start / 快速开始
# Install via NuGet
dotnet add package Quant.Infra.Net --version 1.5.1
// Register all modules
var services = new ServiceCollection();
services.AddQuantInfraNet();
// Fetch OHLCV data from Yahoo Finance
var dataService = services.BuildServiceProvider()
.GetService<ITraditionalFinanceSourceDataService>();
var bars = await dataService.GetOhlcvListAsync("AAPL", DateTime.Now.AddDays(-30), DateTime.Now);
// Place order via Binance Futures (testnet)
var binance = services.BuildServiceProvider()
.GetService<IBinanceUsdFutureService>();
await binance.SetUsdFutureHoldingsAsync("BTCUSDT", 0.01, PositionSide.Long);
// Send notification alert when strategy triggers
var dingTalk = services.BuildServiceProvider()
.GetService<IDingtalkService>();
await dingTalk.SendNotificationAsync("[Alert] BTC long position opened", token, secret);
Documentation / 文档
| Document | Description |
|---|---|
| User Manual / 使用手册 | Installation, module usage guide, API examples |
| Architecture Overview / 架构概览 | System design, module relationships, data flow |
| Code Standards / 代码规范 | SOLID principles, XML docs, naming conventions, checklist |
| Orchestration Layer Design / 编排层设计 | E2E orchestration: signal generation, risk gate, Paper execution, pipeline & DI |
| Orchestration Quick Start (EN) / 编排层使用说明 (中文) | What the demo's data source/symbol/strategy actually are, and how to swap in your own data source, symbols, or strategy |
| Trading Runtime Design R0–R6 / 统一运行时设计 | Phase-2 unified runtime: one entry, one switch, Backtest replay + live driving + parity regression |
| Unified Runtime Quick Start (EN) / 统一运行时使用说明 (中文) | The single demo host: run Backtest/Paper with one config value, and how to swap data source, strategy, or credentials |
Changelog / 变更记录
| Date | Change / 变更 |
|---|---|
| 2026-07-20 | Phase 2 unified runtime (feature/backtest-engine): AddQuantInfraNet one entry + RunMode one switch; Backtest↔Paper parity regression tests; demo hosts converged into Quant.Infra.Net.Runtime.Console |
📖 GitHub Pages — full documentation site
Related Projects / 相关项目
| Project | Description |
|---|---|
| LLSDA | Open-source lightning location system (LLS) data analysis library — published on NuGet, cited in a TechRxiv preprint. 开源闪电定位系统数据分析类库 —— 已发布 NuGet 包,并被 TechRxiv 预印本引用。 |
| HealthData-Interoperability-Csharp | AI-driven FHIR R4/R5 healthcare interoperability engine for .NET — HIPAA compliance helpers, US Core conformance, local AI semantic validation. 基于 .NET 的 AI 驱动 FHIR R4/R5 医疗数据互操作引擎 —— HIPAA 合规辅助、US Core 一致性校验、本地 AI 语义验证。 |
More projects by the same author: github.com/memoryfraction / 同一作者的更多项目
Disclaimer: See DISCLAIMER for full disclaimer and limitation of liability / 详见免责声明了解完整免责条款与责任限制。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Options (>= 9.0.10)
- Quant.Infra.Net.Orchestration (>= 1.6.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Quant.Infra.Net.Backtest:
| Package | Downloads |
|---|---|
|
Quant.Infra.Net.Runtime
Unified RunMode switch (Backtest/Paper/Testnet/Live) and one-file-per-strategy plugin convention for Quant.Infra.Net — write a strategy once, run it everywhere. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.6.0 | 110 | 8/29/2026 |
v1.6.0 — initial release: Orchestration event-driven pipeline + Backtest engine + Runtime RunMode/plugin layer on top of Quant.Infra.Net 1.5.1.