Skip to main content

mark_strat_opt Strategy Deep Analysis

Strategy Number: #463 (463rd out of 465 strategies)
Strategy Type: Oversold Rebound + Multi-Indicator Extreme Value Confirmation
Timeframe: 1 minute (1m)


I. Strategy Overview

mark_strat_opt is a short-term strategy focused on capturing extreme oversold conditions. Its core philosophy is "be greedy when others are fearful" — entering when price falls below the lower Bollinger Band by 4 standard deviations and multiple momentum indicators simultaneously reach extreme oversold levels, then waiting for mean reversion.

Core Characteristics

FeatureDescription
Buy Conditions5 independent indicator conditions, all must be satisfied (AND logic)
Sell Conditions4-condition combination + trailing stop
Protection MechanismsTiered ROI take-profit + trailing stop dual protection
Timeframe1-minute level, high-frequency trading
Dependenciestalib, qtpylib, numpy, pandas

II. Strategy Configuration Analysis

2.1 Base Risk Parameters

# ROI Exit Table
minimal_roi = {
"0": 0.06965, # 6.965% profit immediately after entry
"8": 0.01125, # Drops to 1.125% after 8 minutes
"19": 0.00498, # Drops to 0.498% after 19 minutes
"34": 0 # Break-even exit after 34 minutes
}

# Stop Loss Setting
stoploss = -0.20206 # 20.2% fixed stop loss

Design Rationale:

  • ROI uses rapid decay模式, from 7% quickly dropping to break-even, suitable for ultra-short-term trading
  • Wide stop loss (-20%), allowing sufficient price fluctuation space
  • Break-even exit after 34 minutes to avoid prolonged position holding

2.2 Trailing Stop Configuration

trailing_stop = True
trailing_only_offset_is_reached = False
trailing_stop_positive = 0.07573 # Trailing activates after 7.57% profit
trailing_stop_positive_offset = 0.09805 # Trailing offset 9.8%

Design Rationale:

  • Trailing stop activates after profit exceeds 7.5%
  • Trailing offset 9.8%, locking in most profits
  • No activation threshold, immediate trailing

2.3 Order Type Configuration

order_types = {
'buy': 'limit',
'sell': 'limit',
'stoploss': 'market',
'stoploss_on_exchange': False
}

III. Buy Conditions Detailed Analysis

3.1 Buy Signal (Single Condition Group, 5 Indicators)

Strategy uses full indicator confirmation mode, all conditions must be satisfied simultaneously:

dataframe.loc[
(
(dataframe['adx'] > 49) & # Condition 1: ADX > 49
(dataframe['fastd'] < 30) & # Condition 2: FastD < 30
(dataframe['mfi'] < 23) & # Condition 3: MFI < 23
(dataframe['rsi'] < 34) & # Condition 4: RSI < 34
(dataframe['close'] < dataframe['bb_lowerband4']) # Condition 5: Close price below BB lower band (4 std dev)
),
'buy'] = 1

3.2 Condition Interpretation

Condition #IndicatorThresholdMarket Meaning
#1ADX> 49Extremely high trend strength (extreme market conditions)
#2FastD< 30Stochastic indicator oversold
#3MFI< 23Money flow极度枯竭
#4RSI< 34Relative strength oversold
#5Close Price< BB Lower Band 4σPrice extremely deviated from mean

Buy Logic Summary:

  • This is an extreme oversold capture strategy
  • Requires extremely high trend strength (ADX > 49) to ensure sufficient volatility
  • Simultaneously requires multiple momentum indicators in oversold territory
  • Price must fall below Bollinger Band lower band by 4 standard deviations, an extremely rare extreme condition
  • Five-fold condition simultaneous satisfaction, signals are rare but extremely high quality

IV. Sell Logic Detailed Analysis

4.1 Sell Signal (4-Condition Combination)

dataframe.loc[
(
(dataframe['adx'] < 95) & # Condition 1: ADX < 95
(dataframe['fastd'] > 70) & # Condition 2: FastD > 70
(dataframe['rsi'] > 94) & # Condition 3: RSI > 94
(qtpylib.crossed_above(dataframe['sar'], dataframe['close'])) # Condition 4: SAR crosses above close
),
'sell'] = 1
Condition #IndicatorThresholdMarket Meaning
#1ADX< 95Trend strength limit (almost always satisfied)
#2FastD> 70Stochastic indicator overbought
#3RSI> 94Relative strength极度超买
#4SARCrosses above closeParabolic SAR bearish reversal signal

Sell Logic Summary:

  • Requires multiple indicators simultaneously entering extreme overbought territory
  • SAR crossing above close price as trend reversal confirmation
  • Signal trigger means price has rebounded significantly

4.2 ROI Tiered Take-Profit

Time (minutes)Target ReturnDescription
06.965%Immediate take-profit threshold after entry
81.125%Lower requirement after 8 minutes
190.498%Further reduced after 19 minutes
340%Break-even exit after 34 minutes

4.3 Trailing Stop Mechanism

  • Activation threshold: 7.57% profit
  • Trailing offset: 9.8%
  • When price continues rising, trailing stop locks in profits

V. Technical Indicator System

5.1 Core Indicators

Indicator CategorySpecific IndicatorUsage
Trend StrengthADXJudge whether trend is strong enough
Momentum IndicatorRSIRelative strength oversold/overbought judgment
Money FlowMFIMoney inflow/outflow intensity
Stochastic IndicatorFastD (Stochastic Fast)Fast stochastic indicator
Volatility ChannelBollinger Bands (4σ)Price extreme deviation judgment
Trend ReversalSAR (Parabolic SAR)Trend reversal signal
Trend IndicatorMACDAuxiliary trend judgment

