PSX Strategy Backtester
Backtest any PSX stock strategy in 10 seconds — no code, no signup, free. Pick a stock, stack indicator conditions, and see how your strategy would have performed.
1 1. Pick a Stock and Period
2 2. Build Your Strategy (No Code)
3 3. Backtest Settings
Backtest Results
Equity Curve vs Buy and Hold
Portfolio value over time. Dashed line shows simply buying and holding the stock.
Drawdown
Peak-to-trough decline of the strategy equity curve.
Trade Log
| # | Entry Date | Exit Date | Entry Rs | Exit Rs | Return | P and L Rs |
|---|
How It Works
1. Simulated price history
Each stock gets a reproducible 2-year daily series generated from a seeded random walk tuned to that stock’s typical volatility. The same stock always produces the same series, so your backtests are comparable.
2. Indicator signals
SMA, RSI and MACD are computed bar by bar. A buy signal fires when your conditions turn true at a bar close; a sell signal fires on the opposite cross. With AND logic every condition must agree; with OR logic any single condition can trigger.
3. Realistic fills
Orders fill at the next bar’s open (never at the signal bar’s close — that would be lookahead bias). Commission and slippage are deducted on both sides. The model is long-only with full capital per trade.
4. Read the verdict
Compare total return against buy-and-hold, check max drawdown for risk, and Sharpe ratio for risk-adjusted performance. A strategy that beats buy-and-hold with lower drawdown is genuinely interesting.
Frequently Asked Questions
Is this real PSX data?
No. Phase 1 uses simulated data so you can test the engine instantly with zero setup. Phase 2 will integrate real PSX historical data. Treat all numbers as illustrative.
Why do results differ from TradingView?
Different data feed, different fill assumptions and different indicator implementations all change results. Our engine fills at next-bar open with commission and slippage, which is conservative by design.
Can I backtest short selling?
Not in Phase 1 — the engine is long-only, matching how most PSX retail investors trade (shorting is restricted on PSX anyway).
Does a good backtest guarantee future profits?
Absolutely not. Backtests are hypothetical, simulated markets miss real-world liquidity shocks, and overfit strategies fail live. Never risk money you cannot afford to lose.
