Your First Trading Strategy

Learn how to build a complete trading strategy from scratch using MangoLabs' visual strategy builder. We'll create a simple but effective RSI-based mean reversion strategy that you can backtest and deploy.

Strategy Overview

We'll build a RSI Mean Reversion strategy that:

  • Buys when RSI drops below 30 (oversold)
  • Sells when RSI rises above 70 (overbought)
  • Uses a 14-period RSI indicator
  • Works on 1-hour timeframe for Bitcoin (BTCUSDT)

Prerequisites

Before building your strategy, make sure you have:

  • A MangoLabs account (see Quick Start)
  • A paper trading account created
  • Basic understanding of RSI indicator (we'll explain as we go)

Step 1: Create the RSI Feature

Features are the building blocks of strategies. Let's create an RSI feature:

Creating RSI Feature

  1. Navigate to Features: Click "Features" in the sidebar
  2. Create New Feature: Click the "Create Feature" button
  3. Configure Feature:
    • Name: RSI_14
    • Type: Select "RSI" from the indicator dropdown
    • Period: Enter 14
    • Source: Select "Close" (closing price)
  4. Save Feature: Click "Create" button

What is RSI? The Relative Strength Index (RSI) measures the speed and magnitude of price changes. Values below 30 typically indicate oversold conditions (potential buy), while values above 70 indicate overbought conditions (potential sell).

Step 2: Create Your Strategy Canvas

Now we'll use the visual strategy builder to design our trading logic:

Creating Strategy

  1. Navigate to Strategies: Click "Strategies" in the sidebar
  2. Create New Strategy: Click "Create Strategy" button
  3. Name Your Strategy: Enter "RSI Mean Reversion"
  4. Enter Strategy Editor: Click "Create" to open the visual canvas

Step 3: Build Entry Logic (Buy Signal)

Let's create the logic for when to enter a trade (buy):

Buy Signal Logic

Drag these nodes onto the canvas:

  1. Feature Node:
    • From the left palette, drag a "Feature" node
    • Select "RSI_14" from the dropdown
    • This provides the current RSI value
  2. Static Value Node:
    • Drag a "Static Value" node
    • Enter value: 30
    • This is our oversold threshold
  3. Comparison Node:
    • Drag a "Comparison" node
    • Set operator to < (less than)
    • This checks if RSI is below 30
  4. Output Node:
    • Drag an "Output" node
    • Label it: buy_signal

Connect the nodes:

  • Connect RSI_14 feature → Comparison node (left input)
  • Connect Static Value (30) → Comparison node (right input)
  • Connect Comparison output → Output node (buy_signal)

Result: The buy_signal output will be true when RSI drops below 30, indicating an oversold condition.

Step 4: Build Exit Logic (Sell Signal)

Now create the logic for when to exit a trade (sell):

Sell Signal Logic

Add these nodes:

  1. Feature Node:Drag another "Feature" node and select "RSI_14"
  2. Static Value Node:Drag a "Static Value" node with value 70
  3. Comparison Node:Drag a "Comparison" node with operator > (greater than)
  4. Output Node:Drag an "Output" node labeled sell_signal

Connect the nodes:

  • Connect RSI_14 feature → Comparison node (left input)
  • Connect Static Value (70) → Comparison node (right input)
  • Connect Comparison output → Output node (sell_signal)

Result: The sell_signal output will be true when RSI rises above 70, indicating an overbought condition.

Step 5: Save Your Strategy

Before testing, make sure to save your work:

  1. Click the "Save" button in the top-right corner of the strategy editor
  2. Wait for the success notification
  3. Your strategy is now saved and ready for backtesting

Step 6: Backtest Your Strategy

Time to see how your strategy would have performed historically:

Running Your Backtest

  1. From the strategy editor, click the "Backtest" button
  2. Configure backtest parameters:
    • Symbol: BTCUSDT
    • Timeframe: 1h
    • Start Date: 3 months ago
    • End Date: Today
    • Initial Capital: $10,000
  3. Click "Start Backtest"
  4. Wait 30-60 seconds for results

Step 7: Analyze Results

Once the backtest completes, review these key metrics:

Total Return

Percentage gain or loss over the backtest period. Positive means profitable!

Sharpe Ratio

Risk-adjusted return. Above 1.0 is good, above 2.0 is excellent.

Max Drawdown

Largest peak-to-trough decline. Lower is better (less risk).

Win Rate

Percentage of profitable trades. Above 50% means more wins than losses.

Interpreting Results: Don't just look at total return! A strategy with high returns but massive drawdowns might be too risky. Look for balanced strategies with decent returns, good Sharpe ratio, and manageable drawdowns.

Step 8: Deploy to Paper Trading (Optional)

If your backtest results look promising, test it in real-time with paper trading:

  1. Navigate to "Paper Trading" in the sidebar
  2. Click "Deploy Strategy"
  3. Select your "RSI Mean Reversion" strategy
  4. Choose your paper trading account
  5. Set position sizing (e.g., 10% of capital per trade)
  6. Click "Deploy" to start trading with live market data

Pro Tip: Always paper trade for at least 2-4 weeks before considering live trading. This helps you understand how your strategy behaves with real market conditions and slippage.

What's Next?

Congratulations! You've built your first trading strategy. Here are some ideas to improve it:

Add Stop Loss

Protect your capital by adding a stop loss condition (e.g., sell if price drops 5% below entry).

Combine Multiple Indicators

Add MACD or Bollinger Bands to confirm signals and reduce false positives.

Test Different Timeframes

Try 4h or 1d timeframes for longer-term trades with potentially smoother equity curves.