OPEN-SOURCE SCRIPT
Updated

Weighted Ichimoku Strategy

4 343
HSBA

The Ichimoku Kinko Hyo indicator is a comprehensive tool that combines multiple signals to identify market trends and potential buying/selling opportunities. My weighted variant of this strategy attempts to assign specific weights to each signal, allowing for a more nuanced and customizable approach to trend identification. The intent is to try and make a more informed trading decision based on the cumulative strength of various signals.

I've tried not to make it a mishmash of this and that + MACD + RSI and on and on; most people have their preferred indicator that focuses on just that that they can use in conjunction.


The signals used can be grouped into two groups the 'Core Ichimoku Signals' & the 'Additional Signals' (at the end you will find the signals and their assigned weights followed by the thresholds where they align).

The Core Ichimoku Signals are the primary signals used in Ichimoku analysis, including Kumo Breakout, Chikou Cross, Kijun Cross, Tenkan Cross, and Kumo Twist.

While the Additional Signals provide further insights and confirmations, such as Kijun Confirmation, Tenkan-Kijun Above Cloud, Chikou Above Cloud, Price-Kijun Cross, Chikou Span Signal, and Price Positioning.

Entries are triggered when the cumulative weight of bullish signals exceeds a specified buy threshold, indicating a strong uptrend or potential trend reversal.

Exits are initiated when the cumulative weight of bearish signals surpasses a specified sell threshold, or when additional conditions such as consolidation patterns or ATR-based targets are met.

https://www.tradingview.com/x/pkQRQK4d/

There are various exit types that you can choose between, which can be used separately or in conjunction with one another. As an example you might want to exit on a different condition during consolidation periods than during other periods or just use ATR with some other backstop.
They are listed in evaluation order i.e. ATR trumps all, Consolidation exit trumps the regular Kumo sell and so on:
  • **ATR Sell**: Exits trades based on ATR-based profit targets and stop-losses.
  • **Consolidation Exit**: Exits trades during consolidation periods to reduce drawdown.
  • **Sell Below Kumo**: Exits trades when the price is below the Kumo, indicating a potential downtrend.
  • **Sell Threshold**: Exits trades when the cumulative weight of bearish signals surpasses a specified sell threshold.


There are various 'filters' which are really behavior modifiers:
  • **Kumo Breakout Filter**: Requires price to close above the Kumo for buy signals (essentially a entry delay).
  • **Whipsaw Filter**: Ensures trend strength over specified days to reduce false signals.
  • **Buy Cooldown**: Prevents new entries until half the Kijun period passes after an exit (prevents flapping).
  • **Chikou Filter**: Delays exits unless the previous close is below the Chikou Span.
  • **Consolidation Trend Filter**: Prevents consolidation exits if the trend is bullish (rare, but happens).


Then there are some debugging options. Ichimoku periods have some presets (personally I like 8/22/44/22) but are freely configurable, preset to the traditional values for purists.

The list of signals and most thresholds follow, play around with them. Thats all.

