How aremiat/macro-sensitive-analysis-of-quantitative-investment-strategies works
Main Components
• Data Module:
– Files: Loader.cs, loader/loader.py, and associated requirements (loader/requirements.txt)
– Role: Responsible for loading, cleaning, filtering, and segmenting historical data from CSV files (e.g., secteurs.csv, PerformanceMetrics.csv).
• Strategies Module:
– Files: strategy.cs (likely containing StrategyBase along with specific implementations for MomentumStrategy and ValueStrategy as described)
– Role: Implements the logic behind quantification (calculations, asset selections, weighting rules, etc.).
• Backtest Module:
– Files: backtest.cs, backtestUI.cs, Main.cs, and potentially BacktestForm.Designer.cs for UI design and simulation control.
– Role: Simulates portfolio rebalancing on a monthly basis and integrates strategies within the portfolio simulation.
• Reporting Module:
– Files: results.cs, plotter.cs, and Database.cs
– Role: Computes performance metrics (e.g., Sharpe ratio, volatility) and generates both graphical analysis (reports/charts) and CSV outputs.
• Testing:
– File: BacktestProject.Tests.cs
– Role: Contains unit/integration tests ensuring that key functionalities work per design.
Specify Relationships and Data Flow
• Data flows sequentially through the modules:
– Start with the Data Module that performs data collection and preprocessing.
– Processed data is passed to the Strategies Module where performance calculations and trade selection logic are applied.
– The Backtest Module consumes both the raw/prepared data and the computed strategies to simulate portfolio behavior over time.
– Finally, the Reporting Module aggregates simulation results and produces visual and CSV reports.
• Additionally, the system should show dependencies such as how the UI (from the Backtest UI files) interacts with the simulation logic and perhaps the database interactions (in Database.cs).
Incorporate Architectural Patterns and Key Technologies
• The architecture follows a modular, linear processing flow—data moves step-by-step through discrete layers delivering separation of concerns.
• Although written mostly in C#, the small Python “loader” component might be used for specialized tasks such as fetching data from external sources, so include a separate node for “Data Loader (Python)” if needed.
• Dependencies such as CSV file input, data cleaning libraries, and plotting/reporting libraries should be annotated. Note also that testing is included and should be represented to indicate continuous integration or test-driven design practices.