Projects
Financial Strategy Backtesting Engine
A backtesting engine and web dashboard built with Python + Backtrader that tests financial strategies against historical data.
G-Risk is a Python-based backtesting engine and web dashboard that enables investment strategies to be tested against historical market data. The project was developed in two separate iterations to help financial decision-makers make strategy validation a systematic process.
Problem
The core problem for analysts and portfolio managers developing investment strategies was this: it was extremely difficult to test in advance how a strategy would perform in a real market. Existing tools were either too simplistic and could not express custom strategy logic, or they ran unacceptably slowly on large datasets. Changing strategy parameters and retesting was a time-consuming cycle. Separate tools were needed to visualize results and compare different strategies.
Solution
The Backtrader library was chosen as the core engine. Strategy definitions were moved to YAML configuration files; this allows analysts to change parameter sets and define new strategies without writing Python code. JIT compilation with Numba was integrated to eliminate computational bottlenecks on large historical datasets. Results are visualized through Plotly-based interactive charts; different strategy runs can be compared side by side on the web dashboard. In the second version of the project, the architecture was restructured, computational performance was increased, and the user interface was improved.
Key Features
- YAML-Based Strategy Configuration: Entry/exit rules, position sizing, and risk parameters are defined in a YAML file; no code changes required
- Backtrader Engine: Realistic market simulation including commissions, slippage, and multiple position management
- Numba JIT Optimization: CPU-level speed gains in critical computation loops; practical run times for large datasets
- Pandas + NumPy Data Processing: Cleaning, resampling, and feature engineering of multi-source historical price data
- Plotly Interactive Charts: Equity curve, drawdown analysis, trade history, and risk metrics; zoomable and filterable views
- Web Dashboard: Summary table comparing different strategy runs; performance metrics and backtest parameters side by side
Technical Infrastructure
The Python ecosystem was a natural choice for this project: while it is the richest environment for financial libraries, having Backtrader, Pandas, and Numba work together in the same language reduced development complexity. Numba’s @jit decorator provided speed levels for vectorized computations that NumPy alone could not achieve. The YAML configuration layer separated the technical definition of the strategy from the application code, making it possible to quickly try different parameter sets. Plotly was preferred over static chart libraries because it allows analysts to interactively explore results.
Results
G-Risk dramatically shortened the strategy testing cycle compared to manual processes. Thanks to the YAML-based structure, analysts can configure and run a new strategy hypothesis in minutes. Numba optimization brought tests on large historical datasets that previously took hours down to minutes. The two-iteration development process was guided by real user feedback at each stage; the result was a tool that offers both technical robustness and practical usability.
2024
Services Used in This Project
Got a Similar Need?
Tell us what is scattered, manual or slow in your current process. We will map the first practical software step.
Discuss the SolutionSimilar Projects
A digital ecosystem that connects e-commerce, marketplace, ERP, inventory, product feed and iOS/Android mobile app flows through one data layer.
Corporate Website ModernizationFast, fully responsive corporate website built with Astro 5 and Cloudflare Workers, optimized for technical SEO and millisecond loads.
MSSQL XML Agent: ERP Automation AgentPortable Windows automation agent that exports XML from MSSQL databases for ERP flows, with scheduling and a web management UI.