Data Acquisition, Statistical Analysis, Broker Integration, Portfolio Analytics & Notifications — One NuGet Package
数据获取、统计分析、券商集成、组合分析、通知推送 —— 一个 NuGet 包全部搞定
Building quantitative trading systems requires connecting to multiple data sources, brokers, and notification channels — each with their own API quirks. Instead of writing separate integrations for every platform, Quant.Infra.Net gives you a single unified C# API.
| Pain Point | Solution |
|---|---|
| Data APIs return inconsistent formats — you write converters for every provider | Unified ITraditionalFinanceSourceDataService and ICryptoSourceDataService with standardized OHLCV models |
| Binance needs API keys + rate limiting; Schwab needs OAuth; IB needs TWS/Gateway IPC | Single IBrokerService abstraction — swap brokers by changing configuration, not code |
| Every broker uses different order models and status enums | Cross-broker unified order model with state machine for fill tracking |
| Portfolio metrics require stitching together position data from multiple brokers | Built-in CAGR, Sharpe ratio, Calmar ratio, Max Drawdown — just call the method |
| Strategy alerts scattered across Slack, email, DingTalk, WeChat... | One notification service with pluggable channels — send everywhere from one line of code |
| Module | Responsibility | Key Interfaces |
|---|---|---|
| SourceData | Multi-source market data ingestion | Yahoo Finance (via yfinance/pythonnet), Binance klines, Alpaca equity, CSV/MySQL/MongoDB |
| Broker | Unified broker execution layer | Binance Futures (Testnet/Paper/Live), Alpaca US Equity, Charles Schwab, Interactive Brokers via InterReact |
| Analysis | Quantitative/statistical tooling | ADF test, OLS regression, Z-Score, Shapiro-Wilk, pair-trading spread |
| Portfolio | Position tracking and performance | CAGR, Sharpe, Calmar, Max Drawdown, equity curve charting (ScottPlot) |
| Notification | Strategy alert dispatch | DingTalk bot, WeChat Work webhook, bulk email |
| Shared | Cross-cutting utilities | IntervalTrigger, RollingWindow<T>, resolution helpers |
| Version | Date | Highlights |
|---|---|---|
| 1.5.1 | 2026-08-12 | Code_Standards.md compliance — bilingual XML docs on all public members, parameter validation audit |
| 1.5.0 | 2026-05-28 | Interactive Brokers (InterReact) full integration; Charles Schwab broker service; MIT license; enhanced unit tests |
| 1.4.0 | 2024-05-16 | Updated broker API integrations, comprehensive documentation |
| 1.3.0 | 2024-04-05 | Enhanced notification services with email templates |
| 1.0.0 | 2024-01-15 | Initial release — data, analysis, execution, notifications |
View complete module documentation, API reference, and code examples:
dotnet test --filter "FullyQualifiedName!~Binance"
构建量化交易系统需要连接多个数据源、券商和通知渠道,每个平台的 API 都有不同的细节。Quant.Infra.Net 让你不再为每个平台重复编写集成代码,而是提供一个统一的 C# API。
| 痛点 | 解决方案 |
|---|---|
| 数据 API 返回格式不一致,每个提供商都要写转换器 | 统一的 ITraditionalFinanceSourceDataService 和 ICryptoSourceDataService,标准化的 OHLCV 数据模型 |
| Binance 需要 API Key + 限流;Schwab 需要 OAuth;IB 需要 TWS/Gateway IPC | 单一 IBrokerService 抽象接口 —— 改配置换券商,不改代码 |
| 每个券商使用不同的订单模型和状态枚举 | 跨券商统一订单模型,状态机追踪成交 |
| 组合指标需要拼接多个券商的持仓数据 | 内置 CAGR、夏普比率、卡尔玛比率、最大回撤 —— 调用一个方法即可 |
| 策略信号分散在 Slack、邮件、钉钉、企业微信…… | 单一通知服务,插件式通道 —— 一行代码发送到所有渠道 |
| 模块 | 职责 | 关键接口 |
|---|---|---|
| SourceData | 多源市场数据接入 | Yahoo Finance (通过 yfinance/pythonnet)、Binance K 线、Alpaca 美股、CSV/MySQL/MongoDB |
| Broker | 统一券商执行层 | Binance Futures (测试网/模拟盘/实盘)、Alpaca 美股、Charles Schwab、Interactive Brokers (通过 InterReact) |
| Analysis | 量化统计工具 | ADF 平稳性检验、OLS 回归、Z-Score、Shapiro-Wilk 正态性检验、配对交易价差计算 |
| Portfolio | 持仓跟踪和绩效分析 | CAGR、夏普比率、卡尔玛比率、最大回撤、权益曲线图表 (ScottPlot) |
| Notification | 策略通知推送 | 钉钉机器人、企业微信 Webhook、批量邮件 |
| Shared | 横切工具类 | IntervalTrigger、RollingWindow<T>、分辨率转换辅助方法 |
| 版本 | 日期 | 主要变更 |
|---|---|---|
| 1.5.1 | 2026-08-12 | Code_Standards.md 合规 —— 所有公共成员添加双语 XML 文档,参数校验审计 |
| 1.5.0 | 2026-05-28 | Interactive Brokers (InterReact) 完整集成;Charles Schwab 券商服务;MIT 许可证;增强单元测试 |
| 1.4.0 | 2024-05-16 | 更新券商 API 集成,完善文档 |
| 1.3.0 | 2024-04-05 | 增强通知服务(邮件模板) |
| 1.0.0 | 2024-01-15 | 初始版本 —— 数据、分析、执行、通知 |
dotnet test --filter "FullyQualifiedName!~Binance"
查看完整的模块说明、API 参考和使用示例: