DEV Community

Henry Lin
Henry Lin

Posted on

Lesson 10: Trading Pair Selection and Testing

Lesson 10: Trading Pair Selection and Testing

⏱ Duration: 1.5 hours
🎯 Learning Objectives: Learn to select suitable trading pairs
πŸ“š Difficulty: ⭐⭐ Backtesting practical


πŸ“– Course Overview

Different trading pairs have different characteristics. Choosing suitable trading pairs has a huge impact on strategy performance. This lesson will teach you how to evaluate the liquidity and volatility of trading pairs, and how to build multi-pair portfolios to diversify risk.


10.1 Blue Chips vs Altcoins

Trading Pair Classification

1. Blue Chips

Definition: Top 10-20 cryptocurrencies by market cap

Representative Coins:

  • BTC/USDT (Bitcoin) - #1 market cap
  • ETH/USDT (Ethereum) - #2 market cap
  • BNB/USDT (Binance Coin) - Exchange token
  • XRP/USDT (Ripple)
  • SOL/USDT (Solana)
  • ADA/USDT (Cardano)

Characteristics:

  • βœ… Good liquidity (high trading volume)
  • βœ… Relatively stable volatility
  • βœ… Small price spread (low slippage)
  • βœ… Hard to manipulate
  • βœ… Transparent information
  • ⚠️ Relatively lower returns

Risk Rating: 🟒 Low Risk

2. Mid-Caps

Definition: Market cap ranking 20-100

Representative Coins:

  • MATIC/USDT (Polygon)
  • LINK/USDT (Chainlink)
  • UNI/USDT (Uniswap)
  • AVAX/USDT (Avalanche)
  • ATOM/USDT (Cosmos)

Characteristics:

  • βœ… Good liquidity
  • ⚠️ Higher volatility
  • ⚠️ Higher return potential
  • ⚠️ Moderate risk

Risk Rating: 🟑 Medium Risk

3. Altcoins

Definition: Market cap ranking 100+

Characteristics:

  • ❌ Poor liquidity (low trading volume)
  • ❌ Extremely high volatility (daily volatility 20%+)
  • ❌ Large price spread (high slippage)
  • ❌ Easy to manipulate
  • ❌ Information asymmetry
  • ⚠️ High risk, high return

Risk Rating: πŸ”΄ High Risk

Blue Chips vs Altcoins Comparison

Feature Blue Chips Mid-Caps Altcoins
Daily Volume > $1B $100M-$1B < $100M
Daily Volatility 2-5% 5-10% 10-30%
Slippage < 0.1% 0.1-0.3% > 0.5%
Manipulation Risk Very Low Low High
Return Potential Medium High Very High
Suitable for Beginners βœ… Yes ⚠️ Cautious ❌ No

Recommended Configurations

Conservative (Beginner Recommended)

100% Blue Chips
- BTC/USDT: 40%
- ETH/USDT: 40%
- BNB/USDT: 20%
Enter fullscreen mode Exit fullscreen mode

Balanced

70% Blue Chips + 30% Mid-Caps
- BTC/USDT: 30%
- ETH/USDT: 30%
- BNB/USDT: 10%
- SOL/USDT: 15%
- MATIC/USDT: 15%
Enter fullscreen mode Exit fullscreen mode

Aggressive (Experienced)

50% Blue Chips + 40% Mid-Caps + 10% Altcoins
- BTC/USDT: 25%
- ETH/USDT: 25%
- SOL/USDT: 20%
- LINK/USDT: 20%
- Other small coins: 10%
Enter fullscreen mode Exit fullscreen mode

10.2 Liquidity Assessment

What is Liquidity?

Definition: The ability of an asset to be quickly bought or sold without significantly affecting its price.

Key Metrics:

  1. 24-hour Trading Volume
  2. Order Book Depth
  3. Bid-Ask Spread

24-hour Trading Volume

Evaluation Standards:

Excellent: > $500M/day
Good: $100M-$500M/day
Average: $20M-$100M/day
Poor: $5M-$20M/day
Very Poor: < $5M/day
Enter fullscreen mode Exit fullscreen mode

How to Check:
Visit CoinMarketCap or CoinGecko

Case Comparison:

