Skip to main content

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

FeatureDescription
Buy Condition1 composite buy signal requiring 4 conditions to be met simultaneously
Sell Condition1 composite sell signal requiring 4 conditions to be met simultaneously
Protection MechanismFixed stop-loss (-10%) + Trailing stop + Tiered ROI exit
Timeframe5-minute primary timeframe
Dependenciesnumpy, 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 NameLogic DescriptionPurpose
#1RSI Oversold ReversalRSI crosses above 30 from belowCapture oversold bounce signal
#2Price Low PositionTEMA below Bollinger Band middle bandConfirm price is at relatively low position
#3Short-term Trend UpTEMA value higher than previous candleConfirm short-term trend improving
#4Volume ConfirmationVolume greater than 0Filter invalid signals

3.3 Buy Signal Interpretation

The core concept of this buy logic is oversold bounce capture:

  1. RSI Breaks Above 30: Classic oversold reversal signal indicating price may have bottomed
  2. TEMA Below BB Middle Band: Double confirmation that price is at relatively low position
  3. TEMA Rising: Confirms short-term trend has started to turn
  4. 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 NameLogic DescriptionPurpose
#1RSI Overbought SignalRSI crosses above 70 from belowCapture overbought reversal signal
#2Price High PositionTEMA above Bollinger Band middle bandConfirm price is at relatively high position
#3Short-term Trend DownTEMA value lower than previous candleConfirm short-term trend weakening
#4Volume ConfirmationVolume greater than 0Filter invalid signals

V. Technical Indicator System

5.1 Core Indicators

Indicator CategorySpecific IndicatorPurpose
MomentumRSI (Relative Strength Index)Overbought/oversold judgment, signal triggering
TrendTEMA (Triple Exponential Moving Average)Short-term trend direction judgment
VolatilityBollinger BandsRelative price position judgment
TrendSAR (Parabolic SAR)Strategy name origin, used for visual analysis
MomentumMACDAuxiliary trend judgment
MomentumADX (Average Directional Index)Trend strength judgment
MomentumStochastic FastShort-term momentum indicator
VolumeMFI (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

  1. Clear Logic: Symmetrical buy/sell conditions, easy to understand and adjust
  2. Oversold Bounce Capture: RSI oversold reversal is a classic effective strategy
  3. Multiple Filtering: 4 conditions must be met simultaneously, reducing false signals
  4. Trailing Stop: Allows profits to run while controlling risk

⚠️ Limitations

  1. Oscillating Market Risk: May trigger frequent stop-losses in sideways markets
  2. Single Signal Source: Relies on only one composite signal, lacks diversity
  3. Wide Stop-Loss: 10% stop-loss may be too large, requires capital management coordination
  4. Unoptimized Parameters: Default parameters may not suit all trading pairs

VIII. Applicable Scenario Recommendations

Market EnvironmentRecommended ConfigurationNotes
Oscillating Decline ReversalDefault configurationBest for capturing oversold bounces
Single-direction DowntrendDisable or adjustNot suitable for catching falling knives
Single-direction UptrendAdjust RSI thresholdMay miss most of the gains
Sideways OscillationReduce trading frequencyMany 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 TypePerformance RatingReason 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 ItemRecommended ValueNotes
Stop-loss-0.08 ~ -0.12Adjust based on trading pair volatility
RSI Buy Threshold25-35Adjust oversold definition based on market
RSI Sell Threshold65-75Adjust overbought definition based on market
Timeframe5m (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 PairsMinimum MemoryRecommended Memory
1-10 pairs2GB4GB
10-50 pairs4GB8GB

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:

  1. Clear Logic: Symmetrical buy/sell conditions, easy to understand and implement
  2. Classic Method: RSI oversold reversal is a proven effective strategy
  3. 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.