β¨ Originality and Utility
- This script does not simply reproduce the stock QQE oscillator. It restructures the calculation into a layered decision pipeline where a signal only qualifies after passing through several independent, user-toggleable filters, turning a single momentum flip into a multi-factor confluence check.
- The source price is first routed through a selectable pre-smoothing stage offering eight distinct algorithms, ranging from classic moving averages to a proprietary slope-projection method and a recursive Kalman estimator, before it ever reaches the QQE math. This changes the responsiveness and noise profile of every signal generated downstream.
- A second, independently parameterized QQE instance runs in parallel purely as a confirmation gate, meaning a raw crossover on the primary pair is discarded unless a slower QQE pair already agrees with its direction.
- An ADX/DMI strength filter and a non-repainting higher-timeframe bias filter can each independently veto a signal, so traders can require trend strength and multi-timeframe agreement without writing their own confluence logic.
- The script goes beyond signal generation into trade management: a built-in ATR trade planner converts a qualifying cross into a full stop-loss and three-tiered take-profit plan, drawn directly on the chart and tracked bar by bar.
- A structured JSON alert payload system is built into every signal and trade-management event, making the tool usable as the signal engine for an external automation or webhook pipeline without any manual message formatting.
- The combination of these components is deliberate rather than incidental: the pre-smoothing stage shapes what “signal” means, the dual-QQE and filter stack decides which of those signals are trustworthy, and the trade planner and alert system decide what to do once a signal is accepted. Removing any one layer would leave a materially different and less complete tool, which is why they are published together as a single confluence system rather than as separate scripts.
π¬ Methodology and Concepts
β’ Adaptive Pre-Smoothing Engine
Before the source price reaches the QQE engine, it can optionally be passed through one of eight smoothing or prediction methods, selectable from a dropdown. This determines how “clean” or “responsive” the underlying momentum reading is.
- Simple, Exponential and Wilder (RMA) moving averages behave as their standard definitions.
- A double weighted moving average applies a WMA to the result of a first WMA pass, compounding the weighting effect for extra lag reduction.
- A triple volume-weighted moving average chains three successive VWMA passes, folding volume into the trend estimate at each stage.
- The Hull Moving Average uses the standard weighted-difference technique to reduce lag relative to a simple weighted average.
- The proprietary LLAMA method computes a simple moving average baseline over the lookback window, then measures the linear slope of price across that same window (the difference between the current source and the value from “length” bars back, divided by length). That slope is then projected forward by half the lookback length and added to the SMA baseline. The practical effect is a moving average that leans ahead of price during a steady trend and collapses back toward a standard SMA when price is flat or choppy.
- The Kalman Filter option treats the source price as a noisy observation of an underlying “true” trend state. It maintains an internal estimate and error variance, computes a Kalman gain each bar from a length-derived process-noise assumption and a fixed measurement-noise assumption, and blends the new price observation into the estimate proportionally to that gain, producing a smoothing curve that adapts its own responsiveness over time.
β’ Dual QQE Core
The QQE concept itself works by smoothing an RSI reading with an EMA, then measuring the average magnitude of bar-to-bar changes in that smoothed RSI (a Wilder-style double-smoothed “ATR of RSI”), and multiplying it by a factor to build a trailing envelope around the smoothed RSI line. This trailing level only moves in the direction the RSI is already travelling and locks in place, ratchet-style, whenever RSI reverses, similar in spirit to a classic ATR trailing stop but applied in RSI space rather than price space. A cross of the smoothed RSI over or under this trailing level marks a momentum shift. This script runs two such QQE instances simultaneously: a faster primary pair that generates the raw crossover, and an optional slower secondary pair whose sole purpose is confirmation, a signal from the primary pair is only accepted if the secondary pair’s RSI-to-trail relationship already agrees with the same direction.
β’ Confirmation Filters
- An optional ADX/DMI filter, built on Wilder’s Average Directional Index, requires trend strength to be above a user-defined threshold before a signal is allowed through, filtering out crosses that occur during flat, directionless conditions.
- An optional higher-timeframe bias filter pulls the same QQE relationship (smoothed RSI versus trailing level) from a user-selected higher timeframe and requires it to agree with the direction of the current-timeframe signal. This request is built using the previous, already-confirmed value on the higher timeframe combined with lookahead-on merging, which is the standard non-repainting pattern for higher-timeframe data: the value shown on any historical bar is the same value that would have been available to a trader watching in real time.
β’ ATR-Based Trade Planner
Once a signal clears every enabled filter, the script computes a stop-loss using the 14-period Average True Range multiplied by a user-defined multiple, anchored to the prior bar’s close. Three take-profit levels are then derived from that risk distance using independently configurable risk:reward ratios. These levels are drawn as extending price lines with labels and shaded risk/reward zone fills, and the script continuously checks, bar by bar, whether price has touched each take-profit or the stop-loss, retiring the plan once the final target or the stop is hit. A lock control can freeze the currently displayed plan so it does not get replaced by a new signal while a trade is being managed.
β’ Signal Confirmation Behavior
The crossover state that drives every signal is always evaluated using the prior, already-completed bar’s smoothed RSI and trailing-level relationship rather than the still-forming current bar. In practical terms, this means a BULL or BEAR marker only ever prints once the underlying cross is confirmed, and it does not shift position or disappear on subsequent price updates within the same bar.
β’ Automation-Ready Alerts
Every entry, exit, and trade-management event (long entry, short entry, close-long, close-short, and each of the three take-profit levels plus stop-loss) is wrapped in its own alert condition and also emits a structured JSON message through a single dynamic alert call, gated to fire only once per confirmed bar close for entries. Each JSON message includes the instrument, timeframe, and an editable action keyword, allowing the same signal engine to be wired directly into an external automation or webhook workflow.
π¨ Visual Guide
- In the indicator’s own pane: the blue RSI MA line is the primary smoothed-RSI reading, the yellow Smoothed Trail line is its dynamic trailing envelope, and the histogram plotted around the zero line reflects the distance between the two, colored teal on the bullish side and red on the bearish side.
- Dashed reference lines at 70 and 30 mark overbought and oversold RSI zones with a light shaded fill between each level and the 50 midline when enabled.
- On the price chart itself: candles can be recolored using a four-tone scheme, strong bullish teal and weak bullish dark teal, or strong bearish red and weak bearish dark red, with a neutral gray used whenever the current QQE distance is smaller than its own running average, giving an at-a-glance read on momentum strength as well as direction.
- BULL and BEAR labeled arrows print just below or above the triggering candle whenever a fully confirmed signal fires.
- When trade levels are enabled, dashed lines and small labels for the stop-loss, entry, and three take-profit levels extend to the right from the signal bar, with the area between entry and stop shaded as a risk zone and the area between entry and the furthest target shaded as a reward zone.
- An optional multi-row dashboard panel, placeable in any chart corner, summarizes the instrument and timeframe, lock status, current bias, the raw RSI MA and Trail Level values, an ASCII progress-bar style RSI strength meter, the secondary confluence state, the higher-timeframe bias, the ADX reading and pass/fail color, the currently active pre-smoothing method, the ATR value, the DI+/DI- readings, a momentum strength bar, and the active trade’s direction and price levels.
π How to Use
- Treat a BULL or BEAR arrow as the point where every enabled filter, the primary cross, the secondary QQE confirmation, the ADX gate, and the higher-timeframe bias, has already agreed on a direction.
- Use candle color intensity and histogram height as a secondary read on how strong the current momentum reading is relative to its own recent average, rather than as a standalone signal.
- Scan the dashboard’s Bias, Confluence, and HTF Bias rows for a fast multi-factor summary without needing to inspect the oscillator pane directly.
- Enable the trade levels option to have the script draw a stop-loss and three take-profit targets automatically on each qualifying signal, and use the lock control to freeze that plan in place while managing an open position.
- Adjust the ATR stop multiple and the three risk:reward ratios to match your own risk tolerance before relying on the drawn levels.
- For automation, create a TradingView alert using the “Any alert() function call” option to receive the full JSON payload stream, or use the individual named alert conditions if only a single event type is needed.
- This tool is a momentum and confluence framework, not a complete trading system on its own. Combine it with your own market structure, support/resistance, or volatility context before acting on any signal.
βοΈ Inputs and Settings
- Core Settings: RSI Length and RSI EMA Smoothing control the primary QQE’s momentum lookback and responsiveness; QQE Factor scales how wide the trailing envelope sits from the smoothed RSI; Source selects the price series feeding the whole calculation; the secondary QQE toggle, along with its own EMA smoothing and factor, controls the confirmation pair.
- Filters: the ADX toggle, length, and threshold control the trend-strength gate; the Adaptive Filter dropdown and length select which of the eight pre-smoothing methods (including LLAMA and the Kalman Filter) is applied to price before the QQE math runs; the HTF filter toggle and timeframe control the higher-timeframe bias confirmation.
- Trade Tools: toggles for showing trade levels and locking the current signal, an ATR multiple for stop-loss distance, and three independent risk:reward ratios for the three take-profit targets.
- Visuals: independent toggles for the overbought/oversold zone fill, the histogram, the crossover arrows, and the color-matched candles.
- Dashboard: a toggle to show or hide the panel and a dropdown to choose which chart corner it docks to.
- Alerts: editable text fields defining the action keyword sent in the JSON payload for each of the eight tracked events, letting the output match whatever automation platform is receiving it.
- Colors: a full set of color pickers covering the oscillator lines, histogram, zones, arrows, candle tones, trade-planning lines and fills, and dashboard styling, purely cosmetic and with no effect on calculations.
π Deconstruction of the Underlying Scientific and Academic Framework
- The foundation of the oscillator is J. Welles Wilder Jr.’s Relative Strength Index and his broader family of smoothed volatility and trend-strength tools, including the Average True Range concept and the Average Directional Index used here as an optional filter.
- The QQE structure itself extends Wilder’s trailing-stop logic, normally applied to price, into RSI space: an ATR-style measure of RSI’s own volatility is used to build a ratcheting trailing envelope around the smoothed RSI line, conceptually related to other ATR-trailing-stop tools such as Chandelier Exit or SuperTrend but operating on a momentum oscillator rather than raw price.
- The Hull Moving Average option is built on Alan Hull’s weighted-difference technique for reducing the inherent lag of weighted moving averages.
- The LLAMA pre-smoothing option applies a basic linear extrapolation principle, projecting a simple moving average forward using the measured slope of price across the same lookback window, a lightweight analogue of trend-extrapolation methods used in linear regression forecasting.
- The Kalman Filter option is a direct application of Rudolf KΓ‘lmΓ‘n’s recursive estimation framework, treating price as a noisy observation of an unobserved underlying trend state and updating that estimate bar by bar using a dynamically computed gain, a technique widely used in modern adaptive filtering and signal processing.
- The ATR trade planner applies standard volatility-based position planning, using a multiple of Average True Range to size a stop distance and deriving profit targets from fixed risk:reward multiples of that same distance.
β οΈ 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.
Source link
Author

- Ytv Market News
- Share-market news writer and analyst with deep experience covering equities, commodities, forex, and cryptocurrencies for readers in the USA, UK, Canada, and Australia. Ytv Market News delivers timely market updates, practical trading insights, and clear explanations of macro and company-level catalysts that move prices. Combines on-the-ground financial reporting with technical analysis, using concise charts and actionable ideas to help investors and traders make smarter decisions.
Latest entries
Politics News TodayAugust 25, 2026‘Lioness’ latest episode leaves fans reeling after brutal and violent execution scene
Market Movers TodayAugust 25, 20262 S&P 500 Stocks to Research Further and 1 We Ignore
Forex NewsAugust 25, 2026Oil: Chinese demand peak shifts market balance β Commerzbank
IndiaAugust 25, 2026ISMA blames speculation for sugar price surge, seeks tightening of stock limit
