SAR Strategy In-Depth Analysis
Strategy ID: #353 (353rd of 465 strategies)
Strategy Type: Multi-Indicator Trend Reversal Tracking Strategy
Timeframe: 5 minutes (5m)
I. Strategy Overview
SAR (Parabolic SAR) is a multi-indicator trend reversal tracking strategy centered around the Parabolic SAR indicator. This strategy combines multiple technical indicators including RSI oversold bounce, TEMA trend judgment, and Bollinger Band position filtering to form a complete trend reversal capture system.
Core Features
| Feature | Description |
|---|---|
| Buy Condition | 1 composite buy signal requiring 4 conditions to be met simultaneously |
| Sell Condition | 1 composite sell signal requiring 4 conditions to be met simultaneously |
| Protection Mechanism | Fixed stop-loss (-10%) + Trailing stop + Tiered ROI exit |
| Timeframe | 5-minute primary timeframe |
| Dependencies | numpy, pandas, talib, qtpylib |
II. Strategy Configuration Analysis
2.1 Basic Risk Parameters
# ROI Exit Table
minimal_roi = {
"60": 0.01, # Exit with 1% profit after 60 minutes
"30": 0.02, # Exit with 2% profit after 30 minutes
"0": 0.04 # Exit immediately with 4% profit
}
# Stop-loss Setting
stoploss = -0.10 # Fixed 10% stop-loss
# Trailing Stop
trailing_stop = True
Design Philosophy:
- ROI uses a time-decreasing design; shorter holding periods have higher profit targets, encouraging quick profit-taking
- The 4% immediate profit target is relatively aggressive, suitable for capturing short-term rebounds
- Fixed 10% stop-loss combined with trailing stop protects capital while allowing profits to run
2.2 Order Type Configuration
order_types = {
'buy': 'limit',
'sell': 'limit',
'stoploss': 'market',
'stoploss_on_exchange': False
}
Configuration Notes:
- Buy and sell orders use limit orders to reduce slippage costs
- Stop-loss orders use market orders to ensure execution efficiency
III. Buy Conditions Detailed Analysis
3.1 Core Buy Logic
The strategy uses a single composite buy condition requiring all 4 conditions to be met simultaneously:
dataframe.loc[
(
(qtpylib.crossed_above(dataframe['rsi'], 30)) & # RSI crosses above 30
(dataframe['tema'] <= dataframe['bb_middleband']) & # TEMA below BB middle band
(dataframe['tema'] > dataframe['tema'].shift(1)) & # TEMA rising
(dataframe['volume'] > 0) # Has volume
),
'buy'] = 1
3.2 Buy Condition Breakdown
| Condition # | Condition Name | Logic Description | Purpose |
|---|---|---|---|
| #1 | RSI Oversold Reversal | RSI crosses above 30 from below | Capture oversold bounce signal |
| #2 | Price Low Position | TEMA below Bollinger Band middle band | Confirm price is at relatively low position |
| #3 | Short-term Trend Up | TEMA value higher than previous candle | Confirm short-term trend improving |
| #4 | Volume Confirmation | Volume greater than 0 | Filter invalid signals |
3.3 Buy Signal Interpretation
The core concept of this buy logic is oversold bounce capture:
- RSI Breaks Above 30: Classic oversold reversal signal indicating price may have bottomed
- TEMA Below BB Middle Band: Double confirmation that price is at relatively low position
- TEMA Rising: Confirms short-term trend has started to turn
- Volume Filter: Ensures signal validity
IV. Sell Logic Detailed Analysis
4.1 Tiered ROI Profit-Taking
The strategy uses a three-tier ROI exit mechanism:
Holding Time Target Profit Signal Name
───────────────────────────────────────────
0 minutes 4% Immediate profit
30 minutes 2% Short-term profit
60 minutes 1% Break-even exit
4.2 Trailing Stop Mechanism
trailing_stop = True
When trailing stop is enabled, the system dynamically adjusts the stop-loss position as price rises, achieving the "let profits run" effect.
4.3 Technical Sell Signal
dataframe.loc[
(
(qtpylib.crossed_above(dataframe['rsi'], 70)) & # RSI crosses above 70
(dataframe['tema'] > dataframe['bb_middleband']) & # TEMA above BB middle band
(dataframe['tema'] < dataframe['tema'].shift(1)) & # TEMA falling
(dataframe['volume'] > 0) # Has volume
),
'sell'] = 1
| Condition # | Condition Name | Logic Description | Purpose |
|---|---|---|---|
| #1 | RSI Overbought Signal | RSI crosses above 70 from below | Capture overbought reversal signal |
| #2 | Price High Position | TEMA above Bollinger Band middle band | Confirm price is at relatively high position |
| #3 | Short-term Trend Down | TEMA value lower than previous candle | Confirm short-term trend weakening |
| #4 | Volume Confirmation | Volume greater than 0 | Filter invalid signals |
V. Technical Indicator System
5.1 Core Indicators
| Indicator Category | Specific Indicator | Purpose |
|---|---|---|
| Momentum | RSI (Relative Strength Index) | Overbought/oversold judgment, signal triggering |
| Trend | TEMA (Triple Exponential Moving Average) | Short-term trend direction judgment |
| Volatility | Bollinger Bands | Relative price position judgment |
| Trend | SAR (Parabolic SAR) | Strategy name origin, used for visual analysis |
| Momentum | MACD | Auxiliary trend judgment |
| Momentum | ADX (Average Directional Index) | Trend strength judgment |
| Momentum | Stochastic Fast | Short-term momentum indicator |
| Volume | MFI (Money Flow Index) | Money flow judgment |
5.2 Auxiliary Indicators
# Cycle Indicators
hilbert = ta.HT_SINE(dataframe)
dataframe['htsine'] = hilbert['sine']
dataframe['htleadsine'] = hilbert['leadsine']
Hilbert Transform Sine Wave indicators are used for cyclical analysis to assist in market cycle determination.
VI. Risk Management Features
6.1 Dual Protection: Fixed Stop-Loss + Trailing Stop
- Fixed Stop-Loss -10%: Sets a safety floor to prevent major losses
- Trailing Stop: Dynamically adjusts stop-loss position during profit to lock in gains
6.2 Tiered ROI Profit-Taking
Time-Dimension Risk Management:
├── 0 minutes: 4% target → Quick profit opportunity
├── 30 minutes: 2% target → Medium-term profit
└── 60 minutes: 1% target → Break-even exit
6.3 Multi-Condition Filtering
Both buy and sell require 4 conditions to be met simultaneously, effectively reducing false signals:
- RSI breakout confirms trend reversal intent
- TEMA/BB position confirms relative price level
- TEMA change direction confirms short-term trend
- Volume confirms signal validity
VII. Strategy Advantages and Limitations
✅ Advantages
- Clear Logic: Symmetrical buy/sell conditions, easy to understand and adjust
- Oversold Bounce Capture: RSI oversold reversal is a classic effective strategy
- Multiple Filtering: 4 conditions must be met simultaneously, reducing false signals
- Trailing Stop: Allows profits to run while controlling risk
⚠️ Limitations
- Oscillating Market Risk: May trigger frequent stop-losses in sideways markets
- Single Signal Source: Relies on only one composite signal, lacks diversity
- Wide Stop-Loss: 10% stop-loss may be too large, requires capital management coordination
- Unoptimized Parameters: Default parameters may not suit all trading pairs
VIII. Applicable Scenario Recommendations
| Market Environment | Recommended Configuration | Notes |
|---|---|---|
| Oscillating Decline Reversal | Default configuration | Best for capturing oversold bounces |
| Single-direction Downtrend | Disable or adjust | Not suitable for catching falling knives |
| Single-direction Uptrend | Adjust RSI threshold | May miss most of the gains |
| Sideways Oscillation | Reduce trading frequency | Many false signals, use with caution |
IX. Applicable Market Environment Details
SAR strategy is a trend reversal capture strategy. Based on its code architecture and logic design, it is best suited for oversold bounce markets, while performing poorly in single-direction downtrends or highly volatile markets.
9.1 Strategy Core Logic
- Oversold Reversal Capture: Uses RSI crossing above 30 as core trigger signal
- Position Confirmation: TEMA below BB middle band confirms price at relatively low position
- Trend Turn Confirmation: TEMA rising confirms short-term trend starting to improve
- Symmetrical Sell: RSI crosses above 70 + TEMA above BB middle band + TEMA falling
9.2 Performance in Different Market Environments
| Market Type | Performance Rating | Reason Analysis |
|---|---|---|
| 📈 Oscillating Decline Reversal | ⭐⭐⭐⭐⭐ | Best scenario, oversold bounce capture is most effective |
| 🔄 Sideways Oscillation | ⭐⭐⭐☆☆ | Many false signals, needs stop-loss coordination |
| 📉 Single-direction Downtrend | ⭐⭐☆☆☆ | May trigger frequent stop-losses, not recommended |
| ⚡️ High Volatility | ⭐☆☆☆☆ | Signals may lag, high risk |
9.3 Key Configuration Recommendations
| Configuration Item | Recommended Value | Notes |
|---|---|---|
| Stop-loss | -0.08 ~ -0.12 | Adjust based on trading pair volatility |
| RSI Buy Threshold | 25-35 | Adjust oversold definition based on market |
| RSI Sell Threshold | 65-75 | Adjust overbought definition based on market |
| Timeframe | 5m (default) | Try 15m for more stable signals |
X. Important Reminder: The Cost of Complexity
10.1 Learning Curve
This strategy is relatively simple with a low learning curve. Main concepts to understand:
- RSI indicator's overbought/oversold concept
- TEMA indicator's trend judgment method
- Bollinger Band's position filtering function
10.2 Hardware Requirements
| Number of Pairs | Minimum Memory | Recommended Memory |
|---|---|---|
| 1-10 pairs | 2GB | 4GB |
| 10-50 pairs | 4GB | 8GB |
10.3 Backtesting vs Live Trading Differences
- Backtesting Environment: Historical data may not fully reflect future markets
- Live Trading Notes: Slippage, fees, liquidity and other factors will affect actual returns
- Recommendation: Test with paper trading first, then gradually increase capital
10.4 Manual Trader Recommendations
- Watch for RSI reversal signals after touching below 30
- Confirm reversal intent with candlestick patterns
- Pay attention to stop-loss settings, control single loss
XI. Summary
SAR Strategy is a simple and effective trend reversal capture strategy. Its core value lies in:
- Clear Logic: Symmetrical buy/sell conditions, easy to understand and implement
- Classic Method: RSI oversold reversal is a proven effective strategy
- Controllable Risk: Dual protection with fixed stop-loss + trailing stop
For quantitative traders, this is a strategy suitable for beginners, serving as an example for understanding the Freqtrade framework and multi-indicator coordination.