AI Backtest Optimizer
Describe a strategy in plain English. The AI runs a backtest, checks Sharpe ratio, drawdown, and win rate against your targets, then automatically refines the strategy and re-runs — up to 5 times — until it passes.

MokshaGPT
Stock Market Insights by AI
Describe a strategy in plain English. The AI runs a backtest, checks Sharpe ratio, drawdown, and win rate against your targets, then automatically refines the strategy and re-runs — up to 5 times — until it passes.
A backtest optimizer goes beyond a single backtest run. It automatically evaluates your strategy against quality targets — Sharpe ratio, drawdown, win rate — and keeps refining it until it passes or the iteration limit is reached. No manual parameter tuning needed.
Powered by LangGraph. The optimizer runs backtest → evaluate → refine in a loop — up to 10 iterations — without any manual intervention from you.
Set your own Sharpe ratio, max drawdown, and win rate targets. The optimizer won't stop until all three are met — or it has exhausted all iterations.
Every iteration is logged — strategy text, Sharpe, drawdown, win rate. You see exactly what was tried and how each refinement improved the metrics.
Even if thresholds are never fully met, the optimizer returns the single best strategy found — ranked by a composite score of Sharpe, drawdown, and win rate.
Describe Your Strategy
Type any strategy in plain English — SMA crossover, RSI mean reversion, MACD, or custom multi-indicator logic.
AI Runs Backtest
The AI parses your strategy, generates signal code, and runs a full vectorbt backtest on real historical data.
Evaluate vs Thresholds
Sharpe ratio, max drawdown, and win rate are checked against your targets. If all pass, the loop ends.
Refine & Repeat
If any threshold fails, the AI refines the strategy — adjusting periods, adding filters or stop-losses — and re-runs.
Indicator Periods
Adjusts SMA/EMA/RSI/MACD periods to reduce noise and improve signal quality.
Entry Filters
Adds RSI, volume, or trend filters to the entry condition to improve win rate.
Stop-Loss Rules
Introduces percentage or points-based stop-losses to control max drawdown.
Take-Profit Targets
Adds profit targets to lock in gains and improve the profit factor.
Timeframe Tuning
Suggests slower timeframes when intraday noise is hurting performance.
Position Sizing
Recommends risk-based or Kelly Criterion sizing to improve Sharpe ratio.
A backtest optimizer automatically runs multiple backtest iterations on variations of your strategy, evaluating each against quality thresholds like Sharpe ratio, max drawdown, and win rate. It keeps refining until the strategy passes all targets or the iteration limit is reached — saving you hours of manual parameter tuning.
The AI Backtester runs your strategy once and returns the result. The Backtest Optimizer runs it multiple times, automatically refining the strategy between iterations until it meets your quality targets. Use the Backtester to test a specific strategy; use the Optimizer when you want the AI to find the best version of a strategy concept.
No. The optimizer refines your original strategy concept — adjusting periods, adding filters, or introducing stop-loss rules. It keeps the same ticker and capital. If you describe an SMA crossover, it will try variations of SMA crossovers, not switch to Camarilla pivots or a completely unrelated approach.
The optimizer always returns the best result found — even if no iteration fully passed. The iteration log shows every variation tried and its metrics, so you can see which threshold was hardest to meet. This is a signal that the strategy concept may not suit the asset or timeframe, and a different approach should be considered.
Yes. Click "Customize quality thresholds" before running to set your own Sharpe ratio minimum, max drawdown limit, win rate target, and maximum number of iterations (up to 10). The defaults are Sharpe ≥ 0.8, drawdown ≤ -20%, win rate ≥ 45%.
Yes. MokshaGPT's AI Backtest Optimizer is completely free to use for educational and informational purposes. No sign-up, no credit card required.
MokshaGPT is a full suite of AI-powered trading tools — all free, no sign-up required.
AI Stock Analyzer
Analyze any stock with AI — technicals, fundamentals, and market sentiment in plain English.
AI Backtester
Describe any trading strategy and backtest it instantly. Sharpe ratio, win rate, drawdown, and more.
Ensemble Builder
Combine multiple uncorrelated trading strategies into a single robust portfolio with diversified risk.
AI Stock Screener
Find stocks using plain English — RSI, P/E, moving averages, sector, market cap across global markets.
AI Reporter
Generate professional financial reports from Excel/CSV data — for advisors and wealth managers.
Trade Analyzer
Upload your brokerage trade history and get P&L analysis, overtrading detection, and AI coaching.