Back to Resources
Guides8 min read

Backtesting Your First Strategy in Stonkly

Backtesting converts a trading idea into a track record. Stonkly's visual engine lets you run a full historical simulation in under two minutes — no code required. This guide walks you through a moving average crossover strategy from scratch and shows you exactly how to read what comes back.

What backtesting actually tests

A backtest runs your entry and exit rules against historical price data and reports what would have happened if you had traded that way. It measures rule-following, not forecasting — the result tells you how your rules performed in the past, under the conditions that existed then. Market conditions change, which is why interpreting the result carefully matters more than the headline return number.

A backtest is a lower bound on friction. Real fills are slightly worse than historical prices. Factor in at least 0.1% slippage per trade when reading the results.

Building the moving average crossover

Open the Backtester from the top navigation. Under Strategy Builder, select "Moving Average Crossover" from the template list. Set the fast MA to 20 days and the slow MA to 50 days. The entry signal fires when the fast MA crosses above the slow MA; the exit fires on the reverse cross. Set your starting capital, choose a date range that covers at least one full market cycle (2018–present works well), and run the simulation.

  • Fast MA: 20 days
  • Slow MA: 50 days
  • Entry: fast crosses above slow
  • Exit: fast crosses below slow
  • Date range: 2018 → present

Reading the equity curve

The equity curve shows cumulative portfolio value over time. A rising curve is not enough — look at its shape. A smooth, steady climb indicates the strategy performs consistently. A curve that spikes up then gives back half the gains before recovering suggests high volatility of outcomes, which matters as much as the final return. Compare your curve against the SPY benchmark line that appears as an overlay.

The slope matters more than the endpoint. A strategy that reaches the same endpoint in a straighter line beats one that got there with a 40% drawdown in the middle — most traders would have quit before the recovery.

Interpreting drawdown periods

Drawdown is the peak-to-trough decline at any point in the backtest. Stonkly shows Max Drawdown, Average Drawdown, and a shaded Drawdown Chart underneath the equity curve. The question is not whether the max drawdown happened — it's whether you could have held through it. A 35% drawdown on paper is easy to accept in retrospect; living through it in real money is different. Size your position so the max drawdown is within the range you could tolerate emotionally.

  • Max Drawdown: worst single peak-to-trough decline
  • Average Drawdown: typical trough depth across all losing periods
  • Recovery time: how long after each trough before a new high

Key Takeaway

The backtest result is a starting point, not a verdict. Run your strategy over multiple date ranges and across a few different symbols to see if the logic holds broadly — a strategy that only works on one stock in one era is fitting noise, not signal.