Time Price Opportunity Gravity Grid [ALT_analyst]Time Price Opportunity Gravity Grid
■ Description
This script executes a strictly quantified market structure analysis by integrating Time Price Opportunity (TPO) profiling, dynamic Value Area (70%) boundaries, POC Migration matrices, and Z-Score volatility anomaly detection.
By overriding standard OHLC data limitations via lower-timeframe data injection (request.security_lower_tf), it constructs an uncompromisingly high-resolution price-density profile. Trend definitions and signal thresholds are stripped of subjective bias, executing purely on the spatial shift of accepted value and mathematical volatility expansion.
■ Core Architecture & Mechanical Edge
The algorithm mandates the simultaneous confluence of three independent mathematical variables. This relentless confluence acts as a strict mechanical filter, systematically rejecting ranging environments and isolating only mathematically significant structural shifts.
1. Value Area Calculation (70% Auction Density)
Mechanics:
Computes the absolute TPO block count per session, isolating the exact price range containing 70% of execution density (approximating 1 standard deviation).
Expansion originates strictly from the POC (maximum density node) and iteratively absorbs adjacent price rows based on relative volume weight, capturing the absolute center of the market auction.
Visualization:
Deployed as modern, semi-transparent filled boxes (Value Area Box) to eliminate visual noise, obsoleting legacy dashed-line renderings.
Application:
Price action within the Value Area is mathematically defined as balance.
A confirmed close outside this boundary signals structural imbalance. To mathematically neutralize low-volume fakeouts, breakouts are strictly invalidated unless simultaneously confirmed by both POC Migration and Volatility expansion.
2. POC Migration (Structural Trend)
Mechanics:
Evaluates the spatial shift of accepted value across consecutive sessions using a discrete step-function.
// Bullish Migration (+1):
Current_POC > Previous_POC and Current_VAL > Previous_VAL
// Bearish Migration (-1):
Current_POC < Previous_POC and Current_VAH < Previous_VAH
Application:
By demanding the simultaneous directional shift of both the peak density (POC) and the boundary floor/ceiling (VAL/VAH), the script verifies that the core market consensus has definitively relocated.
3. Volatility Z-Score (Anomaly Detection)
Mechanics & Equation:
Z_Score = (ATR(14) - SMA(ATR(14), 100)) / StDev(ATR(14), 100)
Calculation Rationale:
To measure exactly how many standard deviations the current volatility deviates from its 100-period baseline, standardizing volatility spikes across all asset classes regardless of absolute price.
Expected Output Example:
If current ATR is 1.5, 100-period mean is 1.0, and standard deviation is 0.2, the Z-Score outputs 2.5 (+2.5 standard deviations above the mean).
Application:
A Z-Score strictly > 2.0 flags a statistical outlier (top ~2.2% of historical occurrences). The algorithm enforces this threshold to ensure breakouts are driven by aggressive, statistically significant kinetic expansion, rejecting market noise.
4. Gaussian Liquidity Grid Distortion
Mechanics & Equation:
Pull_Factor = Math.exp(-(Distance_Y^2) / (2 * Pull_Radius^2))
Calculation Rationale:
Utilizes a Gaussian decay function to translate historical price congestion into a gravitational pull on the background grid, mathematically quantifying market memory.
Expected Output Example:
If price is 100 ticks away with a radius of 200, the function outputs a multiplier of ~0.882, pulling the visual grid line 88.2% closer to the price center.
Application:
Distorted grid zones visually map historical liquidity pools (high probability of deceleration/mean reversion). Smooth grids indicate liquidity vacuums for rapid price discovery.
■ Signal Execution Rules
Signals execute ONLY upon total alignment:
Long Entry: Close strictly > active POC, Structural Trend = +1, Z-Score > 2.0.
Short Entry: Close strictly < active POC, Structural Trend = -1, Z-Score > 2.0.
Risk Management: Invalidations must mathematically reside outside the active Value Area (below VAL for longs, above VAH for shorts).
Disclaimer
This script provides objective mathematical analysis for educational purposes. It does not constitute financial advice.
Indicator

Regime Ribbon + CompassTraditional ADX asks you to read three tangled lines at once — +DI, −DI, and the ADX line — and combine them in your head in real time. This tool collapses all three into a single, intuitive read: direction by color, trend strength by height. No sub-pane needed — the entire regime picture lives right on your price chart.
◈ WHAT IT DOES
The Regime Ribbon recolors a smoothed baseline directly on your candles: green when the directional index confirms an uptrend with strength, red for a downtrend with strength, and muted gray during low-ADX chop. An optional faint background tint reinforces the current regime at a glance.
The Regime Compass — a floating right-edge gauge — turns the same read into a live instrument you can check at a glance:
Fill direction shows who's in control: the meter fills upward from its midline when bulls lead (+DI over −DI) and downward when bears lead (−DI over +DI).
Fill color matches the regime: green for an up-regime, red for a down-regime, dim gray during chop.
Fill height encodes conviction: the stronger the trend (higher ADX), the further the meter fills toward its pole. A weak or ranging market barely lifts off the midline; a powerful trend pushes the fill close to the edge.
Bull / Bear poles mark the top and bottom of the gauge so you always know which way is which.
A live readout on the meter prints the current state and ADX value — for example "▲ TREND 34", "▼ TREND 28", or "◈ CHOP 12" — and a light-blue dashed midline marks the neutral point.
One glance answers both questions traders normally have to compute from three separate lines: which way, and how much to trust it. The gauge floats to the right of the last candle so it never sits on top of your price action, and it can be slid further out to taste.
An on-chart dashboard ties everything together in one row along the bottom of the chart — no separate pane. Each cell is a live readout:
REGIME — the current state in plain terms: BULL ▲, BEAR ▼, or CHOP ◈, colored to match.
ADX — the raw ADX value plus a word for context: WEAK (below the trend threshold), TREND (trend confirmed), or STRONG (a powerful move).
STRENGTH — a compact bar that fills with ADX, so you can gauge trend power without reading the number.
+DI — the positive directional value (up-pressure).
−DI — the negative directional value (down-pressure).
BALANCE — the two directional values distilled into a single signed percentage. Positive means bulls lead, negative means bears lead, and the size shows how lopsided it is. This is the "collapsed" read at the heart of the tool.
TP/SL — the take-profit and stop-loss distances currently configured, with their unit (percent or ATR).
COOLDOWN — how many bars remain before a new signal is allowed, or "clear" when it's ready.
STATUS — the current position state: FLAT, LONG ●, or SHORT ●.
Together the ribbon, compass, and dashboard give you the full regime picture — direction, strength, the underlying directional balance, your trade parameters, and current state — all on the price chart, readable in a single glance.
◈ HOW TO USE
Read it in two steps — direction, then conviction:
Ribbon and compass green with the meter filling high → an uptrend with conviction. Continuation-style approaches tend to suit these conditions, and the taller the compass fill, the more decisive the move.
Red with the meter filling low → a downtrend with conviction.
Ribbon dim gray and the compass short (hugging the midline) → ADX is low; a chop/range regime where trend-following is prone to whipsaw and range tactics tend to fit better. Many traders simply stand aside here.
Watch the BALANCE cell and the compass together: when balance swings from negative to positive (or vice-versa) and the compass starts filling with height, that's the regime waking up — the shift from chop into a directional move.
Optional markers and funnel labels highlight the exact moment the regime flips into a confirmed strong trend, drawing example take-profit and stop-loss reference levels on the chart so you can see the setup framed end to end.
A practical workflow: use the ribbon for your at-a-glance bias, the compass for how much weight to give it, the BALANCE cell to spot early shifts, and the STATUS/COOLDOWN cells to keep your own entries disciplined.
◈ SETTINGS
Regime Engine — DI Length, ADX Smoothing, Trend Threshold (the ADX level separating trend from chop), Strong-Trend level.
Regime Ribbon — baseline length, background tint toggle.
Regime Compass — right-edge offset, width, height (in ATR).
Trade Levels — TP/SL in Percent or ATR, ATR length, TP/SL box toggle.
Risk Management — cooldown between signals, max bars in trade, optional EOD flatten window.
Webhook — optional alert payload with a configurable strategy ID.
Dashboard — on/off.
◈ NON-REPAINTING
All signals evaluate only on confirmed (closed) bars, and every directional value is read from closed bars — so a signal that prints will not disappear or shift intrabar. Entry logic arms on the signal bar's close and references the next bar's open, matching realistic order timing. No future data is used anywhere in the logic.
◈ DISCLAIMER
This script is a technical-analysis tool provided for educational and informational purposes only. It is not financial advice, does not predict future price movement, and does not guarantee any outcome. Trading carries a substantial risk of loss. Always do your own research and manage your own risk. The past behavior of any indicator or market condition does not indicate future results. Indicator

