Your First Backtest

In this tutorial, you'll run your first backtest using one of Stratify's template strategies. No coding required - just follow these steps and you'll be analyzing trading strategies in minutes.

Time required: 5-10 minutes
Prerequisites: A Stratify account (sign up for free at localhost:3000/register)

Step 1: Access the Backtesting Section

First, navigate to the backtesting feature in your Stratify app:

  1. Log into your Stratify account at localhost:3000
  2. Click on "Backtesting" in the sidebar navigation
  3. You'll see three tabs: Strategies, Backtests, and Results

Understanding the Three Tabs:

  • Strategies: Create and manage your trading strategies
  • Backtests: View all your backtest runs and their status
  • Results: Compare multiple backtests side-by-side

Step 2: Explore Template Strategies

Stratify provides 4 ready-to-use template strategies. You'll find them automatically loaded in the Strategies tab:

Momentum - RSI & MA Crossover

Buys when RSI is oversold (below 30) and the short moving average crosses above the long moving average. Sells when RSI is overbought (above 70) or the moving averages cross downward.

Best for: Trending markets • Risk: 2% stop loss, 5% take profit

Mean Reversion - Bollinger Bands

Buys when price touches the lower Bollinger Band and RSI confirms oversold conditions. Sells when price returns to the middle or upper band.

Best for: Range-bound markets • Risk: 3% stop loss, 4% take profit

Breakout - Volume Confirmed

Buys when price breaks above the 20-day high with volume 1.5x above average. Uses a trailing stop to capture extended trends.

Best for: Explosive moves • Risk: 2.5% stop loss, 6% take profit, 1% trailing stop

Sentiment - Social + Technical

Combines social media sentiment analysis with RSI indicators. Trades when high positive sentiment >0.6 aligns with technical signals.

Best for: News-driven stocks • Risk: 3% stop loss, 5% take profit

Tip: For your first backtest, we recommend starting with the Momentum - RSI & MA Crossover strategy. It's straightforward, widely used, and performs well in trending markets.

Step 3: Run Your First Backtest

Now let's test the Momentum strategy on historical data:

  1. Find the Momentum strategy in your Strategies list
  2. Click the "Run Backtest" button on the strategy card
  3. Configure your backtest settings:

    Symbol

    Enter AAPL (Apple) - A stable, liquid stock perfect for testing

    Date Range

    Start: 2024-01-01
    End: 2024-12-31
    (A full year gives you enough data to see how the strategy performs)

    Timeframe

    Keep the default 1d (daily bars)

    Initial Capital

    Keep the default $100,000

    Commission & Slippage

    Keep defaults (0.1% each) - These represent real-world trading costs

  4. Click "Run Backtest" to start the simulation

What's happening now: Stratify is loading historical price data for AAPL from 2024, applying the Momentum strategy rules to every trading day, simulating all buy and sell orders, tracking your positions, and calculating performance metrics.

Step 4: View Your Results

Your backtest will complete in a few seconds. Here's how to interpret the results:

  1. Go to the "Backtests" tab to see your run
  2. Watch the status:
    • 🟡 Pending - Waiting to start
    • 🔵 Running - Currently executing
    • 🟢 Completed - Finished successfully
    • 🔴 Failed - Error occurred (check error message)
  3. Click on your completed backtest to see detailed results

Understanding Key Metrics

Total Return

The overall profit or loss as a percentage. If you started with $100,000 and ended with $108,000, your total return is +8.0%.

Good: Positive returns • Great: Above 10% annually

Total Trades

Number of complete buy-sell cycles. More trades mean more opportunities but also more commissions.

Watch out: Too many trades (>100/year) can eat up profits with commissions

Win Rate

Percentage of trades that made money. A 60% win rate means 6 out of 10 trades were profitable.

Good: Above 50% • Note: High win rate doesn't guarantee profits if losses are larger than wins

Max Drawdown

The largest peak-to-trough decline. If your account went from $110,000 down to $95,000, the max drawdown is 13.6%.

Lower is better: Below 20% is good • Important: Can you emotionally handle this loss?

Sharpe Ratio

Risk-adjusted returns. It measures how much return you're getting per unit of risk. Higher is better.

Below 1.0: Not great • 1.0-2.0: Good • Above 2.0: Excellent

Pro Tip: Don't focus only on total return. A strategy with 50% return but 40% max drawdown is riskier than one with 30% return and 10% drawdown. Look at the complete picture.

Step 5: Compare Multiple Strategies

The real power of backtesting comes from comparing different approaches. Let's compare all 4 template strategies:

  1. Run backtests for all 4 template strategies using the same settings (AAPL, 2024-01-01 to 2024-12-31)
  2. Go to the "Results" tab
  3. Select multiple completed backtests using the checkboxes (maximum 5)
  4. Click "Compare Selected"

The comparison view shows all strategies side-by-side. Look for:

  • Highest return - Which made the most money?
  • Lowest drawdown - Which was least risky?
  • Best Sharpe ratio - Which had the best risk-adjusted returns?
  • Most trades - Which was most active?

Key Insight: Different strategies work better in different conditions. Momentum works in trends, Mean Reversion works in ranges, Breakout catches explosions, and Sentiment captures news-driven moves.

What's Next?

Congratulations! You've run your first backtest. Now you can:

Test Different Stocks

Try other symbols like MSFT, TSLA, SPY, or QQQ. Some strategies work better on different stocks.

Try Different Time Periods

Test on 2020-2023 to include bear markets. Does your strategy survive tough times?

Use Bulk Testing

Test all 4 strategies at once with the "Bulk Test Multiple Strategies" button.

Create Your Own Strategy

Clone a template and modify it, or build one from scratch.

Ready to Build Your Own Strategy?

Now that you know how to backtest, learn how to create and customize your own trading strategies.

Build Your First Strategy