Build Your First Strategy

Learn how to create custom trading strategies tailored to your investment goals. Whether you're tweaking a template or building from scratch, this guide will walk you through every step.

Who is this for: Anyone who wants to customize strategies or implement their own trading ideas
Prerequisites: Complete the Your First Backtest tutorial

When to Create Custom Strategies

Template strategies are great starting points, but you might want to create your own when:

  • You have specific risk tolerance preferences (tighter stops, different position sizes)
  • You want to test a trading idea you've read about or developed
  • The template parameters don't match your trading timeframe
  • You want to combine multiple technical indicators in a unique way
  • You're trading specific asset classes that need different approaches

Strategy Anatomy: What Makes Up a Strategy

Every trading strategy in Stratify consists of these core components:

1. Basic Information

  • Name: Descriptive title (e.g., "Aggressive Momentum", "Conservative Mean Reversion")
  • Description: What the strategy does and when to use it
  • Tags: Keywords for organization (e.g., "momentum", "swing-trading", "tech-stocks")

2. Strategy Type

Choose the trading approach:

  • momentum: Follow trends and ride price movements
  • mean_reversion: Buy dips, sell rallies back to average
  • breakout: Capture explosive moves beyond support/resistance
  • sentiment_based: Trade based on social/news sentiment
  • custom: Your own unique approach

3. Timeframe

The chart interval for analysis:

  • 1m, 5m, 15m - Day trading
  • 1h, 4h - Intraday/swing
  • 1d - Daily (most common)
  • 1w, 1M - Long-term

4. Parameters

Strategy-specific settings that control indicator values, thresholds, and logic. These vary by strategy type (explained in detail below).

5. Risk Management

  • Stop Loss %: Maximum loss per trade (e.g., 2%)
  • Take Profit %: Target gain to exit (e.g., 5%)
  • Trailing Stop % (optional): Moving stop that locks in gains

6. Position Sizing

  • fixed: Fixed dollar amount per trade (e.g., $10,000)
  • percent_equity: Percentage of account (e.g., 10%)
  • risk_based: Based on distance to stop loss
  • kelly: Kelly Criterion for optimal sizing

Method 1: Clone and Modify a Template

The easiest way to create a custom strategy is to start with a template and modify it. This is perfect for beginners.

Step-by-Step:

  1. Go to the Strategies tab
  2. Find a template strategy similar to what you want (e.g., Momentum)
  3. Click the "Clone" button on the strategy card
  4. The strategy form opens with all the template's settings pre-filled
  5. Modify what you want:
    • Change the name (e.g., "Momentum - RSI & MA Crossover" → "My Aggressive Momentum")
    • Adjust parameters (e.g., RSI oversold from 30 to 25)
    • Tweak risk management (e.g., stop loss from 2% to 3%)
    • Modify position size (e.g., from 10% to 5% of equity)
  6. Click "Create Strategy"
  7. Run a backtest to see how your changes affect performance

Pro Tip: Clone the template first, then make ONE change at a time. Run backtests after each change to see the impact. This helps you understand what works and what doesn't.

Common Modifications:

Make it More Aggressive

  • • Wider stop loss (2% → 4%)
  • • Higher take profit (5% → 8%)
  • • Larger position size (10% → 15%)
  • • More sensitive indicators (RSI 30 → 40)

Make it More Conservative

  • • Tighter stop loss (2% → 1%)
  • • Lower take profit (5% → 3%)
  • • Smaller position size (10% → 5%)
  • • Less sensitive indicators (RSI 30 → 20)

Adjust for Different Timeframes

  • • Daily → 1h: Reduce MA periods (50 → 20)
  • • Daily → Weekly: Increase MA periods (50 → 100)
  • • Shorter timeframe = tighter stops
  • • Longer timeframe = wider stops

Method 2: Create from Scratch