RSI Divergence Entry Engine [trade_w_samet]🎯 RSI Divergence Entry Engine
RSI Divergence Entry Engine is a pivot-confirmed RSI divergence, optional trend-filtering, ATR-based trade-mapping, historical visualization, alert, and statistics indicator designed to help traders study how regular bullish and bearish RSI divergences can be converted into a structured chart workflow.
The script is built around one central idea:
A confirmed RSI divergence should be treated as analytical context first, and as a tracked trade setup only when the active direction filter and trade-state rules allow it.
The engine identifies regular RSI divergence between confirmed RSI pivots and corresponding price pivots.
When a divergence is confirmed, the script can:
• Display the divergence inside the RSI panel
• Fill the region between the RSI path and its divergence reference line
• Draw a three-layer neon divergence line directly between the corresponding price pivots on the main chart
• Evaluate the active trend-filter mode
• Open one tracked bullish or bearish setup when the signal is eligible
• Calculate an ATR-based Stop Loss
• Calculate TP1, TP2, and TP3
• Extend risk/reward boxes while the trade remains active
• Preserve completed trade boxes and historical TP price labels
• Track TP3 wins, Stop Losses, Win Rate, NET R, Average R, and Profit Factor
• Display a full desktop dashboard or a compact mobile dashboard
• Send separate PulseWire alert conditions
• Support one combined “Any alert() function call” workflow
• Apply Dark Mode, Light Mode, or Mobile Theme styling
The indicator includes:
• Fixed RSI 14 calculation using closing prices
• Pivot-based regular bullish divergence detection
• Pivot-based regular bearish divergence detection
• Adjustable Pivot Lookback
• Adjustable Confirmation Bars
• A fixed internal pivot-distance window
• Confirmed-bar divergence acceptance
• RSI-panel bullish and bearish divergence lines
• RSI-panel divergence-area fills
• Main-chart three-layer neon divergence lines
• Adjustable main-chart BULLISH / SELL label size
• Fixed compact RSI-panel labels
• Dark Mode
• Light Mode
• Mobile Theme
• EMA 200 Trend Filter
• Supertrend filter using ATR 10 and factor 3.0
• Higher-timeframe EMA 200 Trend Filter
• Adjustable higher timeframe
• ATR-based Stop Loss
• Adjustable ATR period
• Adjustable ATR Stop Loss multiplier
• Adjustable TP3 target from 1R to 7R
• Automatically calculated TP1 and TP2
• One active tracked trade at a time
• Conservative same-candle TP3 / SL handling
• Permanent historical TP / SL boxes
• Historical TP1, TP2, and TP3 price labels
• Dynamic active-trade price labels
• TP3 TARGET HIT labels
• Stop Loss result labels
• Full desktop statistics dashboard
• Two-row Mobile Theme dashboard
• Static alertcondition() support
• Dynamic alert() support
• “Any alert() function call” compatibility
• Bold-italic visual text
• Pure-white Dark Mode label text
• Hidden status-line input values
• Main-chart overlay visuals from a separate RSI pane
• Loaded-history trade statistics
The purpose of the script is to provide a transparent visual framework for reviewing confirmed RSI divergence, directional context, mapped risk, target structure, and bar-based historical outcomes.
It is not financial advice.
It is not an automated trading system.
It does not execute broker orders.
It does not calculate position size.
It does not guarantee that a divergence will produce a reversal.
It does not guarantee that the displayed Win Rate, NET R, or Profit Factor will continue in future market conditions.
It does not include spread, commission, slippage, latency, financing, or partial fills.
It does not reproduce the exact intrabar path inside historical candles.
━━━━━━━━━━━━━━━━━━━━━━
📌 OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━
At a high level, RSI Divergence Entry Engine does the following:
• Calculates RSI using a fixed 14-period length and closing prices.
• Searches the RSI series for confirmed pivot lows and pivot highs.
• Compares each confirmed RSI pivot with the previous eligible pivot of the same type.
• Compares the corresponding price low or high with the prior price pivot.
• Identifies regular bullish divergence when RSI forms a higher low while price forms a lower low.
• Identifies regular bearish divergence when RSI forms a lower high while price forms a higher high.
• Requires the distance between the two confirmed pivots to remain inside the fixed internal range window.
• Waits for the required right-side confirmation bars before accepting a pivot.
• Displays confirmed divergence inside the RSI panel.
• Draws the same confirmed price-pivot relationship on the main chart with a neon line.
• Evaluates the selected trend-filter mode.
• Rejects a tracked entry when the trend filter does not allow that direction.
• Rejects a tracked entry when an opposite divergence is simultaneously present.
• Rejects a tracked entry while another trade is active.
• Opens a tracked trade at the close of the divergence-confirmation candle.
• Calculates Stop Loss distance from ATR.
• Places TP1 and TP2 at proportional distances inside the final TP3 target.
• Tracks only TP3 as the winning exit.
• Tracks Stop Loss as a -1R loss.
• Extends the active profit and loss boxes until the trade closes.
• Preserves completed boxes as historical trade visuals.
• Preserves historical TP1, TP2, and TP3 price labels.
• Updates the dashboard with bar-based historical statistics.
• Provides separate static alerts and combined dynamic alerts.
The script does not use machine-learning prediction.
It does not claim that RSI divergence predicts the future with certainty.
Its dashboard is not PulseWire Strategy Tester.
Its statistics are calculated internally from the script’s own bar-touch rules.
━━━━━━━━━━━━━━━━━━━━━━
🧠 CORE IDEA
━━━━━━━━━━━━━━━━━━━━━━
RSI divergence describes disagreement between price direction and RSI pivot direction.
A regular bullish divergence occurs when:
• price forms a lower low
• RSI forms a higher low
A regular bearish divergence occurs when:
• price forms a higher high
• RSI forms a lower high
The divergence can indicate that momentum is not confirming the newest price extreme.
However, divergence alone does not answer:
• whether the broader trend supports the reversal
• whether price is above or below a long-term directional reference
• whether Supertrend agrees with the signal
• whether the selected higher timeframe agrees with the signal
• where a volatility-adjusted Stop Loss should be mapped
• where intermediate and final targets should be displayed
• whether another tracked trade is already active
• whether historical bar touches reached TP3 or Stop Loss first
• how the signal behaves across Dark, Light, or Mobile layouts
The script therefore combines the divergence calculation with an optional trend filter and a fixed trade-tracking model.
The complete workflow is:
RSI pivot confirmation
→ price-pivot comparison
→ regular divergence confirmation
→ RSI-panel visualization
→ main-chart neon price-divergence line
→ optional trend-filter validation
→ one-active-trade check
→ entry at confirmation-candle close
→ ATR-based Stop Loss
→ TP1 / TP2 / TP3 mapping
→ historical bar-touch tracking
→ TP3 or SL result
→ dashboard statistics
→ static and dynamic alerts
The modules are not intended to operate as unrelated indicators.
Each module supports the same process: identifying a confirmed divergence, deciding whether it is eligible for tracking, mapping the trade structure, and recording the result under explicit rules.
━━━━━━━━━━━━━━━━━━━━━━
🧩 WHY THIS SCRIPT IS NOT A SIMPLE RSI DIVERGENCE MARKER
━━━━━━━━━━━━━━━━━━━━━━
A basic RSI divergence script can stop after drawing a line between two oscillator pivots.
RSI Divergence Entry Engine continues beyond that step.
A confirmed divergence can move through the following stages:
RSI pivot appears
→ right-side confirmation bars complete
→ previous eligible RSI pivot is located
→ pivot distance is validated
→ corresponding price pivots are compared
→ bullish or bearish divergence is confirmed
→ RSI divergence region is displayed
→ main-chart neon price-divergence line is displayed
→ active trend filter is evaluated
→ opposite-direction conflict is rejected
→ existing active-trade state is checked
→ ATR risk distance is calculated
→ entry, SL, TP1, TP2, and TP3 are stored
→ trade boxes extend through time
→ TP3 or SL is detected
→ completed trade is added to statistics
→ historical TP prices remain visible
The RSI module identifies the momentum disagreement.
The trend-filter module defines whether the tracked entry is directionally permitted.
The ATR module adapts the Stop Loss distance to current volatility.
The target module translates the chosen TP3 R multiple into three visual target levels.
The trade-state module prevents overlapping tracked positions.
The statistics module summarizes the outcomes produced by those exact rules.
The alert module communicates divergence, entry, TP3, and Stop Loss events.
This coordinated process makes the publication an entry-engine framework rather than only a divergence drawing tool.
━━━━━━━━━━━━━━━━━━━━━━
⚙️ HOW THE SCRIPT WORKS
━━━━━━━━━━━━━━━━━━━━━━
The indicator operates from a separate RSI pane while using force-overlay visuals for selected elements on the main chart.
The internal RSI configuration is:
• RSI length: 14
• Source: close
• Regular bullish divergence: enabled
• Regular bearish divergence: enabled
• Hidden bullish divergence: internally disabled
• Hidden bearish divergence: internally disabled
• Minimum pivot separation: 5 bars
• Maximum pivot separation: 60 bars
The user controls:
• Pivot Lookback
• Confirmation Bars
• Main-chart signal-label size
• ATR Period
• Stop Loss Distance in ATR
• TP3 Target in R
• Trend Filter
• Higher-Timeframe Trend Timeframe
• Theme Mode
First, the script calculates RSI:
osc = ta.rsi(close, 14)
The script then detects confirmed RSI pivots:
pivotLowValue = ta.pivotlow(osc, lbL, lbR)
pivotHighValue = ta.pivothigh(osc, lbL, lbR)
A pivot is not known on the pivot candle itself.
It becomes confirmed only after the selected Confirmation Bars have closed to its right.
The script then retrieves the previous confirmed pivot value, price value, and pivot bar.
Regular bullish divergence requires:
• current RSI pivot low above the previous RSI pivot low
• current price low below the previous price low
• valid pivot distance
• confirmed current chart bar
Regular bearish divergence requires:
• current RSI pivot high below the previous RSI pivot high
• current price high above the previous price high
• valid pivot distance
• confirmed current chart bar
The confirmed divergence is then displayed in two places:
• RSI pane
• Main price chart
The trend filter is applied only to the tracked trade entry.
This means a confirmed divergence can remain visible even when:
• the selected trend filter rejects the direction
• another trade is already active
• bullish and bearish conditions conflict on the same calculation
This separation is intentional.
The divergence visual represents analytical context.
The main-chart BULLISH or SELL trade label represents an entry that the tracking engine actually accepted.
━━━━━━━━━━━━━━━━━━━━━━
📉 RSI CALCULATION
━━━━━━━━━━━━━━━━━━━━━━
The Relative Strength Index is calculated from closing prices using a fixed length of 14.
The RSI line is displayed in blue.
The RSI pane includes:
• 70 Overbought line
• 50 Middle line
• 30 Oversold line
Dark Mode uses:
• black RSI-panel background
• red Overbought line
• white dotted Middle line
• green Oversold line
Light Mode uses:
• white RSI-panel background
• dark Middle line
• red Overbought line
• green Oversold line
The 70 and 30 lines provide visual context.
They are not mandatory divergence conditions.
A bullish divergence can be detected outside the Oversold region.
A bearish divergence can be detected outside the Overbought region.
The script does not require RSI to cross 30 or 70 before accepting a divergence.
━━━━━━━━━━━━━━━━━━━━━━
🔍 PIVOT DETECTION MODEL
━━━━━━━━━━━━━━━━━━━━━━
Pivot Lookback controls the number of candles examined on the left side of a potential RSI pivot.
The default value is 5.
Higher values generally produce larger and less frequent swing points.
Lower values generally produce smaller and more frequent swing points.
Confirmation Bars controls the number of completed candles required on the right side of the potential pivot.
The default value is 1.
A higher Confirmation Bars value provides more right-side confirmation but increases delay.
A lower value confirms earlier but can identify smaller structures.
The script also requires the previous pivot to be between 5 and 60 bars away.
These minimum and maximum distance values are fixed internally to keep the public settings panel compact.
The pivot model is symmetrical:
• pivot lows are used for bullish divergence
• pivot highs are used for bearish divergence
━━━━━━━━━━━━━━━━━━━━━━
🟢 REGULAR BULLISH DIVERGENCE
━━━━━━━━━━━━━━━━━━━━━━
A regular bullish divergence is confirmed when:
• a new RSI pivot low is confirmed
• the previous eligible RSI pivot low exists
• the current RSI pivot low is higher than the previous RSI pivot low
• the current corresponding price low is lower than the previous price low
• the pivot distance is between the fixed internal limits
• the current calculation bar is confirmed
Conceptually:
Price:
lower low
RSI:
higher low
The RSI pane displays:
• a green divergence line between the two RSI pivot values
• a translucent green fill between the real RSI path and the straight divergence reference
• a BULLISH label at the confirmed pivot location
The main chart displays:
• a three-layer green neon line between the corresponding price lows
A tracked bullish trade opens only when:
• the bullish divergence is not opposed by a bearish divergence on the same calculation
• the selected trend filter allows bullish entries
• no tracked trade is currently active
• another trade did not close on the same candle
• ATR is available and greater than zero
The tracked entry price is the close of the confirmation candle.
It is not the historical pivot-low price.
━━━━━━━━━━━━━━━━━━━━━━
🔴 REGULAR BEARISH DIVERGENCE
━━━━━━━━━━━━━━━━━━━━━━
A regular bearish divergence is confirmed when:
• a new RSI pivot high is confirmed
• the previous eligible RSI pivot high exists
• the current RSI pivot high is lower than the previous RSI pivot high
• the current corresponding price high is higher than the previous price high
• the pivot distance is between the fixed internal limits
• the current calculation bar is confirmed
Conceptually:
Price:
higher high
RSI:
lower high
The RSI pane displays:
• a red divergence line between the two RSI pivot values
• a translucent red fill between the real RSI path and the straight divergence reference
• a SELL label at the confirmed pivot location
The main chart displays:
• a three-layer red neon line between the corresponding price highs
A tracked bearish trade opens only when:
• the bearish divergence is not opposed by a bullish divergence on the same calculation
• the selected trend filter allows bearish entries
• no tracked trade is currently active
• another trade did not close on the same candle
• ATR is available and greater than zero
The tracked entry price is the close of the confirmation candle.
It is not the historical pivot-high price.
━━━━━━━━━━━━━━━━━━━━━━
⏳ PIVOT CONFIRMATION AND SIGNAL TIMING
━━━━━━━━━━━━━━━━━━━━━━
This section is important.
The script uses ta.pivotlow() and ta.pivothigh().
Pivot functions require candles to the right of the pivot before confirmation.
For example, when Confirmation Bars is 1:
• the potential pivot occurs
• one additional candle closes
• the pivot becomes confirmed
• the divergence condition can then be calculated
The RSI-panel divergence line and RSI divergence label are drawn at the original pivot-bar location after confirmation.
The main-chart neon divergence line also connects the original price-pivot bars after the divergence is confirmed.
This creates a historical visual relationship between the two pivots.
It does not mean the divergence was available in realtime on the original pivot candle.
The tracked trade entry is not placed back on the pivot.
The tracked entry occurs at the close of the later candle where the divergence confirmation becomes available.
Therefore, users must distinguish between:
Pivot Visualization
Shows where the confirmed historical pivots occurred.
Trade Entry Label
Shows the candle where the script actually accepted and opened the tracked setup.
Changing Confirmation Bars changes the confirmation delay.
Increasing Confirmation Bars can materially change signal timing and historical divergence output.
━━━━━━━━━━━━━━━━━━━━━━
✨ MAIN-CHART NEON DIVERGENCE VISUALS
━━━━━━━━━━━━━━━━━━━━━━
Confirmed RSI divergences are also displayed directly on the main price chart.
Bullish divergence:
• connects the two corresponding price lows
• uses green
• uses a three-layer neon appearance
Bearish divergence:
• connects the two corresponding price highs
• uses red
• uses a three-layer neon appearance
The neon effect is created from:
• a wide transparent outer glow
• a medium inner glow
• a bright two-pixel core line
The neon line is a historical divergence visual.
It is not an entry line.
It is not a Stop Loss.
It is not a support or resistance guarantee.
The line is created only after the RSI pivot and divergence have been confirmed.
Older line objects are removed when the configured internal object limit is exceeded.
Deleting an older visual object does not change the underlying signal calculation.
━━━━━━━━━━━━━━━━━━━━━━
🎨 RSI DIVERGENCE AREA SYSTEM
━━━━━━━━━━━━━━━━━━━━━━
Inside the RSI pane, the script creates a filled polygon between:
• the actual RSI path from the first pivot to the second pivot
• the straight divergence line connecting those pivot endpoints
Bullish divergence uses a translucent green fill.
Bearish divergence uses a translucent red fill.
The purpose is to make the momentum disagreement easier to recognize than a thin line alone.
The fill does not measure probability.
A larger visual area does not automatically mean a stronger or more profitable divergence.
The fill depends on:
• RSI movement between the pivots
• distance between the pivots
• selected Pivot Lookback
• selected Confirmation Bars
• chart symbol
• timeframe
• loaded historical data
━━━━━━━━━━━━━━━━━━━━━━
🧭 TREND FILTER SYSTEM
━━━━━━━━━━━━━━━━━━━━━━
The trend filter determines whether a confirmed divergence is eligible to open a tracked trade.
Available modes are:
• Off
• EMA Trend
• Supertrend
• HTF Trend
The filter does not hide the confirmed divergence visuals.
It only changes whether the trade engine accepts the bullish or bearish entry.
This allows users to study:
• all confirmed divergence structures
• only the subset that passed the selected directional filter
The active trend reference is drawn on the main chart when a filter mode is selected.
The reference is green when the active filter state is bullish.
The reference is red when the active filter state is bearish.
━━━━━━━━━━━━━━━━━━━━━━
📈 EMA TREND FILTER
━━━━━━━━━━━━━━━━━━━━━━
EMA Trend uses a fixed chart-timeframe EMA 200.
Bullish entries are allowed when:
• chart close is above EMA 200
Bearish entries are allowed when:
• chart close is below EMA 200
When price equals the EMA exactly, neither directional condition is satisfied.
The EMA filter is intended to align bullish divergence tracking with price above a long-term average and bearish divergence tracking with price below it.
It does not guarantee that price will continue in the filtered direction.
A divergence rejected by the EMA filter can still remain visible as a divergence visual.
━━━━━━━━━━━━━━━━━━━━━━
📊 SUPERTREND FILTER
━━━━━━━━━━━━━━━━━━━━━━
Supertrend mode uses fixed internal parameters:
• ATR length: 10
• factor: 3.0
Bullish entries are allowed when the Supertrend state is bullish.
Bearish entries are allowed when the Supertrend state is bearish.
The Supertrend reference is displayed on the main chart.
The fixed parameters keep the public settings menu simple and make behavior consistent across users.
The Supertrend filter can react differently across symbols and timeframes because ATR and price structure differ.
A bullish Supertrend state does not guarantee a successful bullish divergence trade.
A bearish Supertrend state does not guarantee a successful bearish divergence trade.
━━━━━━━━━━━━━━━━━━━━━━
⏱️ HIGHER-TIMEFRAME TREND FILTER
━━━━━━━━━━━━━━━━━━━━━━
HTF Trend compares the selected higher-timeframe close with its EMA 200.
Bullish entries are allowed when:
• higher-timeframe close is above higher-timeframe EMA 200
Bearish entries are allowed when:
• higher-timeframe close is below higher-timeframe EMA 200
The default higher timeframe is 240 minutes.
The request uses:
• gaps_off
• lookahead_off
The script does not intentionally request future higher-timeframe data.
However, the currently forming higher-timeframe candle can continue changing until that higher-timeframe candle closes.
This means the realtime HTF filter state can change while the active higher-timeframe candle is still developing.
Users who require fully closed higher-timeframe confirmation should account for this timing characteristic when interpreting realtime signals.
Changing the HTF Trend Timeframe recalculates historical eligibility.
━━━━━━━━━━━━━━━━━━━━━━
🎯 ENTRY MODEL
━━━━━━━━━━━━━━━━━━━━━━
The indicator uses the close of the divergence-confirmation candle as the tracked entry reference.
A bullish trade is opened when:
• valid bullish divergence is confirmed
• no bearish divergence conflict exists
• bullish trend permission is true
• no trade is active
• no trade closed on the same candle
• ATR is valid
A bearish trade uses the mirrored conditions.
The entry is stored at close.
The script then calculates:
• ATR-based risk distance
• Stop Loss
• TP1
• TP2
• TP3
Only signals that actually open a tracked trade receive the main-chart BULLISH or SELL entry label.
A divergence visual without an entry label can therefore indicate:
• trend-filter rejection
• existing active trade
• same-candle direction conflict
• same-candle previous trade closure
• unavailable ATR
━━━━━━━━━━━━━━━━━━━━━━
🛑 ATR STOP LOSS MODEL
━━━━━━━━━━━━━━━━━━━━━━
Risk distance is calculated as:
ATR × Stop Loss Distance.
Default settings:
• ATR Period: 14
• Stop Loss Distance: 2.0 ATR
Bullish trade:
Stop Loss = entry − risk distance
Bearish trade:
Stop Loss = entry + risk distance
ATR adapts the raw price distance to current market volatility.
The script does not examine:
• market structure below the bullish signal
• market structure above the bearish signal
• spread
• instrument tick value
• account size
• position size
• broker margin
• contract specifications
The ATR Stop Loss is a visual and statistical model.
It is not a broker order.
━━━━━━━━━━━━━━━━━━━━━━
🏆 TP1 / TP2 / TP3 MODEL
━━━━━━━━━━━━━━━━━━━━━━
The user selects the final TP3 target from 1R to 7R.
The default is 2R.
TP1 and TP2 are placed automatically inside the final target distance.
TP1:
one-third of the TP3 distance
TP2:
two-thirds of the TP3 distance
For a 3R TP3 setting:
• TP1 = 1R
• TP2 = 2R
• TP3 = 3R
For a 2R TP3 setting:
• TP1 ≈ 0.67R
• TP2 ≈ 1.33R
• TP3 = 2R
TP1 and TP2 are visual guide levels.
The current statistics engine does not close partial positions at TP1 or TP2.
It does not move Stop Loss to break even after TP1 or TP2.
It does not add partial R profit when TP1 or TP2 is touched.
Only TP3 is counted as a winning trade.
A Stop Loss is counted as -1R.
━━━━━━━━━━━━━━━━━━━━━━
🚦 ONE ACTIVE TRADE AT A TIME
━━━━━━━━━━━━━━━━━━━━━━
The trade engine maintains one active tracked position.
While a trade is active:
• new bullish divergence entries are not opened
• new bearish divergence entries are not opened
• divergence visuals can still appear
• historical divergence lines can still be drawn
This prevents overlapping tracked positions from affecting the statistics model.
A new trade is also prevented from opening on the same candle that the previous trade closes.
The next eligible divergence must occur on a later candle.
This design keeps each tracked result independent under the script’s internal accounting rules.
━━━━━━━━━━━━━━━━━━━━━━
⚠️ TP3 / SL SAME-CANDLE HANDLING
━━━━━━━━━━━━━━━━━━━━━━
Historical OHLC candles do not reveal the exact sequence of every intrabar price movement.
A candle can contain both:
• the TP3 price
• the Stop Loss price
When both are touched inside the same candle, the script cannot know from OHLC data which level occurred first.
The engine uses a conservative rule:
Stop Loss receives priority.
The trade is recorded as a loss.
TP3 and Stop Loss checks begin on the candle after entry.
The entry candle cannot immediately close the tracked trade.
This avoids assuming an unknown movement sequence inside the entry candle.
The conservative priority rule can produce different outcomes from lower-timeframe or tick-based execution reconstruction.
━━━━━━━━━━━━━━━━━━━━━━
📦 TRADE BOX VISUAL SYSTEM
━━━━━━━━━━━━━━━━━━━━━━
Each tracked trade creates two main-chart boxes:
Profit Box
Extends from entry to TP3.
Stop Box
Extends from entry to Stop Loss.
Bullish and bearish trades use the same green profit-area and red risk-area color logic.
While the trade remains active, the boxes extend to the current bar.
When the trade closes, the boxes stop at the exit candle and remain visible historically.
The boxes help visualize:
• entry timing
• risk distance
• final target distance
• trade duration
• exit candle
The boxes are chart drawings.
They are not broker orders.
Older boxes are deleted when the internal historical object limit is exceeded.
━━━━━━━━━━━━━━━━━━━━━━
🏷️ ACTIVE AND HISTORICAL PRICE LABELS
━━━━━━━━━━━━━━━━━━━━━━
During an active tracked trade, the right side of the chart displays dynamic labels for:
• ENTRY
• SL
• TP1
• TP2
• TP3
Each label includes the current stored price.
The labels move to the newest bar while the trade remains active.
On the exit candle, the final prices remain visible for that calculation.
When the trade closes, permanent historical labels are created for:
• TP1
• TP2
• TP3
These historical labels remain attached to the completed trade’s right edge.
The purpose is to preserve the target-price structure after the active dynamic labels disappear.
Historical TP labels do not indicate that TP1 or TP2 was actually touched.
They display the planned target prices for the completed tracked trade.
The final result is determined only by TP3 or Stop Loss.
━━━━━━━━━━━━━━━━━━━━━━
✅ RESULT LABELS
━━━━━━━━━━━━━━━━━━━━━━
When TP3 is reached, the script prints:
TARGET HIT
The trade is counted as a win equal to the selected TP3 R value.
When Stop Loss is reached, the script prints:
SL
The trade is counted as a -1R loss.
Result labels are displayed at the corresponding exit price.
All visible chart labels use bold-italic typography.
Dark Mode label text uses pure white.
Light Mode uses dark text where required for contrast.
━━━━━━━━━━━━━━━━━━━━━━
🎨 THEME SYSTEM
━━━━━━━━━━━━━━━━━━━━━━
The indicator includes three theme modes:
• Dark Mode
• Light Mode
• Mobile Theme
Dark Mode
Designed for dark PulseWire layouts.
It uses:
• black RSI-panel background
• dark dashboard surface
• white dashboard text
• pure-white chart-label text
• red brand accents
• green bullish visuals
• red bearish visuals
Light Mode
Designed for light PulseWire layouts.
It uses:
• white RSI-panel background
• white dashboard surface
• dark dashboard text
• dark chart-label text where appropriate
• red brand accents
• adjusted divergence transparency
Mobile Theme
Designed for smaller screens.
It uses:
• compact main-chart labels
• smaller RSI labels
• tiny price labels
• a two-row dashboard
• Win Rate
• NET R
Mobile Theme does not display the full desktop statistics table.
Theme selection changes presentation.
It does not change the underlying divergence, trend-filter, or trade calculations.
━━━━━━━━━━━━━━━━━━━━━━
📟 DASHBOARD
━━━━━━━━━━━━━━━━━━━━━━
Dark Mode and Light Mode display the full bottom-right dashboard.
The header displays:
• RSI DIVERGENCE
• selected TP3 R value
• active Trend Filter
The full dashboard includes:
Status
Possible values:
• NO ACTIVE TRADE
• ACTIVE BUY
• ACTIVE SELL
Closed Trades
Number of completed tracked trades.
TP3 Wins
Number of trades that reached TP3 before Stop Loss under the script’s bar-touch rules.
Losses
Number of trades recorded at Stop Loss.
Win Rate
TP3 Wins divided by Closed Trades.
NET R
Gross Profit R minus Gross Loss R.
Gross Profit
Sum of winning TP3 R values.
Gross Loss
Number of losing trades expressed as R because every Stop Loss equals -1R.
Average / Trade
NET R divided by Closed Trades.
Profit Factor
Gross Profit R divided by Gross Loss R.
Mobile Theme displays only:
• Win Rate
• NET R
The dashboard is placed on the main chart even though the indicator calculates in a separate RSI pane.
━━━━━━━━━━━━━━━━━━━━━━
📊 STATISTICS METHODOLOGY
━━━━━━━━━━━━━━━━━━━━━━
The statistics are produced by the script’s internal bar-based trade tracker.
They are not imported from a broker.
They are not verified account results.
They are not PulseWire Strategy Tester results.
Win Rate:
wins / closed trades
Gross Profit R:
wins × selected TP3 R
Gross Loss R:
losses × 1R
NET R:
Gross Profit R − Gross Loss R
Average R:
NET R / closed trades
Profit Factor:
Gross Profit R / Gross Loss R
When there are profitable trades but no recorded losses, the script displays 999 as a finite placeholder instead of mathematical infinity.
The statistics do not include:
• TP1 partial profits
• TP2 partial profits
• break-even exits
• trailing stops
• spread
• commission
• slippage
• swap
• latency
• order rejection
• partial fills
• position sizing
• account equity
• compounding
• taxes
Statistics depend on:
• loaded chart history
• selected symbol
• timeframe
• data provider
• Pivot Lookback
• Confirmation Bars
• Trend Filter
• HTF Trend Timeframe
• ATR Period
• Stop Loss multiplier
• TP3 target
• historical-data revisions
Changing any of these inputs can change historical results.
━━━━━━━━━━━━━━━━━━━━━━
🚨 ALERT SYSTEM
━━━━━━━━━━━━━━━━━━━━━━
The script includes static PulseWire alert conditions for:
• Regular Bullish Divergence
• Hidden Bullish Divergence
• Regular Bearish Divergence
• Hidden Bearish Divergence
• BUY Entry
• SELL Entry
• TP3 Hit
• Stop Loss Hit
Regular bullish and bearish divergence are enabled in the current public configuration.
Hidden bullish and hidden bearish divergence logic is internally disabled.
The hidden alert choices can therefore appear in PulseWire’s alert-condition list, but no hidden divergence event is produced while the internal hidden-divergence switches remain disabled.
The script also includes dynamic alert() calls for:
• BUY entry
• SELL entry
• TP3 hit
• Stop Loss hit
Dynamic BUY and SELL messages can include:
• tradewsamet identifier
• chart ticker
• chart timeframe
• entry price
• TP1 price
• TP2 price
• TP3 price
• Stop Loss price
• final R target
• active Trend Filter
This allows one PulseWire alert using:
Any alert() function call
to receive all dynamic entry and result events.
━━━━━━━━━━━━━━━━━━━━━━
🔔 HOW TO USE ALERTS
━━━━━━━━━━━━━━━━━━━━━━
For a specific static event:
1. Add RSI Divergence Entry Engine to the chart.
2. Open PulseWire’s Create Alert window.
3. Select the indicator as the condition.
4. Choose the required event.
5. Select the notification method.
6. Use an appropriate frequency.
7. Test the alert before relying on it.
For one combined dynamic workflow:
1. Add the indicator to the chart.
2. Open Create Alert.
3. Select RSI Divergence Entry Engine .
4. Select Any alert() function call.
5. Configure the delivery method.
6. Test BUY, SELL, TP3, and SL message handling.
When the script, settings, symbol, or timeframe changes materially, recreate existing alerts.
A PulseWire alert can continue using the script snapshot stored when the alert was created.
Alerts are monitoring tools.
They do not execute, modify, or close broker orders.
━━━━━━━━━━━━━━━━━━━━━━
🧪 HOW TO USE THE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
A practical workflow:
1. Add RSI Divergence Entry Engine to a standard candlestick chart.
2. Select Dark Mode, Light Mode, or Mobile Theme.
3. Begin with Pivot Lookback set to 5.
4. Begin with Confirmation Bars set to 1.
5. Observe the RSI-panel divergence structures.
6. Observe the matching neon price-pivot lines on the main chart.
7. Remember that the pivot visual becomes available only after right-side confirmation.
8. Distinguish the neon divergence line from the later tracked entry label.
9. Begin with Trend Filter set to Off when studying raw divergence frequency.
10. Test EMA Trend for chart-timeframe directional alignment.
11. Test Supertrend for volatility-based directional alignment.
12. Test HTF Trend for higher-timeframe EMA context.
13. Verify the selected HTF timeframe.
14. Review the main-chart trend reference.
15. Observe whether a BULLISH or SELL entry label is accepted.
16. Review ENTRY, SL, TP1, TP2, and TP3 prices.
17. Observe the profit and risk boxes.
18. Remember that TP1 and TP2 are visual only.
19. Review the final TARGET HIT or SL result.
20. Review dashboard Win Rate and NET R.
21. Compare Dark/Light full dashboard with Mobile Theme.
22. Use alerts for monitoring rather than blind execution.
23. Review broader market structure independently.
24. Review spread, liquidity, volatility, and news conditions.
25. Define personal account risk and position size.
26. Test the exact symbol, timeframe, and data feed personally used.
The indicator is designed for structured study and monitoring.
It should not be treated as an automatic decision-maker.
━━━━━━━━━━━━━━━━━━━━━━
⚙️ SETTINGS REFERENCE
━━━━━━━━━━━━━━━━━━━━━━
🎨 Theme
Theme Mode
Dark Mode
Uses the full dark visual profile.
Light Mode
Uses the full light visual profile.
Mobile Theme
Uses compact labels and a two-row dashboard.
━━━━━━━━━━━━━━━━━━━━━━
🎯 Signal Settings
Pivot Lookback
Controls the left-side pivot search width.
Default:
5
Higher values generally create larger and less frequent pivot structures.
Confirmation Bars
Controls the number of right-side completed candles required to confirm the RSI pivot.
Default:
1
Increasing the value increases confirmation delay.
Chart Signal Label Size
Controls the main-chart BULLISH and SELL entry-label size.
Available values:
• Tiny
• Small
• Normal
• Large
• Huge
Mobile Theme overrides the selected size with a compact layout.
━━━━━━━━━━━━━━━━━━━━━━
🧭 Trend Filter
Trend Filter
Available modes:
• Off
• EMA Trend
• Supertrend
• HTF Trend
Off
Allows tracked bullish and bearish entries without directional trend filtering.
EMA Trend
Uses chart close relative to EMA 200.
Supertrend
Uses ATR 10 and factor 3.0.
HTF Trend
Uses selected higher-timeframe close relative to higher-timeframe EMA 200.
HTF Trend Timeframe
Selects the higher timeframe used by HTF Trend.
Default:
240 minutes
This setting has no effect when HTF Trend is not selected.
━━━━━━━━━━━━━━━━━━━━━━
🛡️ Trade Management
ATR Period
Controls the ATR used for risk-distance calculations.
Default:
14
Stop Loss Distance (ATR)
Multiplies ATR to calculate the Stop Loss distance.
Default:
2.0
TP3 Target (R)
Selects the final target from 1R to 7R.
Default:
2R
TP1 and TP2 are calculated automatically from the TP3 distance.
All public input values are hidden from PulseWire’s status line to reduce chart-header clutter.
━━━━━━━━━━━━━━━━━━━━━━
🧠 WHAT MAKES THIS SCRIPT ORIGINAL
━━━━━━━━━━━━━━━━━━━━━━
RSI, divergence, EMA, Supertrend, ATR, risk/reward targets, and trade statistics are established technical-analysis concepts.
These concepts are not unique by themselves.
The originality of RSI Divergence Entry Engine lies in the coordinated workflow applied to them:
fixed RSI calculation
→ confirmed oscillator pivots
→ price / RSI regular divergence comparison
→ pivot-distance validation
→ RSI-path divergence filling
→ main-chart three-layer neon pivot lines
→ optional chart or higher-timeframe trend filtering
→ one-active-trade state
→ confirmation-candle entry
→ ATR-normalized Stop Loss
→ proportional TP1 / TP2 placement
→ adjustable TP3 R target
→ conservative OHLC exit handling
→ permanent risk/reward history
→ historical target-price labels
→ theme-aware chart output
→ mobile-specific dashboard
→ internal R-based statistics
→ static and dynamic alert workflows
Distinctive implementation features include:
• separating divergence context from accepted tracked entries
• displaying the same confirmed divergence in the RSI pane and on the main chart
• filling the RSI path-to-divergence region
• using a three-layer neon price-divergence line
• preserving trade boxes after closure
• preserving TP1, TP2, and TP3 planned prices historically
• allowing multiple direction-filter models inside one entry workflow
• maintaining one tracked trade at a time
• applying conservative Stop Loss priority when TP3 and SL share a candle
• offering theme-specific dashboard behavior
• reducing the Mobile Theme dashboard to Win Rate and NET R
• supporting static conditions and combined dynamic alert() messages
• keeping public settings compact while documenting fixed internal values
The script is not a collection of unrelated indicators placed on one chart.
Every component supports the same objective: converting a confirmed RSI divergence into a transparent, filterable, volatility-mapped, historically reviewable entry framework.
━━━━━━━━━━━━━━━━━━━━━━
⚠️ IMPORTANT PRACTICAL NOTES
━━━━━━━━━━━━━━━━━━━━━━
Signal frequency depends on:
• symbol
• timeframe
• data provider
• Pivot Lookback
• Confirmation Bars
• fixed 5–60 bar pivot-distance window
• Trend Filter
• HTF Trend Timeframe
• existing active-trade state
• ATR availability
• available historical data
Higher Pivot Lookback values can reduce frequency.
Higher Confirmation Bars values increase delay.
EMA Trend can reject counter-position signals relative to EMA 200.
Supertrend can change direction after price movement.
HTF Trend can remain sensitive to the currently developing higher-timeframe candle.
Only one tracked trade can be active.
A divergence can therefore be visible without becoming a tracked trade.
TP1 and TP2 are not partial exits.
Historical TP1, TP2, and TP3 labels display planned prices, not proof that every level was touched.
Dashboard statistics use loaded chart history only.
Different brokers or exchanges can produce different:
• highs
• lows
• closes
• RSI pivots
• ATR values
• divergence signals
• trend-filter states
• TP3 / SL outcomes
• dashboard statistics
Changing the chart’s available history can change the first eligible pivot pair and all later trade-state sequencing.
━━━━━━━━━━━━━━━━━━━━━━
⚠️ LIMITATIONS AND SHORTCOMINGS
━━━━━━━━━━━━━━━━━━━━━━
This script has important limitations:
It does not guarantee profitable trades.
It does not predict future price movement.
It does not execute orders.
It does not place broker Stop Loss orders.
It does not place broker Take Profit orders.
It does not calculate position size.
It does not calculate account risk.
It does not include spread.
It does not include commission.
It does not include slippage.
It does not include latency.
It does not include swap or financing.
It does not model partial fills.
It does not model order rejection.
It does not model contract specifications.
It does not model tick-by-tick execution.
It uses historical OHLC bars.
It cannot always determine whether TP3 or SL occurred first inside one candle.
It resolves same-candle TP3 / SL ambiguity in favor of Stop Loss.
It does not record TP1 or TP2 as partial profit.
It does not move Stop Loss to break even.
It does not trail Stop Loss.
It maintains one active tracked trade.
It can ignore otherwise valid new entries while a trade is active.
It uses pivot confirmation.
Pivot visuals are not available on the original pivot candle in realtime.
RSI pivot visuals are placed at the historical pivot location after confirmation.
Main-chart neon lines are created after divergence confirmation.
The HTF filter can change while the current higher-timeframe candle remains open.
A confirmed divergence can fail.
A trend-aligned divergence can fail.
A larger divergence area does not guarantee a stronger result.
A neon divergence line is not guaranteed support or resistance.
A TARGET HIT label is not broker-verified execution.
Dashboard statistics are not audited performance.
Profit Factor displays 999 when wins exist without recorded losses.
Changing settings recalculates historical conditions.
Changing symbol, timeframe, provider, or available history can change output.
Alert delivery depends on PulseWire and user configuration.
Alerts do not guarantee broker execution.
For these reasons, the indicator should be used as an educational decision-support and chart-review tool, not as a standalone automated strategy.
━━━━━━━━━━━━━━━━━━━━━━
👤 WHO THIS SCRIPT MAY BE USEFUL FOR
━━━━━━━━━━━━━━━━━━━━━━
This script may be useful for traders who:
• understand basic RSI divergence
• want regular bullish and bearish divergence visuals
• prefer pivot-confirmed structures
• want divergence displayed in both RSI and price
• want a clear neon main-chart divergence line
• want optional trend filtering
• use EMA 200
• use Supertrend
• use higher-timeframe direction
• want ATR-based risk mapping
• want adjustable R targets
• want historical risk/reward boxes
• want historical planned TP prices
• want one-active-trade statistics
• want Dark, Light, and Mobile themes
• want static alerts
• want one combined dynamic alert
• understand that chart statistics are not verified trading results
It may be less suitable for users who:
• want signals on the unconfirmed pivot candle
• want no pivot delay
• want hidden divergence enabled publicly
• want every divergence to open a trade
• want multiple overlapping tracked trades
• want partial TP accounting
• want automatic break-even management
• want trailing stops
• want tick-level backtesting
• want verified Strategy Tester results
• want broker execution
• want guaranteed reversal signals
• expect a high Win Rate to continue unchanged
• expect the HTF filter to remain fixed before the higher-timeframe candle closes
━━━━━━━━━━━━━━━━━━━━━━
🧭 BEST PRACTICE SUGGESTIONS
━━━━━━━━━━━━━━━━━━━━━━
For studying raw divergence behavior:
• use Trend Filter Off
• begin with Pivot Lookback 5
• begin with Confirmation Bars 1
• observe divergence visuals before evaluating trades
• distinguish pivot location from confirmation timing
For trend-aligned divergence:
• test EMA Trend
• test Supertrend
• compare signal frequency
• review whether the filter removes useful countertrend setups
For broader directional context:
• test HTF Trend
• use a higher timeframe meaningfully above the chart timeframe
• remember that the active HTF candle can change before closing
For trade mapping:
• begin with ATR 14
• begin with Stop Loss Distance 2.0 ATR
• begin with TP3 2R
• remember that TP1 and TP2 are visual only
• review same-candle TP3 / SL cases conservatively
For chart clarity:
• use Dark Mode on dark chart layouts
• use Light Mode on light chart layouts
• use Mobile Theme on small screens
• adjust the main-chart entry-label size
• use neon divergence lines as context, not automatic entries
Always:
• wait for divergence confirmation
• review broader price structure
• review liquidity and volatility
• review session conditions
• review news risk
• define personal account risk
• define personal position size
• test the exact symbol and timeframe
• verify alerts before relying on them
• remember that every divergence can fail
━━━━━━━━━━━━━━━━━━━━━━
🔓 PUBLICATION NOTE
━━━━━━━━━━━━━━━━━━━━━━
RSI Divergence Entry Engine is published as an educational RSI-divergence, directional-filtering, ATR trade-mapping, historical-visualization, and alert tool.
The purpose of this description is to explain:
• how RSI is calculated
• how RSI pivot lows and highs are confirmed
• how Pivot Lookback affects structure selection
• how Confirmation Bars affect delay
• how the fixed pivot-distance window works
• how regular bullish divergence is identified
• how regular bearish divergence is identified
• how divergence is displayed inside the RSI pane
• how the RSI divergence area is filled
• how corresponding price pivots are displayed with neon lines
• when the pivot visuals become available
• why pivot visuals appear at historical pivot locations
• why tracked entries are placed on confirmation-candle close
• how the trend filter affects entries without hiding divergence context
• how EMA Trend works
• how Supertrend works
• how HTF Trend works
• how currently forming higher-timeframe candles affect realtime context
• how ATR risk distance is calculated
• how Stop Loss is placed
• how TP1, TP2, and TP3 are calculated
• why TP1 and TP2 are visual only
• why only TP3 counts as a win
• how one-active-trade handling works
• how same-candle TP3 / SL ambiguity is resolved
• how historical trade boxes are retained
• what historical TP labels represent
• how Dark Mode, Light Mode, and Mobile Theme differ
• what the dashboard displays
• how Win Rate, NET R, Average R, and Profit Factor are calculated
• why the statistics are not broker-verified
• what static alert conditions are available
• how “Any alert() function call” works
• what the script does not simulate
• why the combined modules form one coordinated workflow
The script is designed to support structured review.
It does not promise profitable results.
It does not remove market risk.
It does not replace independent analysis.
It does not replace personal risk management.
━━━━━━━━━━━━━━━━━━━━━━
🕒 REPAINTING, BACKPLOTTING, AND TIMING DISCLOSURE
━━━━━━━━━━━━━━━━━━━━━━
RSI Divergence Entry Engine uses pivot functions.
Pivot confirmation requires future candles relative to the original pivot location.
The number of required right-side candles is controlled by Confirmation Bars.
The script does not know that a pivot exists on the original pivot candle.
After the right-side candles close:
• the pivot becomes confirmed
• the divergence can be calculated
• the RSI divergence line is displayed at the historical pivot locations
• the RSI divergence label is displayed at the confirmed pivot location
• the main-chart neon line connects the corresponding historical price pivots
This historical placement is a visual back-reference to the confirmed pivot structure.
It must not be interpreted as a realtime signal that was available on the original pivot candle.
The tracked trade entry is not backdated.
The tracked trade opens at the close of the later confirmation candle when all entry rules are valid.
The main-chart BULLISH or SELL entry label appears on that confirmation candle.
Trade outcome checks begin on the following candle.
The HTF Trend request uses lookahead_off.
It does not intentionally access future higher-timeframe values.
However, the current higher-timeframe candle can continue developing in realtime until it closes.
Historical results can change when:
• Pivot Lookback changes
• Confirmation Bars changes
• Trend Filter changes
• HTF Trend Timeframe changes
• ATR settings change
• TP3 target changes
• chart symbol changes
• timeframe changes
• exchange or broker feed changes
• historical data is revised
• available chart history changes
Confirmed chart-bar calculations reduce unfinished current-chart-candle changes.
They do not remove pivot confirmation delay, historical pivot placement, HTF live-candle variation, data-feed differences, or market risk.
━━━━━━━━━━━━━━━━━━━━━━
🛡️ DISCLAIMER
━━━━━━━━━━━━━━━━━━━━━━
RSI Divergence Entry Engine is provided for educational and informational purposes only.
It does not constitute financial, investment, trading, legal, accounting, or tax advice.
No indicator can guarantee future results.
Markets are uncertain.
Momentum changes.
Volatility changes.
Trend changes.
Liquidity changes.
Historical chart behavior does not ensure future performance.
Every user is responsible for their own:
• analysis
• validation
• symbol selection
• timeframe selection
• trend-filter selection
• execution planning
• Stop Loss placement
• target planning
• position sizing
• risk management
• alert configuration
• trading decisions
• broker execution
• legal obligations
• tax obligations
The RSI pivots, divergence lines, divergence fills, neon price-pivot lines, trend references, BULLISH labels, SELL labels, ENTRY labels, Stop Loss levels, TP1 levels, TP2 levels, TP3 levels, trade boxes, historical target labels, TARGET HIT labels, SL labels, dashboard statistics, Win Rate, NET R, Average R, Profit Factor, and alerts are visual analysis tools only.
A bullish divergence is not a guaranteed reversal.
A bearish divergence is not a guaranteed reversal.
An EMA-aligned signal is not guaranteed to succeed.
A Supertrend-aligned signal is not guaranteed to succeed.
A higher-timeframe aligned signal is not guaranteed to succeed.
A TARGET HIT label is not proof of an actual broker fill.
An SL label is not proof of an actual broker fill.
The dashboard is not verified account performance.
The statistics are not audited.
The script does not include spread, commission, slippage, latency, financing, partial fills, order rejection, position sizing, account equity, or broker-specific execution behavior.
Use the script as a structured RSI-divergence review, directional-filtering, trade-mapping, and monitoring framework—not as a promise of profitability or a substitute for independent judgment.
Indicator

