Skip to main content

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

FeatureDescription
Entry Conditions1 entry signal (price breaks through cloud + MA golden cross)
Exit Conditions1 exit signal (price breaks below cloud + MA death cross)
ProtectionNo explicit protection mechanisms
Timeframe1 minute
Dependenciestechnical (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:

ParameterValueMeaning
trailing_stop_positive0.011% retracement triggers exit
trailing_stop_positive_offset0.03Activate 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:

ComponentParameterDescription
Conversion Line (Tenkan-sen)200 periodsShort-term trend line
Base Line (Kijun-sen)350 periodsMedium-term trend line
Cloud A (Senkou Span A)Midpoint of 200+350Leading span A
Cloud B (Senkou Span B)450 periodsLeading span B
Lagging Span (Chikou Span)75 periodsLagging 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:

  1. close > senkou_span_a: Price above cloud upper edge
  2. close > senkou_span_b: Price above cloud lower edge
  3. 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:

  1. close < senkou_span_a: Price below cloud upper edge
  2. close < senkou_span_b: Price below cloud lower edge
  3. 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

ComponentChinese NameCalculation MethodTrading Meaning
Tenkan-senConversion Line(High+Low)/2, period 9Short-term trend baseline
Kijun-senBase Line(High+Low)/2, period 26Medium-term trend baseline
Senkou Span ACloud A(Conversion+Base)/2, shifted 26 forwardSupport/resistance upper edge
Senkou Span BCloud B(High+Low)/2, period 52, shifted 26 forwardSupport/resistance lower edge
Chikou SpanLagging SpanClose shifted 26 forwardTrend confirmation

5.2 Cloud Interpretation

Price PositionMarket StateTrading Meaning
Price > CloudUptrendBullish pattern, can go long
Price < CloudDowntrendBearish pattern, can go short
Price inside CloudRanging/ConsolidationMainly observe
Cloud sloping upTrend upwardTrade with trend
Cloud sloping downTrend downwardCounter-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

  1. Classic Theory Support: Based on Ichimoku Cloud, deep theoretical background
  2. Multi-Dimensional Signal Confirmation: Triple condition confirmation, reduces false signal probability
  3. Long-Short Symmetrical Design: Entry/exit logic symmetrical, strategy complete
  4. Simple Code Implementation: Around 100 lines, easy to understand and modify
  5. Adjustable Parameters: Cloud parameters can be optimized for different markets

⚠️ Cons

  1. 1-Minute Noise: Very short timeframe, signals frequent and unstable
  2. No Protection Mechanisms: No filtering conditions
  3. Late Entry: Only enters after price breaks through cloud
  4. Fixed Parameters: Cloud periods fixed, lacks flexibility
  5. High Computation: Ichimoku calculation resource demands high

VIII. Applicable Scenarios

Market EnvironmentRecommended ConfigurationDescription
Clear trending marketUsableCloud performs better in trending markets
Ranging marketUse with cautionCloud intertwined, frequent signals
High volatility coinsAdjust stoploss10% may not be enough
Mainstream coinsRecommendedGood 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 TypePerformance RatingReason 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 ItemSuggested ValueDescription
Trading pairs5-10Risk diversification
TimeframeTry 5m/15mReduce noise
StoplossAdjustableDepends 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 PairsMinimum MemoryRecommended Memory
1-101GB2GB
10-302GB4GB

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:

  1. Theoretical Depth: Based on Japanese classic technical analysis
  2. Simple Implementation: Little code, easy to maintain
  3. Long-Short Symmetry: Complete two-way trading system
  4. 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