Cheers,

  • **Core Ichimoku Signals**
    **Kumo Breakout**
    - 30 (Bullish) / -30 (Bearish)
    - Indicates a strong trend when the price breaks above (bullish) or below (bearish) the Kumo (cloud). This signal suggests a significant shift in market sentiment.
    **Chikou Cross**
    - 20 (Bullish) / -20 (Bearish)
    - Shows the relationship between the Chikou Span (lagging span) and the current price. A bullish signal occurs when the Chikou Span is above the price, indicating a potential uptrend. Conversely, a bearish signal occurs when the Chikou Span is below the price, suggesting a downtrend.
    **Kijun Cross**
    - 15 (Bullish) / -15 (Bearish)
    - Signals trend changes when the Tenkan-sen (conversion line) crosses above (bullish) or below (bearish) the Kijun-sen (base line). This crossover is often used to identify potential trend reversals.
    **Tenkan Cross**
    - 10 (Bullish) / -10 (Bearish)
    - Indicates short-term trend changes when the price crosses above (bullish) or below (bearish) the Tenkan-sen. This signal helps identify minor trend shifts within the broader trend.
    **Kumo Twist**
    - 5 (Bullish) / -5 (Bearish)
    - Shows changes in the Kumo's direction, indicating potential trend shifts. A bullish Kumo Twist occurs when Senkou Span A crosses above Senkou Span B, and a bearish twist occurs when Senkou Span A crosses below Senkou Span B.
  • **Additional Signals**
    • **Kijun Confirmation**
      - 8 (Bullish) / -8 (Bearish)
      - Confirms the trend based on the price's position relative to the Kijun-sen. A bullish signal occurs when the price is above the Kijun-sen, and a bearish signal occurs when the price is below it.
    • **Tenkan-Kijun Above Cloud**
      - 5 (Bullish) / -5 (Bearish)
      - Indicates a strong bullish trend when both the Tenkan-sen and Kijun-sen are above the Kumo. Conversely, a bearish signal occurs when both lines are below the Kumo.
    • **Chikou Above Cloud**
      - 5 (Bullish) / -5 (Bearish)
      - Shows the Chikou Span's position relative to the Kumo, indicating trend strength. A bullish signal occurs when the Chikou Span is above the Kumo, and a bearish signal occurs when it is below.
    • **Price-Kijun Cross**
      - 2 (Bullish) / -2 (Bearish)
      - Signals short-term trend changes when the price crosses above (bullish) or below (bearish) the Kijun-sen. This signal is similar to the Kijun Cross but focuses on the price's direct interaction with the Kijun-sen.
    • **Chikou Span Signal**
      - 10 (Bullish) / -10 (Bearish)
      - Indicates the trend based on the Chikou Span's position relative to past price highs and lows. A bullish signal occurs when the Chikou Span is above the highest high of the past period, and a bearish signal occurs when it is below the lowest low.
    • **Price Positioning**
      - 10 (Bullish) / -10 (Bearish)
      - Shows indecision when the price is between the Tenkan-sen and Kijun-sen, indicating a potential consolidation phase. A bullish signal occurs when the price is above both lines, and a bearish signal occurs when the price is below both lines.


  • **Confidence Level**: Highly Sensitive
    - **Buy Threshold**: 50
    - **Sell Threshold**: -50
    - **Notes / Significance**: ~2–3 signals, very early trend detection. High sensitivity, may capture noise and false signals.
  • **Confidence Level**: Entry-Level
    - **Buy Threshold**: 58
    - **Sell Threshold**: -58
    - **Notes / Significance**: ~3–4 signals, often Chikou Cross or Kumo Breakout. Very sensitive, risks noise (e.g., false buys in choppy markets).
  • **Confidence Level**: Entry-Level
    - **Buy Threshold**: 60
    - **Sell Threshold**: -60
    - **Notes / Significance**: ~3–4 signals, Kumo Breakout or Chikou Cross anchors. Entry point for early trends.
  • **Confidence Level**: Moderate
    - **Buy Threshold**: 65
    - **Sell Threshold**: -65
    - **Notes / Significance**: ~4–5 signals, balances sensitivity and reliability. Suitable for moderate risk tolerance.
  • **Confidence Level**: Conservative
    - **Buy Threshold**: 70
    - **Sell Threshold**: -70
    - **Notes / Significance**: ~4–5 signals, emphasizes stronger confirmations. Reduces false signals but may miss some opportunities.
  • **Confidence Level**: Very Conservative
    - **Buy Threshold**: 75
    - **Sell Threshold**: -75
    - **Notes / Significance**: ~5–6 signals, prioritizes high confidence. Minimizes risk but may enter trades late.
  • **Confidence Level**: High Confidence
    - **Buy Threshold**: 80
    - **Sell Threshold**: -80
    - **Notes / Significance**: ~6–7 signals, very strong confirmations needed. Suitable for cautious traders.
  • **Confidence Level**: Very High Confidence
    - **Buy Threshold**: 85
    - **Sell Threshold**: -85
    - **Notes / Significance**: ~7–8 signals, extremely high confidence required. Minimizes false signals significantly.
  • **Confidence Level**: Maximum Confidence
    - **Buy Threshold**: 90
    - **Sell Threshold**: -90
    - **Notes / Significance**: ~8–9 signals, maximum confidence level. Ensures trades are highly reliable but may result in fewer trades.
  • **Confidence Level**: Ultra Conservative
    - **Buy Threshold**: 100
    - **Sell Threshold**: -100
    - **Notes / Significance**: ~9–10 signals, ultra-high confidence. Trades are extremely reliable but opportunities are rare.
  • **Confidence Level**: Extreme Confidence
    - **Buy Threshold**: 110
    - **Sell Threshold**: -110
    - **Notes / Significance**: All signals align, extreme confidence. Trades are almost certain but very few opportunities.