5.2 Indicator Calculation Code

# Trend strength indicators
dataframe['adx'] = ta.ADX(dataframe)
dataframe['sar'] = ta.SAR(dataframe)

# Momentum indicators
dataframe['rsi'] = ta.RSI(dataframe)
dataframe['mfi'] = ta.MFI(dataframe)

# Stochastic indicator
stoch_fast = ta.STOCHF(dataframe)
dataframe['fastd'] = stoch_fast['fastd']

# Bollinger Bands (4 standard deviations)
bollinger4 = qtpylib.bollinger_bands(
qtpylib.typical_price(dataframe), window=20, stds=4
)
dataframe['bb_lowerband4'] = bollinger4['lower']

# MACD
macd = ta.MACD(dataframe)
dataframe['macd'] = macd['macd']
dataframe['macdsignal'] = macd['macdsignal']

VI. Risk Management Features

6.1 Extreme Value Multiple Confirmation

Strategy requires 5 conditions to be satisfied simultaneously before entry:

  • ADX > 49: Ensure sufficient trend strength
  • FastD < 30, RSI < 34, MFI < 23: Multiple oversold confirmation
  • Close price below Bollinger Band lower band 4 standard deviations: Price extreme deviation

6.2 Rapid Take-Profit Mechanism

  • ROI rapidly decays from 7% to break-even
  • Forced break-even exit after 34 minutes
  • Trailing stop locks in significant profits

6.3 Wide Stop Loss Space

  • Fixed stop loss -20.2%, providing sufficient room for maneuver
  • Avoid being stopped out by normal fluctuations

VII. Strategy Advantages and Limitations

✅ Advantages

  1. Extremely high signal quality: 5-fold condition simultaneous satisfaction greatly reduces false signals
  2. Captures extreme market conditions: Bollinger Band 4 standard deviations is an extremely rare oversold situation
  3. Rapid take-profit mechanism: ROI rapid decay + trailing stop dual protection
  4. Clear logic: Buy and sell conditions are explicit, strong interpretability

⚠️ Limitations

  1. Rare signals: Extreme oversold market conditions don't occur often, limited trading opportunities
  2. High-frequency requirements: 1-minute level requires stable API connection and low latency
  3. Slippage risk: Liquidity may be insufficient during extreme market conditions
  4. Overfitting risk: Precise parameter thresholds may be historical data fitting results

VIII. Applicable Scenario Recommendations

Market EnvironmentRecommended ConfigurationDescription
Severe volatilityKeep original parametersExtreme conditions are exactly the strategy's strength
Oscillating declineCan appropriately relax RSI thresholdIncrease trading frequency
Stable marketNot recommendedSignals extremely rare, low capital utilization
Rapid rallyNot applicableStrategy focuses on oversold rebound

IX. Applicable Market Environment Detailed Analysis

mark_strat_opt is an extreme oversold capture strategy. Based on its code architecture, it is most suitable for high volatility, trend-obvious markets, and performs poorly in stable oscillating markets.

9.1 Strategy Core Logic

  • Extreme value capture: Wait for price to fall below Bollinger Band lower band by 4 standard deviations
  • Multiple confirmation: 5 indicators simultaneously oversold, reducing false signals
  • Rapid profit taking: ROI rapid decay, timely profit realization

9.2 Performance in Different Market Environments

Market TypePerformance RatingReason Analysis
📈 Sharp decline followed by rebound⭐⭐⭐⭐⭐Exactly the strategy's designed best scenario
🔄 High volatility oscillation⭐⭐⭐☆☆May have some extreme oversold opportunities
📉 One-sided bear market⭐⭐☆☆☆Continuous decline may trigger stop loss
⚡️ Stable market⭐☆☆☆☆Signals extremely rare, capital idle

9.3 Key Configuration Recommendations

Configuration ItemRecommended ValueDescription
Timeframe1m (native)Not recommended to modify
Trading pairsHigh volatility varietiesSuch as BTC, ETH, etc.
Capital allocation10-20%Signals rare, avoid capital idle

X. Important Reminder: The Cost of Complexity

10.1 Learning Cost

Strategy logic is relatively simple, but requires understanding:

  • Meaning of Bollinger Band extreme deviation
  • Coordination relationship of multiple momentum indicators
  • Working principle of trailing stop

10.2 Hardware Requirements

Number of Trading PairsMinimum MemoryRecommended Memory
1-5 pairs4GB8GB
6-20 pairs8GB16GB
20+ pairs16GB32GB

10.3 Differences Between Backtest and Live Trading

  • Slippage may be significant during extreme market conditions
  • 1-minute level is sensitive to API latency
  • Live trading signals may be fewer than backtest

10.4 Manual Trader Recommendations

  • Can use this strategy as "extreme oversold alert"
  • Manually confirm whether to enter when signals trigger
  • Note liquidity risk during extreme market conditions

XI. Summary

mark_strat_opt is a short-term strategy focused on extreme oversold market conditions. Its core value lies in:

  1. Signal quality priority: 5-fold condition confirmation, better to miss than make mistakes
  2. Extreme market expert: Bollinger Band 4 standard deviations is an extremely rare trading opportunity
  3. Rapid take-profit protection: ROI rapid decay + trailing stop dual profit locking

For quantitative traders, this is a low-frequency high-quality strategy, suitable as a "sniper" role in the portfolio, capturing rebound opportunities during extreme market panic.