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
| Feature | Description |
|---|---|
| Entry Conditions | Multiple TEMA-based fast trend signals |
| Exit Conditions | Multi-layer take-profit + trailing stop protection |
| Protection Mechanisms | TEMA trend filtering + dynamic stop-loss |
| Timeframe | 15-minute primary timeframe |
| Dependencies | pandas, 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
| Indicator | Response Speed | Smoothness | Lag | Applicable Scenario |
|---|---|---|---|---|
| SMA | Slow | High | High | Long-term trend confirmation |
| EMA | Medium | Medium | Medium | Short-to-medium term trends |
| TEMA | Fast | Medium-High | Low | Fast trend capture |
| DEMA | Fast | Medium | Low | Short-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 Type | Parameters | Function |
|---|---|---|
| Trend Filtering | Price vs. TEMA relationship | Only trade with the trend |
| TEMA Confirmation | Short-term TEMA crosses above long-term TEMA | Trend strengthening confirmation |
| Support Verification | TEMA as dynamic support | Confirm valid support |
| Multi-Period Resonance | Different period TEMAs simultaneously met | Improve 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
| Scenario | Trigger Condition | Signal Name |
|---|---|---|
| TEMA Death Cross | Short-term TEMA crosses below long-term TEMA | Trend Exit |
| Price Breaks Below TEMA | Price breaks below key TEMA | Support Breakdown |
| High Altitude Pullback | Price deviates far from TEMA | Profit-taking |
| Stop-Loss Triggered | Loss 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
| Indicator | Parameters | Purpose |
|---|---|---|
| Short-Term TEMA | 5, 10 | Ultra-fast response to short-term price changes |
| Medium-Term TEMA | 20, 30 | Confirm medium-term trend direction |
| Long-Term TEMA | 50, 100 | Determine long-term trend direction |
5.2 Auxiliary Indicators
| Indicator | Purpose |
|---|---|
| RSI | Momentum verification, overbought/oversold judgment |
| ATR | Volatility measurement, dynamic stop-loss reference |
| Volume | Trend confirmation, price-volume coordination |
5.3 TEMA Trading Signal Interpretation
| Signal Type | Condition | Meaning |
|---|---|---|
| Golden Cross | Short TEMA crosses above long TEMA | Buy signal, trend turns bullish |
| Death Cross | Short TEMA crosses below long TEMA | Sell signal, trend turns bearish |
| Support | Price retraces to TEMA without breaking | Buy opportunity, support valid |
| Multi-Asset Up | TEMAs arranged upward in sequence | Strong uptrend, hold positions |
VI. Risk Management Features
6.1 TEMA Trend Filtering
TEMA, as a fast trend judgment tool, provides the following protection:
| Filtering Type | Description |
|---|---|
| Trend Trading | Only go long when TEMA is upward |
| TEMA Angle | Only enter when TEMA slopes upward |
| Multi-Period Confirmation | Only trade when multiple TEMAs resonate |
6.2 Tiered Stop-Loss Mechanism
| Stop-Loss Type | Trigger Condition | Description |
|---|---|---|
| Hard Stop | -9.5% | Final defense, protect principal |
| Trailing Stop | 3.5% activation, 5.5% trigger | Protect existing profits |
| TEMA Stop | Price breaks below TEMA | Trend exit |
6.3 Capital Management Recommendations
| Number of Pairs | Single Position Size | Description |
|---|---|---|
| 5-10 | 10-15% | Moderate diversification |
| 10-20 | 5-10% | Diversify risk |
| 20+ | 3-5% | Maximum diversification |
VII. Strategy Pros & Cons
✅ Pros
- Ultra-Fast Response: TEMA is the fastest responding MA, identifies trends earlier
- Low Lag: Triple smoothing reduces lag, signals are more timely
- Noise Filtering: Smoother than single-layer EMA, fewer false signals
- Ninja Agility: Fast response characteristics perfectly match Ninja style
- Trend Capture: Excellent performance in fast trending markets
⚠️ Cons
- Parameter Sensitive: TEMA parameter adjustments significantly affect results
- False Signals in Ranging: Fast indicators easily fail in sideways
- Requires Trends: Performance is average without clear trends
- Computational Complexity: Slightly more complex than SMA, but not by much
VIII. Applicable Scenarios
| Market Environment | Recommended Config | Description |
|---|---|---|
| Trending Up | Actively go long | TEMA multi-asset bullish, signals clear |
| Trending Down | Short or stand aside | TEMA multi-asset bearish arrangement |
| Ranging Market | Reduce trades | High false signal risk |
| Fast Markets | Focus participation | TEMA'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 Type | Rating | Analysis |
|---|---|---|
| 📈 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 Item | Recommended Value | Description |
|---|---|---|
| TEMA Period | 5, 20, 50 | Classic combination |
| Stop-Loss | -9.5% | Strict stop-loss |
| Trading Pairs | 5-15 | Moderate 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:
- Ultra-Fast Response: TEMA is the fastest responding MA, identifies trends earliest
- Low Lag: Triple smoothing reduces lag, signals are more timely
- Noise Filtering: Smoother than single-layer EMA, fewer false signals
- 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.