TimelyUps · Trading Tools

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.

Phase 1 — simulated data: this demo runs on realistic simulated price data (seeded, reproducible per stock). Connect a live PSX feed in Phase 2 for real historical backtests. Results are hypothetical and for education only.

1 1. Pick a Stock and Period

15 major KSE-100 constituents. Simulated 2-year history per stock.

2 2. Build Your Strategy (No Code)

Exit triggers when the opposite signal fires.
SMA: buy on fast crossing above slow, sell on cross below. RSI: buy below oversold, sell above overbought. MACD: buy on line crossing above signal, sell on cross below.

3 3. Backtest Settings

PSX standard is about 0.15%.
Accounts for bid-ask spread on fills.
Long-only. Signals computed at bar close, filled at next bar open. Full capital per trade.

Backtest Results

Run a backtest to see results.
Total Return
–
Buy and Hold
–
Win Rate
–
Max Drawdown
–
Sharpe Ratio
–
Profit Factor
–
Trades Taken
–
Avg Trade
–
Final Equity
–

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 DateExit DateEntry RsExit RsReturnP 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.

Disclaimer: This tool runs on simulated, hypothetical price data — not real PSX market data. Backtested performance is hypothetical, does not guarantee future results, and is for educational purposes only. Nothing here is financial advice. Consult a licensed advisor before investing.