BTC/USDT: $25,000M/day βœ… Excellent
ETH/USDT: $10,000M/day βœ… Excellent
SOL/USDT: $800M/day βœ… Excellent
MATIC/USDT: $300M/day βœ… Good
DOGE/USDT: $150M/day βœ… Good
Some small coin/USDT: $2M/day ❌ Very Poor
Enter fullscreen mode Exit fullscreen mode

Order Book Depth

Definition: The quantity of orders at different price levels.

How to Check:

  1. Login to Binance
  2. Open the trading pair page
  3. View "Depth Chart"

Evaluation Standards:

Good depth: Large number of orders within Β±2% price range
Poor depth: Few orders within Β±2% price range
Enter fullscreen mode Exit fullscreen mode

Impact:

  • Good depth β†’ Large orders won't significantly affect price
  • Poor depth β†’ Large orders will cause significant price fluctuations

Bid-Ask Spread

Definition: The difference between the best bid price and best ask price.

Calculation Formula:

Spread = (Ask Price - Bid Price) / Bid Price Γ— 100%
Enter fullscreen mode Exit fullscreen mode

Case:

BTC/USDT:
Bid Price: $43,500.00
Ask Price: $43,500.50
Spread = ($43,500.50 - $43,500.00) / $43,500.00 = 0.0011%

Some small coin/USDT:
Bid Price: $0.1000
Ask Price: $0.1050
Spread = ($0.1050 - $0.1000) / $0.1000 = 5%
Enter fullscreen mode Exit fullscreen mode

Evaluation Standards:

Excellent: < 0.01% (Blue Chips)
Good: 0.01-0.05%
Average: 0.05-0.1%
Poor: 0.1-0.5%
Very Poor: > 0.5% (Altcoins)
Enter fullscreen mode Exit fullscreen mode

Impact of Liquidity on Strategies

High Liquidity Trading Pairs:

  • βœ… Small slippage (execution price close to backtest price)
  • βœ… More reliable backtest results
  • βœ… Suitable for high-frequency strategies
  • βœ… Large capital can trade

Low Liquidity Trading Pairs:

  • ❌ Large slippage (live trading returns much lower than backtest)
  • ❌ Unreliable backtest results
  • ❌ Not suitable for high-frequency strategies
  • ❌ Large capital will affect price

Slippage Case:

Backtest Results (Ideal):
Buy Price: $100.00
Sell Price: $102.00
Return: +2%

Live Trading Results (Low Liquidity):
Buy Price: $100.20 (slippage +0.2%)
Sell Price: $101.60 (slippage -0.4%)
Return: +1.4% (30% profit loss!)
Enter fullscreen mode Exit fullscreen mode

10.3 Volatility Analysis

What is Volatility?

Definition: The magnitude and frequency of price changes.

Calculation Methods:

# Daily volatility (simplified)
daily_volatility = (high - low) / low Γ— 100%

# Standard deviation volatility (professional)
import numpy as np
returns = prices.pct_change()
volatility = returns.std() Γ— 100%
Enter fullscreen mode Exit fullscreen mode

Volatility Classification

Volatility Daily Range Representative Coins Suitable Strategies
Very Low < 2% Stable coin pairs Arbitrage
Low 2-5% BTC, ETH Trend Following
Medium 5-10% Mid-caps Balanced Strategies
High 10-20% Hot altcoins Short-term Breakout
Very High > 20% Small cap coins Not Recommended

Impact of Volatility on Strategies

High Volatility vs Low Volatility

High Volatility Trading Pairs (Daily Range > 10%):

Advantages:

  • βœ… Large profit space
  • βœ… Easy to reach take profit targets
  • βœ… Suitable for short-term strategies

Disadvantages:

  • ❌ Easy to trigger stop losses
  • ❌ Many false breakouts
  • ❌ High drawdown risk
  • ❌ High psychological pressure

Suitable Strategies:

  • Short-term breakout strategies
  • High-frequency trading strategies
  • Need to widen stop loss (> -10%)

Low Volatility Trading Pairs (Daily Range < 5%):

Advantages:

  • βœ… Good stability
  • βœ… Small drawdowns
  • βœ… Controllable risk
  • βœ… Suitable for beginners

Disadvantages:

  • ⚠️ Small profit space
  • ⚠️ Hard to reach high take profit targets
  • ⚠️ Few trading opportunities