Release Notes
My weighted variant of this strategy attempts to assign specific weights to each signal, allowing for a more nuanced and customizable approach to trend identification. The intent is to try and make a more informed trading decision based on the cumulative strength of various signals.

The signals used can be grouped into two groups the 'Core Ichimoku Signals' & the 'Additional Signals' (at the end you will find the signals and their assigned weights followed by the thresholds where they align).

The Core Ichimoku Signals are the primary signals used in Ichimoku analysis, including Kumo Breakout, Chikou Cross, Kijun Cross, Tenkan Cross, and Kumo Twist.

While the Additional Signals provide further insights and confirmations, such as Kijun Confirmation, Tenkan-Kijun Above Cloud, Chikou Above Cloud, Price-Kijun Cross, Chikou Span Signal, and Price Positioning.

Entries are triggered when the cumulative weight of bullish signals exceeds a specified buy threshold, indicating a strong uptrend or potential trend reversal.

Exits are initiated when the cumulative weight of bearish signals surpasses a specified sell threshold, or when additional conditions such as consolidation patterns or ATR-based targets are met.

snapshot

There are various exit types that you can choose between, which can be used separately or in conjunction with one another. As an example you might want to exit on a different condition during consolidation periods than during other periods or just use ATR with some other backstop.
They are listed in evaluation order i.e. ATR trumps all, Consolidation exit trumps the regular Kumo sell and so on:
  • ATR Sell: Exits trades based on ATR-based profit targets and stop-losses.
  • Consolidation Exit: Exits trades during consolidation periods to reduce drawdown.
  • Sell Below Kumo: Exits trades when the price is below the Kumo, indicating a potential downtrend.
  • Sell Threshold: Exits trades when the cumulative weight of bearish signals surpasses a specified sell threshold.


There are various 'filters' which are really behavior modifiers:
  • Kumo Breakout Filter: Requires price to close above the Kumo for buy signals (essentially a entry delay).
  • Whipsaw Filter: Ensures trend strength over specified days to reduce false signals.
  • Buy Cooldown: Prevents new entries until half the Kijun period passes after an exit (prevents flapping).
  • Chikou Filter: Delays exits unless the previous close is below the Chikou Span.
  • Consolidation Trend Filter: Prevents consolidation exits if the trend is bullish (rare, but happens).


Then there are some debugging options. Ichimoku periods have some presets (personally I like 8/22/44/22) but are freely configurable, preset to the traditional values for purists.

The list of signals and most thresholds follow, play around with them. Thats all.