DOUBLE SUPERTREND PYRAMID STRATEGYDouble Supertrend Pyramid Strategy
This strategy trades off two Supertrend indicators calculated on independent, user-selected timeframes (defaults: 1-minute and 2-minute). A trade is only taken when both Supertrends agree on direction — when they align upward, the strategy goes long; when they align downward, it goes short. Each new alignment is treated as a new "plotted course," and the strategy tracks that course's direction so it doesn't re-enter on every bar, only on an actual flip.
Core Entry Logic
Long/Short/Both direction control, so you can restrict the strategy to one side of the market if desired.
A session time-window filter (with a timezone dropdown covering major global zones) lets you restrict trading to specific hours, with an option to auto-close everything when the window ends.
On a Supertrend flip, the strategy normally waits until the position is completely flat before entering the new direction — it does not force-close open tiered or pyramid contracts just because the trend flipped. (See "Exit At Next Supertrend Plotted Course" below for the opt-in alternative.)
Tiered Exit System
Three independent, fully self-contained profit-scaling tiers (Tier 1/2/3), each with:
A profit target (ticks) and contract quantity to scale out at that target
An optional Stop Loss, and an optional Trailing Stop with a separate activation threshold (ticks, own enable checkbox)
An "Exit At Next Supertrend Plotted Course" checkbox — when checked, that tier's contracts are force-closed the moment the trend flips; when unchecked (default), the tier runs entirely on its own Target/Stop/Trailing settings regardless of what the trend does next.
Pyramid Add-On System
Eight independent pyramid types can each be enabled separately to add contracts in the direction of an existing position when their own specific condition fires:
Turtle ATR Unit — adds every time price moves a set fraction of ATR in your favor from the last fill.
Swing Structure — adds on a new confirmed swing high/low in the trend direction.
Momentum Re-confirmation — adds when ADX is rising with DI+/DI- agreement and RSI holds past a threshold.
Breakout / Consolidation — adds on a fresh Donchian channel breakout.
Multi-Timeframe Alignment — adds only when a higher-timeframe EMA filter agrees with the trade direction.
Error-Function One-Tailed Test — adds when the current bar's move is statistically significant versus its recent return distribution (Normal or Student-T approximation).
KDE Percentile — adds when the current move ranks in the top percentile of a non-parametric kernel-density estimate of recent returns.
Viterbi Regime Detection — adds only while a 2-state Hidden Markov Model infers the market is in a "trending" (versus "ranging") regime.
Each pyramid type is fully self-contained: its own contracts-per-signal size, its own optional TP/SL/Trailing Stop, its own per-course contract and signal caps, a delay-between-signals timer, a minimum-distance-before-next-add gate (selectable as ATR multiple, percent, ticks, points, or dollars), and its own "Exit At Next Supertrend Plotted Course" checkbox. All types default to fully disabled.
Global Risk Controls (always active, override everything)
Max contracts per trade (position size cap across core + pyramid adds)
Master daily $ take-profit and $ max-loss halts
Volatility Exit — flattens everything if ATR expands beyond a multiple of its recent average
ATR Protective Stop — a catastrophic-loss stop measured off the position's average entry price
Reverse-At-Stop-Loss — an optional system that flips the core position to the opposite side when the per-course Stop Loss is hit, capped at a configurable number of reversals per course Strategy