Suitable Strategies:

  • Trend following strategies
  • Long-term swing strategies
  • Need to lower ROI targets (2-5%)

Volatility Testing

Using Freqtrade Commands:

# Download data
freqtrade download-data -c config.json --pairs BTC/USDT ETH/USDT SOL/USDT DOGE/USDT --days 90 --timeframes 1d

# View price fluctuations
freqtrade plot-dataframe -c config.json --pairs BTC/USDT --timerange 20250701-20250930
Enter fullscreen mode Exit fullscreen mode

Manual Calculation:
Visit TradingView, view ATR (Average True Range) indicator for different trading pairs.

Strategy Adaptation to Volatility

Adjust Stop Loss:

# Low volatility trading pairs
stoploss = -0.03  # 3% stop loss

# Medium volatility trading pairs
stoploss = -0.05  # 5% stop loss

# High volatility trading pairs
stoploss = -0.10  # 10% stop loss
Enter fullscreen mode Exit fullscreen mode

Adjust ROI:

# Low volatility trading pairs (BTC/ETH)
minimal_roi = {
    "0": 0.05,   # 5% target
    "120": 0.03,
    "240": 0.01
}

# High volatility trading pairs (altcoins)
minimal_roi = {
    "0": 0.15,   # 15% target
    "60": 0.08,
    "120": 0.03
}
Enter fullscreen mode Exit fullscreen mode

10.4 Multi-Pair Portfolio Testing

Why Need Multiple Trading Pairs?

Risk of Single Trading Pair:

Only trading BTC/USDT:
- BTC sideways β†’ No strategy signals β†’ No returns
- BTC crashes β†’ Stop loss triggered β†’ Losses
Enter fullscreen mode Exit fullscreen mode

Advantages of Multiple Trading Pairs:

  • βœ… Diversify risk
  • βœ… Increase trading opportunities
  • βœ… Smooth return curve
  • βœ… Reduce drawdowns

Multi-Pair Backtesting

Method 1: Configuration File Setup

Edit config.json:

