NFI46 Strategy Analysis
Strategy ID: #261 (261st of 465 strategies)
Strategy Type: Multi-condition Trend Following + Multi-layer Protection Mechanisms
Timeframe: 5 Minutes (5m) + 1 Hour (1h) Informational Layer
I. Strategy Overview
NFI46 is the 46th strategy in the NostalgiaForInfinityV4 series, developed by iterativ. This is a typical complex trend-following strategy that combines multiple entry conditions, dynamic take-profit logic, and comprehensive risk protection mechanisms. The strategy captures entry opportunities across different market environments through 17 independent buy signals and implements refined profit management via a 12-level dynamic take-profit system.
Core Features
| Feature | Description |
|---|---|
| Entry Conditions | 17 independent buy signals, independently enableable/disableable |
| Exit Conditions | 8 basic sell signals + 12-level dynamic take-profit + multi-scenario sell logic |
| Protection Mechanisms | Dip Protection (12 thresholds) + Pump Protection (9 parameter sets) |
| Timeframe | 5m primary framework + 1h informational framework |
| Dependencies | qtpylib, talib, numpy, pandas |
II. Strategy Configuration Analysis
2.1 Basic Risk Parameters
# ROI Exit Table
minimal_roi = {
"0": 0.10, # Immediate: 10%
"30": 0.05, # After 30 minutes: 5%
"60": 0.02 # After 60 minutes: 2%
}
# Stop Loss Settings
stoploss = -0.10 # 10% hard stop loss
# Trailing Stop
trailing_stop = True
trailing_stop_positive = 0.01 # Activates after 1% profit
trailing_stop_positive_offset = 0.025 # Triggers at 2.5% profit
Design Philosophy:
- ROI uses a three-tier declining design, encouraging longer holds while locking in partial profits
- 10% hard stop loss as the last line of defense, paired with dynamic trailing stop for dual protection
- Trailing stop parameters are relatively conservative, allowing price room for fluctuation
2.2 Order Type Configuration
order_types = {
'buy': 'market',
'sell': 'market',
'trailing_stop_loss': 'market',
'stoploss': 'market',
'stoploss_on_exchange': False
}
All orders use market orders to ensure fast execution.
III. Entry Conditions Details
3.1 Protection Mechanisms (3 Groups)
Each entry condition is equipped with independent protection parameter groups, using a dual-protection architecture:
Dip Protection (Pullback Protection)
| Type | Parameters | Function |
|---|---|---|
| Normal | threshold_1~4 | Standard pullback protection (1, 2, 12, 144 periods) |
| Strict | threshold_5~8 | Strict pullback protection (tighter thresholds) |
| Loose | threshold_9~12 | Loose pullback protection (allows larger pullbacks) |
# Normal Dip Protection Example
safe_dips_normal = (
((open - close) / close < threshold_1) &
((open.rolling(2).max() - close) / close < threshold_2) &
((open.rolling(12).max() - close) / close < threshold_3) &
((open.rolling(144).max() - close) / close < threshold_4)
)
Pump Protection (Pump-Up Protection)
| Time Window | Normal | Strict | Loose |
|---|---|---|---|
| 24h | threshold_1/4/7 | pull_threshold_1/4/7 | Looser parameters |
| 36h | threshold_2/5/8 | pull_threshold_2/5/8 | Looser parameters |
| 48h | threshold_3/6/9 | pull_threshold_3/6/9 | Looser parameters |
3.2 Typical Entry Condition Examples
Condition #1: Trend Pullback Entry
# Logic
- 1h EMA50 > EMA200 golden cross
- SMA200 uptrend
- Safe pullback protection + 48h Pump protection
- RSI oversold (< 21.6)
- MFI money flow low (< 47.4)
Characteristics: Classic trend pullback strategy, seeking oversold entry points in an uptrend.
Condition #3: Bollinger Band Breakout Pullback
# Logic
- Price above 1h EMA200's 99.8%
- Multiple EMAs in bullish alignment
- BB40 lower band breakout + price regression
- Special condition: bbdelta > close * 5.3%
Characteristics: Uses Bollinger Band width to identify breakout opportunities after volatility contraction.
Condition #8: Alligator Breakout
# Logic
- Price above 1h EMA200's 99.4%
- Alligator three-line bullish alignment
- All three lines rising simultaneously (momentum confirmation)
- Bullish candle close
- RSI < 30.4
Characteristics: Combines Alligator indicator to capture trend initiation points.
3.3 Classification of 17 Entry Conditions
| Condition Group | Condition Numbers | Core Logic |
|---|---|---|
| Trend Pullback | #1, #5, #14, #15 | Seeking oversold pullback entries in uptrends |
| Bollinger Band Strategy | #2, #3, #4, #5, #6, #14 | Using BB lower band breakouts for rebound opportunities |
| EMA Difference | #5, #6, #7, #14, #15 | Using EMA26-EMA12 difference for trend momentum |
| Alligator | #8 | Using Alligator alignment for trend initiation |
| EWO Strategy | #12, #13, #16, #17 | Using Elliott Wave Oscillator for wave trading |
IV. Exit Conditions Details
4.1 Multi-Level Take-Profit System
The strategy employs a 12-level dynamic take-profit mechanism:
Profit Range Take-Profit Threshold Signal Name
─────────────────────────────────────────────────────────────
> 23.7% RSI < 39.31 signal_profit_11
11.1% ~ 23.7% RSI < 42.94 signal_profit_10
...
1% ~ 2.2% RSI < 38.65 signal_profit_1
0.1% ~ 2.2% RSI < 32.69 signal_profit_0
Core Logic: Higher profit yields looser RSI thresholds, encouraging longer holds during trends.
4.2 Special Exit Scenarios
| Scenario | Trigger Condition | Signal Name |
|---|---|---|
| Below EMA200 Take-Profit | close < EMA200 with profit conditions met | signal_profit_u_* |
| Post-Pump Take-Profit | 24h/36h/48h surge exceeds threshold | signal_profit_p_* |
| SMA Decline Take-Profit | SMA200 downtrend | signal_profit_d_* |
| Trailing Take-Profit | Max profit drawdown exceeds threshold | signal_profit_t_* |
| Stop-Loss Scenario | Post-pump loss + SMA decline | signal_stoploss_p_* |
4.3 Basic Sell Signals (8)
# Sell Signal 1: BB Upper Band Continuous Breakout + RSI Overbought
- RSI > 64.9
- 6 consecutive candle closes above BB upper band
# Sell Signal 2: BB Upper Band Short-Term Breakout + RSI Extreme Overbought
- RSI > 72.8
- 3 consecutive candle closes above BB upper band
# Sell Signal 3: RSI Extreme Overbought
- RSI > 90.0
# Sell Signal 4: Dual RSI Overbought
- 5m RSI > 76.1 AND 1h RSI > 82.1
# Sell Signal 6: EMA50~200 Zone + RSI Overbought
- close between EMA50 and EMA200
- RSI > 83.7
# Sell Signal 7: 1h RSI Overbought + EMA Death Cross
- 1h RSI > 93.7
- EMA12 crosses below EMA26
# Sell Signal 8: Price Breaks BB Upper Band
- close > 1h BB upper band * 1.158
V. Technical Indicator System
5.1 Core Indicators
| Indicator Category | Specific Indicators | Purpose |
|---|---|---|
| Trend | EMA 12/15/20/26/35/50/100/200, SMA 5/30/200 | Trend identification, support/resistance |
| Momentum | RSI 14, MFI | Overbought/oversold identification |
| Volatility | BB 20/40 | Volatility channels, breakout signals |
| Special | EWO (Elliott Wave), Alligator | Wave identification, trend initiation |
| Money Flow | CMF 20 | Money inflow/outflow analysis |
5.2 Informational Timeframe Indicators (1h)
The strategy uses 1h as the informational layer for higher-dimensional trend judgment:
- EMA series (12/15/20/26/35/50/100/200)
- SMA 200 and its directional judgment
- RSI 14
- BB 20
- CMF 20
- Pump/Safe Pump markers (24h/36h/48h windows)
VI. Risk Management Highlights
6.1 Dip Protection Mechanism
The strategy monitors pullback depth across four time dimensions, preventing "catching a falling knife":
| Period | Function | Default Threshold |
|---|---|---|
| 1 | Current candle pullback | 3.2% |
| 2 | 2-period max pullback | 5.3% |
| 12 | Short-term pullback | 35.8% |
| 144 | Long-term pullback | 24.8% |
6.2 Pump Protection Mechanism
Prevents chasing after significant price surges:
safe_pump = (
(range_percent_change < thresh) | # Surge not exceeding threshold
(range_maxgap_adjusted > range_height) # Or sufficient pullback already occurred
)
6.3 Trailing Stop
trailing_stop = True
trailing_stop_positive = 0.01
trailing_stop_positive_offset = 0.025
Trailing stop activates after 2.5% profit and triggers on 1% drawdown.
VII. Strategy Pros & Cons
✅ Pros
- Rich Signals: 17 entry conditions covering multiple entry scenarios, improving opportunity capture
- Comprehensive Protection: Dip + Pump dual protection, effectively avoiding chasing highs and catching falling knives
- Refined Take-Profit: 12-level dynamic take-profit + multi-scenario sell logic for refined profit management
- Framework Synergy: 5m trading + 1h trend confirmation reduces false signals
- Adjustable Parameters: All conditions independently enableable/disableable for easy optimization
⚠️ Cons
- Many Parameters: 150+ parameters, high optimization difficulty, easy to overfit
- Computational Complexity: Requires 400 candles for startup, high memory and computation requirements
- Complex Logic: High learning curve, not suitable for beginners
- Trend-Dependent: May underperform in ranging markets
VIII. Applicable Scenarios
| Market Environment | Recommended Configuration | Notes |
|---|---|---|
| Slow Bull Trend | All entry conditions enabled | Fully utilize trend pullback opportunities |
| Ranging Market | Only EWO conditions enabled (#12, #13, #16, #17) | Wave strategies may perform better |
| Bear Market | Disable strategy or only use strictest conditions | Trend strategies have high risk in bear markets |
| High Volatility | Enable Strict Dip/Pump protection | Tighter protection parameters |
IX. Applicable Market Environment Details
NFI46 is the "all-around warrior" of the NostalgiaForInfinity series. Based on its code architecture and community long-term live-trading validation, it is best suited for markets with clear trends, and underperforms during ranging consolidations or sharp crashes.
9.1 Core Strategy Logic
- Trend-Following Nature: Most entry conditions require EMA50 > EMA200 and other trend confirmations
- Pullback Entry Philosophy: Seeking oversold opportunities within uptrends, not chasing rallies
- Protection-First Principle: Dip/Pump protection avoids entering at unfavorable timings
9.2 Performance in Different Market Environments
| Market Type | Rating | Analysis |
|---|---|---|
| 📈 Slow Bull Trend | ⭐⭐⭐⭐⭐ | Perfectly matches strategy design; trend pullbacks provide entry opportunities |
| 🔄 Ranging Sideways | ⭐⭐☆☆☆ | Trend conditions hard to satisfy; false signals increase |
| 📉 Bear Market Decline | ⭐☆☆☆☆ | Trend strategies face extreme risk from counter-trend trades |
| ⚡️ Sharp Volatility | ⭐⭐⭐☆☆ | Protection mechanisms may filter some opportunities, but reduces risk |
9.3 Key Configuration Recommendations
| Configuration | Recommended Value | Notes |
|---|---|---|
| Number of Pairs | 40~80 pairs | Official recommendation, ensures sufficient entry opportunities |
| Concurrent Positions | 4~6 | Balance risk and return |
| Blacklist | Leveraged tokens (*BULL, *BEAR, etc.) | Avoid abnormal volatility |
| Timeframe | Must use 5m | Other timeframes not validated |
X. Important Notes: The Cost of Complexity
10.1 Learning Curve
Understanding NFI46 requires mastering:
- The independent logic of 17 entry conditions
- The trigger conditions of the 12-level take-profit system
- The calculation method of Dip/Pump protection
- The complete flow of the custom_sell function
Recommendation: First disable most conditions, only retain 2-3 core conditions for testing, and gradually enable more conditions after understanding.
10.2 Hardware Requirements
| Number of Pairs | Minimum Memory | Recommended Memory |
|---|---|---|
| 40 pairs | 4GB | 8GB |
| 80 pairs | 8GB | 16GB |
| 100+ pairs | 16GB | 32GB |
Note: startup_candle_count = 400, requires loading a large amount of historical data.
10.3 Backtesting vs. Live Trading Differences
- Overfitting Risk: Many parameters may produce "perfect" backtesting performance
- Slippage Impact: Market orders may incur additional costs in live trading
- Execution Delay: Complex calculations may cause signal delays
10.4 Manual Trading Recommendations
If considering using NFI46 signals manually:
- Focus on entry condition #1 (trend pullback) as the primary signal
- Use condition #3 (Bollinger Band) as auxiliary confirmation
- Strictly follow Dip/Pump protection logic
- Set take-profit targets instead of waiting for signals
XI. Summary
NFI46 is a fully-featured trend-following strategy. Its core value lies in:
- Multi-Dimensional Entry: 17 entry conditions covering different market states
- Comprehensive Protection: Dip/Pump dual protection mechanism effectively controls risk
- Refined Take-Profit: 12-level dynamic take-profit system maximizes profit capture
- High Customizability: All conditions independently switchable for easy personalization
For quantitative traders, NFI46 is a strategy framework worthy of deep research and optimization, but be aware of overfitting risks and the complexity of live execution. It is recommended to conduct sufficient backtesting and dry-run validation before gradually deploying real funds into live trading.