Skip to main content

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

FeatureDescription
Entry Conditions20+ independent buy signals (inheriting v5 architecture) + SMA trend filtering
Exit Conditions8 basic exit signals + multi-layer dynamic take-profit logic
Protection Mechanisms20+ sets of entry protection parameters + SMA trend confirmation
Timeframe5-minute primary timeframe + 1-hour informational timeframe
DependenciesTA-Lib, technical, qtpylib, pandas, numpy
SMA PeriodsSMA50, 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 TypePeriodFiltering LogicFunction
SMA5050 periodsPrice > SMA50Mid-term trend confirmation
SMA100100 periodsPrice > SMA100Medium-long term trend confirmation
SMA200200 periodsPrice > SMA200Long-term trend confirmation
SMA Multi-AlignmentMulti-periodSMA50 > SMA100 > SMA200Strong trend confirmation
SMA SlopeMulti-periodSMA in upward trendTrend 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 TypeParameter DescriptionDefault Example
SMA TrendPrice above SMA50/100/200sma_filter_enabled=True
SMA RisingSMA200 in uptrendsma200_rising=True
EMA FastFast EMA above EMA200ema_fast_len=26
Close Price ProtectionClose above EMAclose_above_ema=True
Safe DipsDownward magnitude thresholdsafe_dips_type=80
Safe PumpsUpward magnitude thresholdsafe_pump_type=70
BTC TrendBTC 1h non-decliningbtc_1h_not_downtrend

3.3 Entry Conditions Classification

Condition GroupCondition NumbersCore LogicSMA Filtering Role
SMA Trend Confirmation1, 5, 8, 14SMA multi-alignment + oversold bounceTrend direction confirmation
Oversold Rebound1, 7, 8, 18, 20RSI/MFI low value + SMA filteringAvoid counter-trend bottom-fishing
Bollinger Strategy2, 3, 4, 5, 6, 9, 10Bollinger lower band + SMA trendEnsure uptrend
EMA Trend5, 6, 7, 14, 15EMA golden cross + SMA confirmationDual trend confirmation
SMA Offset9, 10, 11, 12, 13Price deviation from SMA meanMean reversion opportunity
Special Conditions19, 21, 22, 23Composite indicators + SMA filteringComprehensive 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

ScenarioTrigger ConditionSMA Role
SMA Trend ReversalPrice < SMA50 + profitSMA trend exit
SMA Death CrossSMA50 crosses below SMA100Moving average death cross exit
Below EMA200 take-profitPrice < EMA200 + profit thresholdWeak take-profit
Pump protection24h/36h/48h rise detection + profitPrevent high pullback
Declining trendSMA200 declining + profit zoneTrend 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

  1. SMA smooth filtering: Reduces false signals, avoids chasing
  2. More reliable trend confirmation: SMA multi-alignment as trend confirmation standard
  3. Reduced noise interference: SMA lag filters short-term volatility noise
  4. Highly configurable: Inherits v5's 20+ entry conditions architecture
  5. Multi-layer protection: SMA filtering + original protection mechanisms dual guarantee
  6. Suitable for trending up: Best performance when trend is clear
  7. Stronger risk control: Additional SMA filtering layer reduces counter-trend operations

⚠️ Cons

  1. Greater lag: SMA reacts slowly, may miss fast moves
  2. Trend market slippage: SMA filtering may delay entry in fast rallies
  3. Data dependent: Needs sufficient 1h and 5m historical data
  4. External dependencies: Requires TA-Lib and technical library support
  5. Computationally intensive: SMA + EMA dual calculation, higher resource consumption
  6. 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:

  1. SMA smooth filtering: Adds SMA trend confirmation on top of v5, reducing false signals
  2. Certainty priority: "Rather miss it than be wrong" trading philosophy
  3. Enhanced risk control: Additional SMA filtering layer reduces counter-trend risk
  4. 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