{
  "exchange": {
    "pair_whitelist": [
      "BTC/USDT",
      "ETH/USDT",
      "BNB/USDT",
      "SOL/USDT",
      "XRP/USDT"
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Run backtest:

freqtrade backtesting \
  -c config.json \
  --strategy Strategy001 \
  --timerange 20250701-20250930
Enter fullscreen mode Exit fullscreen mode

Method 2: Command Line Specification

freqtrade backtesting \
  -c config.json \
  --strategy Strategy001 \
  --pairs BTC/USDT ETH/USDT BNB/USDT \
  --timerange 20250701-20250930
Enter fullscreen mode Exit fullscreen mode

Multi-Pair Results Analysis

Backtest Report Example:

BACKTESTING REPORT
┏━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Pair       ┃ Trades ┃ Avg Profit ┃ Tot Profit % ┃ Win Rate % ┃
┑━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
β”‚ BTC/USDT   β”‚     28 β”‚       1.52 β”‚         8.45 β”‚       85.7 β”‚
β”‚ ETH/USDT   β”‚     35 β”‚       1.38 β”‚        10.22 β”‚       82.9 β”‚
β”‚ BNB/USDT   β”‚     22 β”‚       1.65 β”‚         7.15 β”‚       86.4 β”‚
β”‚ SOL/USDT   β”‚     42 β”‚       0.95 β”‚         6.83 β”‚       78.6 β”‚
β”‚ XRP/USDT   β”‚     18 β”‚       1.12 β”‚         4.52 β”‚       77.8 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ TOTAL      β”‚    145 β”‚       1.34 β”‚        37.17 β”‚       82.1 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

Analysis Points:

  1. Best performing pair: ETH/USDT (Total profit 10.22%)
  2. Worst performing pair: XRP/USDT (Total profit 4.52%)
  3. Most stable pair: BNB/USDT (Win rate 86.4%)
  4. Most traded pair: SOL/USDT (42 trades)

Correlation Analysis

What is Correlation?
The similarity of price movements between two trading pairs.

Correlation Coefficient:

+1.0: Perfect positive correlation (move up and down together)
0.0: No correlation
-1.0: Perfect negative correlation (one up, one down)
Enter fullscreen mode Exit fullscreen mode

Typical Correlations:

BTC/USDT vs ETH/USDT: 0.85 (High positive correlation)
BTC/USDT vs DOGE/USDT: 0.65 (Medium positive correlation)
BTC/USDT vs stable coin pairs: 0.05 (No correlation)
Enter fullscreen mode Exit fullscreen mode

Risk Diversification Principles:

  • ❌ Choose pairs with correlation > 0.9 (no diversification effect)
  • βœ… Choose pairs with correlation 0.5-0.8 (optimal balance)
  • ⚠️ Choose pairs with correlation < 0.3 (over-diversified)

Recommended Portfolios:

Portfolio 1 (Conservative):
- BTC/USDT (40%)
- ETH/USDT (40%)
- BNB/USDT (20%)
Correlation: 0.8-0.9

Portfolio 2 (Balanced):
- BTC/USDT (30%)
- ETH/USDT (25%)
- SOL/USDT (20%)
- MATIC/USDT (15%)
- LINK/USDT (10%)
Correlation: 0.6-0.8

Portfolio 3 (Diversified):
- BTC/USDT (20%)
- ETH/USDT (20%)
- BNB/USDT (15%)
- SOL/USDT (15%)
- XRP/USDT (10%)
- MATIC/USDT (10%)
- LINK/USDT (10%)
Correlation: 0.5-0.7
Enter fullscreen mode Exit fullscreen mode

Building Optimal Portfolio

Steps:

  1. Filter Trading Pairs:

    • 24h volume > $100M
    • Tradable on Binance
    • Exclude stable coin pairs
  2. Individual Backtests:

   for pair in BTC/USDT ETH/USDT BNB/USDT SOL/USDT XRP/USDT
   do
     freqtrade backtesting -c config.json --strategy Strategy001 --pairs $pair --timerange 20250701-20250930
   done
Enter fullscreen mode Exit fullscreen mode
  1. Select Well-Performing Pairs:

    • Total profit > 5%
    • Win rate > 70%
    • Max drawdown < 10%
  2. Portfolio Backtest:

   freqtrade backtesting \
     -c config.json \
     --strategy Strategy001 \
     --pairs BTC/USDT ETH/USDT BNB/USDT \
     --timerange 20250701-20250930
Enter fullscreen mode Exit fullscreen mode
  1. Compare Results:
   Single Pair (BTC/USDT):
     Profit: +8.45%
     Drawdown: -6.2%

   Three-Pair Portfolio:
     Profit: +25.82% (sum of all pairs)
     Drawdown: -4.8% (lower!)

   Conclusion: Portfolio is better βœ…
Enter fullscreen mode Exit fullscreen mode

πŸ’‘ Practical Tasks

Task 1: Download Multi-Pair Data

# Download data for 5 mainstream trading pairs
freqtrade download-data \
  -c config.json \
  --pairs BTC/USDT ETH/USDT BNB/USDT SOL/USDT XRP/USDT \
  --days 90 \
  --timeframes 15m
Enter fullscreen mode Exit fullscreen mode

Task 2: Test Each Pair Individually

# Test BTC/USDT
freqtrade backtesting -c config.json --strategy Strategy001 --pairs BTC/USDT --timerange 20250701-20250930 --timeframe 15m

# Test ETH/USDT
freqtrade backtesting -c config.json --strategy Strategy001 --pairs ETH/USDT --timerange 20250701-20250930 --timeframe 15m

# Test BNB/USDT
freqtrade backtesting -c config.json --strategy Strategy001 --pairs BNB/USDT --timerange 20250701-20250930 --timeframe 15m

# Test SOL/USDT
freqtrade backtesting -c config.json --strategy Strategy001 --pairs SOL/USDT --timerange 20250701-20250930 --timeframe 15m

# Test XRP/USDT
freqtrade backtesting -c config.json --strategy Strategy001 --pairs XRP/USDT --timerange 20250701-20250930 --timeframe 15m
Enter fullscreen mode Exit fullscreen mode

Task 3: Create Trading Pair Comparison Table

Trading Pair Trade Count Win Rate% Total Profit% Avg Profit% Max Drawdown% Sharpe 24h Volume Recommendation
BTC/USDT ? ? ? ? ? ? ? ⭐?
ETH/USDT ? ? ? ? ? ? ? ⭐?
BNB/USDT ? ? ? ? ? ? ? ⭐?
SOL/USDT ? ? ? ? ? ? ? ⭐?
XRP/USDT ? ? ? ? ? ? ? ⭐?

Task 4: Portfolio Testing

Select the 3 best performing pairs for portfolio backtesting:

freqtrade backtesting \
  -c config.json \
  --strategy Strategy001 \
  --pairs [your 3 selected pairs] \
  --timerange 20250701-20250930 \
  --timeframe 15m
Enter fullscreen mode Exit fullscreen mode

Compare single pair vs portfolio:

Best Single Pair:
  Pair: ___________
  Total Profit: ___________%
  Max Drawdown: ___________%

Three-Pair Portfolio:
  Total Profit: ___________%
  Max Drawdown: ___________%

Conclusion:
  ☐ Portfolio performs better (higher profit or lower drawdown)
  ☐ Single pair performs better
Enter fullscreen mode Exit fullscreen mode

Task 5: Build Your Portfolio

Based on test results, design your portfolio:

My Portfolio:

Pair 1: ___________ (___%)
Pair 2: ___________ (___%)
Pair 3: ___________ (___%)
Pair 4 (Optional): ___________ (___%)
Pair 5 (Optional): ___________ (___%)

Total: 100%

Reasons for Selection:
1. ___________
2. ___________
3. ___________
Enter fullscreen mode Exit fullscreen mode

πŸ“š Knowledge Check

Basic Questions

  1. What are the main differences between blue chips and altcoins?
  2. What characteristics do good liquidity trading pairs have?
  3. What strategies are suitable for high volatility trading pairs?

Answers

  1. Liquidity, volatility, and risk: Blue chips have good liquidity, low volatility, and low risk; altcoins are the opposite
  2. High trading volume, small bid-ask spread, good order book depth
  3. Short-term breakout strategies, high-frequency trading strategies, need to widen stop loss

Advanced Questions

  1. Why are backtest results for low liquidity trading pairs unreliable?
  2. How to judge correlation between trading pairs?
  3. What is the principle behind multi-pair portfolios reducing risk?

Thought Questions

  1. If all trading pairs are highly correlated, does diversification still make sense?
  2. Altcoin backtest returns are high, should they be traded in live trading?
  3. How to dynamically adjust trading pair portfolios?

πŸ”— Reference Materials

Data Query Websites

Supporting Documentation

Recommended Reading


πŸ“Œ Key Points Summary

  1. Beginners recommend blue chips: BTC, ETH, BNB
  2. Liquidity > Return Potential: Avoid low liquidity trading pairs
  3. Match volatility to strategy: High volatility for short-term, low volatility for long-term
  4. Multi-pair diversifies risk: Don't put all eggs in one basket
  5. Correlation shouldn't be too high: 0.5-0.8 is optimal
  6. Slippage is a silent killer: Live trading returns may be much lower than backtest

➑️ Part Two Summary

Congratulations! You have completed Part Two: Backtesting Practical (Lessons 5-10)

You've learned:

  • βœ… Lesson 5: Run your first complete backtest
  • βœ… Lesson 6: Interpret backtest reports, analyze strategy performance
  • βœ… Lesson 7: Test different timeframes
  • βœ… Lesson 8: Batch compare multiple strategies
  • βœ… Lesson 9: Validate strategy stability, avoid overfitting
  • βœ… Lesson 10: Select suitable trading pairs

Next Part Preview:
Part Three: Strategy Optimization (Lessons 11-15)

In Part Three, you will learn:

  • Lesson 11: Use Hyperopt to optimize strategy parameters
  • Lesson 12: Advanced strategy analysis techniques
  • Lesson 13: Build strategy scoring system
  • Lesson 14: Risk management and capital management
  • Lesson 15: Build strategy portfolios

Preparation:

  • βœ… Select 1-2 well-performing strategies
  • βœ… Download at least 6 months of historical data
  • βœ… Ensure sufficient computing resources (Hyperopt needs it)

🎯 Learning Check Standards:

  • βœ… Can independently select suitable trading pairs
  • βœ… Can evaluate liquidity and volatility of trading pairs
  • βœ… Can build multi-pair portfolios
  • βœ… Understand the impact of correlation on risk diversification

After completing Part Two, you have mastered the core skills of backtesting! Ready to move on to advanced strategy optimization learning! πŸš€πŸŽ‰

Top comments (0)