Quant Strategy Simulator: 155% return in 1 year

Goal: Demonstrate strategy development, backtesting, analytics and ability to scale quant research.
Stack: Python, FastAPI, Plotly, pandas, SQLite or PostgreSQL
Key Features:
- Load historical tick/minute data
- Run backtests (mean reversion, momentum, VWAP)
- Compute metrics: Sharpe, Sortino, drawdown, win ratio
- Interactive performance charts
- Export trade logs & plots
- Optional “Paper Trading Mode” using Alpaca API
- Submit and queue strategy simulations
- Track progress and logs of each run
- View job results and runtime metrics
- Integrate with Quant Simulator for distributed backtests
GPU-Accelerated Optimization for VWAP-Based Momentum Trading
The Stock Parameter Optimizer is a high-performance trading research tool designed to find optimal buy/sell parameters for rule-based stock strategies using GPU acceleration. It focuses on explainable, VWAP-anchored momentum systems, allowing traders and researchers to iterate on ideas in seconds instead of hours.
This project represents the next evolutionary step after PPOAlgo—shifting away from black-box reinforcement learning toward transparent, data-driven parameter optimization.
From PPOAlgo to the Optimizer
This Optimizer was born directly from lessons learned while building PPOAlgo, an earlier reinforcement-learning trading system. While PPOAlgo explored autonomous learning with Proximal Policy Optimization (PPO), practical constraints quickly became apparent.
PPOAlgo vs. Optimizer
AspectPPOAlgo (Original)Optimizer (This Project)GoalLearn trading behaviorOptimize trading parametersCore MethodPPO reinforcement learningBayesian + GPU grid searchStrategy DefinitionNeural network (black box)Human-defined rulesExplainabilityLowFully transparentData RequirementsVery large datasets~1 year of dataIteration SpeedHours / daysSeconds (GPU)
Why the Pivot?
Through extensive experimentation, a clear pattern emerged:
- Markets are efficient—complex ML rarely finds durable edges
- Explainability matters when real capital is at risk
- Fast iteration beats complex models
- Simple strategies with well-optimized parameters consistently outperform overfit AI models
The result was a deliberate shift:
Humans define the strategy. GPUs find the optimal parameters.
Why VWAP-Based Momentum?
At the heart of the Optimizer is an Adaptive VWAP Momentum Strategy. VWAP (Volume-Weighted Average Price) is widely used by institutional traders as a benchmark for execution quality and trend bias.
By anchoring entries to VWAP and layering volatility-adjusted momentum filters, the Optimizer isolates trades where institutional flow is likely aligned with price action.
Adaptive VWAP Entry Logic
All conditions must be met at 10:00 AM ET:
1. price_10am > VWAP → Institutional bias confirmation
2. VWAP slope > 0 → Trend confirmation
3. Stretch < 0.5 × OR vol → Avoid chasing extended moves
4. Momentum > 0.25 × OR vol → Sufficient buying pressure
This structure combines:
- VWAP anchoring (smart-money alignment)
- Trend confirmation (VWAP slope)
- Extension control (volatility-aware stretch)
- Momentum validation (conviction filter)
The result is fewer trades—but significantly higher quality ones.
Key Features
FeatureDescription🧠 Bayesian OptimizationOptuna TPE sampler for intelligent search🔥 GPU AccelerationCuPy-powered parallel backtesting (RTX 3090)📊 VWAP Momentum EngineFour-condition adaptive entry system📈 Real-Time FeedbackLive WebSocket progress with ETA💾 Persistent HistoryPostgreSQL storage with full trade logs🔍 Explainable TradesClear skip reasons for every non-trade📡 Multi-API DataAlpaca, Widesurf, Massive.com🗑️ History ManagementDelete and compare past runs
Trading Strategies Supported
1. Dipper Strategy
Buys price dips below the previous close and exits at a profit target. Best suited for mean-reversion environments.
2. 10AM Momentum Strategy
Enters at 10:00 AM if price is above the open, capturing post-open trend continuation.
3. Adaptive VWAP Strategy ⭐
The flagship strategy combining VWAP anchoring, slope analysis, stretch control, and volatility-scaled momentum.
Each skipped trade includes a human-readable reason such as:
$ < VWAPslope↓ (-0.15%)stretch↑ (0.8%)mom↓ (0.1%)
Performance at Scale
GPU acceleration fundamentally changes what’s possible during research:
ModeParameter SetsTimeSpeedupCPU (Bayesian)200~40 sec1×GPU Grid Search10,000~2 sec20×GPU Grid Search100,000~10 sec200×
Instead of guessing ranges, traders can now brute-force reality.
Architecture Overview
- Backend: Python 3.11, FastAPI
- Optimization: Optuna (Bayesian) + GPU Grid Search
- GPU Compute: CUDA 12.2, CuPy
- Database: PostgreSQL (JSONB trade logs)
- Frontend: HTML, CSS, Vanilla JavaScript
- Real-Time: WebSocket progress updates
- Deployment: Docker (CPU & GPU images)
Real-Time & API-Driven
The Optimizer exposes a clean API and WebSocket interface:
- Start optimization jobs programmatically
- Monitor progress live
- Compare price data across multiple providers
- Retrieve or delete historical runs
Every optimization run is fully reproducible and auditable.
Lessons Learned: From PPO to Practical Trading
This project reflects a philosophical shift in how I approach algorithmic trading:
- Reinforcement learning is powerful—but expensive and opaque
- Transparency beats complexity in real markets
- Parameter optimization delivers outsized returns per unit of effort
- Speed enables better ideas, faster
Instead of training an AI to trade, let humans define the edge—and let GPUs do the math.
Final Thoughts
The Stock Parameter Optimizer is not about chasing “AI trading hype.”
It’s about engineering leverage—using modern hardware to explore strategy space exhaustively, transparently, and quickly.
This is the tool I wish I had when I started systematic trading.
Built from PPOAlgo. Refined for real-world trading. Optimized for speed and clarity.