Skip to main content

Ninja_TEMA Strategy: In-Depth Analysis

Strategy ID: #245 (Strategy #245 of 465) Strategy Type: NFI Series - Ninja TEMA Mode Timeframe: 15 Minutes (15m)


I. Strategy Overview

Ninja_TEMA is the "Ninja" version within the NFI (Nostalgia For Infinity) series, using TEMA (Triple Exponential Moving Average) as its core analytical tool. TEMA is a triple smoothing treatment of EMA, possessing both EMA's sensitivity and SMA's smoothness. It can reflect price trend changes more quickly while effectively reducing false signals.

The Ninja version represents an agile, fast trading style. TEMA's fast response characteristics perfectly match Ninja's "ninja" spirit. This strategy, while maintaining NFI's multi-condition architecture advantages, provides trend signals more sensitive than traditional moving averages.

Core Characteristics

FeatureDescription
Entry ConditionsMultiple TEMA-based fast trend signals
Exit ConditionsMulti-layer take-profit + trailing stop protection
Protection MechanismsTEMA trend filtering + dynamic stop-loss
Timeframe15-minute primary timeframe
Dependenciespandas, numpy, TA-Lib

II. Strategy Configuration Analysis

2.1 Core Risk Parameters

# ROI Exit Table (Time: Minimum Profit Rate)
minimal_roi = {
"0": 0.11, # Immediate exit: 11% profit
"30": 0.075, # After 30 minutes: 7.5% profit
"60": 0.04, # After 60 minutes: 4% profit
"120": 0.015 # After 120 minutes: 1.5% profit
}

# Stop-Loss Settings
stoploss = -0.095 # -9.5% hard stop-loss

# Trailing Stop
trailing_stop = True
trailing_stop_positive = 0.035 # 3.5% trailing activation point
trailing_stop_positive_offset = 0.055 # 5.5% offset trigger

Design Philosophy:

  • Aggressive ROI (11%): Higher take-profit target than Ninja_SMA, matching TEMA's fast characteristics
  • Slightly Wider Stop-Loss (-9.5%): Wider than Ninja_SMA, giving TEMA fast response space
  • Flexible Trailing (3.5-5.5%): Protects existing profits while allowing normal price fluctuation

2.2 Order Type Configuration

order_types = {
"entry": "limit",
"exit": "limit",
"stoploss": "limit",
"stoploss_on_exchange": False,
"exit_timeout_count": 0,
}

III. Entry Conditions Details

3.1 TEMA Core Mechanism

TEMA (Triple Exponential Moving Average) calculation method:

TEMA = 3 × EMA1 - 3 × EMA2 + EMA3

Where:

  • EMA1 = EMA(Price, n)
  • EMA2 = EMA(EMA1, n)
  • EMA3 = EMA(EMA2, n)

TEMA Characteristics:

  • Triple smoothing treatment, effectively filters noise
  • Faster than EMA, less lag
  • Identifies trend changes earlier than ordinary MAs
  • Excellent performance in fast markets

3.2 TEMA vs. Other Moving Averages Comparison

IndicatorResponse SpeedSmoothnessLagApplicable Scenario
SMASlowHighHighLong-term trend confirmation
EMAMediumMediumMediumShort-to-medium term trends
TEMAFastMedium-HighLowFast trend capture
DEMAFastMediumLowShort-term trading

3.3 Core Entry Conditions

Condition Group 1: TEMA Golden Cross

  • Short-term TEMA crosses above long-term TEMA
  • Volume expands with confirmation
  • Price stands above TEMA

Condition Group 2: Price Breakout Through TEMA

  • Price breaks through TEMA resistance level
  • TEMA slopes upward
  • Breakout confirmed as valid

Condition Group 3: Pullback to TEMA Support

  • Price retraces to near TEMA and finds support
  • TEMA continues upward
  • Candlestick shows bounce-back signal

Condition Group 4: TEMA Multi-Asset Arrangement

  • Short, medium, and long-term TEMAs arranged upward in sequence
  • Price above all TEMAs
  • Trend clearly upward

3.4 Protection Mechanisms

Protection TypeParametersFunction
Trend FilteringPrice vs. TEMA relationshipOnly trade with the trend
TEMA ConfirmationShort-term TEMA crosses above long-term TEMATrend strengthening confirmation
Support VerificationTEMA as dynamic supportConfirm valid support
Multi-Period ResonanceDifferent period TEMAs simultaneously metImprove signal quality

IV. Exit Logic Details

4.1 Multi-Layer Take-Profit System

Strategy uses a tiered take-profit mechanism:

Profit Rate Zone     Threshold       Signal Name
─────────────────────────────────────────────
0-30 minutes 11% Quick Profit
30-60 minutes 7.5% Medium-term Target
60-120 minutes 4% Conservative Exit
120+ minutes 1.5% End-of-Session Breakeven

Design Logic:

  • 11% Aggressive Target: Matches TEMA's fast response characteristics
  • Time Decreasing: The longer the hold, the more conservative the target
  • Fast Take-Profit: TEMA signals are fast, exits must also be fast

4.2 Special Exit Scenarios

ScenarioTrigger ConditionSignal Name
TEMA Death CrossShort-term TEMA crosses below long-term TEMATrend Exit
Price Breaks Below TEMAPrice breaks below key TEMASupport Breakdown
High Altitude PullbackPrice deviates far from TEMAProfit-taking
Stop-Loss TriggeredLoss exceeds 9.5%Hard Stop