Ready to build your own strategy from the ground up? Here's how:

  1. Click the "+ Create Strategy" button in the Strategies tab
  2. Fill in basic information:
    • Name: Be descriptive (e.g., "MACD Crossover with Volume Confirmation")
    • Description: Explain your approach and when it works best
    • Tags: Add keywords for easy filtering
  3. Choose your strategy type (momentum, mean_reversion, breakout, sentiment_based, or custom)
  4. Set the timeframe (recommend starting with 1d)
  5. Configure parameters based on your strategy type (see detailed guide below)
  6. Set risk management rules
  7. Choose position sizing method and value
  8. Save and test!

Strategy Parameters Explained

Each strategy type has different parameters. Here's what they mean:

Momentum Strategy Parameters

rsi_period (default: 14)

Number of periods for RSI calculation. Shorter = more sensitive to price changes.

Try: 7 (aggressive), 21 (conservative)

rsi_oversold (default: 30)

Buy threshold. Lower = wait for deeper dips.

Try: 20 (conservative), 40 (aggressive)

rsi_overbought (default: 70)

Sell threshold. Higher = hold longer in uptrends.

Try: 60 (conservative), 80 (aggressive)

ma_short (default: 20)

Short moving average period. Faster indicator.

Try: 10 (day trading), 50 (swing trading)

ma_long (default: 50)

Long moving average period. Slower, smoother indicator.

Try: 100 (longer trends), 200 (major trends)

Example Configuration:
RSI: 14 period, oversold 30, overbought 70
MAs: 20/50 crossover
Logic: Buy when RSI < 30 AND short MA crosses above long MA

Mean Reversion Parameters

bb_period (default: 20)

Bollinger Band lookback period. Standard is 20 days.

Try: 10 (more responsive), 30 (smoother)

bb_std (default: 2.0)

Standard deviations for band width. 2.0 captures ~95% of price action.

Try: 1.5 (tighter bands), 2.5 (wider bands)

rsi_period, rsi_oversold, rsi_overbought

Same as Momentum strategy - used for confirmation.

Example Configuration:
Bollinger: 20 period, 2.0 std dev
RSI: 14 period, oversold 30
Logic: Buy when price touches lower band AND RSI < 30

Breakout Strategy Parameters

lookback (default: 20)

Days to look back for high/low. Buy if price breaks above this range.

Try: 10 (shorter term), 50 (longer term)

volume_threshold (default: 1.5)

Volume must be this much higher than average. 1.5 = 50% above average.

Try: 1.2 (more trades), 2.0 (fewer but stronger)

Example Configuration:
Lookback: 20 days
Volume: 1.5x average
Logic: Buy when price breaks 20-day high WITH volume 1.5x average

Sentiment-Based Parameters

sentiment_threshold (default: 0.6)

Minimum sentiment score (0-1). 0.6 = 60% positive sentiment.

Try: 0.5 (more trades), 0.7 (only very positive)

min_mentions (default: 10)

Minimum social media mentions required for signal reliability.

Try: 5 (smaller stocks), 50 (major stocks only)

rsi_period

RSI for technical confirmation (same as Momentum).

Example Configuration:
Sentiment: 0.6 threshold, 10 min mentions
RSI: 14 period
Logic: Buy when sentiment > 0.6 AND RSI favorable

Risk Management Best Practices

Proper risk management is MORE important than your entry/exit signals. Follow these guidelines:

Stop Loss Guidelines

  • Always use stop losses - Never trade without them
  • • Conservative: 1-2% per trade
  • • Moderate: 2-3% per trade
  • • Aggressive: 3-5% per trade
  • • Never risk more than 5% on a single trade

Take Profit Guidelines

  • • Use a reward:risk ratio of at least 1.5:1
  • • If stop loss is 2%, take profit should be 3% minimum
  • • Swing trading: 3-5% take profit
  • • Day trading: 0.5-2% take profit
  • • Trend following: Use trailing stops instead of fixed targets

Trailing Stops

