How glacode/quantproject works
Project type and purpose
• QuantProject is a full-stack, multi-library C# framework for quantitative finance: it provides data ingestion (QuantDownloader), core data structures (ADT), data access, data providers/streams, strategy backtesting and live trading support, plus optional UI/reporting.
File structure
• Top-level solutions: QuantProject.sln and QuantDownloader.sln
• Layers in QuantProject under directories b1_… through b5_:
• b1_ADT: core abstract data types and math utilities
• b2_DataAccess: ADO.NET/database-level data access
• b3_Data (Model): wrappers around raw data (caching, streaming, domain models)
• b4_Business: strategy definitions, backtester, live-execution interfaces, validation
• b5_Presentation: console/WinForms/Excel reporting and visual charts
• QuantDownloader: standalone executable/library fetching historical data and populating the database
• mdb folder: offline Access database, configuration files under each project, Visual Studio solution files
README for additional insights
• Layers described as “b1_Environment”, “b2_DataAccess”, “b3_Model”, “b4_Business”, “b5_View” and “QuantDownloader”
• Features: plugin strategy framework, backtesting engine, live trading interfaces, modular design
• Dependencies: .NET Framework 4+, Visual Studio, ADO.NET, OpenTick (in QuantDownloader)
Main components
a. Components
1. QuantDownloader Tool
• OpenTickDownloader subsystem (downloaders, selectors, requesters)
• DatabaseImporter/DataBaseWriter → writes to the project’s relational DB (MDB or SQL)
2. Database (Relational store)
• Stores raw ticks, OHLC bars, validated quotes, ticker metadata
3. DataAccess Layer (b2_DataAccess)
• Repository/SQLBuilder/SqlExecutor
• Tables abstractions for Bars, Quotes, Tickers
4. Model/Data Layer (b3_Data)
• IDataStreamer and data providers (HistoricalBarProvider, QuoteProvider)
• Caching subsystems
5. Core ADT Utilities (b1_ADT)
• Math, statistics, linear algebra, optimization engines, history interpolation
6. Business Logic (b4_Business)
• Timing management, validation, financial instruments, accounting, order execution
• Strategy plugin framework (IStrategy, backtester, live handler)
• Optimization subsystems (BruteForce, Genetic)
7. Presentation/Reporting (b5_Presentation)
• Console, Windows Forms, Excel reporting, charts
8. External dependencies/services
• OpenTick market data API
• Configuration files (app.config)
• External trading API for live execution (stub/interface)
b. Relationships and interactions
• QuantDownloader fetches data from OpenTick → writes to Database
• DataAccess layer connects to Database → exposes domain tables to Data Layer
• Data Layer requests historical quotes/bars → may cache → supplies streams to Business Logic
• Business Logic uses ADT utilities for computation → drives Strategy instances (Backtester or Live)
• Backtester simulates orders via the Business “Ordering” sub-module → writes logs
• Presentation reads logs or live results → renders charts/reports
c. Architectural patterns and design principles
• Layered (N-tier) architecture separating persistence, domain, business, presentation
• Plugin architecture for strategies and data providers (interfaces + DI)
• Observer/Event-driven for download progress, data streaming, order events
• Repository/Unit-of-Work for data access
• Factory and Strategy patterns for extensible algorithm selection and optimization
d. Key technologies/frameworks
• .NET Framework 4.x, C#
• ADO.NET / OleDb / SQLBuilder
• WinForms and Excel Interop (for reporting)
• OpenTick API for market data
• Genetic and BruteForce optimization engines in b1_ADT
Detail
• Sub-components for critical modules (e.g., OpenTickDownloader inside QuantDownloader; TimingManagement in Business)