RSI Volume Compression RibbonRSI Volume Compression Ribbon
RSI Volume Compression Ribbon combines the standard Price RSI with a volume-weighted RSI momentum model and a multi-band compression ribbon.
The indicator is designed to make momentum contraction and expansion visually clear. Periods in which the ribbon narrows represent reduced momentum volatility and compression. A subsequent widening of the ribbon may indicate the beginning of a stronger directional move.
CORE COMPONENTS
1. Price RSI
The main RSI line is calculated from the selected price source.
It can be used for:
• Overbought and oversold analysis
• Momentum assessment
• Bullish and bearish divergence analysis
• Confirmation of exits from extreme zones
The color, transparency, and thickness of the main RSI line are fully adjustable.
2. Volume-Weighted RSI
The volume component is based on an EMA volume-weighted price:
Volume-Weighted Price =
EMA(Volume × Price) / EMA(Volume)
RSI is then calculated from this volume-weighted price.
Two smoothed Volume RSI lines are displayed:
• Fast Volume RSI — reacts more quickly to changes in volume-weighted momentum
• Slow Volume RSI — represents the broader direction of volume-weighted momentum
When the Fast Volume RSI crosses above the Slow Volume RSI, volume-weighted momentum is strengthening.
When the Fast Volume RSI crosses below the Slow Volume RSI, volume-weighted momentum is weakening.
3. Compression Ribbon
The compression ribbon consists of several volatility envelopes around the Fast Volume RSI.
The bands are calculated using the standard deviation of the Fast Volume RSI.
When the bands contract, the indicator identifies a momentum-compression environment.
When the bands begin to separate after compression, momentum volatility is expanding. This often occurs near the beginning of a stronger market impulse, although the ribbon itself does not determine the direction of the move.
Compression is evaluated relative to the recent average ribbon width, allowing the indicator to adapt to changing market conditions.
4. Crossover Dots
Black-outlined dots mark crossings between the Fast and Slow Volume RSI lines.
By default, the indicator emphasizes crossings that occur:
• During a ribbon compression
• Shortly after compression
• While the ribbon begins to expand
The dot center uses conventional directional colors:
• Green — Fast Volume RSI crosses above Slow Volume RSI
• Red — Fast Volume RSI crosses below Slow Volume RSI
All ordinary crossings can also be displayed through the settings.
Dot size, outline size, and center size are adjustable.
5. Classic RSI Zones
The indicator includes narrow RSI zones inspired by the original concept:
• 70–67: upper momentum zone
• 30–27: lower momentum zone
• 92–89: upper extreme zone
• 8–5: lower extreme zone
The width, colors, and transparency of these zones can be customized.
Optional broad backgrounds for the 0–30 and 70–100 regions are also available.
6. Active Extreme Fills
When the Price RSI moves below the oversold level, the area between the RSI and the oversold boundary is highlighted.
When the Price RSI moves above the overbought level, the corresponding upper area is highlighted.
The colors and transparency of both active fills are independently adjustable.
SIGNALS
The indicator provides alerts for:
• Bullish Volume RSI crossover near compression
• Bearish Volume RSI crossover near compression
• Any Volume RSI crossover near compression
• Price RSI exit from oversold
• Price RSI exit from overbought
Crossover signals are confirmed at bar close.
INTERPRETATION
Compression does not indicate direction by itself.
A compressed ribbon represents reduced momentum dispersion. Direction should be evaluated using:
• The direction of the Fast and Slow Volume RSI crossover
• Price structure
• Support and resistance
• Trend context
• Price RSI behavior
• Divergences
• Volume quality
A common sequence is:
Compression → Volume RSI crossover → Ribbon expansion → Momentum impulse
However, compression may also produce false starts or short-lived expansions, particularly in sideways or illiquid markets.
MARKET APPLICATION
The indicator can be applied to:
• Cryptocurrencies
• Stocks
• Futures
• Commodities
• Currency pairs
• Indices and CFDs with usable volume data
The Volume RSI component is most meaningful when the chart provides reliable volume information. On instruments with synthetic, incomplete, or unavailable volume, the Price RSI may be more reliable than the volume-weighted calculations.
SETTINGS
The indicator includes controls for:
• Price RSI length
• Overbought and oversold levels
• Volume RSI length
• Fast and slow smoothing
• Ribbon calculation length
• Ribbon deviation multiplier
• Compression threshold
• Compression lookback
• Post-compression crossover window
• Main RSI color, transparency, and width
• Zone colors and transparency
• Active fill colors and transparency
• Crossover dot size
• Classic narrow zones
• Broad RSI-zone backgrounds
CREDITS
Original concept and source code:
@wozdux — RSIVolume_2graf
This version was redesigned and rewritten in Pine Script v6 with:
• A cleaner visual structure
• Volume RSI compression analysis
• Multi-band compression ribbon
• Compression-filtered crossover dots
• Adjustable visual settings
• Classic RSI zones
• Confirmed crossover alerts
DISCLAIMER
This indicator is provided for informational and educational purposes only. It does not constitute financial or investment advice.
No indicator can predict market direction with certainty. Signals should be evaluated together with market structure, trend context, and appropriate risk management. Indicator