4.3 Basic Exit Signals

# Exit Signal 1: TEMA Death Cross
- Short-term TEMA crosses below long-term TEMA
- Trend weakening signal

# Exit Signal 2: Breaks Below TEMA Support
- Price breaks below key TEMA
- Support becomes resistance

# Exit Signal 3: Stop-Loss Triggered
- Loss reaches -9.5%
- Protect capital safety

V. Technical Indicator System

5.1 Core Indicator: TEMA

IndicatorParametersPurpose
Short-Term TEMA5, 10Ultra-fast response to short-term price changes
Medium-Term TEMA20, 30Confirm medium-term trend direction
Long-Term TEMA50, 100Determine long-term trend direction

5.2 Auxiliary Indicators

IndicatorPurpose
RSIMomentum verification, overbought/oversold judgment
ATRVolatility measurement, dynamic stop-loss reference
VolumeTrend confirmation, price-volume coordination

5.3 TEMA Trading Signal Interpretation

Signal TypeConditionMeaning
Golden CrossShort TEMA crosses above long TEMABuy signal, trend turns bullish
Death CrossShort TEMA crosses below long TEMASell signal, trend turns bearish
SupportPrice retraces to TEMA without breakingBuy opportunity, support valid
Multi-Asset UpTEMAs arranged upward in sequenceStrong uptrend, hold positions

VI. Risk Management Features

6.1 TEMA Trend Filtering

TEMA, as a fast trend judgment tool, provides the following protection:

Filtering TypeDescription
Trend TradingOnly go long when TEMA is upward
TEMA AngleOnly enter when TEMA slopes upward
Multi-Period ConfirmationOnly trade when multiple TEMAs resonate

6.2 Tiered Stop-Loss Mechanism

Stop-Loss TypeTrigger ConditionDescription
Hard Stop-9.5%Final defense, protect principal
Trailing Stop3.5% activation, 5.5% triggerProtect existing profits
TEMA StopPrice breaks below TEMATrend exit

6.3 Capital Management Recommendations

Number of PairsSingle Position SizeDescription
5-1010-15%Moderate diversification
10-205-10%Diversify risk
20+3-5%Maximum diversification

VII. Strategy Pros & Cons

✅ Pros

  1. Ultra-Fast Response: TEMA is the fastest responding MA, identifies trends earlier
  2. Low Lag: Triple smoothing reduces lag, signals are more timely
  3. Noise Filtering: Smoother than single-layer EMA, fewer false signals
  4. Ninja Agility: Fast response characteristics perfectly match Ninja style
  5. Trend Capture: Excellent performance in fast trending markets

⚠️ Cons

  1. Parameter Sensitive: TEMA parameter adjustments significantly affect results
  2. False Signals in Ranging: Fast indicators easily fail in sideways
  3. Requires Trends: Performance is average without clear trends
  4. Computational Complexity: Slightly more complex than SMA, but not by much

VIII. Applicable Scenarios

Market EnvironmentRecommended ConfigDescription
Trending UpActively go longTEMA multi-asset bullish, signals clear
Trending DownShort or stand asideTEMA multi-asset bearish arrangement
Ranging MarketReduce tradesHigh false signal risk
Fast MarketsFocus participationTEMA's best suited scenario

IX. Applicable Market Environment Details

Ninja_TEMA is the version within the NFI series pursuing extreme response speed. TEMA's triple smoothing characteristic allows it to maintain trend judgment while identifying trend changes earlier than ordinary moving averages.

9.1 Strategy Core Logic

  • TEMA Fast Response: Identifies trends faster than traditional MAs
  • Trend Trading: Go long when TEMA is upward, stand aside when downward
  • Ninja Agility: Fast entries and exits, decisive
  • Multi-Condition Confirmation: Filter false signals, improve win rate

9.2 Performance in Different Market Environments

Market TypeRatingAnalysis
📈 Trending Up⭐⭐⭐⭐⭐TEMA multi-asset bullish, fast response, profit by following trend
🔄 Ranging Market⭐⭐☆☆☆Fast indicators have many false signals in ranging
📉 Downtrend⭐⭐⭐⭐☆TEMA multi-asset bearish, can short or stand aside
⚡️ Fast Volatility⭐⭐⭐⭐⭐TEMA's best suited scenario, ultra-fast response

9.3 Key Configuration Recommendations

Config ItemRecommended ValueDescription
TEMA Period5, 20, 50Classic combination
Stop-Loss-9.5%Strict stop-loss
Trading Pairs5-15Moderate diversification

X. Summary

Ninja_TEMA is a strategy within the NFI series that perfectly combines TEMA's fast response with Ninja's agility. Its core value lies in:

  1. Ultra-Fast Response: TEMA is the fastest responding MA, identifies trends earliest
  2. Low Lag: Triple smoothing reduces lag, signals are more timely
  3. Noise Filtering: Smoother than single-layer EMA, fewer false signals
  4. Ninja Agility: Fast entries and exits, decisive

For quantitative traders, Ninja_TEMA provides a fast-response trend trading system. It is suitable for investors pursuing agile trading and fast entries/exits, especially performing excellently in fast markets with clear trends. However, note that fast indicators generate more false signals in ranging markets and need to be used in conjunction with other filtering conditions.