Cheers,
  • Core Ichimoku Signals
  • Kumo Breakout: 30 (Bullish) / -30 (Bearish)
    - Indicates a strong trend when the price breaks above (bullish) or below (bearish) the Kumo (cloud). This signal suggests a significant shift in market sentiment.
  • Chikou Cross: 20 (Bullish) / -20 (Bearish)
    - Shows the relationship between the Chikou Span (lagging span) and the current price. A bullish signal occurs when the Chikou Span is above the price, indicating a potential uptrend. Conversely, a bearish signal occurs when the Chikou Span is below the price, suggesting a downtrend.
  • Kijun Cross: 15 (Bullish) / -15 (Bearish)
    - Signals trend changes when the Tenkan-sen (conversion line) crosses above (bullish) or below (bearish) the Kijun-sen (base line). This crossover is often used to identify potential trend reversals.
  • Tenkan Cross: 10 (Bullish) / -10 (Bearish)
    - Indicates short-term trend changes when the price crosses above (bullish) or below (bearish) the Tenkan-sen. This signal helps identify minor trend shifts within the broader trend.
  • Kumo Twist: 5 (Bullish) / -5 (Bearish)
    - Shows changes in the Kumo's direction, indicating potential trend shifts. A bullish Kumo Twist occurs when Senkou Span A crosses above Senkou Span B, and a bearish twist occurs when Senkou Span A crosses below Senkou Span B.

Additional Signals
  • Kijun Confirmation: 8 (Bullish) / -8 (Bearish)
    - Confirms the trend based on the price's position relative to the Kijun-sen. A bullish signal occurs when the price is above the Kijun-sen, and a bearish signal occurs when the price is below it.
  • Tenkan-Kijun Above Cloud: 5 (Bullish) / -5 (Bearish)
    - Indicates a strong bullish trend when both the Tenkan-sen and Kijun-sen are above the Kumo. Conversely, a bearish signal occurs when both lines are below the Kumo.
  • Chikou Above Cloud: 5 (Bullish) / -5 (Bearish)
    - Shows the Chikou Span's position relative to the Kumo, indicating trend strength. A bullish signal occurs when the Chikou Span is above the Kumo, and a bearish signal occurs when it is below.
  • Price-Kijun Cross: 2 (Bullish) / -2 (Bearish)
    - Signals short-term trend changes when the price crosses above (bullish) or below (bearish) the Kijun-sen. This signal is similar to the Kijun Cross but focuses on the price's direct interaction with the Kijun-sen.
  • Chikou Span Signal: 10 (Bullish) / -10 (Bearish)
    - Indicates the trend based on the Chikou Span's position relative to past price highs and lows. A bullish signal occurs when the Chikou Span is above the highest high of the past period, and a bearish signal occurs when it is below the lowest low.
  • Price Positioning: 10 (Bullish) / -10 (Bearish)
    - Shows indecision when the price is between the Tenkan-sen and Kijun-sen, indicating a potential consolidation phase. A bullish signal occurs when the price is above both lines, and a bearish signal occurs when the price is below both lines.


  • Confidence Level: Highly Sensitive - Buy Threshold: 50 - Sell Threshold: -50
    - ~24 signals, often Chikou Cross or Kumo Breakout. Very sensitive, risks noise (e.g., false buys in choppy markets).
  • Confidence Level: Entry-Level - Buy Threshold: 60 - Sell Threshold: -60
    - ~35 signals, balances sensitivity and reliability. Suitable for moderate risk tolerance.
  • Confidence Level: Conservative - Buy Threshold: 70 - Sell Threshold: -70
    - ~46 signals, prioritizes high confidence. Minimizes risk but may enter trades late.
  • Confidence Level: High Confidence - Buy Threshold: 80 - Sell Threshold: -80
    - ~68 signals, extremely high confidence required. Minimizes false signals significantly.
  • Confidence Level: Maximum Confidence - Buy Threshold: 90 - Sell Threshold: -90
    - ~810 signals, ultra-high confidence. Trades are extremely reliable but opportunities are rare.
  • Confidence Level: Extreme Confidence - Buy Threshold: 110 - Sell Threshold: -110
    - All signals align, extreme confidence. Trades are almost certain but very few opportunities.
Release Notes
Made some adjustments to deal with realtime bar updates/Replay Trading and enabled 'On every tick' by default so it updates on every real-time bar update.

Re-added candle sentiment coloring (Can be disabled by disabling 'Candle Sentime
nt Painting' from the DEBUGGING inputs section, incase thats not your thing).

Made some performance related changes and optimizations.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.