Indicator

NQ Engine Health **NQ Engine Health**
NQ Engine Health is a session-aware trade-management and market-confirmation dashboard designed for NQ and MNQ.
During the New York session, it measures whether the current NQ move is supported by six major Nasdaq leaders, NQ price structure, VXN behavior and broader ES market context.
During London and Asia, the indicator switches to a futures-based engine using the active session open, session VWAP, NQ momentum, volume participation and ES confirmation.
The dashboard displays:
* Market direction and directional score
* Engine Health from 0% to 100%
* Strengthening, stable, losing-fuel or diverging conditions
* ES and VXN confirmation
* Individual Nasdaq leader direction and momentum
* Session-adjusted confidence
* Suggested trade-management posture
Management conditions include **Breathing Room, Normal Structure, Protect Profit and Defensive**.
This indicator does not generate trade entries. It is designed to complement a separate entry strategy, important price levels and structured risk management.
Alerts are included for Full Throttle, Losing Fuel, Divergence, Protect Profit and Defensive conditions.
For educational and analytical purposes only. No indicator can predict or guarantee market outcomes.
Indicator

Uptrick: Flow Expansion TrendIntroduction
Uptrick: Flow Expansion Trend (FET) is an overlay tool built around an efficiency-adaptive midline that speeds up or slows down based on how directional recent price movement has been. The midline is paired with a volatility-based signal boundary and a minimum flow-strength filter to determine confirmed trend flips, and the script includes a market-state read that classifies current conditions as directional, developing, or compressed. Signal labels can be anchored to price highs and lows, a fixed ATR distance from price, or the midline itself.
Originality
This script's core is an efficiency ratio, calculated as the net price movement over a lookback divided by the sum of all bar-to-bar movement over that same lookback, which produces a value between 0 and 1 describing how directional versus choppy the recent path has been. Rather than using this ratio as a standalone oscillator, it is fed into the smoothing constant of the midline itself, so the midline's responsiveness continuously adjusts between a fast and slow smoothing constant based on current market efficiency. This is what separates the midline from a standard moving average, since it does not use a fixed lookback response but instead reshapes itself with the character of the move.
The signal boundary distance around the midline is also adaptive: it widens or narrows based on the same efficiency reading, so the distance price must travel to trigger a trend flip contracts in efficient, directional conditions and expands in choppier ones. A trend flip additionally requires a minimum flow-strength threshold, a normalized measure of the midline's own rate of change relative to ATR, so a boundary breach alone is not sufficient to flip the trend without accompanying follow-through in the midline's slope.
Combining an adaptive midline, an adaptive signal boundary, and a flow-strength confirmation filter into a single confirmed-trend mechanism is the original contribution of this script, since each of the three components is derived from the same efficiency and volatility inputs but serves a distinct role in preventing premature or noise-driven flips. The selectable signal anchor further separates the trend calculation from the signal display, letting traders choose whether labels sit at the bar's high/low, a fixed ATR offset from price, or directly on the midline, without altering the underlying trend logic in any way.
Features
Efficiency-adaptive midline that adjusts its smoothing speed based on how directional recent price action has been
Adaptive signal boundary that widens in choppy conditions and narrows in directional conditions
Minimum flow-strength filter required alongside a boundary breach to confirm a trend flip
Confirmed-bar trend state calculation to avoid intrabar repainting of the trend flip
Selectable signal anchor for up and down labels: high/low, fixed ATR distance from price, or midline
Adjustable ATR distance value when the ATR distance anchor is selected
Up and down trend signal labels
Optional candle coloring based on the most recent confirmed signal
Adjustable midline width
On-chart dashboard showing trend, market efficiency percentage, flow strength, market state classification, bars since the last signal, and current signal anchor mode
Four selectable dashboard positions
Four alert conditions: up signal, down signal, any trend signal, and market becoming directional
Inputs
Trend Engine: source, trend length, signal distance multiplier, minimum signal strength threshold.
Signals: show/hide up and down signals, signal anchor mode, signal ATR distance.
Visuals: candle coloring toggle, midline width, show/hide dashboard, dashboard position.
How It Works / How to Use
The script measures how efficiently price has moved over the trend length by comparing net displacement to total path length traveled. This efficiency value continuously reshapes the midline's smoothing speed, so the midline hugs price more closely in strong directional runs and lags more in choppy conditions. An ATR-based boundary is placed around the midline, with its distance also scaled by the same efficiency reading. A trend flip is confirmed only when price closes beyond this boundary on a confirmed bar and the midline's own rate of change exceeds the minimum flow-strength threshold in that direction.
Once a flip is confirmed, the up or down label is placed according to the chosen signal anchor: at the bar's high or low, at a fixed ATR distance beyond price, or directly on the midline. This is purely a display choice and does not affect when or why a trend flip occurs.
Traders can use the midline's slope and color for ongoing directional bias, the up and down signals for confirmed flips, and the dashboard's market-state classification to gauge whether current conditions are more suited to trend-following or more likely to produce choppy, range-bound behavior.
Conclusion
Uptrick: Flow Expansion Trend combines an efficiency-adaptive midline, a matching adaptive signal boundary, and a flow-strength confirmation filter into a single trend-following overlay, giving traders a trend read that reshapes itself with current market conditions rather than relying on a fixed-speed average, with flexible signal placement to suit different charting preferences.
Disclaimer
This script is provided for informational and educational purposes only and does not constitute financial advice. Past performance, whether shown historically or implied through the script's logic, does not guarantee future results. Always perform your own due diligence and risk management before making trading decisions. Indicator

