Ichimoku Cloud and ADX with Trailing Stop Loss (by Coinrule)
Jan 12, 2023

The Ichimoku Cloud and ADX with Trailing Stop Loss indicator combines multi-layered trend confirmation with volatility-based strength filtering and dynamic risk management to capture high-probability market reversals and trend swings.
Usage
The Usage section describes how the script can be used to identify entry and exit points based on the confluence of trend direction and momentum. The indicator provides visual cues on the chart through the Ichimoku Cloud components and executes strategy logic based on ADX levels.
- Long Entry: Occurs when the Tenkan-Sen is above the Kijun-Sen (bullish cross), the Chikou-Span is above the price from 26 periods ago, the current price is above the Kumo Cloud, and the DMI shows +DI > -DI with an ADX reading suggesting a specific trend phase.
- Short Entry: Occurs when the Tenkan-Sen is below the Kijun-Sen (bearish cross), the Chikou-Span is below the price from 26 periods ago, the current price is below the Kumo Cloud, and the DMI shows -DI > +DI with an ADX reading suggesting trend exhaustion or strength.
- Trailing Stop Loss: Once a position is active, the script calculates a dynamic exit point based on a percentage of the price. For long positions, the stop moves upward as price increases but never decreases. For short positions, the stop moves downward as price decreases but never increases.
Details
This tool utilizes the Ichimoku Kinko Hyo system developed by Goichi Hosoda to define support and resistance via the "Cloud" (Senkou Span A and B). The cloud projects potential future price barriers, while the Tenkan-Sen and Kijun-Sen act as fast and slow signal lines.
The integration of the Average Directional Index (ADX) and Directional Movement Index (DMI) serves as a secondary filter. While the Ichimoku system identifies direction, the ADX measures the intensity of that movement. In this specific implementation, a contrarian approach is applied to the ADX; high values (e.g., above 45) are used to identify overextended trends that may be susceptible to reversals, while standard DMI crossovers (+DI/-DI) ensure the trade aligns with the immediate directional momentum.
Settings
Ichimoku Settings
- Tenkan-Sen Bars: The period for the conversion line (default 9).
- Kijun-Sen Bars: The period for the base line (default 26).
- Senkou-Span B Bars: The period for the leading span B (default 52).
- Chikou-Span Offset: The number of bars to displace the lagging span (default 26).
- Senkou-Span Offset: The number of bars to project the cloud into the future (default 26).
Strategy Settings
- Long Entry: Toggles the execution of bullish trades.
- Short Entry: Toggles the execution of bearish trades.
- Trail Long Loss (%): The percentage distance for the trailing stop loss on long positions.
- Trail Short Loss (%): The percentage distance for the trailing stop loss on short positions.
- Show Date Range: Filters signals and backtesting results to a specific timeframe starting from 2022.
FAQ
How do I interpret the Kumo Cloud color? The cloud is green when Senkou Span A is above Senkou Span B, indicating a bullish future bias, and red when Senkou Span B is above Senkou Span A, indicating a bearish future bias.
What is the role of the ADX in this script? The ADX measures trend strength. In this script, it is used to filter entries by ensuring the trend is either gaining momentum or reaching an exhaustion point (above 45) to signal a potential contrarian reversal.
How can I access this tool? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.