Strategy vault / Trend following
Ichimoku Early Cloud Trend Following Strategy
The Ichimoku Early Cloud Trend Following Strategy is a trend following strategy based on the popular Ichimoku Cloud indicator. It utilizes the crossover lines of the Ichimoku Cloud to generate early entry signals and…

Overview
The Ichimoku Early Cloud Trend Following Strategy is a trend following strategy based on the popular Ichimoku Cloud indicator. It utilizes the crossover lines of the Ichimoku Cloud to generate early entry signals and capture trends ahead of time. The strategy also incorporates moving averages for trend validation to avoid false breakouts.
Strategy Logic
The strategy is mainly based on the following elements:
Construct the Ichimoku Cloud using the Conversion Line and Base Line, and plot the cloud with a 26-period displacement.
Trigger a long signal when close breaks above the top of the cloud; trigger a short signal when close breaks below the bottom of the cloud.
Require close to also break the max/min of the Conversion and Base Lines to filter out false breakouts.
Optionally set a 5% stop loss based on entry price.
With such multilayer filtering, it can effectively identify trend reversal points and capture emerging trading opportunities in a timely manner. The strict breakout criteria also help reduce false signals.
Advantages
The strategy has the following advantages:
- Ichimoku Cloud crossover lines have clear early indication before trend reversal.
- Incorporating moving averages avoids false breakout due to overnight gaps.
- Multiple filter conditions reduce false signals and improve signal quality.
- Long holding periods result in smaller drawdowns and easier profit taking.
- Applicable to different products, especially trending instruments.
Risks
There are also some risks to consider:
- Works better for trending markets; may generate more false signals during range-bound periods.
- Ichimoku parameters need to be optimized for different products.
- Stop loss placement requires caution to avoid premature exit.
- Relatively low signal frequency, tends to miss short-term opportunities.
Risks can be reduced by:
- Select strongly trending products, avoid ranging products.
- Optimize Ichimoku parameters for different timeframes to find best combinations.
- Employ trailing stop loss to control loss on single trades.
- Add other indicators to increase signal frequency.
Enhancements
The strategy can be further improved on the following aspects:
Add position sizing to control amount traded programmatically via
strategy.position_size.Add security universe filtering to auto detect trend strength via
security().Incorporate stop loss/profit taking techniques for risk management.
Build multi-indicator system combining indicators like Bollinger Bands and RSI to improve signal quality.
Apply machine learning to judge signal reliability and dynamically adjust order quantities.
Conclusion
The Ichimoku Early Cloud Trend Following Strategy utilizes Ichimoku Cloud for early trend identification, reinforced by moving average filters, to reliably detect high-quality trading opportunities. The strategy is stable with much room for enhancements and can be widely adopted for live trading.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 9 | Conversion Line Period |
| v_input_2 | 26 | Base Line Period |
| v_input_3 | 52 | Lagging Span 2 Period |
| v_input_4 | 26 | Displacement |
| v_input_5 | false | Long Only |
| v_input_6 | 5 | Stop-loss (%) |
| v_input_7 | false | Use Stop-Loss |
Source Pine Script
/*backtest
start: 2022-12-05 00:00:00
end: 2023-12-11 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © QuantCT
//@version=4
strategy("Ichimoku Cloud Strategy Idea",
shorttitle="Ichimoku",
overlay=true,
pyramiding=0,
default_qty_type=strategy.percent_of_equity,
default_qty_value=99,
initial_capital=1000,
commission_type=strategy.commission.percent,
commission_value=0.1)
// ____ Inputs
conversion_period = input(9, minval=1, title="Conversion Line Period")
base_period = input(26, minval=1, title="Base Line Period")
lagging_span2_period = input(52, minval=1, title="Lagging Span 2 Period")
displacement = input(26, minval=1, title="Displacement")
long_only = input(title="Long Only", defval=false)
slp = input(title="Stop-loss (%)", minval=1.0, maxval=25.0, defval=5.0)
use_sl = input(title="Use Stop-Loss", defval=false)
// ____ Logic
donchian(len) => avg(lowest(len), highest(len))
conversion_line = donchian(conversion_period)
base_line = donchian(base_period)
lead_line1 = avg(conversion_line, base_line)
lead_line2 = donchian(lagging_span2_period)
chikou = close
chikou_free_long = close > high[displacement] and close > max(lead_line1[2 * displacement], lead_line2[2 * displacement])
enter_long = chikou_free_long and close > max(lead_line1[displacement], lead_line2[displacement])
exit_long = close < lead_line1[displacement] or close < lead_line2[displacement]
chikou_free_short = close < low[displacement] and close < min(lead_line1[2 * displacement], lead_line2[2 * displacement])
enter_short = chikou_free_short and close < min(lead_line1[displacement], lead_line2[displacement])
exit_short = close > lead_line1[displacement] or close > lead_line2[displacement]
strategy.entry("Long", strategy.long, when=enter_long)
strategy.close("Long", when=exit_long)
if (not long_only)
strategy.entry("Short", strategy.short, when=enter_short)
strategy.close("Short", when=exit_short)
// ____ SL
sl_long = strategy.position_avg_price * (1- (slp/100))
sl_short = strategy.position_avg_price * (1 + (slp/100))
if (use_sl)
strategy.exit(id="SL", from_entry="Long", stop=sl_long)
strategy.exit(id="SL", from_entry="Short", stop=sl_short)
// ____ Plots
colors =
enter_long ? #27D600 :
enter_short ? #E30202 :
color.orange
p1 = plot(lead_line1, offset = displacement, color=colors,
title="Lead 1")
p2 = plot(lead_line2, offset = displacement, color=colors,
title="Lead 2")
fill(p1, p2, color = colors)
plot(chikou, offset = -displacement, color=color.blue)
Published by ChaoZhang on the FMZ strategy square · last modified 2023-12-12. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Ichimoku-Early-Cloud-Trend-Following-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Multiple Timeframe Filtered Trend Following StrategyPine Script · Trend following · 1h
- Multitimeframe Trend Hunter StrategyPine Script · Trend following · 1h
- Cloud Based Bollinger Bands Double Moving Average Quantitative Trend StrategyPine Script · Trend following · 1d
- TrendHunter w MF Multi Timeframe Trend StrategyPine Script · Trend following · 1h
- Ichimoku Cloud Trend Following StrategyPine Script · Trend following · 1h
- Dynamic Multi Indicator Optimized Trend Following StrategyPine Script · Trend following · 2d