NeuPortal - Forecast LevelsDraws a pre-computed probabilistic price forecast on the chart: a core-50% / 80% cone projected forward, the median path, an entry zone, an invalidation level, two reference levels, Fibonacci retracements, support/resistance and three EMAs.
This is a RENDERER, not a signal generator. You paste the numbers — produced by your own model or by hand — into the settings, and the script draws them consistently. Nothing is computed from price except the moving averages.
Why it is built this way: a forecast written down with an explicit invalidation and a stated probability band can be scored afterwards. A drawing without those cannot.
Inputs are grouped:
1) Forecast — central (median), core 50% band, wide 80% band, projection length
2) Position — bias (long / short / neutral), entry zone, invalidation, two reference levels
3) Structure — support, resistance, five Fibonacci retracements
4) Moving averages — three EMAs, bundled in to save an indicator slot
Educational content — not financial advice. Indicator

DNSE VN301!, Donchian Break Out Strategy"Donchian Channel Breakout with SMA Trend Filter" is a trend-following breakout strategy designed to capture sustained price movements while filtering out low-probability signals. The Donchian Channel identifies breakouts by tracking the highest high and lowest low over a specified lookback period, generating potential entry signals when price closes outside the recent trading range. Because breakouts during sideways or low-volatility markets often fail, the strategy incorporates a Simple Moving Average (SMA) as a trend filter.
Long signals are prioritized when the SMA is rising, while Short signals are prioritized when the SMA is falling, ensuring trades align with the prevailing market trend. By combining breakout detection with trend confirmation, the strategy aims to reduce false breakouts and improve overall signal quality.
*By default: each VN Futures contract requires VND 30,000,000 of initial margin. The strategy assumes an initial capital of VND 100,000,000, resulting in a fixed position size of 3 contracts for each trading signal.
To better reflect real-market trading conditions, the backtest incorporates a commission of VND 10,000 per contract and a minimum slippage assumption of 3 ticks on every executed trade.
Settings & Strategy Configuration:
Chart: recommended 15-minute timeframe
Donchian Channel Period: 20
SMA Period: 200
Stop Loss: 10 points
Take Profit: 20 points
SMA Trend Filter: On / Off
Use Take Profit: On / Off
Time Filter: On / Off
Trading Session: 09:00 – 14:30
Trade Direction: Long / Short / Both
Default Script Settings:
The strategy calculates the upper and lower bands of the Donchian Channel using the selected lookback period. A breakout above the upper band may indicate buying pressure, while a breakout below the lower band may indicate selling pressure.
When the SMA(200) trend filter is enabled, the script only allows Long entries when SMA(200) is rising and only allows Short entries when SMA(200) is falling. When the SMA filter is disabled, the strategy can trade both directions based only on Donchian Channel breakout signals.
Entry & Exit Conditions:
Entry Long:
Close Price > Upper Donchian Channel
AND SMA(200) is rising, if the SMA filter is enabled
AND the signal appears within the selected trading session
AND Long trading is allowed by the trade direction setting
Exit Long:
Stop Loss: 10 points from entry price
Take Profit: 20 points from entry price, if enabled
Opposite Donchian breakout signal
Position reversal when a valid Short signal appears
Automatic close at the end of the trading session
Entry Short:
Close Price < Lower Donchian Channel
AND SMA(200) is falling, if the SMA filter is enabled
AND the signal appears within the selected trading session
AND Short trading is allowed by the trade direction setting
Exit Short:
Stop Loss: 10 points from entry price
Take Profit: 20 points from entry price, if enabled
Opposite Donchian breakout signal
Position reversal when a valid Long signal appears
Automatic close at the end of the trading session
Disclaimers:
Trading futures contracts carries a high degree of risk, and price movements can be highly volatile. This script is intended as a reference and research tool only. It should be used by individuals who understand futures trading, have assessed their own risk tolerance, and are knowledgeable about the strategy’s logic.
All investment decisions are the sole responsibility of the user. DNSE bears no liability for any potential losses incurred from applying this strategy in real trading. Past performance does not guarantee future results.
______________________________________________________________________
"Chiến lược Breakout Donchian Channel kết hợp bộ lọc xu hướng SMA" là một chiến lược giao dịch theo xu hướng, được thiết kế nhằm tận dụng các đợt bứt phá giá mạnh đồng thời giảm thiểu các tín hiệu nhiễu. Donchian Channel xác định các điểm breakout bằng cách theo dõi mức giá cao nhất và thấp nhất trong một khoảng thời gian xác định, từ đó tạo tín hiệu khi giá đóng cửa vượt ra khỏi vùng dao động gần nhất. Do các tín hiệu breakout trong giai đoạn thị trường đi ngang hoặc biến động thấp thường có xác suất thất bại cao, chiến lược sử dụng thêm đường trung bình động đơn giản (SMA) làm bộ lọc xu hướng.
Khi đường SMA đang dốc lên, chiến lược ưu tiên các tín hiệu Long; ngược lại, khi SMA dốc xuống, chiến lược ưu tiên các tín hiệu Short, giúp các lệnh giao dịch đi cùng xu hướng chính của thị trường. Bằng cách kết hợp tín hiệu breakout với xác nhận xu hướng, chiến lược hướng tới việc giảm các tín hiệu phá vỡ giả và nâng cao chất lượng giao dịch.
*Theo mặc định, mỗi hợp đồng VN Futures yêu cầu ký quỹ ban đầu là 30.000.000 VNĐ. Chiến lược giả định vốn ban đầu là 100.000.000 VNĐ, tương ứng với quy mô vị thế cố định là 3 hợp đồng cho mỗi tín hiệu giao dịch được tạo ra.
Để phản ánh sát hơn điều kiện giao dịch thực tế, kết quả kiểm định (backtest) được giả định với phí giao dịch là 10.000 VNĐ cho mỗi hợp đồng và độ trượt giá (slippage) tối thiểu là 3 bước giá (ticks) đối với mỗi lệnh được khớp.
Cài đặt & cấu hình chiến lược:
Biểu đồ: khuyến nghị khung 15 phút
Chu kỳ Donchian Channel: 20
Chu kỳ SMA: 200
Cắt lỗ: 10 điểm
Chốt lời: 20 điểm
Bộ lọc xu hướng SMA: Bật / Tắt
Dùng chốt lời: Bật / Tắt
Bộ lọc giờ: Bật / Tắt
Khung giờ giao dịch: 09:00 – 14:30
Chiều giao dịch: Mua / Bán / Cả hai
Cài đặt mặc định của script:
Chiến lược tính toán biên trên và biên dưới của Donchian Channel dựa trên chu kỳ được chọn. Khi giá phá lên biên trên, lực mua có thể đang chiếm ưu thế. Khi giá phá xuống biên dưới, lực bán có thể đang chiếm ưu thế.
Khi bật bộ lọc xu hướng SMA(200), script chỉ cho phép lệnh Mua khi SMA(200) dốc lên và chỉ cho phép lệnh Bán khi SMA(200) dốc xuống. Khi tắt bộ lọc SMA, chiến lược có thể giao dịch cả hai chiều chỉ dựa trên tín hiệu breakout của Donchian Channel.
Điều kiện vào và thoát lệnh:
Vào lệnh Mua:
Giá đóng cửa > Biên trên Donchian Channel
VÀ SMA(200) dốc lên, nếu bật bộ lọc SMA
VÀ tín hiệu xuất hiện trong khung giờ giao dịch
VÀ chiều giao dịch cho phép lệnh Mua
Thoát lệnh Mua:
Cắt lỗ: 10 điểm từ giá vào lệnh
Chốt lời: 20 điểm từ giá vào lệnh, nếu bật
Có tín hiệu breakout ngược chiều
Đảo chiều khi xuất hiện tín hiệu Bán hợp lệ
Tự động đóng lệnh khi hết khung giờ giao dịch
Vào lệnh Bán:
Giá đóng cửa < Biên dưới Donchian Channel
VÀ SMA(200) dốc xuống, nếu bật bộ lọc SMA
VÀ tín hiệu xuất hiện trong khung giờ giao dịch
VÀ chiều giao dịch cho phép lệnh Bán
Thoát lệnh Bán:
Cắt lỗ: 10 điểm từ giá vào lệnh
Chốt lời: 20 điểm từ giá vào lệnh, nếu bật
Có tín hiệu breakout ngược chiều
Đảo chiều khi xuất hiện tín hiệu Mua hợp lệ
Tự động đóng lệnh khi hết khung giờ giao dịch
Tuyên bố rủi ro:
Giao dịch hợp đồng tương lai có mức độ rủi ro cao và giá có thể biến động mạnh. Script này chỉ phục vụ mục đích tham khảo, nghiên cứu và kiểm thử. Người dùng cần hiểu rõ giao dịch phái sinh, khẩu vị rủi ro cá nhân và logic của chiến lược trước khi áp dụng vào giao dịch thực tế.
Mọi quyết định đầu tư thuộc trách nhiệm của người dùng. DNSE không chịu trách nhiệm cho bất kỳ khoản lỗ nào phát sinh từ việc sử dụng chiến lược này trong giao dịch thực tế. Hiệu quả trong quá khứ không đảm bảo kết quả trong tương lai.
Strategy

MTF Trend Context
MTF Trend Context is a decision-support panel that answers one question before you trade: does the current context allow a trade at all? It does not generate entry signals — it tells you when trend alignment, trend strength, distance from value, volatility and time of day justify looking for one, and tells you to stand aside the rest of the time.
WHAT IT DOES
It reads the trend on your chart timeframe plus two higher timeframes and condenses everything into a single verdict at the bottom of the panel:
🟢 LONGS ONLY — all three timeframes aligned up and the market is trending
🔴 SHORTS ONLY — all three timeframes aligned down and the market is trending
🟡 STRETCHED — WAIT PULLBACK — aligned, but price is too far from VWAP to chase
🟡 CONFLICT — WAIT — timeframes disagree
⛔ RANGE — NO TRADE — ADX below threshold
⛔ OFF HOURS — NO TRADE — outside your personal trading window (optional filter)
HOW IT WORKS
Trend score per timeframe: three conditions worth ±1 each — price vs fast EMA (20), fast EMA vs slow EMA (50), and price vs session VWAP. A full score on the chart timeframe plus agreement on both higher timeframes is required for alignment. Higher timeframes are picked automatically (5m → 15m + 1h, 15m → 1h + 4h, etc.) or set manually. On daily and higher timeframes the VWAP component is excluded automatically and the maximum score adjusts accordingly.
Range filter: when ADX on the chart timeframe is below the threshold (default 20) the verdict is forced to RANGE regardless of alignment. Trend strength is shown as a 5-block bar (ADX 10 → empty, ADX 40 → full).
Stretched price (anti-FOMO): the session VWAP is anchored to the daily session open (on CME futures, the 18:00 ET Globex open) with ±1σ and ±2σ bands. Beyond 2σ the price is considered stretched and the verdict switches to WAIT PULLBACK.
Volatility with a time-of-day baseline: the current ATR is compared against its own average at the same time of day over the last N sessions (default 10), not against a flat rolling average. Intraday volatility is strongly seasonal — a flat average would make quiet sessions such as Asia read "low" permanently. 100% = normal for this time of day. It needs roughly N sessions of chart history to fill in.
Daily levels: previous day high, low, close and the current session open, drawn only for the current session with optional name labels. The panel shows the nearest level, its distance and direction, and warns when a level sits in the way of a trade.
Trend age: bars since the current alignment started, classified as young / mature / late, so you know whether you are early or chasing.
Trading-hours filter (optional): define your own window and timezone; outside it the verdict is NO TRADE and all alerts are muted.
Session row: shows whether Asia, London or New York is active.
NON-REPAINTING
Higher-timeframe readings use the last CONFIRMED higher-timeframe bar (request.security with a offset and lookahead), so the values shown on historical bars are exactly what you would have seen live. The cost is one higher-timeframe bar of lag; the benefit is an honest history.
ALERTS
Three alert conditions — traffic light GREEN (longs), traffic light RED (shorts), and entering RANGE — plus matching alert() events, so a single alert with "Any alert() function call" covers everything. Recommended trigger: "Once per bar close".
SETTINGS
Every chart element (EMAs, EMA cloud, VWAP line and bands, stretched-zone fill, level lines and labels) has its own visibility toggle, color and width. Panel rows can be hidden one by one; panel position and text size are configurable.
NOTES AND LIMITATIONS
Designed with CME index futures on intraday charts in mind; works on any symbol, but on 24/7 markets the "day" follows the exchange's daily bar.
Defaults are tuned for 5-minute charts. On quiet sessions consider lowering the ADX threshold to 17–18.
This is a context filter, not a strategy. It does not tell you where to enter or exit, and a green or red verdict is not a prediction about any individual trade. Indicator