Automatically move your stop loss as price increases. Perfect for trend-following strategies.

  • • Conservative: 0.5-1% trailing
  • • Aggressive: 1-2% trailing
  • • Use with momentum and breakout strategies
  • • Don't use with mean reversion (needs fixed targets)

Position Sizing

  • • Conservative: 5-10% of equity per trade
  • • Moderate: 10-15% of equity per trade
  • • Aggressive: 15-20% of equity per trade
  • • Never put all capital in one trade
  • • Consider using risk_based sizing for automatic calculation

Critical Rule: Never risk more than 2% of your total capital on a single trade. If you have $100,000, your maximum loss per trade should be $2,000. This protects you from catastrophic losses.

Testing Your Strategy

After creating your strategy, test it thoroughly before using real money:

1. Test on Multiple Symbols

Run backtests on at least 5-10 different stocks:

  • Different sectors (tech, finance, healthcare, energy)
  • Different market caps (large, mid, small cap)
  • Different volatility levels (stable vs volatile)

2. Test Multiple Time Periods

Your strategy must work in different market conditions:

  • Bull market (2020-2021)
  • Bear market (2022)
  • Sideways market (2023)
  • At least 2-3 years of total data

3. Use Bulk Testing

Save time by testing multiple configurations at once:

  1. Create 2-3 variations of your strategy (conservative, moderate, aggressive)
  2. Go to the Backtests tab
  3. Click "Bulk Test Multiple Strategies"
  4. Select all your variations
  5. Configure once (same symbol, dates, capital)
  6. Click "Run X Backtests"
  7. Compare results in the Results tab

4. Compare Against Templates

Run your custom strategy alongside the templates on the same data. Does yours perform better? If not, why?

Iterating and Improving

Your first strategy won't be perfect. Here's how to improve it:

Analyze Losing Trades

Click on your backtest to see all trades. Look for patterns in losses:

  • Are you entering too early? Adjust your indicators
  • Are stop losses too tight? Widen them
  • Are you trading in wrong conditions? Add filters

Track Your Changes

Keep notes in your strategy description about what you've tested:

"v1: Original template (RSI 30/70)
v2: Tightened to RSI 25/75 - improved win rate
v3: Added 200 MA filter - reduced drawdown by 5%"

Walk-Forward Testing

Professional approach to avoid overfitting:

  1. Optimize on 2020-2022 data
  2. Test on 2023 data (out-of-sample)
  3. If it works on 2023, you have a robust strategy
  4. If it fails, you overfit - start over

Warning: Don't endlessly optimize until you get perfect results. That's curve-fitting and it won't work in real trading. A strategy that works "good enough" on multiple stocks and time periods is better than one that's perfect on limited data.

What Makes a Good Strategy?

Look for these characteristics when evaluating your strategy:

✓ Good Characteristics

  • • Positive returns across multiple stocks
  • • Sharpe ratio above 1.0
  • • Max drawdown under 20%
  • • Win rate above 45%
  • • Consistent performance over time
  • • Works in different market conditions
  • • Simple logic (fewer parameters = better)

✗ Warning Signs

  • • Works on only one or two stocks
  • • Great in one period, terrible in another
  • • Too many parameters (over-optimization)
  • • Requires perfect timing
  • • High win rate but huge losses
  • • Max drawdown over 30%
  • • Too good to be true (check for errors)

Final Tips for Success

  • Start simple - Clone a template and make small changes
  • Test thoroughly - Multiple stocks, multiple periods
  • Focus on risk management - Protect your capital first
  • Document everything - What you tried, what worked, what didn't
  • Be patient - Building a good strategy takes time
  • Paper trade first - Test with fake money before risking real capital
  • Keep learning - Markets change, strategies need updates

Ready to Build Your Strategy?

You now have all the knowledge you need to create and test your own trading strategies. Start by cloning a template, make one change at a time, and test thoroughly.

Open Stratify App

Related Resources