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.
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.
The strategy has the following advantages:
There are also some risks to consider:
Risks can be reduced by:
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.
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.
/*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)