← Back to Portfolio
strategy-optimization
Python TradingView Pine Script Backtesting TopStepX

Trading Strategy Optimization

Full backtest optimization of an EMA 89 Flip strategy on E-mini S&P 500 — parameter sweep across 1,260 combinations, PDF report with actionable insights, and a production-ready Pine Script strategy.

Overview

A prop firm trader on TopStepX had a promising EMA 89 crossover strategy with a 67% win rate — but was losing money overall due to uncapped losses. They needed data-driven parameter optimization to find the right TP/SL settings and trading windows.

I pulled historical price data, built a custom Renko-based backtesting engine in Python, ran a full parameter sweep across 1,260 configurations, and delivered a professional PDF report with clear recommendations. Then converted their indicator into a production-ready Pine Script strategy with the optimized settings built in.

Key Features

Results

Technical Details

Tech Stack

Python numpy pandas TradingView Pine Script v5 TopStepX API Yahoo Finance API Chrome Headless PDF HTML/CSS

Outcome

The client loaded the strategy on TradingView, confirmed it matched expectations, and released payment the same day. They left a 5-star review: "absolutely amazing, goes above and beyond to help his clients." The extended backtest and code update were delivered as a bonus — building trust that led to immediate repeat engagement potential.