OPEN-SOURCE SCRIPT
Cardwell Dual Confluence [MarkitTick]

💡 A comprehensive momentum and trend-following framework built to identify high-probability market shifts. By synthesizing Andrew Cardwell's established Relative Strength Index (RSI) range rules with dynamic trend filtering and volatility metrics, this tool provides a unified analytical engine. It moves beyond standard oscillator readings to map the underlying momentum regime, ensuring that signals are structurally aligned with the dominant trend.
● ✨ Originality and Utility
Traditional momentum oscillators often produce premature reversal signals during strong trends, leading to false entries in directionless markets. This indicator solves that problem by integrating a dual-tier confluence model. It does not rely solely on an isolated RSI moving average crossover; instead, it demands structural validation through Cardwell's defined momentum ranges.
● 🔬 Methodology and Concepts
The logic engine of this tool evaluates multiple distinct criteria before registering a valid signal.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework

The analytical foundation of this tool rests on advanced momentum physics and statistical distribution theories.
● 🎨 Visual Guide

The tool employs a clean, visually dynamic chart interface to transmit complex data instantly without cluttering the workspace.
● 📖 How to Use

Deploying this tool requires patience and strict adherence to structural confirmation.
● ⚙️ Inputs and Settings

The script features highly customizable parameters grouped logically for maximum workflow efficiency.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.
● ✨ Originality and Utility
Traditional momentum oscillators often produce premature reversal signals during strong trends, leading to false entries in directionless markets. This indicator solves that problem by integrating a dual-tier confluence model. It does not rely solely on an isolated RSI moving average crossover; instead, it demands structural validation through Cardwell's defined momentum ranges.
- The primary utility lies in its objective structural filtering: a momentum cross is only validated if the broader market regime structurally supports the direction of the momentum.
- By combining a base timeframe momentum cross with a Higher Timeframe (HTF) trend regime and Average Directional Index (ADX) volatility filtering, this tool prevents overtrading in choppy, non-directional environments.
- This deliberate combination of an oscillator, a trend filter, and a volatility metric acts as a logical confluence engine. It avoids the pitfalls of disjointed indicator mashups by ensuring every component serves a distinct mathematical purpose in validating the signal before it is printed to the chart.
● 🔬 Methodology and Concepts
The logic engine of this tool evaluates multiple distinct criteria before registering a valid signal.
- • Momentum Crossover
The script calculates a base RSI and smooths it using two Running Moving Averages (RMA): a Fast RMA and a Slow RMA. A baseline momentum shift occurs when the Fast RMA crosses the Slow RMA, indicating a localized surge in buying or selling pressure. - • Regime Mapping
A structural trend is evaluated by comparing the closing price to a Simple Moving Average (SMA). Simultaneously, a secondary RSI is evaluated against Cardwell's defined structural ranges. A Bullish Regime requires the price to be above the SMA and the RSI to hold within a specific upper tier (defaulting to 40-80). A Bearish Regime requires the price to be below the SMA and the RSI to hold within a lower tier (defaulting to 20-60). - • Confirmation and Confluence
Regimes must persist for a user-defined number of consecutive bars to filter out transient market noise. Confluence is achieved when an RMA momentum crossover occurs within a tight, predefined window of a regime shift, ensuring both immediate momentum and the structural trend are perfectly aligned. - • Higher Timeframe and Volatility Verification
An optional HTF module checks the regime state of a larger timeframe using a strict non-repainting historical offset. Furthermore, the ADX is calculated to measure pure trend strength. If the ADX is below the user-defined minimum threshold, the market is deemed too choppy, and all signals are suppressed. - • Dynamic Trade Architecture
Once a signal is validated strictly on a confirmed bar close, the script projects dynamic Stop Loss and Take Profit levels using a multiplier of the Average True Range (ATR), actively adapting the trade geometry to current market volatility.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The analytical foundation of this tool rests on advanced momentum physics and statistical distribution theories.
- • Cardwell RSI Range Theory
Developed by Andrew Cardwell, this theory posits that the Relative Strength Index is not merely an overbought/oversold oscillator, but a powerful trend-identifying metric. In a mathematically robust uptrend, the RSI establishes a baseline support near the 40 level and frequently reaches 80. Conversely, in a downtrend, it establishes resistance near 60 and drops to 20. The indicator algorithmically enforces these limits to objectively classify market environments. - • Running Moving Average (RMA) Dynamics
The script utilizes the RMA, also known as the Modified Moving Average (MMA) or SMMA, to smooth the RSI base. The RMA applies an exponential smoothing weight defined exactly as 1 / length. This specific mathematical weighting retains a longer memory of past data compared to a standard SMA, preventing the abrupt drop-offs that occur when large data points exit a simple moving average window. This makes the RMA crossover highly sensitive to genuine shifts in cumulative momentum without the lag of a standard exponential moving average. - • Average Directional Movement Index (ADX)
Created by J. Welles Wilder, the ADX quantifies trend strength independent of directional vector. By calculating the smoothed moving averages of the +DI and -DI directional movement indicators, the ADX isolates the absolute magnitude of price expansion. The script uses this mathematical isolation to construct an absolute threshold; requiring ADX to exceed a base level ensures that the statistical probability of trend continuation is mathematically viable before capital is exposed. - • Volatility-Scaled Projection (ATR)
Take profit and stop loss coordinates are mapped using Wilder's Average True Range. The ATR measures the greatest of the current high minus the current low, the absolute value of the current high minus the previous close, and the absolute value of the current low minus the previous close. By scaling targets using ATR multipliers, the tool shifts from fixed-point geometry to dynamic, standard-deviation-aligned targeting, ensuring targets expand during high volatility and contract during consolidation.
● 🎨 Visual Guide
The tool employs a clean, visually dynamic chart interface to transmit complex data instantly without cluttering the workspace.
- • Heatmap Candles
Candle bodies and wicks are dynamically colored based on the active regime. Teal indicates a confirmed Bullish Regime, Red indicates a Bearish Regime, and Gray indicates a Neutral market state. - • Signal Labels
When all confluence parameters are met on a confirmed bar close, a solid blue "BUY" label appears below the bar, or an orange "SELL" label appears above the bar, complete with strict execution markers. - • Dynamic Trade Levels
Upon signal generation, the tool plots projected trade levels extending to the right of the price action. A solid Red line indicates the Stop Loss threshold. A dashed Blue line denotes the Entry price. Dashed Teal lines represent Take Profit 1, 2, and 3. Labels accurately print the precise price levels directly on the chart axis. - • Risk and Reward Fills
A semi-transparent Red linefill is plotted between the Entry and Stop Loss lines to visualize risk exposure, while a Teal fill between Entry and TP3 visualizes the total projected reward structure, allowing for instant visual evaluation of the trade setup. - • Integrated Dashboard
A comprehensive table is positioned on the chart, displaying real-time operational metrics. It details the current Cross Trend, Regime State, Confirm Bar count, Signal Gap status, Last Signal source, Trade Status, live ATR value, TP3:SL ratio, and HTF/Chop Filter states in an easy-to-read grid.
● 📖 How to Use
Deploying this tool requires patience and strict adherence to structural confirmation.
- Wait for the Heatmap Candles to shift from Gray (Neutral) to Teal (Bullish) or Red (Bearish). This indicates that the broader moving average trend and the internal RSI ranges have aligned into a confirmed structural regime.
- Observe the chart for a printed BUY or SELL label. This confirms that the RMA momentum cross has achieved mathematical confluence with the active regime within the defined allowable window.
- Check the Dashboard to ensure the HTF Regime and Chop Filter (ADX) read as PASS. If the market is blocked by the Chop Filter, do not force an entry, as the statistical probability of a sustained run is low.
- Upon entry, utilize the plotted ATR lines to structure your risk. Place your stop loss exactly at the solid red line, and scale out of your position at the dashed TP1, TP2, and TP3 levels as price action develops.
- Wait for the Signal Gap cooldown period to elapse before considering consecutive entries in the same direction. This engineered delay prevents overexposure during erratic, volatile spikes.
● ⚙️ Inputs and Settings
The script features highly customizable parameters grouped logically for maximum workflow efficiency.
- • Core Settings
Adjust the lengths for the Cross RMA (Fast/Slow) and the primary RSI source. Modify the Trend MA length and explicitly set the boundaries for the Bull Range (default 40-80) and Bear Range (default 20-60). Configure the Confluence Window to define exactly how close a cross and regime shift must occur to trigger a valid signal, and set the Signal Gap cooldown timer. - • Filters
Toggle the HTF Confirmation logic and select the desired higher timeframe for broader structural alignment. Enable the ADX Chop Filter and set the minimum required trend strength to strip out low-probability environments. - • Trade Tools
Define the ATR lookback length and customize the specific multipliers for the Stop Loss and the three Take Profit targets to match your unique risk-to-reward requirements. Modify the Line Extend Bars input to control how far into the future the trade levels are drawn. - • Visuals and Dashboard
Toggle individual visual components, including candle coloring, signal labels, and trade level plotting. Position the dashboard to any corner of the chart to prevent the obstruction of live price action. - • Alerts
Input specific JSON string payloads for Long, Short, Close Long, Close Short, SL, and TP actions. This allows the indicator to integrate seamlessly with automated execution platforms or third-party webhooks without requiring manual code modifications.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
💡 Proprietary indicators. Original research. Built by analysts who trade.
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
💡 Proprietary indicators. Original research. Built by analysts who trade.
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.