Stavix2 Strategy Analysis
Strategy Number: #34
Strategy Type: Ichimoku Cloud Trend Following Strategy
Timeframe: 1 minute (1m)
I. Strategy Overview
Stavix2 is a quantitative trading strategy based on the famous Japanese technical analysis theory "Ichimoku Kinko Hyo" (Ichimoku Cloud). The strategy analyzes various components of the cloud chart to judge market trends and trading signals, one of the simpler trend following solutions in the Freqtrade strategy library.
Ichimoku Kinko Hyo is an all-around technical analysis system, invented by Japanese journalist Ichimoku Sanjin (Hosoda Goichi) in the 1930s. It can simultaneously provide trend judgment, support/resistance identification, momentum analysis, and trading signals, hailed as "the pinnacle of Japanese technical analysis".
Stavix2 strategy uses only the core components of Ichimoku cloud, yet implements complete trend following functionality, very suitable for traders hoping to learn technical analysis automation.
Core Features
| Feature | Description |
|---|---|
| Entry Conditions | 1 entry signal (price breaks through cloud + MA golden cross) |
| Exit Conditions | 1 exit signal (price breaks below cloud + MA death cross) |
| Protection | No explicit protection mechanisms |
| Timeframe | 1 minute |
| Dependencies | technical (indicators.ichimoku), technical (qtpylib) |
II. Strategy Configuration Analysis
2.1 Base Risk Parameters
# ROI exit table
minimal_roi = {
"0": 0.15 # Immediate exit requires 15% profit
}
# Stoploss setting
stoploss = -0.10 # 10% fixed stoploss
Design Logic:
Stavix2's ROI setting adopts a single threshold design; 15% immediate take-profit target is quite aggressive for 1-minute timeframe. This indicates the strategy author expects to capture larger trend moves, not accumulate small profits.
10% fixed stoploss matches aggressive target return, reserving sufficient space for price fluctuations.
2.2 Trailing Stop Configuration
trailing_stop = True
trailing_only_offset_is_reached = True
trailing_stop_positive = 0.01
trailing_stop_positive_offset = 0.03
Design Logic:
| Parameter | Value | Meaning |
|---|---|---|
| trailing_stop_positive | 0.01 | 1% retracement triggers exit |
| trailing_stop_positive_offset | 0.03 | Activate after 3% profit |
This means the strategy allows profit retracement to only 2% before triggering exit (3% - 1% = 2%), a relatively conservative setting.
III. Entry Conditions Details
3.1 Ichimoku Indicator Calculation
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
cloud = ichimoku(dataframe, conversion_line_period=200, base_line_periods=350, laggin_span=150, displacement=75)
dataframe['tenkan_sen'] = cloud['tenkan_sen']
dataframe['kijun_sen'] = cloud['kijun_sen']
dataframe['senkou_span_a'] = cloud['senkou_span_a']
dataframe['senkou_span_b'] = cloud['senkou_span_b']
dataframe['chikou_span'] = cloud['chikou_span']
return dataframe
Ichimoku Parameter Details:
| Component | Parameter | Description |
|---|---|---|
| Conversion Line (Tenkan-sen) | 200 periods | Short-term trend line |
| Base Line (Kijun-sen) | 350 periods | Medium-term trend line |
| Cloud A (Senkou Span A) | Midpoint of 200+350 | Leading span A |
| Cloud B (Senkou Span B) | 450 periods | Leading span B |
| Lagging Span (Chikou Span) | 75 periods | Lagging confirmation |
3.2 Entry Conditions
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['close'] > dataframe['senkou_span_a']) &
(dataframe['close'] > dataframe['senkou_span_b']) &
(qtpylib.crossed_above(dataframe['kijun_sen'], dataframe['tenkan_sen']))
),
'buy'] = 1
return dataframe
Logic Breakdown:
- close > senkou_span_a: Price above cloud upper edge
- close > senkou_span_b: Price above cloud lower edge
- crossed_above(kijun_sen, tenkan_sen): Base line crosses above conversion line (golden cross)
Technical Meaning:
This is a triple-confirmed entry signal:
- Price breaks through cloud: Indicates price enters strong area
- Price above both cloud edges: Confirms bullish pattern
- MA golden cross: Momentum confirmation
IV. Exit Logic Details
4.1 Exit Conditions
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['close'] < dataframe['senkou_span_a']) &
(dataframe['close'] < dataframe['senkou_span_b']) &
(qtpylib.crossed_above(dataframe['tenkan_sen'], dataframe['kijun_sen']))
),
'sell'] = 1
return dataframe
Logic Breakdown:
- close < senkou_span_a: Price below cloud upper edge
- close < senkou_span_b: Price below cloud lower edge
- crossed_above(tenkan_sen, kijun_sen): Conversion line crosses above base line (death cross)
Symmetrical Design:
The strategy's exit conditions form perfect symmetry with entry conditions, this design allows the strategy to work effectively in both long and short directions.
V. Technical Indicator System
5.1 Ichimoku Core Components
| Component | Chinese Name | Calculation Method | Trading Meaning |
|---|---|---|---|
| Tenkan-sen | Conversion Line | (High+Low)/2, period 9 | Short-term trend baseline |
| Kijun-sen | Base Line | (High+Low)/2, period 26 | Medium-term trend baseline |
| Senkou Span A | Cloud A | (Conversion+Base)/2, shifted 26 forward | Support/resistance upper edge |
| Senkou Span B | Cloud B | (High+Low)/2, period 52, shifted 26 forward | Support/resistance lower edge |
| Chikou Span | Lagging Span | Close shifted 26 forward | Trend confirmation |
5.2 Cloud Interpretation
| Price Position | Market State | Trading Meaning |
|---|---|---|
| Price > Cloud | Uptrend | Bullish pattern, can go long |
| Price < Cloud | Downtrend | Bearish pattern, can go short |
| Price inside Cloud | Ranging/Consolidation | Mainly observe |
| Cloud sloping up | Trend upward | Trade with trend |
| Cloud sloping down | Trend downward | Counter-trend trading |
VI. Risk Management Features
6.1 Fixed Stoploss
stoploss = -0.10
10% fixed stoploss is one of standard settings in cryptocurrency market, can tolerate normal intraday fluctuations, while effectively protecting capital when trend reverses.
6.2 Trailing Stop
trailing_stop_positive = 0.01 # 1%
trailing_stop_positive_offset = 0.03 # 3%
1% trailing stop threshold means triggers exit when profit retraces to only 2% (3% - 1% = 2%), a relatively tight setting.
6.3 Take-Profit Target
minimal_roi = {"0": 0.15}
15% take-profit target is quite aggressive for 1-minute timeframe, requires significant trend to achieve.
VII. Strategy Pros & Cons
✅ Pros
- Classic Theory Support: Based on Ichimoku Cloud, deep theoretical background
- Multi-Dimensional Signal Confirmation: Triple condition confirmation, reduces false signal probability
- Long-Short Symmetrical Design: Entry/exit logic symmetrical, strategy complete
- Simple Code Implementation: Around 100 lines, easy to understand and modify
- Adjustable Parameters: Cloud parameters can be optimized for different markets
⚠️ Cons
- 1-Minute Noise: Very short timeframe, signals frequent and unstable
- No Protection Mechanisms: No filtering conditions
- Late Entry: Only enters after price breaks through cloud
- Fixed Parameters: Cloud periods fixed, lacks flexibility
- High Computation: Ichimoku calculation resource demands high
VIII. Applicable Scenarios
| Market Environment | Recommended Configuration | Description |
|---|---|---|
| Clear trending market | Usable | Cloud performs better in trending markets |
| Ranging market | Use with caution | Cloud intertwined, frequent signals |
| High volatility coins | Adjust stoploss | 10% may not be enough |
| Mainstream coins | Recommended | Good liquidity |
IX. Detailed Applicable Market Environments
9.1 Strategy Core Logic
Stavix2's design philosophy is capturing "trend continuation after cloud breakout". When price breaks through cloud and obtains MA golden cross confirmation, considers trend clearly established, enters at this point to follow trend until reversal signal appears.
9.2 Performance in Different Market Environments
| Market Type | Performance Rating | Reason Analysis |
|---|---|---|
| 📈 Strong uptrend | ⭐⭐⭐⭐⭐ | Price continuously above cloud, MA golden cross effective |
| 📉 Strong downtrend | ⭐⭐⭐⭐⭐ | Exit conditions equally effective, can short |
| 🔄 Ranging market | ⭐⭐ | Frequent cloud crossing, generates many false signals |
| ⚡ High volatility | ⭐⭐⭐ | Large volatility has chance to reach take-profit |
9.3 Key Configuration Recommendations
| Configuration Item | Suggested Value | Description |
|---|---|---|
| Trading pairs | 5-10 | Risk diversification |
| Timeframe | Try 5m/15m | Reduce noise |
| Stoploss | Adjustable | Depends on risk preference |
X. Important Reminders: The Cost of Complexity
10.1 Learning Cost
Although Stavix2 strategy code is simple, involved Ichimoku theory is relatively complex:
- Need to understand five components of cloud chart
- Need to understand interactions between components
- Need to understand cloud chart interpretation in different market environments
- Suggested learning time: 1-2 weeks
10.2 Hardware Requirements
| Number of Pairs | Minimum Memory | Recommended Memory |
|---|---|---|
| 1-10 | 1GB | 2GB |
| 10-30 | 2GB | 4GB |
10.3 Backtest vs Live Trading Differences
- Ichimoku calculation needs historical data initialization
- 1-minute K-line may have differences between live trading and backtest
- Suggest using longer timeframe for verification
10.4 Manual Trader Suggestions
- First understand basic principles of Ichimoku Cloud
- Test on paper trading at least 2 weeks
- Focus on cloud slope direction
XI. Summary
Stavix2 is a simple strategy that automates classic technical analysis theory. Through Ichimoku Cloud's multi-dimensional signal confirmation mechanism, implements complete trend following functionality while maintaining code simplicity.
Its core values are:
- Theoretical Depth: Based on Japanese classic technical analysis
- Simple Implementation: Little code, easy to maintain
- Long-Short Symmetry: Complete two-way trading system
- Extensibility: Parameters adjustable, adapts to different markets
For quantitative traders, Stavix2 is a very good starting strategy, can help understand basic framework of technical indicator automation. But considering 1-minute timeframe noise issues, recommend using longer periods in practical application.
Document Version: v1.0
Strategy Series: Ichimoku Cloud Trend Following