Sphinx Key Levels DOL Graded Supply & DemandA draw-on-liquidity (DOL) map that plots the reference levels price is drawn toward, then builds supply and demand zones ONLY at those levels using an ICT-style delivery sequence. The aim is confluence by construction: rather than printing supply/demand everywhere, a zone can only exist where a tracked liquidity level was actually raided.
What it plots
Liquidity levels (each toggleable): prior day, week and month highs/lows; prior Asia and London session highs/lows; and the overnight high/low. Nearby levels are merged into a single graded band so the chart stays readable, and untested ("naked") levels are weighted up, since unswept liquidity tends to act as a stronger magnet.
Equilibrium references, kept separate from liquidity: midnight, 08:30 and 09:30 opens, plus optional weekly and monthly opens. A compact table reads price as premium or discount against each open.
Opening gaps: NDOG (new day) and NWOG (new week), drawn at their true range with a consequent-encroachment midline.
How the zones are built
For each enabled level, the script runs a four-step sequence:
Sweep - price trades through the level, raiding the short-term liquidity resting beyond it.
Reclaim - price closes back on the origin side within a set window, rejecting the raid.
Order block - the last opposite-close candle into the swept extreme is marked as the zone, optionally extended to the swept wick so a protective stop can sit beyond the raided liquidity.
Displacement - a fair value gap must form in the move away from the level to validate the zone. No FVG within the window, no zone. This step can be turned off to draw on the order block alone.
A high-type level that is swept and reclaimed produces a supply zone; a low-type level produces a demand zone. Only enabled level types generate zones, so selecting, for example, only prior day high/low restricts zones to those two levels. Each level holds one live zone at a time. A zone is mitigated when price closes through its far side, and by default a zone expires when its underlying level rolls to a new session, so a zone only remains on the chart while a live level of that type stands behind it.
Alerts
Three conditions: a new zone forms, price enters an active zone, and a zone is mitigated.
Notes
Higher-timeframe values use confirmed prior-period data and do not repaint after a bar closes. Zone detection runs on the live bar by default, so a forming zone can update until that bar closes and is fixed on close; an option is included to confirm zones only on closed bars for users who prefer no intrabar movement. Session times are New York based. Built for intraday index futures on sub-hourly charts; other symbols and timeframes will need the sweep and displacement windows retuned.
This is an analysis and context tool. It does not place orders and makes no performance claims. Indicator

Indicator

Indicator

Pymander's EZ Momentum Matrix**Pymander’s EZ Momentum Matrix** is a responsive momentum oscillator designed to help traders measure directional strength, identify potential momentum shifts, and confirm whether price is moving with or against the broader trend.
The main oscillator compares fast and slow price movement, adjusts the result for current market volatility, and smooths the output into an easy-to-read wave. When the oscillator is rising, bullish momentum is strengthening. When it is falling, bearish momentum is gaining control.
The indicator also includes a separate **Trend Matrix** that analyzes momentum, price position, and trend structure using a series of double-smoothed moving averages. This helps distinguish strong directional movement from weaker or neutral market conditions.
Key features include:
* Rising and falling momentum visualization
* Overbought and oversold reference zones
* Bullish and bearish extreme-turn signals
* Trend Matrix showing bullish, bearish, or neutral conditions
* Confluence signals when oscillator momentum aligns with the broader trend
* Optional glow and gradient-fill effects
* Adjustable sensitivity, speed, smoothing, and trend settings
* Alerts for confluence and extreme momentum turns
Diamond signals appear when momentum direction and the Trend Matrix become aligned. Circle signals identify potential turns from overbought or oversold conditions.
What sets EZ Momentum Matrix apart from a traditional oscillator is that it does not rely on momentum alone. It combines momentum strength, momentum direction, trend confirmation, and price location into one clear visual tool. This can help traders confirm entries, avoid fighting strong trends, recognize weakening momentum, and better understand who currently has control of the market.
As with any indicator, use EZ Momentum Matrix alongside proper risk management, market structure, and a tested trading plan. No indicator can guarantee profitable results.
Best of luck with your trading. Stay patient, remain disciplined, and protect your capital.
— **Pymander**
Indicator

