NFI_v5_SMA Strategy Analysis
Strategy Number: #252 (252nd of 465 strategies) Strategy Type: NFI Series Standard Version — SMA Trend Filter Variant Timeframe: 5 Minutes (5m) + 1 Hour Informational Timeframe
I. Strategy Overview
NFI_v5_SMA is the SMA (Simple Moving Average) variant of the NFI (Nostalgia For Infinity) Series v5 version. Inheriting NFI_v5's core 20+ entry condition architecture, it introduces SMA trend filtering to reduce false signals through a smoother moving average system. It is suitable for investors pursuing steady trading.
The core difference between SMA and EMA lies in calculation: EMA gives higher weight to recent prices, reacts faster but has more noise; SMA gives equal weight to all prices, reacts slower but signals are more reliable. NFI_v5_SMA leverages SMA's characteristics to provide more stable judgment in trend confirmation.
Core Features
| Feature | Description |
|---|---|
| Entry Conditions | 20+ independent buy signals (inheriting v5 architecture) + SMA trend filtering |
| Exit Conditions | 8 basic exit signals + multi-layer dynamic take-profit logic |
| Protection Mechanisms | 20+ sets of entry protection parameters + SMA trend confirmation |
| Timeframe | 5-minute primary timeframe + 1-hour informational timeframe |
| Dependencies | TA-Lib, technical, qtpylib, pandas, numpy |
| SMA Periods | SMA50, SMA100, SMA200 multi-period moving averages |
II. Strategy Configuration Analysis
2.1 Basic Risk Parameters
# ROI exit table (time: minimum profit rate)
minimal_roi = {
"0": 0.08, # Immediate exit: 8% profit
"40": 0.05, # After 40 minutes: 5% profit
"80": 0.03, # After 80 minutes: 3% profit
"120": 0.01 # After 120 minutes: 1% profit
}
# Stop-loss settings
stoploss = -0.12 # -12% hard stop-loss
# Trailing stop
trailing_stop = True
trailing_only_offset_is_reached = True
trailing_stop_positive = 0.02 # 2% trailing activation point
trailing_stop_positive_offset = 0.035 # 3.5% offset trigger
Design Philosophy:
- Steady ROI ladder: Consistent with v5, first-tier ROI at 8%, reflecting SMA variant's steady positioning
- Loose stop-loss buffer: -12% gives market sufficient volatility room
- Gentle trailing stop: 2% activation, 3.5% lock-in, balancing profit protection and trend following
- SMA filteringenhanced: SMA trend confirmation as an additional last line of defense
III. Entry Conditions Details
3.1 SMA Trend Filtering Mechanism
The core innovation of NFI_v5_SMA is the SMA trend filtering layer:
| SMA Type | Period | Filtering Logic | Function |
|---|---|---|---|
| SMA50 | 50 periods | Price > SMA50 | Mid-term trend confirmation |
| SMA100 | 100 periods | Price > SMA100 | Medium-long term trend confirmation |
| SMA200 | 200 periods | Price > SMA200 | Long-term trend confirmation |
| SMA Multi-Alignment | Multi-period | SMA50 > SMA100 > SMA200 | Strong trend confirmation |
| SMA Slope | Multi-period | SMA in upward trend | Trend direction confirmation |
SMA Filtering Advantages:
- Reduces false breakouts: SMA lag filters short-term noise
- More reliable trend confirmation: Multi-alignment confirms trend strength
- Avoids counter-trend trades: Reduces buying when price is below SMA
3.2 Protection Mechanisms (20+ Sets)
Each entry condition has independent protection parameters plus SMA filtering:
| Protection Type | Parameter Description | Default Example |
|---|---|---|
| SMA Trend | Price above SMA50/100/200 | sma_filter_enabled=True |
| SMA Rising | SMA200 in uptrend | sma200_rising=True |
| EMA Fast | Fast EMA above EMA200 | ema_fast_len=26 |
| Close Price Protection | Close above EMA | close_above_ema=True |
| Safe Dips | Downward magnitude threshold | safe_dips_type=80 |
| Safe Pumps | Upward magnitude threshold | safe_pump_type=70 |
| BTC Trend | BTC 1h non-declining | btc_1h_not_downtrend |
3.3 Entry Conditions Classification
| Condition Group | Condition Numbers | Core Logic | SMA Filtering Role |
|---|---|---|---|
| SMA Trend Confirmation | 1, 5, 8, 14 | SMA multi-alignment + oversold bounce | Trend direction confirmation |
| Oversold Rebound | 1, 7, 8, 18, 20 | RSI/MFI low value + SMA filtering | Avoid counter-trend bottom-fishing |
| Bollinger Strategy | 2, 3, 4, 5, 6, 9, 10 | Bollinger lower band + SMA trend | Ensure uptrend |
| EMA Trend | 5, 6, 7, 14, 15 | EMA golden cross + SMA confirmation | Dual trend confirmation |
| SMA Offset | 9, 10, 11, 12, 13 | Price deviation from SMA mean | Mean reversion opportunity |
| Special Conditions | 19, 21, 22, 23 | Composite indicators + SMA filtering | Comprehensive signal confirmation |
IV. Exit Conditions Details
4.1 Multi-Layer Take-Profit System
Uses tiered take-profit combined with SMA trend state dynamic adjustment:
Profit Zone RSI Threshold SMA Check
────────────────────────────────────────────────
> 18% < 32 Price > SMA50
14%-18% < 40 Price > SMA50
10%-14% < 50 Price > SMA50
8%-10% < 52 Price > SMA50
6%-8% < 48 Trend check
5%-6% < 42 Trend check
4%-5% < 40 Trend check
3%-4% < 38 Trend check
2%-3% < 36 Trend check
1%-2% < 34 Trend check
< 1% < 32 Trend check
SMA Exit Enhancement:
- When price breaks below SMA50, take-profit thresholds relax (more aggressive selling)
- When SMA200 starts declining, prioritize profit-taking
- When multi-alignment breaks, trigger protective selling
4.2 Special Exit Scenarios
| Scenario | Trigger Condition | SMA Role |
|---|---|---|
| SMA Trend Reversal | Price < SMA50 + profit | SMA trend exit |
| SMA Death Cross | SMA50 crosses below SMA100 | Moving average death cross exit |
| Below EMA200 take-profit | Price < EMA200 + profit threshold | Weak take-profit |
| Pump protection | 24h/36h/48h rise detection + profit | Prevent high pullback |
| Declining trend | SMA200 declining + profit zone | Trend reversal protection |
V. Risk Management Features
5.1 SMA Trend Filtering Layer
SMA filtering as an additional risk control layer:
# SMA trend filtering logic
if price < SMA200:
# Most buy signals prohibited
# Only extreme oversold signals may trigger
sma_filter = "bearish"
if price > SMA50 > SMA100 > SMA200:
# All buy signals open
sma_filter = "bullish"
5.2 Dip Protection (Safe Dips)
11 levels of dip threshold protection combined with SMA confirmation:
Level Threshold 1 Threshold 2 Threshold 3 Threshold 4 SMA Check
──────────────────────────────────────────────────────────────────────────────
10 1.5% 10% 24% 42% Price > SMA50
50 2.0% 14% 32% 50% Price > SMA50
80 2.4% 22% 38% 66% Price > SMA50
100 2.6% 24% 42% 80% SMA rising
VI. Strategy Pros & Cons
✅ Pros
- SMA smooth filtering: Reduces false signals, avoids chasing
- More reliable trend confirmation: SMA multi-alignment as trend confirmation standard
- Reduced noise interference: SMA lag filters short-term volatility noise
- Highly configurable: Inherits v5's 20+ entry conditions architecture
- Multi-layer protection: SMA filtering + original protection mechanisms dual guarantee
- Suitable for trending up: Best performance when trend is clear
- Stronger risk control: Additional SMA filtering layer reduces counter-trend operations
⚠️ Cons
- Greater lag: SMA reacts slowly, may miss fast moves
- Trend market slippage: SMA filtering may delay entry in fast rallies
- Data dependent: Needs sufficient 1h and 5m historical data
- External dependencies: Requires TA-Lib and technical library support
- Computationally intensive: SMA + EMA dual calculation, higher resource consumption
- Parameter sensitive: SMA period selection greatly impacts strategy performance
VII. Summary
NFI_v5_SMA is the steady trend variant of NFI_v5. Its core value lies in:
- SMA smooth filtering: Adds SMA trend confirmation on top of v5, reducing false signals
- Certainty priority: "Rather miss it than be wrong" trading philosophy
- Enhanced risk control: Additional SMA filtering layer reduces counter-trend risk
- Suitable for steady traders: Ideal choice for traders sensitive to noise
For quantitative traders, NFI_v5_SMA is a choice pursuing certainty:
- More conservative and steady than v5 original
- Fewer but more reliable signals than aggressive strategies
- Suitable for investors pursuing stable returns and unwilling to trade frequently
Recommendation:
- Use in markets with clear trends
- Consider relaxing SMA filtering in fast markets
- Accept "missing some profit" as the cost of using SMA
- Pay attention to SMA multi/null alignment changes