Ichimoku Strategy Analysis
Strategy ID: #204 (204th out of 465 strategies)
Strategy Type: Trend Following / Ichimoku Cloud
Timeframe: 5 Minutes (5m)
I. Strategy Overview
Ichimoku (Ichimoku Cloud) is a classic Japanese technical analysis strategy invented by Japanese journalist Goichi Hosoda in the 1930s. The strategy comprehensively evaluates price trends, support/resistance levels, and momentum through multiple balance line calculations, making it one of the most widely used technical analysis tools in Japanese financial markets.
Core Characteristics
| Feature | Description |
|---|---|
| Buy Conditions | 1 condition: Tenkan crosses above Kijun + Cloud color change |
| Sell Conditions | 1 condition: No explicit sell conditions (sell=1 vacant) |
| Protection | Trailing stop (positive) |
| Timeframe | 5 Minutes |
| Dependencies | technical (qtpylib) |
II. Strategy Configuration Analysis
2.1 Basic Risk Parameters
# Exit Mechanism
minimal_roi = {"0": 1} # 100% profit exit (effectively inactive)
Design Philosophy:
- Ultra-high ROI value: Set for 100% profit exit; effectively governed by trailing stop in practice
2.2 Trailing Stop Configuration
trailing_stop = True
trailing_stop_positive = 0.01 # 1% trailing activation
trailing_stop_positive_offset = 0.02 # 2% trailing stop level
trailing_only_offset_is_reached = True # Only activate when offset is reached
Design Philosophy:
- Positive trailing: Activates trailing stop after profit exceeds 2%
- 1% cushion: Profit above 2% triggers automatic close on 1% pullback
- Let profits run: Provides adequate price volatility room
2.3 Stop-Loss Configuration
stoploss = -0.1 # -10% hard stop-loss
III. Ichimoku Cloud Core Indicators
3.1 Indicator Calculations
# Ichimoku Cloud Calculations
ichi = ichimoku(dataframe)
dataframe["tenkan"] = ichi["tenkan_sen"] # Tenkan-sen (9-period)
dataframe["kijun"] = ichi["kijun_sen"] # Kijun-sen (26-period)
dataframe["senkou_a"] = ichi["senkou_span_a"] # Senkou Span A
dataframe["senkou_b"] = ichi["senkou_span_b"] # Senkou Span B
dataframe["cloud_green"] = ichi["cloud_green"] # Cloud green (bullish)
dataframe["cloud_red"] = ichi["cloud_red"] # Cloud red (bearish)
3.2 Indicator Explanations
| Indicator | Name | Calculation | Role |
|---|---|---|---|
| Tenkan-sen | Conversion Line | (9-period high + 9-period low) / 2 | Short-term trend |
| Kijun-sen | Base Line | (26-period high + 26-period low) / 2 | Medium-term trend |
| Senkou Span A | Leading Span A | (Tenkan + Kijun) / 2, projected 26 periods forward | Cloud upper edge |
| Senkou Span B | Leading Span B | (52-period high + 52-period low) / 2, projected 26 periods forward | Cloud lower edge |
| Chikou Span | Lagging Span | Current closing price, projected 26 periods back | Signal confirmation |
IV. Entry Conditions Details
4.1 Core Buy Logic
# Buy Conditions
dataframe.loc[
(
(dataframe["tenkan"].shift(1) < dataframe["kijun"].shift(1)) & # Previous Tenkan < Previous Kijun
(dataframe["tenkan"] > dataframe["kijun"]) & # Current Tenkan > Current Kijun
(dataframe["cloud_red"] == True) # Cloud is red (bearish state)
),
"buy",
] = 1
Logic Breakdown:
- Golden cross: Tenkan crosses from below to above Kijun (short-term trend strengthening)
- Cloud confirmation: Cloud is red, indicating prior downtrend may now reverse
- Dual confirmation: Trend reversal + cloud confirmation improve signal quality
4.2 Signal Interpretation
| Condition | Meaning |
|---|---|
| Tenkan > Kijun | Bullish trend |
| Kijun > Tenkan | Bearish trend |
| Price > Cloud | Strong bullish |
| Price < Cloud | Strong bearish |
| Cloud green | Bullish cloud |
| Cloud red | Bearish cloud |
V. Exit Conditions Details
5.1 Sell Conditions
# Sell Conditions
dataframe.loc[(), "sell"] = 1
Problem: The sell condition in the original code is empty — this is a serious strategy flaw.
5.2 Actual Exit Mechanism
Since sell conditions are undefined, the strategy actually relies on:
| Exit Method | Trigger Condition |
|---|---|
| Trailing stop | Profit > 2%, then 1% pullback |
| Hard stop-loss | Loss > 10% |
| ROI exit | 100% profit (theoretical value) |
VI. Technical Indicator System
6.1 Core Indicators
| Indicator Category | Specific Indicator | Purpose |
|---|---|---|
| Trend Indicator | Tenkan-sen (9) | Short-term trend |
| Trend Indicator | Kijun-sen (26) | Medium-term trend |
| Cloud Indicator | Senkou Span A/B | Support/resistance |
| Confirmation Indicator | Cloud Green/Red | Bull/bear state |
VII. Risk Management
7.1 Trailing Stop Mechanism
# Trailing Stop Example
# Assume entry price 100 USDT
# Activates trailing at 102 USDT (2%)
# Auto-sells at 101 USDT (1% pullback)
7.2 Hard Stop-Loss
stoploss = -0.10 # -10%
VIII. Strategy Pros & Cons
Advantages
- Comprehensive analysis: Simultaneously considers trend, momentum, and support/resistance
- Multi-dimensional confirmation: Multiple indicators verify each other, improving signal quality
- Cloud visualization: Intuitive support/resistance zone display
- Trailing stop: Effectively protects profits
Limitations
- Missing sell conditions: Strategy has no explicit sell logic design — a serious flaw
- Fixed parameters: Cloud parameters (9, 26, 52) not suitable for all markets
- High complexity: Requires deep understanding of indicator relationships
- Poor oscillating performance: Signals are frequent and inaccurate in oscillating markets
- Lagging: Calculated from historical data; has some lag
IX. Modification Suggestions
9.1 Must Fix
- Complete sell conditions: Add sell logic based on cloud or crossover
- Add take-profit: Set reasonable profit targets
9.2 Optimization Suggestions
- Add confirmation indicators: Use RSI or MACD for signal confirmation
- Time filtering: Avoid trading at specific times
- Multi-timeframe analysis: Use higher timeframes to confirm trends
- Cloud thickness filtering: Only trade when the cloud is thin
X. Summary
Ichimoku is a powerful comprehensive technical analysis system, providing a full-spectrum market analysis method. However, the current strategy implementation has a clear flaw — sell conditions are undefined. Before actual use, sell logic must be completed, and risk must be managed through trailing stops and hard stop-losses.
The strategy is suitable for traders with some technical analysis background. Beginners should first deeply study Ichimoku Cloud principles before using it.
Appendix: Complete Code Structure
class Ichimoku(IStrategy):
minimal_roi = {"0": 1}
stoploss = -0.1
timeframe = "5m"
trailing_stop = True
trailing_stop_positive = 0.01
trailing_stop_positive_offset = 0.02
trailing_only_offset_is_reached = True
def populate_indicators(self, dataframe, metadata):
ichi = ichimoku(dataframe)
dataframe["tenkan"] = ichi["tenkan_sen"]
dataframe["kijun"] = ichi["kijun_sen"]
dataframe["senkou_a"] = ichi["senkou_span_a"]
dataframe["senkou_b"] = ichi["senkou_span_b"]
dataframe["cloud_green"] = ichi["cloud_green"]
dataframe["cloud_red"] = ichi["cloud_red"]
return dataframe
def populate_entry_trend(self, dataframe, metadata):
dataframe.loc[
(dataframe["tenkan"].shift(1) < dataframe["kijun"].shift(1)) &
(dataframe["tenkan"] > dataframe["kijun"]) &
(dataframe["cloud_red"] == True),
"buy"
] = 1
return dataframe
def populate_exit_trend(self, dataframe, metadata):
dataframe.loc[(), "sell"] = 1 # Needs completion
return dataframe