Adaptive Regression Breakout Map | GainzAlgoThe Adaptive Regression Breakout Map (ARBM) is an advanced volatility and trend-tracking system designed to identify periods of extreme market compression and automatically map out high-probability breakout trades.
Rather than relying on traditional lagging indicators, ARBM utilizes a continuous statistical baseline to measure market "squeezes." Once a breakout is confirmed, the indicator shifts from analysis into execution mode, drawing a dynamic visual map on your chart that outlines precise Entry, Stop Loss, and Take Profit (TP1, TP2, TP3) levels, complete with automated trailing stop logic and a live performance dashboard.
How It Works
At its core, the ARBM operates on a dual-engine architecture:
Statistical Compression (The Squeeze): The script calculates a rolling linear regression baseline and wraps it in standard deviation bands. It continuously measures the width of this channel and compares it to a historical lookback period. When the bandwidth drops into a historically low percentile, the bands change color, signaling that the market is in a "squeeze" and building energy for a move.
Auto-Trendlines: Alongside the statistical bands, the script plots dynamic, auto-trendlines across recent pivot highs (cyan) and lows (magenta). These holographic lines track geometric compression and leave a visual history on the chart.
The Breakout Trigger: A signal is generated when the price violently escapes either the statistical standard deviation bands or the geometric auto-trendlines while the market is in a confirmed contraction state.
Dynamic Trade Mapping: Upon a breakout, the script calculates targets based on the volatility (bandwidth) at the time of the breakout. It plots the trade directly on your chart and actively trails the stop loss as targets are hit.
The Settings and Selections
The indicator is highly customizable, divided into four primary control groups:
Regression Model:
Regression Length: The lookback period for the linear regression baseline.
Deviation Multiplier: The width of the statistical bands (similar to Bollinger Bands).
Contraction Metrics:
Lookback Period: How far back the script looks to determine if the current channel is historically narrow.
Contraction Threshold %: The percentile the bandwidth must drop below to trigger a "squeeze" state.
Target Architecture:
TP1, TP2, TP3 Multipliers: Determines how far away your take profit targets are, dynamically scaled by multiplying the width of the channel at the time of the breakout.
Trendlines Overlay:
Show Holographic Trendlines: Toggle the geometric trendlines on or off.
Pivot Length: Determines how sensitive the script is when identifying the swing highs and lows used to draw the trendlines.
How to Use It
Trading with the ARBM is highly visual and systematic:
Wait for the Squeeze: Watch the regression channel. When the bands turn gray, volatility has compressed, and the market is consolidating.
Wait for the Signal: Look for a "Breakout, Long" or "Breakout, Short" label to appear. This confirms price has broken structure with momentum.
Follow the Map: The script will immediately draw your Entry (Blue), Stop Loss (Red), and three Take Profit targets (Green dashed lines).
Manage the Trade: The indicator handles trade management visually.
When TP1 is hit, the Stop Loss line automatically moves to your Entry price (Breakeven), and a label confirms the trail.
When TP2 is hit, the Stop Loss trails to TP1.
When TP2 is hit, the Stop Loss trails to TP1.
The trade closes entirely if TP3 or the trailing stop is hit. (Note: Hitting TP1 secures a win for the system's tracking, even if the remainder is stopped out at breakeven).
Monitor Performance: A stylized dashboard in the top right corner tracks the total number of signals, the historical Win Rate, and the Trade-by-Trade Sharpe Ratio, allowing you to quickly validate the settings for any given asset or timeframe.
Final Thoughts
The Adaptive Regression Breakout Map removes the guesswork from breakout trading. By combining continuous statistical volatility tracking with futuristic geometric trendlines, it mathematically identifies when a market is ready to move. Furthermore, by drawing the exact risk-to-reward parameters on the chart and tracking its own historical performance, it forces strict risk management and objective trade execution.
Indicator

Volatility Drag OscillatorVolatility Drag Oscillator — what is holding exposure costing you, and what does leverage do to it?
Compound growth is g = μ − σ²/2; under leverage, g(L) = L·μ − L²·σ²/2. Return scales with L, drag scales
with L² — which is the whole reason leverage does not raise your probability of success. Volatility is
estimable in hundreds of bars; drift needs decades. So this tool measures only the knowable half:
- DRAG = σ²/2 annualised (Yang-Zhang by default; Close-to-close / Parkinson / Garman-Klass /
Rogers-Satchell selectable to see estimator disagreement = gap-risk information), EWMA-smoothed and
ranked into a percentile so you know if today is a cheap or expensive time to hold.
- DRAG DECOMPOSITION — realised drag split into its exact cumulant pieces: variance (σ²/2) + skew +
excess-kurtosis, shown as "σ² · skw · tail" in %/yr. A fat-tail warning tells you HOW MUCH of your
drag is tails, not just that they exist — and it compares realised drag to its own Gaussian part, so
it can't be fooled by estimator choice.
- LEVERAGE CURVE — drag at 1×/2×/3×, plus break-even L_be = 2μ/σ² and Kelly = μ/σ², shown ONLY as
conditionals on an edge YOU enter. The script never estimates drift, and says why.
READ IT how you like: a familiar 0-100 percentile OSCILLATOR in the pane (cheap<20, expensive>80,
midline 50, like an RSI of holding-cost), or the absolute drag %/yr line. On price, a heat-RIBBON and
green/red regime triangles show cheap→expensive to hold — VOLATILITY regime, direction-agnostic. A red
marker means "expensive, size down", never "go short".
No directional claim and no backtest — there is nothing here to fit. Descriptive risk context, not advice.
Leverage magnifies losses; this shows one cost of it, not all risks. Indicator

NY Open Range Gap Reversal (M1D)M1D NY Open Range Gap Reversal
OVERVIEW
A reference and marking tool for the New York Regular Trading Hours (RTH) opening gap. It maps the price and time levels of the classic open-gap "manipulation then reversal" sequence so a discretionary trader can read the session at a glance. It draws levels and flags conditions on closed bars — it does not place orders, produce buy/sell calls, or predict outcomes.
THE IDEA
At the 09:30 ET cash open a gap frequently forms between the prior session's 16:15 ET RTH close and today's open. That gap often produces an early "judas swing": a first push off the open that raids liquidity, fails, and reverses back through the gap toward a gap-fill draw. This indicator frames that sequence with objective, repeatable levels and time windows so the read is consistent from day to day.
WHAT IT DRAWS
- RTH Open (True Day Open) line, annotated with the day's gap size and direction.
- Opening-gap retracement levels at 25%, 50% (the primary draw, emphasised), 75%, and 100% (full fill = the prior RTH close).
- Shading of the 09:30-10:00 gap-fill window and a 10:00 checkpoint line.
- Opening Range high and low (first N minutes of RTH; default 30).
- Liquidity Sweep flag when the opening-range extreme is taken and price closes back inside (the manipulation leg).
- SMT divergence flag against two correlated index futures (default YM and ES), pivot-based. Each flag names which comparison index diverged (e.g. "SMT - YM"), so a one-sided divergence is distinguishable from both indices disagreeing.
- An info panel showing gap size, live gap-fill percentage, a countdown to the RTH close, the day's directional bias, and which SMT comparison symbols are in play.
- Right-margin labels that sit within a configurable ATR distance of each other are merged into one line of text instead of overlapping illegibly.
HOW IT WORKS
Session handling uses the exchange clock in the America/New_York timezone, so it is daylight-saving safe with no fixed offset. The gap is measured from the prior RTH session's 16:15 ET futures close to the current 09:30 ET open; the electronic/Globex 17:00 ET close is intentionally not used. Directional bias is derived from gap direction: a gap up frames a bearish fade toward the fill, a gap down frames a bullish fade. The Sweep and SMT modules only evaluate on days whose gap is at or above a configurable minimum. The minimum can be expressed as a multiple of the previous day's ATR (the default, 0.15, so the threshold scales with each instrument's own volatility), as a percentage of price, or in raw points. Both modules arm only after the opening range locks (SMT pivot history is still tracked through the range, so the first pivot after the lock has a same-session reference; an input allows SMT inside the range). By default an SMT flag requires BOTH comparison symbols to fail to confirm the chart's pivot; an input relaxes this to either one. A comparison symbol that tracks the same index as the chart cannot diverge from it, so that leg is automatically excluded and the info panel reports which symbols remain active. Line and label activity (extension and new Sweep/SMT detection) stops at a configurable cutoff (default 11:30 ET) and resumes automatically at the next session's open; the info panel is unaffected and keeps updating through the close. All detection is evaluated on bar close (barstate.isconfirmed) to avoid repainting, and prior-day drawings are removed at the 16:15 ET boundary so nothing carries into the next session.
HOW TO USE IT
Apply to CME equity-index futures (for example MNQ/NQ, MES/ES, MYM/YM) on an intraday execution timeframe such as 1-5 minute. Read the levels as context: the gap-fill levels are potential draws, the opening range and its sweep mark the manipulation leg, and the SMT flag marks a confirming (or diverging) move in the correlated indices. The trader decides where and how to act — the script does not mark an entry. Every module, colour, time window, label size, and the SMT symbol pair are adjustable in the settings.
INPUTS
Grouped controls for session times, the gap minimum (ATR-relative, percent, or points) and which fib levels to show, opening-range length, timing references, and the Sweep / SMT modules (symbol pair, pivot length, both-or-either divergence, bias filter). Every drawn line and label has its own colour, line style, and label text, on top of global controls for the brand colours, line width, label size, right-margin offset, and info-table position.
NOTES
- This is an indicator, not a strategy: it does not generate orders, alerts to enter, or performance results.
- It evaluates conditions on closed bars and does not repaint.
- Descriptions of how gaps have tended to behave are informational, not predictive.
DISCLAIMER
This script is provided for educational and informational purposes only. It is not financial advice and is not a recommendation to buy or sell any instrument. Trading futures carries a substantial risk of loss. Past behaviour is not indicative of future results. You are solely responsible for your own trading decisions. Test thoroughly before relying on it in any live environment. Indicator

Indicator

Reversal Scalper 2.0- Adib NooraniReversal Scalper - Smoothed Stoch & ATR Trend Filter
Hey everyone, I originally put this script together to help me scalp XAUUSD and Indian equities on lower timeframes, specifically to solve a problem I was having with standard momentum oscillators.
We all know the main issue with using a regular Stochastic for scalping: it’s great for spotting exhaustion, but when a strong trend kicks in, the oscillator just stays pegged in the overbought or oversold zones. If you try to trade those reversal signals blindly, you just get run over by the trend.
To fix this, I created a mashup that combines a smoothed Stochastic with a custom ATR-based structural trend ribbon. The whole point of combining these two indicators is to use the ATR bands to define the actual market structure, and only take the Stochastic reversal signals when the trend filter confirms that the push is actually exhausted.
How the math works:
First, the bottom oscillator (what I call the Reversal Strength Meter) is based on a standard 8-period Stochastic. But to cut out the erratic noise you usually get on the 1m or 5m charts, I ran it through a 5-period Simple Moving Average. It gives a much cleaner read on momentum.
Second, the background trend filter uses a long-term ATR (100-period, halved) multiplied by a deviation factor (default is 3). The script looks back at recent swing highs and lows to project a volatility channel. I linked this channel to the bar colors so you don't need to look at messy lines on your chart.
How to trade with it:
If the price breaks hard outside the ATR channel, the candles change color (white for a strong push up, black for a strong push down). When you see this, it means the trend is expanding—do not look for reversals, even if the Stochastic is at an extreme.
For Longs: Wait for a strong downward push that turns the candles black. Let the smoothed Stochastic dip below the 20 level. You only enter long when the candles go back to their normal color (showing the structural selling pressure has stopped) AND the stochastic crosses firmly back up above 20.
For Shorts: Wait for a bullish push that turns the candles white. Let the stochastic ride up above 80. Your short trigger is when the candles return to normal and the stochastic crosses back down below 80.
I left the inputs open so you can adjust the Stochastic lengths and the ATR deviation factor depending on what timeframe or asset you are trading. Hope this helps you guys filter out the fake outs. Indicator

Session Seasonality Deviation [MarkitTick]💡 A highly advanced analytical framework meticulously engineered to quantify, measure, and visualize volatility anomalies within specific, localized trading windows. By programmatically isolating price action strictly to predefined market hours—such as the London or New York opens—this tool establishes an objective statistical baseline of expected market movement based exclusively on historical day-of-the-week performance data. Rather than relying on lagging continuous averages, this mathematical model detects the precise moment a market transitions from baseline activity into statistically significant expansion or compression, providing an objective lens through which to view true price dynamics.
● ✨ Originality and Utility
Traditional volatility metrics and bands typically analyze continuous price data streams, inadvertently blending distinct, structurally different trading periods into a single, homogenized moving average. This generalized approach inherently degrades the accuracy of volatility forecasting. The core utility of the SSD indicator lies in its targeted isolation of distinct market sessions, mathematically acknowledging the reality that a Tuesday London session behaves with entirely different liquidity parameters than a Friday New York session.
By creating an isolated historical distribution for each specific day of the week, this tool offers a highly accurate, predictive baseline for expected volatility that adapts to the calendar. Furthermore, the integration of structural price action filters ensures that these statistical anomalies are always correlated with actual market mechanics, elevating the tool beyond simple moving average bands and providing a robust, multidimensional analysis of market intent.
● 🔬 Methodology and Concepts
This script operates on a sophisticated confluence of statistical profiling and structural market analysis, creating an unyielding logic engine designed to filter market noise.
Time-Series Stratification: The underlying logic initiates by isolating raw price data exclusively within a user-defined temporal window. It captures the extreme upper and lower boundaries of this session, establishing the true operational range and discarding irrelevant data from inactive hours.
Day-of-Week (DOW) Seasonality Profiling: Rather than utilizing a generic rolling lookback of consecutive calendar days, the algorithmic engine stores and categorizes historical session ranges based on the specific day of the week. It builds an independent, localized statistical distribution for each day, calculating the mean average range and the variance of those specific historical instances.
Standardized Deviation (Z-Score) Engine: The primary mathematical trigger relies on a rigorous Z-Score calculation. It compares the current session's confirmed range against the historical DOW average, divided by the established standard deviation. This quantifies exactly how far the current volatility deviates from the empirical historical norm.
Structural Confluence and Market Character: To prevent the system from acting on anomalous volatility that lacks definitive directional intent, the logic engine requires a structural confirmation. It evaluates recent high and low boundaries, demanding that the closing price breaches these structural bounds to validate the statistical signal and confirm a genuine shift in market character.
● 🎨 Visual Guide
The visual interface is precision-engineered for rapid cognitive interpretation of complex statistical states, designed to relay critical data without cluttering the charting canvas.
Dynamic Heatmap Candles: The primary price action is overlaid with a responsive heatmap. Candlesticks are colored dynamically to reflect the internal bias of the active session, providing an immediate visual cue of the dominant buying or selling pressure.
Average Range Bounds: Subtle, non-intrusive bracketing lines are plotted symmetrically around the session open, projecting the historical average range. This creates a visual baseline for expected session expansion, allowing the user to see when price escapes the statistical norm.
Actionable Trade Levels: Upon the generation of a confirmed signal, the tool plots projected Entry, Stop Loss, and multiple Take Profit coordinates. Chart labels are meticulously configured to display raw value strings without percentage signs, ensuring a clean, distraction-free presentation of critical price levels.
Analytical Heads-Up Dashboard: A sophisticated data table is rendered on the chart, centralizing key real-time metrics. It details the active session, current directional bias, real-time Z-Score, Sample Size validity, and structural state. The dashboard is explicitly designed to display a matching, comprehensive evaluation of both long and short transaction outcomes, ensuring a perfectly balanced view of all potential market trajectories.
● 📖 How to Use
Interpreting the output of this tool requires a methodical, step-by-step approach, focusing heavily on the intersection of statistical deviation and structural shifts.
Monitor the on-chart dashboard for the Z-Score to definitively exceed the user-defined deviation threshold, which serves as the primary indicator of a statistically significant expansion in volatility.
Verify the directional bias of the current session using the Heatmap Candles and ensure this localized momentum aligns with the broader, macro market structure.
Wait for a confirmed structural breach signal that perfectly matches the directional bias of the initial statistical deviation, ensuring momentum is backed by actual price displacement.
Utilize the automatically plotted Trade Action Levels for strict risk management. The Stop Loss is dynamically calculated based on historical variance, and Take Profit levels offer scaled, mathematically logical target zones.
Exercise extreme caution and avoid executing signals during periods of severe price compression, or when the dashboard indicates that the sample size of historical data is insufficient to form a mathematically reliable statistical distribution.
● ⚙️ Inputs and Settings
The configuration panel is categorized logically to allow for the precise, modular tuning of both the statistical engine and the visual outputs.
Core Settings: Select the target session (Asia, London, New York) and define the lookback period for the seasonality model. Adjust the precise Deviation Threshold (Z-Score limit) to control the strictness and sensitivity of the generated signals.
Filters: Toggle specific confirmation layers, including the minimum required historical sample size, minimum expansion criteria, and specific structural requirements necessary to validate a move.
Trade Tools: Calibrate the multiplier values for the dynamically calculated Stop Loss and Take Profit levels, allowing the user to seamlessly align the tool with their individual risk parameters and payout models.
Visuals and Dashboard: Customize the display properties of the heatmap candles, the average range bands, and the spatial positioning of the analytical dashboard to suit personal workspace preferences.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The theoretical foundation of this analytical tool is deeply rooted in advanced Quantitative Finance, specifically drawing upon the established principles of Volatility Clustering and the Day-of-the-Week Anomaly. Academic literature frequently notes that financial markets exhibit leptokurtic distributions, wherein volatility is not a constant force but rather clusters densely in specific, predictable temporal windows. By employing a variance measurement technique akin to Standardized Moments, the script effectively normalizes session volatility.
This process allows the underlying algorithm to objectively classify current price action relative to an empirical baseline, entirely removing subjective human bias from the equation. Furthermore, the integration of structural pivot analysis introduces a deterministic filter to an otherwise probabilistic model. This synthesis ensures that statistical outliers are only deemed actionable when they are accompanied by a verifiable, measurable shift in the underlying supply and demand equilibrium.
⚠️ 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. Indicator

Adaptive Confluence Oscillator [ForexCracked]🔵 OVERVIEW
The Adaptive Confluence Oscillator scores four independent read-outs of the market on a continuous scale, weights them according to the current market regime, and plots the result as a single 0 to 100 line. Instead of asking "do my indicators agree, yes or no," it asks "how strongly does each one agree, and which of them should I be listening to right now."
It has no fixed overbought or oversold levels. The bands are calculated from the oscillator's own recent behaviour, so they widen when the market gets volatile and tighten when it goes quiet.
Signals confirm on candle close and do not repaint.
🔵 WHY THIS IS BUILT THE WAY IT IS
Most multi-indicator tools take a vote. RSI is oversold or it is not. That throws away most of the information: an RSI of 29 and an RSI of 12 are not the same signal, but a vote counts them identically. It also treats every indicator as equally relevant at all times, which is plainly false. Stochastic exhaustion means one thing in a strong trend and the opposite thing in a range.
This oscillator fixes both problems. Every component returns a continuous score, and the market regime decides how much each score is worth.
🔵 THE FOUR COMPONENTS (each scored from -1 to +1)
• Trend: how far price sits from its baseline EMA, measured in ATR units rather than in price. Distance matters, not just which side of the line you are on. Because it is measured in ATR, it reads the same on gold as it does on EURUSD.
• Momentum: RSI recentred around 50, so it contributes proportionally instead of flipping at a threshold.
• Impulse: the MACD histogram converted to a z-score against its own rolling deviation. This makes MACD comparable across symbols and timeframes without ever re-tuning it, which raw MACD values are not.
• Stretch: the Stochastic, recentred. This is the component that changes behaviour with regime (see below).
🔵 THE REGIME SWITCH (the part that makes it adaptive)
ADX decides whether the market is trending or ranging, and that changes two things.
First, the weights re-balance:
• Trending: Trend 0.35, Momentum 0.25, Impulse 0.30, Stretch 0.10
• Ranging: Trend 0.15, Momentum 0.25, Impulse 0.20, Stretch 0.40
Second, and more importantly, the Stretch component flips sign. In a trend, a stretched Stochastic confirms the move and pushes the score further in that direction. In a range, the same reading argues for a fade and pushes the score the other way. This is the behaviour a discretionary trader applies without thinking about it, and it is what a fixed vote cannot express.
🔵 ADAPTIVE BANDS
There are no 70/30 lines here. The upper and lower bands are the rolling mean of the oscillator plus and minus a multiple of its own standard deviation. A reading of 68 can be an extreme in a quiet market and completely unremarkable in a volatile one, and the bands reflect that.
• BUY: the score crosses above the upper adaptive band
• SELL: the score crosses below the lower adaptive band
🔵 DIVERGENCE
The script finds pivots on the score itself and compares them against price at those same bars. When price makes a higher high but the score makes a lower high, that is marked as a bearish divergence, and the mirror case as bullish. Divergences are labelled and have their own alerts. Because a divergence is anchored to a confirmed pivot, it prints a few bars after that pivot forms and never moves once printed.
🔵 THE DASHBOARD
The panel shows each component's live score, its current weight, the detected regime with the ADX value, and the oscillator against its adaptive bands. You can see exactly which component is driving the reading and why, rather than trusting a black box.
🔵 SETTINGS
• Baseline EMA 34, ATR 14, Trend Span 2.0 x ATR
• RSI 14, MACD 12/26/9, Stochastic 14
• ADX 14, trending above 22
• Band lookback 100, band width 1.0 x standard deviation
🔵 HOW TO USE
• Take signals where the dashboard regime agrees with the direction. A BUY in a trending regime is a continuation. A BUY in a ranging regime is a fade off the bottom of the range.
• Treat a divergence as a warning to tighten or take partials, not as a standalone entry.
• Raise the band width above 1.0 for fewer and stronger signals, lower it for more.
• Widen Trend Span on noisy symbols so ordinary volatility does not read as trend.
⚠️ DISCLAIMER
This is an analysis tool, not a prediction. A confluence score is a measure of agreement, and indicators can agree and still be wrong. Results depend on market conditions, settings, and your own execution and risk management. Shared for educational and research purposes. Not financial advice. Indicator

Volatility Jump DetectorVolatility Jump Detector
This tool marks structurally significant price moves and tells you what kind of move each one was. It is an event detector, not a signal — it does not predict direction. It answers "did something real just happen here, and what was behind it?"
HOW JUMPS ARE DETECTED
Most "big candle" indicators compare a move to an ordinary volatility estimate, which has a circular flaw: a large jump inflates the very volatility measure used to judge it, so the biggest moves look less exceptional than they are.
This uses bipower variation (Barndorff-Nielsen and Shephard; Lee and Mykland), which builds the local volatility estimate from products of adjacent absolute returns. That construction is insensitive to a single large move, and it is computed excluding the current bar — so a jump cannot inflate its own threshold. A move is flagged when it exceeds a chosen multiple of that robust volatility, and the panel reports the exact sigma reading.
TWO INDEPENDENT CONTEXT AXES
INTENSITY — Is the recent jump rate elevated versus its own long-run baseline? Reported as a multiple with the underlying counts always visible, so you can see the sample behind the verdict. Note on method: a Hawkes branching-ratio estimate was implemented first and dropped. At a 4-sigma threshold real data yields only a handful of jumps per few hundred bars, far too few for count-variance statistics — it returned zero on every timeframe tested. A plain rate comparison is what sparse events can actually support, and below a minimum count the reading honestly says "insufficient" rather than printing a fabricated number.
VOLUME — Was the jump backed by participation, or did it slip through a thin book? A large move on heavy volume and the same move on nothing are different events. Auto-disables on instruments without a volume feed.
Optionally link the Risk & Levels Cockpit's exported levels, and jumps that fire through your invalidation level or at the point of control are flagged.
ON THE CHART
Direction-aware triangles mark each jump, colored by the intensity regime at that moment. The most recent jump is labelled with its sigma reading and volume tag. The background tints when jump intensity is elevated. The panel adapts to your chart theme and colors each row by meaning.
WORKS ON ANY MARKET AND TIMEFRAME
All lookbacks are in bars with no session, expiry, or clock anchors. Non-repainting: the robust volatility estimate excludes the current bar, and everything confirms at close.
LIMITATIONS
Not a signal and not investment advice. This marks events and describes them; it does not forecast what follows. An earlier version classified jumps as "ignition" versus "exhaustion" and measured the forward tendency of each — the measured continuation and reversal rates sat at base rate, so that classification was removed rather than kept as decoration. Jump detection depends on the threshold you choose; a lower threshold marks more moves and dilutes significance. Intensity needs a long baseline window because jumps are rare, and reports "insufficient" when the count is too low. Volume confirmation requires a volume feed.
CREDITS
Original implementation. Barndorff-Nielsen and Shephard bipower variation; Lee and Mykland (2008) jump test; jump-rate intensity comparison. Indicator
