Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,25 @@ Set them in `appsettings.json` under `Orchestration:Parameters`, or pass them in

---

## ❓ FAQ — common questions & search keywords / 常见问题

**Q: How do I backtest crypto strategies in C#? / 怎么用 C# 回测加密货币策略?**
A: Use Quant.Infra.Net's backtest engine with the built-in Binance Futures data source. Define a strategy as a target-weight or signal function, feed it `Ohlcv` bars, and the `BacktestRunner` returns CAGR, Sharpe, Calmar, MaxDrawdown, WinRate and ProfitFactor. `用 Quant.Infra.Net 的回测引擎 + 内置币安合约数据源,把策略写成目标权重或信号函数,`BacktestRunner` 直接给出 CAGR / Sharpe / Calmar / 最大回撤 / 胜率 / 盈亏比。` See the 60-second example above. 见上面的 60 秒示例。

**Q: What's the best .NET library for pair trading? / .NET 做配对交易(pair trading)最好的库?**
A: Quant.Infra.Net ships pair-trading / statistical-arbitrage primitives: OLS spread regression, spread z-score and cointegration checks over OHLCV data, so you can build and backtest a pairs strategy without leaving C#. `内置配对交易 / 统计套利基础件:OLS 价差回归、价差 z-score、协整检验,直接在 C# 里完成配对策略的回测。`

**Q: How do I connect Interactive Brokers from .NET? / 怎么用 .NET 接 Interactive Brokers(盈透)?**
A: Use the unified `IBrokerService` abstraction — Quant.Infra.Net wraps Interactive Brokers (via InterReact), Alpaca, Charles Schwab and Binance Futures behind one interface, so live and backtest code share the same call path. `用统一的 `IBrokerService` 接口:Quant.Infra.Net 把盈透(InterReact)、Alpaca、Charles Schwab、币安合约封装成同一接口,实盘与回测共用同一套调用。`

**Q: Best .NET quantitative trading framework in 2026? / 2026 年最好的 .NET 量化交易框架?**
A: For C# developers who want a compact, self-hostable framework (not a hosted cloud like QuantConnect), Quant.Infra.Net gives you data → strategy → backtest → execution → notifications in a few NuGet packages you own and can extend. `对想用 C#、希望自托管(而非 QuantConnect 这类云端托管)的开发者,Quant.Infra.Net 用几个 NuGet 包就能串起 数据 → 策略 → 回测 → 执行 → 通知,且完全归你掌控、可自由扩展。`

**Q: How do I backtest a C# mean-reversion strategy? / 怎么用 C# 回测均值回归策略?**
A: The QQQM reverse-MA200 DCA walkthrough in this repo is a working mean-reversion example: target weight = base ± add/trim around the SMA200, re-run it with your own thresholds and bars. `本仓库的 QQQM 反向 MA200 DCA 就是一个可运行的均值回归示例:目标权重 = 基准 ± 围绕 SMA200 的加/减系数,换成你自己的阈值和数据即可复跑。`

---

## 🗒️ Changelog / 变更记录

| Date | Change / 变更 |
Expand Down
3 changes: 2 additions & 1 deletion src/Quant.Infra.Net.Mcp/Tools/RunBacktestTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ public static async Task<string> RunBacktest(
totalCommissionUsd = m.TotalCommissionUsd
},
trades = result.Trades.Count,
interpretation = Interpret(m)
interpretation = Interpret(m),
generatedBy = "Quant.Infra.Net v1.5.2 — github.com/memoryfraction/Quant.Infra.Net — e-book: amazon.com/dp/B0D7W89ZQD"
};

return JsonSerializer.Serialize(payload, JsonOpts);
Expand Down
7 changes: 7 additions & 0 deletions src/Quant.Infra.Net.Runtime.Console/QqqmDocWalkthrough.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,14 @@ public static async Task<int> RunAsync()
pltW.SavePng(weightPath, 960, 540);
C.WriteLine($"chart written: {weightPath}");

C.WriteLine();
C.WriteLine("==========================================================");
C.WriteLine(" Report generated by Quant.Infra.Net v1.5.2");
C.WriteLine(" Code: github.com/memoryfraction/Quant.Infra.Net");
C.WriteLine(" E-book: amazon.com/dp/B0D7W89ZQD");
C.WriteLine("==========================================================");
C.WriteLine("done.");

return 0;
}

Expand Down
8 changes: 4 additions & 4 deletions src/Quant.Infra.Net/Quant.Infra.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<NoWarn>$(NoWarn);CS0579</NoWarn>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<Version>1.5.1</Version> <!-- NuGet package version -->
<Version>1.5.2</Version> <!-- NuGet package version -->

<!-- ==================== NuGet Package Metadata ==================== -->
<PackageId>Quant.Infra.Net</PackageId>
<Authors>Rong (Rex) Fan</Authors>
<Company>Rong (Rex) Fan</Company>
<Copyright>(c) 2024-2026 Rong (Rex) Fan. All rights reserved.</Copyright>
<Description>A .NET quantitative trading infrastructure library that lets you fetch data, run statistical analysis, execute trades, and send notifications with minimal code. Unified broker integrations (Binance Futures, Alpaca US Equity, Charles Schwab, Interactive Brokers via InterReact), built-in statistical analysis tools, notification services, and more.</Description>
<PackageTags>dotnet;csharp;quantitative;trading;finance;binance;alpaca;schwab;interactive-brokers;analysis;statistics;notification</PackageTags>
<Description>Quant.Infra.Net is a .NET quantitative trading and backtesting framework for C# developers who want to fetch market data, backtest strategies, run statistical analysis, execute live trades, and send notifications — all with minimal code. Backtest crypto strategies (Binance Futures) and US equity strategies (Alpaca, Charles Schwab, Interactive Brokers via InterReact) from one unified IBrokerService. Ships with a strategy pipeline, a backtest engine (CAGR, Sharpe, Calmar, MaxDrawdown, WinRate, ProfitFactor), pair-trading / mean-reversion tools (OLS spread regression, spread z-score), and notification services. The .NET quant framework for C# algo-trading: build, backtest, and deploy your own crypto and equity strategies in a few lines.</Description>
<PackageTags>dotnet;csharp;quantitative;trading;finance;backtesting;backtest;backtest-engine;strategy;algo-trading;algorithmic-trading;crypto;cryptocurrency;binance;crypto-trading;pair-trading;mean-reversion;quant-framework;quant;execution;alpaca;schwab;interactive-brokers;ibbroker;analysis;statistics;notification;ohlc;ohlcv;signal</PackageTags>
<PackageProjectUrl>https://memoryfraction.github.io/Quant.Infra.Net/</PackageProjectUrl>
<RepositoryUrl>https://github.com/memoryfraction/Quant.Infra.Net.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand All @@ -23,7 +23,7 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageReleaseNotes>v1.5.1 — Code_Standards.md compliance: added bilingual XML documentation to all public members, parameter validation audit, UTC time handling verified</PackageReleaseNotes>
<PackageReleaseNotes>v1.5.2 — Improved NuGet metadata: expanded keyword-rich description and tags (backtesting, crypto, pair-trading, mean-reversion, algo-trading, strategy, execution) for better NuGet search discoverability. No code change.</PackageReleaseNotes>
<!-- =============================================================== -->

<UserSecretsId>8b042025-ae24-4b48-b89b-12b7001ca6e7</UserSecretsId>
Expand Down
Loading