Range Detector [NJ]✧ OVERVIEW ✧
Range Detector identifies and highlights potential ranging market structures using pivot highs and lows combined with a two-stage confirmation process.
Confirmed ranges are displayed as boxes and remain active until price closes beyond the allowed tolerance.
✧ SETTINGS ✧
Range Tolerance %
Controls how far price may close beyond the range before it is invalidated.
Range First Confirmation %
Controls the first retracement required after both range boundaries have formed.
Range Second Confirmation %
Controls the second reversal required after the first confirmation.
Bars to Confirm the Range
Controls how long the current candidate structure may remain unconfirmed before it expires.
Pivot High/Low Lookback
Controls pivot sensitivity. Lower values detect smaller and more frequent swings, while higher values focus on larger market structures.
✧ HOW IT WORKS ✧
Range Formation
The indicator uses pivot highs and lows to define potential range boundaries. Newer same-side pivots may replace earlier ones until both boundaries are established.
Two-Stage Confirmation
A range is confirmed only after two rotations.
With the default 70% / 50% settings:
High → Low: price retraces 70% toward the high, then returns to 50%.
Low → High: price retraces 70% toward the low, then returns to 50%.
Range Invalidation
The range remains active until price closes beyond a boundary by more than the selected tolerance, measured as a percentage of the range height.
Candidate Timeout
Unconfirmed candidates must complete the confirmation sequence within the selected number of bars. Otherwise, they are discarded. The timer may restart if a newer same-side pivot replaces the current candidate.
✧ VISUALIZATION ✧
Once confirmed, the range is displayed as a box between its upper and lower boundaries.
The box is drawn retrospectively from the earliest pivot used to form the range and extends forward until the range is invalidated.
Because pivot highs and lows require future bars to be confirmed, the beginning of a range can appear several bars before the indicator could have known that the pivot was valid in real time.
✧ USAGE ✧
Range Detector can be used to identify areas of:
Sideways price action
Consolidation
Mean-reversion conditions
Support and resistance
Potential breakout structures
The detected zones can provide additional market structure context for range trading, breakout analysis, or filtering trend-following setups.
As with any technical indicator, it is best used alongside other forms of analysis rather than as a standalone entry or exit signal. 指标

Multi Session ORBORB NQ — Asia / London / NY Break + Reject
Multi-session Opening Range indicator for NQ (and other futures). It builds a short opening-range box for Asia , London , and New York , then marks breakouts and rejections of those boxes.
Sessions (ET, adjustable)
- Asia: 18:00–03:00
- London: 03:00–09:30 (stops when NY starts so boxes do not stack)
- New York: 09:30–16:00
The first N minutes of each session (default 15) become that session’s OR zone. Color and opacity are in settings.
Signals
- SELL (▼ above the candle): price rejects the OR high and closes back inside, or closes out the OR low (breakdown).
- BUY (▲ below the candle): price rejects the OR low and closes back inside, or closes out the OR high (breakout).
Turn Show BUY / SELL text on if you want the words on the markers.
How to read it
1. Wait until the OR window finishes (shaded build column).
2. Rejection = tap the edge, close back inside → fade that side.
3. Breakout = close beyond the box by the minimum points setting → go with that side.
4. First signal per side per session is the default (can be turned off).
Use 1m or 5m . On 15m the “15-minute OR” is a single candle, so signals will not match the 1m chart.
Useful settings
- OR length, wide-OR warning, min breakout distance
- Zone colors / opacity / show-hide per session
- VWAP filter (off by default)
- Reject buffer and optional wick filter
- Session open/close hours
- Alerts: buy breakout, sell breakdown, sell reject high, buy reject low
Not included
This is an indicator, not a strategy. No auto size, stops, or day P&L. You place and manage trades yourself.
Note
signals can be wrong sometimes
LSE cash actually runs until 11:30 ET. London’s box is cut at 09:30 ET on purpose so it does not cover the NY zone. Set London close to 11:30 if you want the real cash overlap. 指标

Bolly Breakout AlertsBolly Breakout Alerts is a simple session-based Bollinger Band breakout indicator designed for 5-minute trading setups.
It monitors for a confirmed candle close above the upper Bollinger Band or below the lower Bollinger Band, then allows alerts to trigger only during the selected trading window. This helps filter out unnecessary notifications outside the periods you actually trade. 📈
The script uses standard Bollinger Band settings:
20-period SMA
2.0 standard deviations
Close price as the source
Included features:
5-minute candle close confirmation
Long breakout alerts above the upper band
Short breakout alerts below the lower band
Combined “Either Direction” breakout alert
Separate DAX and Dow trading windows
UK time handling using Europe/London
Visual breakout markers on the chart
Session filtering to reduce unwanted alerts
Default session windows:
DAX: 06:00–08:20 UK time
Dow: 12:30–14:50 UK time
⚙️ Important setup
After adding the indicator to your chart, open the indicator settings and select the correct market for the chart you are using:
If the indicator is on a DAX chart, select DAX
If the indicator is on a Dow chart, select DOW
This is important because the selected market determines which alert time window is used.
Adding the indicator to the chart does not automatically create a TradingView alert. An alert still needs to be created manually.
Open TradingView’s alert setup and select Bolly Breakout Alerts as the condition, then select Bolly Breakout - Either Direction if you want to be notified when a candle closes outside either the upper or lower Bollinger Band.
For best results, set the alert frequency to Once Per Bar Close. 🔔
If you change the selected market, session times, or other indicator settings after creating an alert, it is advisable to recreate the alert so TradingView uses the updated settings.
The indicator is intended as an alerting and monitoring tool rather than a complete trading system. It does not provide stop losses, profit targets, or trade management rules.
Best used on a 5-minute chart.
⚠️ Always test alerts and session behaviour before relying on them in live trading. 指标

指标

Daily Bias Intelligence [tradewsamet]🎯 DAILY BIAS INTELLIGENCE
Daily Bias Intelligence is a statistical daily-context, historical-bias, range-analysis, intraday-state, calibration, and visualization indicator designed to help traders study how the current trading day compares with completed historical trading days.
The script is built around one central idea:
Daily bias should not be reduced to one weekday percentage or one directional signal.
A trading day develops inside several overlapping historical contexts. Today's weekday, yesterday's direction, the preceding three-day regime, recent market behavior, directional move skew, current time-of-day state, prior-day high/low interaction, range development, and session timing can all describe different parts of the same day.
Daily Bias Intelligence organizes these observations into one transparent analytical framework.
The script can:
• maintain a rolling history of completed trading days
• measure historical weekday directional behavior
• compare today's context with similar previous-day and three-day regimes
• measure recent completed-day directional behavior and Move Skew
• apply sample-size and statistical requirements before historical checks influence the main model
• combine qualified checks into a sample-weighted Daily Bias Score
• classify Strong Bullish / Strong Bearish historical-bias states
• calculate weekday P10 / P25 / P50 / P75 / P90 return distributions
• adjust historical movement for changing volatility regimes
• compare the developing day with historical days at approximately the same point in time
• track prior-day high / low behavior
• study where daily highs and lows historically formed
• measure current daily-range usage and directional streak behavior
• measure Asia / London / New York contribution by weekday
• audit strong-call and expected-range calibration
• display radar, statistics, weekday charts, day boxes, levels, and oscillator views
• provide TradingView alert conditions for important daily-context events
Daily Bias Intelligence is intended as a transparent statistical research and historical-review framework.
It is not a broker execution system, TradingView Strategy Tester, probability-of-profit model, or guarantee of future market direction.
━━━━━━━━━━━━━━━━━━━━━━
📸 CHART SNAPSHOT
━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━━━━━
📌 OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence maintains a rolling database of completed trading days and uses that history to describe the statistical environment surrounding the current trading day.
The indicator separates three different types of information:
Observed historical statistics
Examples include weekday up-day rates, prior-day break rates, session contribution, and range behavior.
Modeled context
Examples include the Daily Bias Score and statistical-significance classifications.
Developing current-day information
Examples include today's return versus the prior close, current range, today's high/low, and NOW-state comparison.
The primary interface can display:
• five-factor Bullish / Bearish Radar
• Daily Bias Score
• Strong Bullish / Strong Bearish state
• four-card Statistics Panel
• weekday directional chart and ALL-days baseline
• calibration scorecard
• P10–P90 and P25–P75 expected ranges
• weekday median and expected absolute movement
• prior-day highs and lows with break markers
• daily range boxes and result labels
• live current-day percentage
• contextual candle coloring
• Waveform, Heat Stripes, or Bar Columns
The indicator is designed to provide context before independent trading decisions rather than creating automatic trade instructions.
━━━━━━━━━━━━━━━━━━━━━━
🧠 CORE IDEA
━━━━━━━━━━━━━━━━━━━━━━
A simple daily-bias model might ask only:
How often did Monday close higher?
Daily Bias Intelligence asks several additional questions.
• What direction did the previous trading day close?
• What was the net direction of the preceding three completed days?
• What has recent completed-day behavior looked like?
• Has historical movement on this weekday been concentrated more on the upside or downside?
• Is the supporting sample large enough?
• Is the observed difference statistically separated from 50%?
• What movement distribution historically belongs to this weekday?
• What happened historically when price was in today's current state at approximately this point in the day?
• How often are prior-day highs and lows broken?
• When do the final daily high and low typically form?
• How much of a normal daily range has already been used?
The workflow is:
completed trading days
→ historical context classification
→ sample validation
→ statistical filtering
→ weighted Daily Bias Score
→ optional strong-bias classification
→ weekday movement distribution
→ live intraday context
→ historical calibration
The indicator is designed to answer:
What does the completed historical dataset say about the type of trading day currently developing?
━━━━━━━━━━━━━━━━━━━━━━
🧩 WHY THIS SCRIPT IS NOT A SIMPLE DAILY BIAS INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
A basic daily-bias tool may calculate one historical percentage and convert it directly into a bullish or bearish label.
Daily Bias Intelligence uses a layered model instead.
Historical checks first require sufficient observations.
Directional rates are then evaluated relative to a neutral reference.
Eligible observations are combined through sample-aware weighting.
Strong classifications are separately gated.
Expected movement is calculated from a weekday-specific historical distribution.
Current intraday state is then studied independently from the opening historical-bias model.
Finally, previous strong classifications and range projections are evaluated after their corresponding trading days complete.
The structure is:
historical observations
→ sample quality
→ statistical evidence
→ modeled bias
→ live context
→ later calibration
A historical observation can exist without being statistically strong.
A Daily Bias Score can lean bullish or bearish without producing a Strong Bullish / Strong Bearish classification.
A strong historical bias can still fail.
A wide expected range says nothing by itself about direction.
The script keeps these concepts separate instead of forcing every statistic into one entry arrow.
━━━━━━━━━━━━━━━━━━━━━━
⚙️ HOW THE SCRIPT WORKS
━━━━━━━━━━━━━━━━━━━━━━
The engine stores completed trading-day information in aligned historical arrays.
A stored historical day can contain:
• raw daily return
• volatility-normalized return
• trading weekday
• previous-day direction known at that day's open
• prior three-day regime known at that day's open
• raw daily price change
• Asia / London / New York contribution
• prior-day high / low break state
• high / low break hold state
• session of the final high and low
• elapsed time until the final high and low
• intraday state relative to the prior close
• completed daily range
• directional streak entering the day
When the next trading day begins, the previous day is finalized and added to the historical dataset.
The model then rebuilds the current day's statistical context from completed observations.
This means the principal historical bias model does not require today's future closing result in order to calculate today's opening context.
━━━━━━━━━━━━━━━━━━━━━━
🔷 BULLISH / BEARISH RADAR
━━━━━━━━━━━━━━━━━━━━━━
The Bullish / Bearish Radar summarizes five historical checks.
WEEKDAY
The up-day rate of completed trading days sharing today's weekday.
PREV DAY
The up-day rate of historical days whose previous day moved in the same direction as yesterday.
3D REGIME
The up-day rate of historical days whose preceding three-day net move had the same directional sign as today's regime definition.
RECENT
The up-day rate across the most recent completed-day sample.
MOVE SKEW
The share of today's-weekday absolute historical movement that occurred in the positive direction.
Radar values represent historical observed shares, not probabilities.
The five checks also overlap, so they should not be interpreted as five independent forecasts.
━━━━━━━━━━━━━━━━━━━━━━
📐 SAMPLE DEPTH & STATISTICAL FILTERING
━━━━━━━━━━━━━━━━━━━━━━
Every historical percentage carries a sample size.
Minimum Sample controls how much historical depth is required before a check can influence the primary Daily Bias Score.
Directional-rate checks use a Wilson 95% interval.
A raw rate slightly above 50% is not automatically considered statistically bullish.
The check must:
• satisfy Minimum Sample
• have its Wilson interval fully above 50%
The equivalent bearish condition requires the interval to sit fully below 50%.
Move Skew uses a separate Student-t based test on the historical mean return.
These tests are historical evidence filters. They do not convert historical statistics into guaranteed future probabilities.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 1 — SAMPLE & WILSON FILTER
━━━━━━━━━━━━━━━━━━━━━━
setRateAxis(int i, float up, float n, float minN) =>
array.set(axShare, i, n > 0 ? up / n * 100.0 : na)
array.set(axN, i, n)
array.set(axMinN, i, minN)
= wilson(up, n)
int sig = 0
if n >= minN
sig := lo > 50.0 ? 1 : hi < 50.0 ? -1 : 0
array.set(axSig, i, sig)
The model keeps the observed percentage, supporting sample size, and statistical classification as separate pieces of information.
━━━━━━━━━━━━━━━━━━━━━━
🧠 DAILY BIAS SCORE
━━━━━━━━━━━━━━━━━━━━━━
Historical checks that satisfy their minimum sample requirement can contribute to the Daily Bias Score.
Each eligible check is measured relative to the neutral 50 level.
Its influence is weighted using the square root of its sample size.
This allows deeper samples to receive additional weight without allowing a very large sample to dominate the model linearly.
Conceptually:
validated historical share
→ distance from 50
→ √N sample weighting
→ weighted combination
→ Daily Bias Score
A score above 50 represents bullish historical context.
A score below 50 represents bearish historical context.
A score of 60 does not mean there is a 60% probability that price will close higher.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 2 — WEIGHTED BIAS MODEL
━━━━━━━━━━━━━━━━━━━━━━
float wSum = 0.0
float sSum = 0.0
for i = 0 to NAXES - 1
float sh = array.get(axShare, i)
float nn = array.get(axN, i)
if not na(sh) and nn >= array.get(axMinN, i)
wSum += math.sqrt(nn)
sSum += math.sqrt(nn) * (sh - 50.0)
biasScore := wSum > 0 ? 50.0 + sSum / wSum : na
━━━━━━━━━━━━━━━━━━━━━━
🔥 STRONG BULLISH / STRONG BEARISH DAYS
━━━━━━━━━━━━━━━━━━━━━━
A directional Daily Bias Score does not automatically become a strong classification.
Minimum Bias controls the required distance from the neutral 50 level.
When Require Significant Check is enabled, a Strong Bullish Day additionally requires:
• at least one statistically significant bullish check
• no statistically significant bearish checks
A Strong Bearish Day requires the opposite.
The engine also uses a warm-up requirement before strong classifications are allowed.
A strong classification should be interpreted as:
The historical conditions used by this model are unusually aligned in this direction.
It should not be interpreted as certainty about today's final close.
━━━━━━━━━━━━━━━━━━━━━━
📅 WEEKDAY INTELLIGENCE
━━━━━━━━━━━━━━━━━━━━━━
The weekday chart displays the directional history of available trading weekdays.
Each weekday can show:
• historical up-day rate
• completed sample size
• Wilson 95% interval
• average return
• average absolute move
Today's weekday is highlighted.
An optional ALL column displays the broader all-days directional baseline.
This comparison matters because an apparently strong weekday rate can be less meaningful when the instrument already has a similar unconditional directional drift.
Example:
Monday historical up-rate: 58%
All-days historical up-rate: 57%
The Monday number is above 50%, but its difference from the instrument's normal historical behavior is small.
━━━━━━━━━━━━━━━━━━━━━━
🎯 EXPECTED WEEKDAY RANGE
━━━━━━━━━━━━━━━━━━━━━━
When sufficient observations exist for today's weekday, the script builds a historical movement sample.
From this sample it calculates:
• P10
• P25
• P50
• P75
• P90
P10–P90 represents the broader historical distribution.
P25–P75 represents the central historical distribution.
P50 represents the historical median.
In Volatility-Adjusted mode, each historical return is normalized using the volatility available at that historical day's open and rescaled using today's volatility reference.
These ranges are empirical historical quantiles.
They are not guaranteed support/resistance boundaries or Take Profit levels.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 3 — WEEKDAY QUANTILES
━━━━━━━━━━━━━━━━━━━━━━
bool deep = array.size(samp) >= minSample
tP10 := deep ? array.percentile_linear_interpolation(samp, 10) : na
tP25 := deep ? array.percentile_linear_interpolation(samp, 25) : na
tP50 := deep ? array.percentile_linear_interpolation(samp, 50) : na
tP75 := deep ? array.percentile_linear_interpolation(samp, 75) : na
tP90 := deep ? array.percentile_linear_interpolation(samp, 90) : na
━━━━━━━━━━━━━━━━━━━━━━
🕒 NOW — SAME-TIME-OF-DAY CONTEXT
━━━━━━━━━━━━━━━━━━━━━━
The NOW card studies the developing trading day from a different perspective.
During completed historical days, the script stores whether price was above or below the prior close at different stages of the trading day.
During today's developing session, it finds historical observations that were:
• at approximately the same stage of the trading day
• on the same side of their prior close
The model then measures how often those historical days eventually closed on that same side.
This distinguishes:
Price is currently above yesterday's close
from:
Historically, when price was already above yesterday's close around this point of the trading day, how often did it remain above into the final close?
The NOW card also compares this conditional result with the broader all-days baseline.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 4 — SAME-TIME-OF-DAY MATCHING
━━━━━━━━━━━━━━━━━━━━━━
if hasNow and math.floor(array.get(hMSeen, i) / pwNow) % 2 == 1
bool wasUp = math.floor(array.get(hMUp, i) / pwNow) % 2 == 1
if wasUp == nowUp
lvN += 1.0
lvK += up == nowUp ? 1.0 : 0.0
Historical observations are completed days.
Today's live state remains provisional while the trading day develops.
━━━━━━━━━━━━━━━━━━━━━━
📍 PRIOR DAY HIGH / LOW
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence can extend completed prior-day highs and lows forward on the price chart.
Each level remains active until price trades through it on a confirmed chart bar.
When a break occurs:
• the level stops extending
• the line becomes visually muted
• the configured break marker is displayed
Historical statistics separately measure:
• prior-day high break rate
• prior-day low break rate
• both-side break rate
• neither-side / inside rate
• high-break hold rate
• low-break hold rate
A wick through the level counts as a break under the current model.
Prior-day highs and lows are analytical reference levels, not guaranteed support or resistance.
━━━━━━━━━━━━━━━━━━━━━━
⏱️ HIGH / LOW TIMING
━━━━━━━━━━━━━━━━━━━━━━
The indicator studies where and when completed trading days formed their final highs and lows.
For intraday charts, each completed high and low is associated with one of three fixed UTC windows:
• Asia — 21:00 to 08:00 UTC
• London — 08:00 to 13:00 UTC
• New York — 13:00 to 21:00 UTC
The HIGH / LOW TIMING card can display:
• the session that historically produced the most daily highs
• the session that historically produced the most daily lows
• how often the final high had already formed by the current point in the day
• how often the final low had already formed
• the session containing today's current high and low
Timing precision depends on the active chart timeframe.
━━━━━━━━━━━━━━━━━━━━━━
📏 STREAK & RANGE CONTEXT
━━━━━━━━━━━━━━━━━━━━━━
The STREAK & RANGE card combines two additional daily-context questions.
Directional streak
The script identifies consecutive positive or negative completed days entering the current trading day and studies historical days that followed a comparable streak.
Range development
The script calculates recent average daily high-low range and compares it with today's developing range.
The card can show:
• recent average range
• today's range so far
• percentage of normal range already used
• percentage of historical days that ultimately became wider than today's current range
This helps distinguish a relatively compressed day from one that has already consumed an unusually large share of its recent historical range.
━━━━━━━━━━━━━━━━━━━━━━
🌍 SESSION CONTRIBUTION
━━━━━━━━━━━━━━━━━━━━━━
Intraday price changes are attributed bar by bar to the fixed UTC session model.
For today's weekday, Daily Bias Intelligence calculates the historical average percentage contribution of:
• Asia
• London
• New York
Session contribution measures historical price movement.
It does not measure order flow or institutional activity.
The UTC windows do not dynamically adjust for daylight-saving changes.
━━━━━━━━━━━━━━━━━━━━━━
🧾 CALIBRATION SCORECARD
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence includes a calibration layer so important model outputs can be evaluated after the fact.
CALLS
Tracks completed Strong Bullish / Strong Bearish classifications and compares their directional hit rate with baseline drift.
RANGE HIT
Tracks how frequently completed trading days closed inside:
• P10–P90
• P25–P75
|MOVE|
Displays the historical average absolute movement for today's weekday and compares it with the all-days average.
SESSIONS
Displays historical average Asia, London, and New York contribution for today's weekday.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 5 — SEQUENTIAL CALIBRATION
━━━━━━━━━━━━━━━━━━━━━━
if todayStable and not na(tP10) and not na(tP90)
calN += 1.0
calIn80 += (r >= tP10 and r <= tP90) ? 1.0 : 0.0
calIn50 += (r >= tP25 and r <= tP75) ? 1.0 : 0.0
if callDir != 0 and allN > 0
callN += 1.0
callHit += ((r > 0) == (callDir > 0)) ? 1.0 : 0.0
callBase += callDir > 0 ? allUp / allN : 1.0 - allUp / allN
A projection is evaluated only after the corresponding trading day later completes.
The final result is not used to create the earlier projection being evaluated.
━━━━━━━━━━━━━━━━━━━━━━
📊 OSCILLATOR VIEWS
━━━━━━━━━━━━━━━━━━━━━━
The lower pane supports several presentation styles.
Off
Keeps the pane focused primarily on statistical panels.
Waveform
Displays the current day's running positive and negative excursion relative to the prior close.
Heat Stripes
Displays developing daily movement as a volatility-normalized background together with a rolling-return line.
Bar Columns
Displays the developing daily return as columns.
These views describe price behavior and do not independently determine the Daily Bias Score.
━━━━━━━━━━━━━━━━━━━━━━
📦 DAY BOXES & DAILY RESULTS
━━━━━━━━━━━━━━━━━━━━━━
The script can frame each trading day's high-low range with a Day Box.
A completed day's box receives its final contextual color after the day completes.
Today's live box remains dashed and updates as the high and low develop.
Completed daily-result labels can display the final daily percentage return.
Today's live percentage can also be displayed separately.
━━━━━━━━━━━━━━━━━━━━━━
🕯️ CANDLE COLORING
━━━━━━━━━━━━━━━━━━━━━━
Candle coloring can compare current price with the previous completed trading-day close.
Vs Prior Close
Price above the reference uses the bullish candle color.
Price below the reference uses the bearish candle color.
Because today's price is live, the contextual color can change throughout the session.
Off
Leaves the chart's native candle colors unchanged.
Candle coloring is visual context only.
━━━━━━━━━━━━━━━━━━━━━━
🚨 ALERT SYSTEM
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence includes TradingView alert conditions for:
• Strong Bullish Day
• Strong Bearish Day
• Day Above Weekday P90
• Day Below Weekday P10
• Any Daily Bias Intelligence Alert
Strong-day alerts relate to the historical context generated for the new trading day.
P90 / P10 events trigger only after a confirmed chart bar closes beyond the corresponding weekday range level.
Alerts are monitoring tools and do not execute broker orders.
━━━━━━━━━━━━━━━━━━━━━━
🔔 HOW TO USE ALERTS
━━━━━━━━━━━━━━━━━━━━━━
For a specific alert:
1. Add Daily Bias Intelligence to the chart.
2. Open TradingView's Create Alert dialog.
3. Select Daily Bias Intelligence .
4. Select the required alert event.
5. Choose the notification method.
6. Configure the alert frequency.
7. Test the alert before relying on it.
For a combined workflow:
1. Add the indicator to the chart.
2. Open Create Alert.
3. Select Daily Bias Intelligence .
4. Select Any Daily Bias Intelligence Alert.
5. Configure the notification method.
6. Test the events on the intended symbol and timeframe.
If the script, symbol, timeframe, or important settings change materially, recreate the alert when necessary.
━━━━━━━━━━━━━━━━━━━━━━
🧪 HOW TO USE THE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
A practical workflow:
1. Add Daily Bias Intelligence to a standard candlestick chart.
2. Make sure enough historical trading days are loaded for the selected Lookback and Minimum Sample.
3. Begin with Volatility-Adjusted Return Units if you want historical movement normalized across changing volatility regimes.
4. Review the Bullish / Bearish Radar.
5. Check the sample size behind each observation.
6. Review the Daily Bias Score and strong-state classification.
7. Compare today's weekday with the ALL baseline.
8. Review P10–P90, P25–P75, P50, and expected absolute movement.
9. Use NOW to compare today's developing state with similar completed historical days.
10. Review prior-day high / low behavior.
11. Review high / low timing.
12. Review streak and daily-range usage.
13. Review session contribution.
14. Use CALLS and RANGE HIT to judge calibration over meaningful samples.
15. Use alerts as monitoring assistance rather than automatic execution.
The indicator should be combined with independent market structure, liquidity, volatility, news, execution, position-sizing, and account-risk analysis.
━━━━━━━━━━━━━━━━━━━━━━
⚙️ SETTINGS REFERENCE
━━━━━━━━━━━━━━━━━━━━━━
⚙️ Statistics Engine
• Lookback Trading Days — number of completed trading days retained.
• Return Units — Volatility-Adjusted / Raw %.
• Volatility Length — completed-day volatility sample.
• Recent Window — completed days used by RECENT.
• Minimum Sample — minimum N required for qualified statistical use.
🧠 Bias Intelligence
• Minimum Bias — required Daily Bias Score displacement from 50.
• Require Significant Check — requires compatible statistical evidence.
📊 Oscillator & Statistics
• Statistics Panel
• Panel Position
• Panel Width / Height
• Text Size
• Plot Style
• Rolling Line
• Today's Expected Range
• Weekday Median
• Daily Result Labels
• Label Location
• Days Shown
📍 Prior Day High / Low
• Show Prior Day High / Low
• Days Kept
• Break Marker
📦 Day Boxes
• Show Day Boxes
• Box Fill Transparency
🧭 Weekday Chart & Scorecard
• Show Weekday Chart
• Show Scorecard
• Main Chart / Pane placement
• Position
• Width
• Bar Area Height
• Show All-Days Column
🔷 Bullish / Bearish Radar
• Show Radar
• Offset
• Radius Bars
• Radius σ
🕯️ Chart Candles
• Candle Colouring — Vs Prior Close / Off
• Bullish Candle Color
• Bearish Candle Color
🎨 Theme & Colours
• Auto
• Dark
• Light
• supporting visual accent controls
Visual and theme changes do not alter the underlying historical calculations.
━━━━━━━━━━━━━━━━━━━━━━
🧠 WHAT MAKES THIS SCRIPT ORIGINAL
━━━━━━━━━━━━━━━━━━━━━━
Daily returns, weekday statistics, volatility normalization, confidence intervals, quantiles, daily highs/lows, and prior-day levels are established analytical concepts.
Daily Bias Intelligence does not claim ownership of those individual concepts.
Its originality lies in how they are coordinated into one completed-day state model.
The implementation combines:
completed-day historical storage
→ weekday context
→ previous-day context
→ three-day regime
→ recent directional context
→ Move Skew
→ Minimum Sample validation
→ Wilson / Student-t statistical filtering
→ √N-weighted Daily Bias Score
→ strong-bias gating
→ volatility-adjusted weekday quantiles
→ same-time-of-day state matching
→ prior-day high / low behavior
→ daily high / low timing
→ streak and range intelligence
→ session contribution
→ sequential range and directional calibration
Distinctive implementation choices include:
• separating observed historical rates from modeled bias
• preventing thin samples from influencing the primary score
• applying statistical filters before strong classifications
• weighting eligible observations by square-root sample depth
• separating live current-day state from completed historical results
• storing historical intraday state for same-time-of-day comparison
• comparing strong-call results with baseline drift
• evaluating projected ranges only after their corresponding days complete
The modules serve one coordinated objective:
making the historical structure surrounding the current trading day visible, measurable, and reviewable.
━━━━━━━━━━━━━━━━━━━━━━
⚠️ IMPORTANT PRACTICAL NOTES
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence depends on available chart history.
Important points:
• Low intraday timeframes can contain fewer completed trading days within the same loaded-bar allowance.
• Every rate should be interpreted together with its sample size.
• Minimum Sample prevents thin observations from influencing key parts of the model.
• Expected weekday ranges require sufficient weekday history.
• Volatility-Adjusted mode changes movement normalization but not directional up/down classification.
• RECENT uses at least the Minimum Sample requirement when the configured Recent Window is smaller.
• Flat completed days are treated as not-up.
• Today's return, high, low, range, NOW state, and contextual candle colors remain live.
• Statistical significance is not certainty.
• Strong historical states and range projections can fail.
• Historical relationships can change as market regimes change.
• Changing important settings rebuilds the historical model under the new configuration.
━━━━━━━━━━━━━━━━━━━━━━
⚠️ LIMITATIONS AND SHORTCOMINGS
━━━━━━━━━━━━━━━━━━━━━━
This script has important limitations:
• Historical frequency is not future probability.
• A statistically significant historical observation does not guarantee today's result.
• The five radar checks overlap and are not independent evidence.
• Multiple comparisons create a risk of chance findings.
• The Daily Bias Score is modeled context, not expected return or probability.
• Strong Bullish / Strong Bearish classifications can be incorrect.
• Sample depth is limited by available chart history.
• Low-timeframe charts may contain relatively few completed trading days.
• Volatility adjustment can react slowly to sudden regime changes.
• Historical quantiles are not fixed future boundaries.
• Prior-day high / low breaks can fail after occurring.
• Session attribution uses fixed UTC hours and does not dynamically adjust for daylight-saving changes.
• Extended-hours data can influence calculations where available.
• High / low timing is limited by chart timeframe resolution.
• Holiday and shortened-session days are treated as normal completed trading days.
• Current-day values remain provisional until the trading day completes.
• Different feeds, symbols, chart history, and timeframes can produce different statistics.
The indicator should be treated as a statistical context tool rather than a standalone predictive system.
━━━━━━━━━━━━━━━━━━━━━━
👤 WHO THIS SCRIPT MAY BE USEFUL FOR
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence may be useful for traders who:
• want historical daily context before evaluating intraday setups
• study weekday tendencies
• want sample sizes beside historical percentages
• prefer statistical filtering over raw percentages alone
• study prior-day highs and lows
• monitor daily-range development
• study when final daily highs and lows tend to form
• compare the current stage of the day with completed historical observations
• want directional context without automatic trade entries
• want historical expected-range information
• value calibration and transparent statistical assumptions
It may be less suitable for users who require automatic entries, automatic SL/TP systems, broker execution, tick-level reconstruction, account-level Strategy Tester results, or guaranteed directional predictions.
━━━━━━━━━━━━━━━━━━━━━━
🧭 BEST PRACTICE SUGGESTIONS
━━━━━━━━━━━━━━━━━━━━━━
For normal use:
• start with sufficient completed-day history
• keep Minimum Sample high enough that thin observations do not dominate interpretation
• compare weekday percentages with the ALL baseline
• read the Daily Bias Score together with the individual radar checks
• distinguish directional lean from a Strong Bullish / Strong Bearish state
• interpret statistical significance as evidence strength, not certainty
• treat expected ranges as historical distributions rather than fixed price barriers
• use NOW as live context rather than a standalone signal
• combine prior-day level statistics with current price behavior
• review CALLS versus drift rather than raw hit rate alone
• wait for meaningful calibration samples before drawing conclusions
• compare symbols and timeframes independently
When testing inputs, change one major group at a time so the effect on sample size, bias classification, expected range, and calibration remains understandable.
━━━━━━━━━━━━━━━━━━━━━━
🔓 PUBLICATION NOTE
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence is published as an educational daily-statistics, historical-bias, intraday-context, expected-range, calibration, visualization, and alert indicator.
This description documents the main mechanics used by the script, including:
• completed-day historical storage
• weekday analysis
• previous-day and three-day context
• recent directional behavior
• Move Skew
• statistical filtering
• Daily Bias Score
• strong-bias classification
• expected weekday distributions
• volatility adjustment
• same-time-of-day analysis
• prior-day high / low behavior
• high / low timing
• streak and range analysis
• session attribution
• sequential calibration
• visualizations and alerts
These modules serve one coordinated purpose:
providing a transparent statistical description of the current trading day based primarily on completed historical observations.
The script does not promise profitable results, remove market risk, or replace independent analysis and personal risk management.
━━━━━━━━━━━━━━━━━━━━━━
🕒 DATA TIMING, REPAINTING, AND HISTORICAL PLACEMENT DISCLOSURE
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence v1.0 builds its principal historical model from completed trading days.
A trading day is finalized when the script detects the beginning of the next trading day.
The previous day's completed data is then added to the historical dataset.
The current day's:
• radar checks
• Daily Bias Score
• strong historical-bias classification
• weekday distributions
• expected range
• expected absolute movement
• historical session averages
are rebuilt from completed historical observations.
The v1.0 daily model does not use a higher-timeframe request.security() feed or future-data lookahead process for these calculations.
Some values are intentionally developing realtime values and can change while today's market develops:
• today's return versus the prior close
• today's high and low
• today's range and range usage
• NOW-card state
• today's high/low session labels
• live day box
• contextual candle coloring
This is normal current-day development and should not be confused with using future historical information.
Prior-day high / low breaks require a confirmed chart bar before they are finalized.
Completed daily-result labels are created only after the corresponding trading day completes.
High / low timing stores the first chart bar that produced the observed extreme, so precision depends on the active timeframe.
Historical calculations can legitimately change when the symbol, timeframe, data feed, available history, Lookback, Volatility Length, Recent Window, Minimum Sample, or Return Units change.
During historical warm-up, the model grows as completed trading days accumulate.
No strong daily classification is permitted until the required warm-up has been satisfied.
These controls reduce hindsight risk in the primary historical model but do not eliminate market uncertainty, regime change, sampling risk, statistical error, or data-feed differences.
━━━━━━━━━━━━━━━━━━━━━━
🛡️ DISCLAIMER
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence is provided for educational and informational purposes only.
It does not constitute financial, investment, trading, legal, accounting, or tax advice.
Historical rates, Wilson intervals, statistical classifications, Move Skew, Daily Bias Scores, Strong Bullish / Strong Bearish states, weekday ranges, expected movement, session statistics, prior-day levels, calibration results, visualizations, and alerts are analytical outputs only.
No indicator can guarantee future market direction or profitability.
Historical relationships can weaken, disappear, or reverse as volatility, liquidity, market structure, participation, macroeconomic conditions, market regimes, and data characteristics change.
Every user remains responsible for independent analysis, validation, symbol and timeframe selection, settings, position sizing, account risk, execution planning, broker execution, alert configuration, and applicable legal or tax obligations.
Use Daily Bias Intelligence as a transparent daily statistical-context and historical-review framework — not as a promise of profitability or a substitute for independent judgment.
指标

Trinity Reversal Pattern [AlgoAlpha]🟠 OVERVIEW
Trinity Reversal Pattern identifies three-candle reversal structures and marks the price extreme associated with each detected setup. It is designed to separate structured reversal patterns from isolated bullish or bearish candles.
Each valid pattern receives a strength score based on the signal candle's body relative to the largest candle body within a selected lookback. The resulting reversal level remains active until price returns to it or the level reaches its selected expiry. An optional EMA trend filter can restrict patterns to the current trend direction.
🟠 CONCEPTS
Bullish Trinity Reversal — A three-candle structure that begins with two bearish candles. The middle candle trades below the first candle's low while remaining below its high. The third candle closes bullish and extends above the first candle's high. The lowest price across the three candles becomes the bullish reversal level.
Bearish Trinity Reversal — The inverse structure. It begins with two bullish candles, with the middle candle trading above the first candle's high while remaining above its low. The third candle closes bearish and extends below the first candle's low. The highest price across the three candles becomes the bearish reversal level.
Signal Strength — The absolute body size of the signal candle divided by the largest candle body found within the selected Strength Lookback, expressed as a percentage. A value near 100% means the signal candle is close to the largest recent body. This measures relative candle-body strength, not reversal probability or historical win rate.
Reversal Level — The lowest point of a bullish three-candle pattern or the highest point of a bearish pattern. It marks the price extreme associated with the reversal structure and stays active until touched or expired.
EMA Trend Filter — An optional directional filter based on fast and slow EMAs. A fast EMA cross above the slow EMA establishes the bullish state, while a cross below establishes the bearish state. When enabled, bullish patterns are accepted only during the bullish state and bearish patterns only during the bearish state.
🟠 FEATURES
Trinity Reversal Signals — Bullish and bearish markers identify completed three-candle reversal structures directly on the chart.
Reversal Levels — Each detected setup creates a level at its three-candle price extreme. Active levels extend forward and become dotted after they are touched or expire.
Strength Labels — Active reversal levels can display their fixed signal strength percentage for quick comparison between setups.
EMA Trend Gradient — Optional fast and slow EMA lines display the active trend state with a gradient between them.
🟠 HOW TO USE
Watch for a bullish marker after a three-candle downside structure or a bearish marker after the corresponding upside structure.
Compare the strength labels between signals. Higher values mean the signal candle has a larger body relative to the recent candle bodies in the selected lookback.
Increase Minimum Signal Strength to remove patterns with weaker signal candles. Lower it to include a broader range of detected structures.
Treat an active reversal level as the price extreme linked to its original setup. A later wick reaching that price counts as a touch and stops the level from remaining active.
Adjust Level Expiry Bars to control how long untouched reversal levels remain active. Shorter values focus on recent setups, while longer values preserve levels for more bars.
Enable the EMA Trend Filter when you want signals aligned with the current EMA state. In a bullish EMA state, only bullish Trinity patterns are accepted. In a bearish EMA state, only bearish patterns are accepted.
Enable Confirm Signals on Close when you want a pattern to be confirmed only after its signal candle closes. Disabling it allows the current candle to produce a signal before the bar is complete, so the signal can change while the candle develops.
Use alerts to track bullish or bearish Trinity signals, touches of active reversal levels, level expirations, and EMA trend crosses without continuously watching the chart.
🟠 CONCLUSION
Trinity Reversal Pattern combines three-candle reversal structures, relative candle-body strength, persistent reversal levels, and an optional EMA trend filter. It gives traders a structured way to identify reversal setups, compare their relative strength, and track whether their associated price extremes remain active or are revisited.
指标

Wick HunterWick Hunter is an open-source price-action indicator designed to identify contextually significant rejection wicks while filtering out many of the smaller or lower-quality wicks that occur during normal market noise.
The purpose of the script is not simply to mark candles with long wicks. Wick size by itself can be misleading, especially during consolidation or strong directional moves. Wick Hunter evaluates the wick together with its size, candle structure, recent volatility, prevailing trend, and surrounding liquidity context before displaying a signal.
The indicator uses three related types of wick behavior:
TREND-CONTINUATION REJECTION
In a strong directional move, Wick Hunter looks for meaningful pullback wicks that reject back in the direction of the prevailing trend. This helps prevent the script from treating every countertrend wick as a reversal.
LIQUIDITY SWEEP/RECLAIM
The script can identify wicks that trade beyond a confirmed swing level and then reclaim that level. These signals represent rejection after liquidity has been taken rather than an isolated candle pattern.
EXTREME WICK EVENTS
Exceptionally large wicks relative to ATR and recent wick behavior can qualify as significant even when they do not fit a normal continuation setup. This is intended to capture unusually aggressive rejection or displacement. The script does not detect scheduled news events; it detects the resulting price behavior.
All three setup types serve the same purpose: determining whether a wick is significant enough to deserve attention. They are not separate indicators combined for additional features.
Wick Hunter also calculates an internal Wick Quality Score . The score considers actual wick size relative to ATR, wick size relative to recent wicks, how much of the candle is occupied by the wick, the quality of the rejection close, the candle’s size relative to recent price action, and the size of the opposing wick. Signals must meet the required quality threshold before appearing.
A moderate consolidation filter is also included. When price is trading inside a compressed range, Wick Hunter suppresses many middle-of-range wick signals while still allowing meaningful rejection near the edges of the range, confirmed liquidity sweeps, and unusually extreme wicks. This filter exists specifically to reduce low-value signals during sideways price action.
SIGNAL INTERPRETATION
A green upward marker indicates a significant lower-wick rejection.
A red downward marker indicates a significant upper-wick rejection.
The accompanying “Significant Wick” label identifies the qualifying candle. Nearby text labels may be suppressed to prevent visual overlap, but valid signal arrows remain visible.
Wick Hunter can display signals on all chart timeframes, but 15-minute and higher timeframes are recommended . The filtering logic was developed with intraday and higher-timeframe price action in mind, and lower timeframes may contain more noise and more frequent short-lived wick behavior. Users can adjust the thresholds to suit different markets and timeframes.
On live candles, Wick Hunter evaluates conditions as price develops and locks a signal once its criteria are satisfied. Historical candles are evaluated using their completed OHLC data, which can result in differences between intrabar behavior and a fully reloaded historical chart.
Wick Hunter includes alert conditions for bullish and bearish Significant Wick signals.
This indicator is intended as a price-action analysis tool and should not be treated as a complete trading system by itself. Market context, execution, risk management, and independent analysis remain important.
SOURCE VISIBILITY
Open-source. The Pine Script code is publicly available so users can inspect how the indicator works. 指标

Normalized SPMA | NAL1. Overview
Normalized SPMA | NAL is a selective trend-regime oscillator built around the Shock Percentile Moving Average (SPMA) concept.
Unlike a conventional moving average that continuously absorbs every new bar, SPMA is deliberately selective. It evaluates current price movement relative to its own historical distribution and only allows qualifying movements to update the underlying baseline.
Normalized SPMA takes this concept further by expressing the relationship between price and the selective baseline in normalized form, then combining it with a volatility-adjusted boundary.
The result is a compact regime model designed to distinguish meaningful directional structure from lower-impact market movement.
2. Shock Percentile Moving Average
The foundation of the indicator is its percentile-gated moving average.
Current price change is ranked against a configurable historical window:
float Ret = close - close
float Per = ta.percentrank(Ret, percentrank_lookback)
bool Gate = Per > percentile_gate
Rather than updating continuously, the SPMA only accepts a new EMA value when the percentile condition is satisfied. Otherwise, its previous value is retained.
MA := na(MA ) ? emaValue : Gate ? emaValue : MA
This creates a form of selective memory: ordinary movement can leave the baseline unchanged, while sufficiently significant positive price events are allowed to reshape it.
3. Normalized Regime Structure
The SPMA is then normalized relative to current price, allowing the model to study the relationship between the selective baseline and the market on a proportional scale.
A rolling standard-deviation component is applied to this normalized structure, creating a second volatility-sensitive series.
float normalizedSPMA = close != 0.0 ? -SPMA / close : na
float normalizedSD = ta.stdev(normalizedSPMA, normSDLen)
float normalizedLowerSD = normalizedSPMA - normalizedSD
The interaction between these two measurements and the normalized reference level forms the final regime logic.
This combination is what gives Normalized SPMA its distinctive character: event-selective trend memory combined with normalized volatility structure.
4. Key Features
Percentile-Gated Trend Filtering
Selective Market Memory
Price Normalization
Volatility-Adjusted Confirmation
Persistent Regime State
Colored Candles and Clear Visualization
5. Purpose
Normalized SPMA was developed to explore a simple idea:
What happens when a trend model is allowed to remember important movement while becoming selectively insensitive to everything else?
By combining percentile-based event selection, adaptive baseline memory, normalization and volatility analysis, the indicator provides a different perspective on directional market structure than a continuously updating moving average.
It is intentionally compact, but the underlying interaction between selectivity, memory, normalization and volatility can produce a remarkably clean representation of changing market regimes.
Normalized SPMA | NAL is provided free and open source for research, experimentation and further study. 指标

Mean-Reversion Half-Life [RC Tools]RC Tools — Mean-Reversion Half-Life
────────────────────────────────────────────────────────────────────
█ OVERVIEW
Knowing a market is "mean-reverting" isn't enough to trade it — a series that takes 5 bars to snap back and one that takes 50 bars to snap back are both technically mean-reverting, but call for completely different holding periods and expectations. This tool estimates that missing number directly: the half-life, in bars, of mean reversion, using the same Ornstein-Uhlenbeck-style regression approach used in quantitative statistical-arbitrage research.
█ WHAT IT DOES
Estimates mean-reversion speed via a rolling OLS regression and classifies each confirmed bar as Fast Mean-Reversion, Slow Mean-Reversion, or No Mean-Reversion based on the resulting half-life. Colours the chart background accordingly, plots the half-life (in bars, capped for readable scale) as a histogram against Fast and No-Reversion threshold lines, and shows a table with the current state, its estimated half-life, and historical base rates (average forward return and win rate) for each state.
█ THE THEORY BEHIND IT
This is a companion tool to RC Tools' Hurst Exponent Regime script, and answers the natural follow-up question it leaves open. The Hurst Exponent tells you whether a market's statistical character is trending, mean-reverting, or a random walk — but it doesn't say how fast a mean-reverting move actually closes. This tool fits a simple version of the Ornstein-Uhlenbeck model, a classical stochastic process used to describe a quantity that drifts back toward a long-run mean at a speed proportional to its current distance from that mean, and converts the fitted speed into a half-life: the number of bars it takes, on average, to close half the current deviation.
█ HOW IT IS CALCULATED
1. Take the log of price, and regress its bar-to-bar change against its own prior level (a one-lag OLS regression): Δy = α + β·y(prior), where y is log price.
2. A negative β implies mean reversion — the more negative, the faster the pull back toward the mean. A β at or above zero implies no reversion (the series is trending or behaving like a random walk).
3. Convert β into a half-life: -ln(2) / β, in bars.
4. Classify: half-life at or below the Fast threshold (default 10 bars) → Fast Mean-Reversion. Above that but at or below the No-Reversion threshold (default 60 bars) → Slow Mean-Reversion. Above the cap, or β non-negative → No Mean-Reversion (the series isn't reliably reverting, or the estimate is too unstable to trust).
β is smoothed before the half-life calculation (rather than smoothing half-life itself), because half-life is numerically unstable near a zero slope and can spike to extreme values that a direct smoothing pass wouldn't tame cleanly.
Classification occurs ONLY on confirmed bar close — the plotted half-life, the background colour and the table all update together, so nothing here can disagree mid-bar or flip back and forth as the current bar forms.
█ SETTINGS & CONFIGURATION
• Source (default close)
• Regression Window (default 50 bars) — longer windows give a more stable estimate but react slower to a genuine regime change
• Fast Mean-Reversion Threshold (default 10 bars) and No-Reversion Threshold (default 60 bars) — the half-life cutoffs between the three states
• Smoothing Length and Type (default 3-period EMA) — applied to the regression slope, not the half-life itself
• Forward Return Window (default 20 bars) — the horizon used for the base-rate table
• Table visibility, position and colours are fully configurable; the main-chart background painting can be toggled off if you only want the statistics pane
█ HOW TO USE IT
Use it to calibrate holding periods and expectations for a mean-reversion approach, not as a standalone entry signal. A Fast Mean-Reversion reading suggests a short-holding-period approach is appropriate; a Slow reading suggests patience is required and tight stops may cut off the reversion before it completes; a No Mean-Reversion reading suggests a mean-reversion approach isn't currently well-suited to this market at all. Pairs naturally with the Hurst Exponent Regime tool — Hurst tells you IF the market's character favours mean reversion, this tool tells you roughly HOW FAST.
Works on any asset and timeframe with sufficient history for the Regression Window.
█ LIMITATIONS
• This is a SIMPLE linear (OLS) estimate of mean-reversion speed, not a full maximum-likelihood Ornstein-Uhlenbeck fit. It is a practical approximation, not a research-grade estimator.
• Half-life describes an estimated SPEED, not a guarantee of reversion — a series classified as mean-reverting can still trend away for an extended period before, or instead of, reverting.
• Near a regression slope of zero, the raw half-life estimate is numerically unstable and can spike to very large values; display values are capped for readability.
• The regression window assumes the mean-reversion relationship is roughly stable across the window; a structural break partway through will distort the estimate until it fully rolls off.
• Shorter windows react faster but produce noisier, less reliable estimates; longer windows are more stable but slower to reflect a genuine change.
• Historical base-rate stats need a meaningful sample count (check N) before being trusted, especially for the less common states.
• This script does NOT repaint. All classification updates on confirmed bar close only.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any mean-reversion state does not indicate future results. Trade at your own risk.
指标

Daily Swing Trader PRO v3.2 # Daily Swing Trader PRO
**Daily Swing Trader PRO** is a rules-based swing-trading indicator designed primarily for traders who use the **daily chart** and want a simple way to combine trend, momentum, volume, volatility, entry quality, and risk management into one TradingView script.
The indicator is built around a **trend + pullback/breakout + confirmation** approach. Instead of relying on a single indicator, it combines several commonly used technical tools to identify higher-quality swing-trading setups.
## Main Features
Daily Swing Trader PRO includes:
* 10 EMA
* 21 EMA
* 50 SMA
* 200 SMA
* SuperTrend
* RSI
* Relative Volume (RVOL)
* ATR and ATR %
* Bullish pullback detection
* Bullish breakout detection
* Bearish breakdown detection
* Bearish failed-rally detection
* BUY signals
* STRONG BUY signals
* SELL signals
* STRONG SELL signals
* Automatic entry level
* Automatic stop-loss level
* Configurable reward/risk target
* TAKE PROFIT signals
* STOP LOSS signals
* Detailed TradingView alerts
* Daily Swing dashboard
* Signal notification panel
* Automatic light/dark chart theme support
## Trading Philosophy
The indicator follows a simple principle:
**Trend first → Price action second → Volume and momentum confirmation → Risk/reward → Trade**
Indicators are used as confirmation rather than as standalone reasons to enter a trade.
The goal is to avoid weak setups, avoid chasing extended stocks, and focus on trades where multiple technical factors are aligned.
# How to Use Daily Swing Trader PRO
## Recommended Timeframe
The indicator is designed primarily for the:
**1-Day / Daily chart**
The default settings are optimized around daily-chart swing trading.
## Bullish Trend Requirements
The script looks for a bullish environment when:
* Price is above the 50 SMA
* Price is above the 200 SMA
* Price is above the 21 EMA
* 10 EMA is above the 21 EMA
* 21 EMA is rising
* SuperTrend is bullish
* RSI is above 50
* Relative volume meets the selected minimum
* ATR volatility meets the minimum requirement
* Price is not excessively extended above the 21 EMA
These conditions help reduce signals that occur during weak or sideways trends.
## BUY Signal
A **BUY** signal can occur when the bullish trend requirements are satisfied and one of the following setups appears:
### Pullback Setup
Price pulls back toward the 10 EMA or 21 EMA and then shows bullish confirmation.
Typical confirmation includes:
* Price holding the EMA support area
* Bullish daily candle
* Close above the previous day's high
* Price closing back above the 10 EMA and 21 EMA
* Adequate relative volume
This setup attempts to enter an existing trend after a controlled pullback instead of chasing price.
### Breakout Setup
A breakout setup occurs when price closes above the highest price of the selected breakout lookback period.
The indicator also requires bullish trend, momentum, volume, and volatility conditions before generating the signal.
## STRONG BUY Signal
A **STRONG BUY** requires the normal BUY conditions plus stronger confirmation.
Default requirements include:
* Bullish trend
* Valid pullback or breakout
* RSI approximately 55–70
* RVOL of at least 1.20
* Strong bullish candle close
* Price not excessively extended
* Bullish SuperTrend
STRONG BUY is intended to identify the highest-quality bullish setups produced by the system.
## SELL Signal
SELL is the bearish counterpart to BUY.
The script looks for:
* Price below the 50 SMA
* Price below the 200 SMA
* Price below the 21 EMA
* 10 EMA below the 21 EMA
* Falling 21 EMA
* Bearish SuperTrend
* RSI below 50
* Adequate relative volume and volatility
A SELL signal may occur after either a bearish breakdown or a failed rally into resistance.
For traders who only trade long positions, SELL can also be used as a warning that bullish conditions have deteriorated.
## STRONG SELL Signal
A **STRONG SELL** requires additional bearish momentum and volume confirmation.
It is designed to identify the strongest bearish setups and may be useful for traders evaluating short positions or long-put option setups.
# Entry, Stop and Take Profit
When a new trade signal appears, the script automatically calculates:
**Entry:** Signal candle closing price
**Stop Loss:** Based on the recent swing high or swing low plus an ATR buffer
**Take Profit:** Based on the selected reward/risk multiple
The default target is:
**2R — approximately 2:1 reward/risk**
Example:
Entry: $100
Stop: $95
Risk: $5
2R Take Profit: $110
The reward/risk target can be adjusted in the indicator settings.
## Stop-Loss Logic
For long trades, the stop is placed below a recent swing low.
For bearish trades, the stop is placed above a recent swing high.
An ATR buffer is added to reduce the chance of being stopped out by normal price movement.
## Take-Profit Logic
When price reaches the calculated target, the indicator produces a:
**TAKE PROFIT**
signal.
The script also tracks STOP LOSS events.
Because a daily candle only provides open, high, low, and close information, if both the stop and profit target are touched on the same daily candle, the script uses the conservative assumption that the stop was reached first.
# Avoiding Extended Trades
One of the most important filters in Daily Swing Trader PRO is the **maximum extension from the 21 EMA**.
The default is:
**2 ATR**
If price becomes too extended above or below the 21 EMA, new entries are filtered out.
This is designed to reduce late entries after unusually large price moves.
# Relative Volume
Relative Volume compares current volume with average recent volume.
Default values:
Normal signal: **RVOL ≥ 1.00**
Strong signal: **RVOL ≥ 1.20**
Higher RVOL generally indicates stronger participation behind the move.
# RSI
RSI is used as a momentum filter rather than simply as an overbought/oversold indicator.
For bullish trades, the script generally looks for RSI above 50.
STRONG BUY signals typically require RSI in the stronger momentum zone of approximately:
**55–70**
Bearish signals use the opposite momentum structure.
# ATR
ATR is used for several purposes:
* Measuring volatility
* Preventing trades in stocks with insufficient movement
* Measuring price extension
* Calculating stop buffers
* Helping evaluate swing-trading opportunity
The dashboard displays both ATR and ATR as a percentage of price.
# Dashboard
The **Daily Swing Dashboard** appears in the top-right corner of the chart.
It displays information such as:
* Current trend
* Trade status
* Last signal
* Setup type
* RSI
* RVOL
* ATR
* ATR %
* Entry
* Stop
* Profit target
The **Signal Notification Panel** appears in the bottom-right corner and displays the most recent trading event.
# TradingView Alerts
The indicator includes individual alert conditions for:
* STRONG BUY
* BUY
* STRONG SELL
* SELL
* TAKE PROFIT
* STOP LOSS
Detailed alerts can include:
* Ticker
* Current price
* Entry
* Stop
* Take-profit target
* Reward/risk
* RSI
* RVOL
* ATR
* ATR %
For daily swing trading, alerts are best evaluated after the daily candle has closed so that the setup is confirmed.
# Suggested Workflow
A practical workflow is:
1. Start with stocks already showing a strong trend.
2. Use the daily chart.
3. Wait for BUY or STRONG BUY rather than chasing large candles.
4. Check nearby support and resistance.
5. Confirm that the profit target has enough room before major resistance.
6. Review earnings and major market-event risk.
7. Enter only if the chart still offers acceptable reward/risk.
8. Use the calculated stop rather than widening the stop after entering.
9. Take profit at the target or manage the position with your own trailing-stop rules.
For conservative use, traders may choose to treat:
**STRONG BUY / STRONG SELL = potential trade signals**
and
**BUY / SELL = watchlist or early-warning signals**
# Default Settings
The default settings are intended as a starting point:
10 EMA: 10
21 EMA: 21
50 SMA: 50
200 SMA: 200
SuperTrend ATR: 10
SuperTrend Factor: 3.0
RSI: 14
RVOL Lookback: 20
Normal RVOL: 1.00
Strong RVOL: 1.20
ATR: 14
Maximum Extension: 2 ATR
Swing Stop Lookback: 5 bars
Take Profit: 2R
Different securities and market conditions may require different settings.
# Important Notes
Daily Swing Trader PRO is not designed to predict the market.
No technical indicator can guarantee profitable trades. Signals should be combined with proper position sizing, risk management, market context, support and resistance, earnings awareness, and individual trading judgment.
Historical signals do not guarantee future performance.
This indicator is provided for educational and informational purposes only and should not be considered financial or investment advice.
指标

Liquidity Sweep Follow-Through GuardA wick through an obvious high or low is often called a liquidity sweep. The useful question is what price does after the level is reclaimed.
**Liquidity Sweep Follow-Through Guard** identifies a sweep of a prior lookback extreme, requires a close back inside that reference, and then evaluates the reversal through holding, extension and path efficiency. The swept level, extreme and ATR reference are frozen when the episode begins.
## Visual guide
- **S+** — a prior low was swept and reclaimed, opening a bullish observation.
- **S−** — a prior high was swept and reclaimed, opening a bearish observation.
- **Shaded zone** — the area between the reclaimed level and the sweep extreme.
- **Orange line** — the frozen reference that must remain reclaimed.
- **Blue line** — the minimum reversal extension.
- **F+ / F−** — efficient bullish or bearish follow-through was confirmed.
- **R** — a confirmed close lost the reclaimed reference.
- **X** — a confirmed close crossed the sweep extreme and fully failed the setup.
- **T** — the observation window expired without a terminal result.
The display is intentionally compact. It has no table and requires no companion indicator.
## Sweep detection
The reference is the highest high or lowest low of the previous 20 completed bars. The current candle must exceed that level by at least 0.10 previous-bar ATR, close back inside it, and devote at least 35% of its range to the rejection wick. References exclude the current bar and are never backdated.
If one exceptional candle sweeps both sides, the candle’s closing direction resolves which episode is tracked. Only one episode can be active at a time.
## Follow-through test
The default confirmation requires:
1. Two consecutive closes remain on the reclaimed side of the frozen reference.
2. Price travels at least 0.30 frozen ATR from the sweep candle close in the reversal direction.
3. Directional progress represents at least 45% of the cumulative close-to-close path after the sweep.
Path efficiency distinguishes direct follow-through from an equally large but noisy move. Repeated back-and-forth closes add traveled path without adding the same directional progress.
## Example
Suppose the lowest low of the prior 20 bars is 100 and frozen ATR is 4. Price trades down to 99.4, then closes at 101 with a qualifying lower wick. The orange reference remains 100 and the default extension target is 102.2. If two closes hold above 100, price reaches 102.2 and efficiency is at least 45%, **F+** is printed. A later close below 100 prints **R**. A close below 99.4 prints **X** and takes priority.
## Behavior and limitations
All state changes and markers occur on confirmed bars. The script uses no future bars, pivot backdating or lookahead requests. Wicks detect the initial sweep, while failure outcomes require confirmed closes.
A sweep is a price pattern, not proof of orders, stop placement or participant intent. Thresholds behave differently across symbols and timeframes. The indicator does not predict outcomes, place trades, size positions or model fees, slippage, liquidity and execution. Standard candles are recommended for interpreting its price-based rules.
BotTradeLab — Human judgment, AI-assisted analysis. 指标

Gap Acceptance GuardA gap is visible immediately. Whether the market accepts the new price area is only revealed by what happens next.
**Gap Acceptance Guard** tracks qualifying opening gaps through a fixed observation sequence. It separates continued acceptance from loss of the gap midpoint, a confirmed close through the previous close, and an unresolved timeout. The original gap, ATR reference, event extreme and decision levels are frozen when the episode begins.
## Visual guide
- **G+ / G−** — a bullish or bearish qualifying gap entered observation.
- **Shaded zone** — the active gap between the previous close and the new open.
- **Orange line** — the acceptance boundary inside the frozen gap.
- **Gray line** — the previous close and full-fill reference.
- **Blue line** — the minimum extension required beyond the event bar.
- **A+ / A−** — acceptance was confirmed.
- **R** — price closed back through the acceptance boundary.
- **X** — price closed beyond the previous close and invalidated the gap thesis.
- **T** — the observation window ended without a terminal decision.
- **Yellow diamond** — the gap-fill line was touched intrabar while the episode remained active.
The display is intentionally chart-first. It uses no table and requires no other indicator.
## Detection
By default, the absolute difference between the current open and previous close must be at least 0.50 times ATR measured on the previous completed bar. On intraday charts, detection is limited to the first bar of each exchange day. On daily and higher charts, each completed bar can be evaluated. An optional setting can require the open to clear the entire previous candle range.
## Acceptance test
Acceptance requires all three default conditions:
1. Two consecutive closes remain beyond the midpoint of the gap in its direction.
2. Price extends at least 0.25 frozen ATR beyond the event bar’s high or low.
3. Directional progress represents at least 45% of the cumulative close-to-close path after the event.
Path efficiency penalizes back-and-forth movement. A direct continuation scores higher than a noisy move that covers the same net distance.
## Example
Assume the previous close is 100, the new open is 104, the event high is 106 and frozen ATR is 4. With a 50% acceptance boundary, the orange line is 102. With a 0.25 ATR extension requirement, price must reach 107. If two closes hold above 102, price reaches 107 and path efficiency is at least 45%, **A+** is printed. A confirmed close below 102 prints **R**; a confirmed close below 100 prints **X** and takes priority.
## Behavior and limitations
State changes and markers occur only on confirmed bars. The script uses no future bars, pivot backdating or lookahead requests. One episode is tracked at a time.
Session structure depends on the exchange and chart timeframe. Extended-hours bars, synthetic candles and markets that trade continuously can change the meaning or frequency of gaps. The indicator describes observed conditions; it does not estimate probabilities, place trades, size positions or model fees, slippage, liquidity and execution.
BotTradeLab — Human judgment, AI-assisted analysis. 指标

Impulse Candle Acceptance GuardA large candle is easy to spot. The harder question is whether the market accepts it.
Impulse Candle Acceptance Guard follows unusually forceful candles through a defined sequence: detection, continued holding, efficient extension, rejection, full reversal, or an unresolved timeout. It freezes the original candle’s range and ATR reference so later price action is judged against the event that started the observation.
VISUAL GUIDE
• I+ / I− — A bullish or bearish impulse candle entered observation.
• Teal or red zone — The frozen high-low range of the impulse candle.
• Orange line — The acceptance and rejection boundary inside the frozen range.
• Blue line — The minimum extension required beyond the impulse candle.
• A+ / A− — The move satisfied the hold, extension, and path-efficiency rules.
• R — A confirmed close crossed the acceptance line against the impulse.
• X — A confirmed close crossed the opposite edge of the entire impulse candle.
• T — The observation window ended without another terminal result.
The script is intentionally chart-first: it uses no table and has no dependency on another indicator.
1 — DETECT THE IMPULSE
The default setup requires the candle’s range to reach at least 1.5 times the ATR measured on the previous completed bar. Its real body must occupy at least 60% of the candle’s range, and the close must finish within the outer 20% in the direction of the move. Zero-range candles cannot qualify.
An optional volume filter requires current volume to exceed a configurable multiple of its moving average. It is disabled by default so the script also remains usable on symbols without meaningful volume data.
2 — FREEZE THE EVENT
At the confirmed close of a qualifying candle, the script freezes the impulse high, low and close; ATR from the bar immediately before the impulse; the acceptance line inside the impulse range; and the required extension beyond the impulse extreme. These levels remain fixed throughout the observation. Only one episode can be active at a time.
3 — MEASURE ACCEPTANCE
Acceptance requires all three default conditions:
1. Two consecutive closes remain beyond the orange acceptance line in the impulse direction.
2. Price reaches at least 0.25 frozen ATR beyond the impulse high or low.
3. Follow-through efficiency is at least 45%.
Follow-through efficiency compares directional progress from the impulse close with the cumulative close-to-close path traveled after it:
efficiency = max(0, directional progress) ÷ cumulative path × 100
A direct continuation produces a high value. Repeated back-and-forth movement increases the path without producing equal progress and lowers the value. The efficiency value is available in TradingView’s Data Window while an episode is active.
WORKED EXAMPLE
Assume a bullish impulse has a low of 100, a high of 110, a close of 109, and a frozen ATR of 4.
• Acceptance line: 100 + 50% × (110 − 100) = 105
• Required extension: 110 + 0.25 × 4 = 111
If the next two candles close above 105, price reaches 111, and directional progress represents at least 45% of the traveled path, A+ is printed. A close below 105 produces R. A close below 100 produces X and takes priority over the ordinary rejection label.
EVENT PRIORITY AND CONFIRMED-BAR BEHAVIOR
Full reversal has first priority, followed by acceptance-line rejection, acceptance, and timeout. An otherwise valid acceptance on the final permitted bar is recorded before timeout. Wicks alone do not reject or fully reverse an episode; those outcomes require confirmed closes.
Markers and state transitions update only after a candle closes. The script uses no future bars, pivot backdating, or lookahead requests.
USAGE AND LIMITATIONS
The mirrored rules operate on bullish and bearish candles across stocks, cryptocurrencies, futures, and forex. Use standard candles when interpreting the price-based rules. Thresholds describe a rule set rather than probabilities, and their meaning changes with symbol and timeframe.
Acceptance means that the specified conditions were observed; it does not guarantee continued movement or establish a profitable strategy. The indicator does not place trades, calculate position sizes, or model fees, slippage, gaps, liquidity, or execution. Historical results can change when settings, available history, or source data change.
BotTradeLab — Human judgment, AI-assisted analysis. 指标

Volatility Shock Half-Life MonitorHow long does a volatility shock actually stay elevated?
The Volatility Shock Half-Life Monitor turns that question into an event-based measurement. Instead of only labeling volatility as “high” or “low,” it detects a fresh shock, freezes the pre-shock baseline, follows subsequent volatility peaks, and counts the bars until the excess volatility has decayed to a chosen fraction.
WHAT THE INDICATOR SHOWS
🟠 Shock detected — Fast realized volatility crosses above the selected multiple of baseline volatility.
🟣 Reheat — Volatility makes a meaningfully higher peak. The decay target is recalculated and the half-life clock restarts from that peak.
🟢 Half-life reached — Excess volatility falls to the selected remaining fraction. With the default 50% setting, half of the excess above the frozen baseline has dissipated.
⬜ Window ended — The episode did not reach its decay target within the maximum observation window.
The aqua curve is fast volatility as a percentage of baseline volatility. The yellow segment is the active decay target. A compact dashboard reports the current state, excess volatility remaining, bars since the latest peak, the most recently observed half-life, and completed versus timed-out episodes.
EXAMPLE
Suppose baseline volatility is 1.0 and a shock peaks at 2.0. With “excess volatility remaining” set to 50%, the target is 1.5:
1.0 + 50% × (2.0 − 1.0) = 1.5
If volatility later reheats to 2.4, the new target becomes 1.7 and the clock restarts from that new peak. This prevents an early measurement from understating a renewed shock.
SUGGESTED USES
• Compare how quickly different assets absorb volatility shocks.
• Delay mean-reversion entries until excess volatility has materially cooled.
• Identify persistent stress when an episode repeatedly reheats or times out.
• Build confirmed-bar alerts for shock, reheat, recovery, timeout, and data-gap events.
METHOD AND LIMITATIONS
Volatility is the rolling standard deviation of logarithmic returns by default. The baseline is frozen on the initial shock bar. “Half-life” here means the observed number of chart bars from the latest volatility peak to the first target crossing; it is not an estimated exponential-decay parameter. Results depend on timeframe, symbol, lookback lengths, and threshold settings. The indicator is a research and risk-context tool, not a forecast or trading strategy.
AI-assisted disclosure: The concept, Pine implementation, validation model, and documentation were developed with AI assistance and reviewed by BotTradeLab. 指标

Overnight Session StateOvernight Session State
Overnight drift is a well-known concept in equities and index futures. This indicator asks a narrower question. Does that drift depend on where price sat relative to the moving averages when the session began?
"If the close prints above the 1H EMA stack, does the night behave differently than if it prints below? Is a night that starts inside the stack a coin flip, or something else?"
That is the whole question this tool was built to answer. It reads where price sits against the EMA stack (20/50/100) at the 16:00 ET close, labels the night above, below or mixed, and draws what happened. The panel then keeps score for each label: average drift, win rate and average range.
🔶 USAGE
Load the indicator on a 1H chart. It was built and tested on index futures (MNQ, MES, NQ, ES), but it runs on anything with an overnight session — set the entry and exit hours to suit the market you're on.
Each overnight session is one shaded box, from the 16:00 ET entry bar to the 07:00 ET exit bar. The box height is the session high to low. The colour is the outcome: green if the 07:00 close finished above the 16:00 entry, red if below.
Inside each box, the solid line is the entry price and the dashed line is the exit price. The gap between them is the overnight drift.
The glyph on the top edge of each box is the state the night started in:
▲ ABOVE — price above all three EMAs at entry
▼ BELOW — price below all three EMAs at entry
• MIXED — price inside the stack at entry
Look at the ▼ nights and see if they look different from the ▲ nights. Then check the panel to see if you notice any trends.
The panel shows which state the current session is in, then a row for above, below and mixed with the number of nights, average drift in bp, win rate and average range in bp across the chart's loaded history. The last bar's time is written at the bottom so you know the numbers are current.
🔶 DETAILS
The state is set once, on the 16:00 bar, using the EMA values from the bar before. It doesn't change after that. The box colour updates as the night goes on and locks in at 07:00. Nothing repaints.
Drift is measured from the 16:00 open to the 07:00 close. Range is the high to low of the whole session. Both are in basis points (1 bp = 0.01%) so the numbers compare across contracts at different price levels.
Nights with no 07:00 bar within 16 hours (holidays, data gaps) are skipped. Sunday's entry is 18:00 ET. Session times are worked out in the session timezone, not the chart's, so the numbers don't change if you switch chart timezones, but the boxes will only line up with the time axis if the chart is set to New York.
🔶 SETTINGS
EMA Stack
EMA 1 / EMA 2 / EMA 3 — the three averages that set the state (20 / 50 / 100)
Show EMA stack — draw the three lines on the chart
EMA colours follow chart theme — lines pick a neutral colour to suit light or dark charts; untick to set your own
EMA 1 / 2 / 3 colour — used when the theme option is off
Session
Session timezone — America/New_York by default; the session hours below are read in this zone
Entry hour Mon–Thu — 16
Entry hour Sunday — 18
Exit bar hour — 7
Drop segment if no exit within (h) — nights with no exit bar inside this window are skipped
Style
Night paid — box and line colour when the exit closes above entry
Night lost — colour when it closes below
Box transparency — 80 by default
Show state glyph — the ▲ ▼ • marker on each box
Panel
Show panel
Corner — move the stats table if it overlaps something
🔶 SUMMARY
Most charts don't give you a clean look at the overnight session. This one does. Each night is labelled by where it started against the averages, boxed by what it did, and counted in the panel so you can see how each group has behaved over the history you've got loaded. What you make of it is up to you. Some people will see a pattern, some won't.
It's not a buy signal and it doesn't include commission or slippage. It's just a way to see how price moved during the overnight session.
指标

Ljung-Box Serial Dependence MonitorLjung-Box Serial Dependence Monitor
Explore serial correlation in returns and in the size of price changes.
This indicator calculates a rolling Ljung-Box Q statistic and its approximate chi-square p-value. It combines the joint test with individual autocorrelations and a compact summary table in a separate pane.
THREE TEST SERIES
• Returns: log returns by default, with simple percentage returns available as an alternative.
• Squared returns: applies the calculation to squared returns.
• Absolute returns: applies the calculation to absolute returns.
The latter two modes explore dependence in return magnitude, including patterns consistent with volatility clustering. They do not establish a particular ARCH/GARCH model.
HOW THE TEST WORKS
For each window, the script subtracts the sample mean and estimates autocorrelations at lags 1 through h. It calculates:
Q = n × (n + 2) × sum , for k = 1…h.
The p-value uses an approximate chi-square distribution with h degrees of freedom. No fitted time-series model or residual degrees-of-freedom adjustment is applied.
A p-value below the selected significance level flags evidence against the joint hypothesis of zero autocorrelation at the tested lags. A larger p-value does not prove independence or unpredictability.
READING THE DISPLAY
• Yellow line: rolling p-value, on a 0–1 scale.
• Dashed level: selected significance threshold; 5% is shown as 0.05.
• Colored background: windows flagged as significant.
• Optional ACF lines: autocorrelation at lags 1, 2 and 3, where included in the lag setting.
• Table: sample size, lag count, Q, p-value, first three ACF values, summed ACF and a descriptive verdict.
The optional ACF band is the simple normal-approximation reference ±z/sqrt(n), labeled “Bartlett” in the script. It is not a simultaneous confidence band across all lags.
WHAT THE REGIME LABELS MEAN
The Ljung-Box statistic squares autocorrelations and does not determine the direction of dependence. This implementation adds a separate heuristic based on the sign of the sum of the tested autocorrelations.
For significant return windows, a positive sum produces the “Momentum / persistence” label; a negative sum produces “Mean reversion.” For transformed-return windows, the corresponding labels describe positive or negative dependence in return magnitude.
These labels summarize the sampled ACF pattern. They are not directional price forecasts or validated trading signals. Positive and negative correlations at different lags can offset one another in the sum.
ILLUSTRATIVE EXAMPLE
With 250 observations, 10 lags and a 5% threshold, a hypothetical p-value of 0.02 is below 0.05 and is highlighted. A p-value of 0.20 is not highlighted.
The first result does not mean a 98% probability that a trade will succeed. The sign-based label requires separate inspection of the ACF pattern. These numbers are illustrative, not backtest results.
SETTINGS AND ALERTS
Defaults are 250 observations, 10 lags, log returns and a 5% significance level. A full window must be available, and the implementation requires h < n/4. Choose a lookback strictly greater than four times the lag count; otherwise the script remains in its warm-up state.
Four alert conditions are included: dependence becomes significant, dependence disappears, positive-sum regime begins and negative-sum regime begins. The last two retain the script's “Momentum regime” and “Mean-reversion regime” alert names even in squared/absolute-return modes; in those modes they concern return magnitude, not price direction.
Values and conditions can change during an open bar. For alerts based on completed candles, select Once Per Bar Close when creating the alert in TradingView.
INTERPRETATION AND LIMITATIONS
Rolling windows overlap, and repeated tests are not independent. There is no multiple-testing correction. The chi-square approximation and the simple ACF reference band rely on statistical assumptions; changing volatility and other departures from these assumptions can affect interpretation.
Missing values are skipped by the sample buffer, so gaps may cause the window to represent the latest valid observations rather than consecutive chart bars. A constant window has no defined autocorrelation; absent Q or p-values must not be read as evidence of independence. Extreme tail probabilities can round to zero numerically. Larger lookbacks and lag counts increase computation substantially.
This is a statistical research display. It does not place trades, estimate expected returns or establish a profitable strategy.
METHOD REFERENCE
NIST: Box-Ljung Test — www.itl.nist.gov 指标

Adaptive Ehlers Filtered PercentileAdaptive Ehlers Filtered Percentile is a trend-regime indicator that combines a volatility-adaptive moving average, a displacement-weighted nonlinear filter, and percentile-based price-deviation bands.
The indicator is designed to separate three tasks: adapt the baseline response to changing price variability, further filter that baseline according to historical displacement, and derive regime thresholds from the observed distribution of price-to-trend deviations rather than from a fixed percentage or standard-deviation multiplier.
🟣How It Works
The first stage measures the standard deviation of one-bar price changes.
That volatility measurement is compared with a rolling reference range. The resulting position inside the range determines the effective moving-average period between the user-defined Minimum MA Period and Maximum MA Period.
Higher volatility favors the shorter period, while lower volatility favors the longer period.
The adaptive period is converted into a smoothing coefficient and applied recursively to produce the Adaptive MA.
🟣Displacement-Weighted Filter
The Adaptive MA is then processed through a nonlinear weighted filter.
For each observation in the filter window, the script compares the current Adaptive MA value with another Adaptive MA value separated by the Momentum Length.
The absolute displacement between those observations becomes the weighting coefficient.
Observations associated with larger displacement therefore contribute more heavily to the final filtered trend value, while observations with little displacement contribute less.
If valid weighting coefficients are unavailable, a simple moving average of the Adaptive MA is used as a fallback.
🟣Percentile Bands
The indicator measures the absolute distance between price and the filtered trend:
Absolute Deviation = |Price - Filtered Trend|
These deviations are ranked over the selected Percentile Length.
The chosen Percentile Level determines the historical deviation used as the base band distance.
Unlike standard-deviation bands, this approach does not assume a particular distribution of deviations. The band width instead comes directly from the ranked historical observations.
Separate upper and lower multipliers allow the two sides of the structure to be adjusted independently.
🟣Regime Logic
A bullish regime begins when the selected source moves above the upper percentile band.
A bearish regime begins when the selected source moves below the lower percentile band.
When price remains between the two bands, the previous regime is retained.
LONG and SHORT markers are therefore displayed only when the persistent regime changes rather than on every bar that remains outside a threshold.
🟣Main Settings
Minimum MA Period / Maximum MA Period define the response range of the volatility-adaptive moving average.
Volatility Period controls how much recent price-change history is used to determine the adaptive response.
Filter Length determines how many Adaptive MA observations contribute to the displacement-weighted filter.
Momentum Length determines the historical separation used when measuring displacement for the filter weights.
Percentile Length defines the sample of historical price-to-filter deviations.
Percentile Level determines which ranked deviation becomes the base band width. Higher percentiles generally create more selective thresholds.
Upper Band Multiplier / Lower Band Multiplier independently scale the bullish and bearish thresholds.
🟣Design Purpose
The indicator uses each component for a specific role:
Price-change volatility → Adaptive MA response
Adaptive-MA displacement → Nonlinear filtering weights
Historical absolute deviation → Percentile band width
Band breakout → Persistent market regime
The percentile stage is applied to the actual distance between price and the adaptive filtered baseline. This allows the threshold structure to adjust to the historical distribution of deviations rather than relying only on a fixed volatility multiplier.
The asymmetric upper and lower multipliers also allow the bullish and bearish breakout requirements to be configured independently.
🟣Limitations
This indicator is a trend-regime tool and not a complete trading system. LONG and SHORT labels identify changes in the indicator's internal regime; they do not imply guaranteed trade outcomes or future performance.
Percentile thresholds are based on historical observations within the selected lookback. A change in market behavior can therefore alter the band width as new deviations enter the sample.
The adaptive moving average and nonlinear filter are derived from current and historical price information and remain dependent on the selected parameters.
The script does not use higher-timeframe requests or lookahead logic. 指标

Sassy CCI: Reversion, Divergence, & CompressionSassy CCI
Reading the Mood Behind Price
1. CCI (Commodity Channel Index). At its simplest, CCI measures **how far price has moved away from its normal average**.
Why I like CCI? I believe CCI often **moves before the larger price move becomes obvious**.
That makes it difficult to use CCI alone for traditional alerts—because it can move quickly and create signals before price has actually confirmed anything.
But that same characteristic makes CCI extremely useful for:
* 👀 **Seeing movement early**
* ⚡ **Scalping**
* 🔄 **Spotting reversals**
* 📦 **Recognizing compression**
* 🧠 **Understanding the relationship between momentum and price**
That is where **Sassy CCI** comes in.
---
2. Why "Sassy"?
Stock trading is ultimately about **psychology**.
Price moves because people make emotional decisions about the future.
Someone thinks:
> "This is going higher."
They buy.
Someone else thinks:
> "This move is over."
They sell.
Fear, confidence, excitement, uncertainty, greed, hesitation and exhaustion all become reflected in the movement of price.
So instead of looking at CCI as simply **overbought or oversold**, I wanted to think about it differently:
### What mood is the market in right now?
Sassy CCI combines CCI, price movement, compression and divergence with additional formulas designed to focus on the **important moments where that relationship changes.**
It isn't designed to predict the future.
It is designed to help **confirm what the market is already beginning to reveal.**
---
3. The Six Moods
### 🔵 CALM
**"Nothing important is happening yet."**
Price and momentum aren't showing a strong relationship or developing pressure.
**Response:**
🧘 **Wait.**
Don't force a trade just because the market is moving.
---
### 🟦 BUILDING
**"Something is starting to develop."**
Price is becoming compressed and conditions are tightening.
Think of it like a spring beginning to load.
**Response:**
👀 **Watch closely.**
This isn't necessarily the entry.
It means the market may be preparing for a larger move.
---
### ⭐ INTENSE
**"Pressure is building inside compression."**
The market has entered a significant compression state.
Price isn't necessarily moving much yet—but something is happening underneath the surface.
**Response:**
🎯 **Prepare for expansion.**
Watch for price, CCI and other confirmation to agree on the direction of the eventual move.
---
### 🩷 GROOVING
**"Price and momentum are working together."**
This is alignment.
Price and CCI are moving in the same general direction rather than fighting each other.
**Response:**
➡️ **Look for continuation.**
This can be especially useful for scalping because the momentum and price action are cooperating.
---
### 🟧 AGITATED
**"Price and momentum aren't agreeing."**
This is where things get interesting.
Price may be moving one way while CCI is telling us something different.
That disagreement can indicate:
* ⚠️ weakening momentum
* 🔄 a possible reversal
* 🪤 a failed move
* ⏳ a move that needs confirmation
**Response:**
🛑 **Slow down.**
Don't chase the move.
Look for confirmation before entering—or consider whether the current move is losing strength.
---
### 🔴 EXHAUSTED
**"The pressure has reached an extreme."**
This corresponds with the strongest pressure zone in Sassy CCI.
The move may still continue, but the market is showing signs that the current emotional push has become extreme.
**Response:**
🔄 **Look for a reaction.**
This is where reversal setups become especially interesting.
---
# 4. The Big Picture
Sassy CCI isn't saying: BUY or SELL.
Instead, it asks: "What is the market doing—and how are momentum and price responding to each other?"
Think of the moods as a progression:
**🔵 CALM**
↓
**🟦 BUILDING**
↓
**⭐ INTENSE**
↓
**🩷 GROOVING**
↓
**🟧 AGITATED**
↓
**🔴 EXHAUSTED**
The indicator is not trying to force a story onto the market.
It is trying to help identify **when the market's behavior changes.**
---
# 5. How I Use It
My goal isn't to use Sassy CCI as a standalone trading system.
I use it as a **confirmation tool**.
I want price action, important levels and Sassy CCI to tell a similar story.
Sassy CCI Alerts
---
# The Most Important Rule
### Don't trade the alert.
### Investigate the alert.
Sassy CCI is designed to **get my attention at important moments.**
Once it does, I look at:
**1. Price action**
**2. Key levels**
**3. Volume / participation**
**4. Market direction**
**5. Sassy CCI confirmation**
The indicator helps answer:
> **"Is something important happening right now?"**
Price action helps answer:
> **"Is there actually a trade here?"**
---
# A Simple Hierarchy
If I had to simplify the entire alert system:
| Signal | Attention Level | My Response |
| ----------------------- | --------------: | --------------------- |
| 🔵 Calm / no alert | Low | Wait |
| 🟦 Compression Start | Medium | Start watching |
| ⭐ Compression / Intense | High | Prepare |
| 🟢 Compression Bias | High | Watch that direction |
| 🩷 Grooving | High | Look for continuation |
| 🟧 Agitated | High | Be cautious |
| 🟡 Pressure 1 | Medium | Momentum increasing |
| 🟠 Pressure 2 | High | Momentum is intense |
| 🔴 Pressure 3 | Very High | Watch for exhaustion |
| 🔄 Divergence | High | Look for a change |
| ⭐ Divergence+ | Very High | Look for confirmation |
### The goal isn't more alerts.
The goal is **better attention.**
Sassy CCI is designed to reduce the amount of time I spend staring at charts and increase the chance that I look at the chart **when something meaningful is developing.**
指标

Split ATRSplit ATR cuts every bar at two ATR envelopes — one around the open, one around the close — and draws the result as stacked candles. Hue is the bar’s volume change; lightness is whether each slice closed up or down; chroma is how surprising that slice is relative to those envelopes.
A sibling of Split VWAP. Same overdraw, same volume-hue coloring. The cut is different. Chroma is the new channel.
The cut
ATR is read from a lower timeframe so one chart bar contains several sub-bars. Auto is one-fifth of the chart: 1 minute on a 5-minute chart, 3 minutes on a 15-minute chart. The ATR length is a chart-bar window, scaled onto that subseries, so 14 on a 5-minute chart is 70 one-minute bars — the same span of time as ATR(14) on the chart.
Two values come off that series:
Open ATR — ATR on the first sub-bar of this chart bar
Close ATR — ATR on the last sub-bar of this chart bar
Those make two intervals, then the four endpoints are sorted in price order:
Open ± Open ATR
Close ± Close ATR
The four prices make five bands. A cut past the bar clamps onto the near extreme and collapses the empty band. A bar with no ATR yet is drawn whole and colored as the unsurprising core.
On the bar still forming, the first and last sub-bar start as the same bar, so open ATR equals close ATR until a second sub-bar appears. Open ATR then freezes; close ATR keeps updating.
What the slices mean
Each band is a slice of the bar. Membership of the slice midpoint decides how surprising it is:
In both envelopes — consensus core. Within typical reach of where the bar began and where it ended. Surprise 0.
Open only — departed. The bar left this zone behind. Surprise 0.5.
Close only — arrived. The bar moved into this zone. Surprise 0.5.
In neither, between them — the gap. Only exists when the two intervals are disjoint. Surprise 1.
In neither, outside both — excursion. Wick territory neither envelope accounts for. Surprise 1.
Color
Hue is the whole bar’s volume change. Red when volume fell, green when it held, blue when it rose. Every slice of the bar shares that hue. A symbol with no volume (an index) still splits; hue sits on the unchanged-volume green, and surprise and price lightness still color the slices.
Chroma is ATR surprise. The core is washed toward gray (Unsurprising chroma, default 0.25). Gap and excursion keep the full chroma. Departed and arrived sit halfway.
Lightness is closed-up / closed-down: each slice against the previous bar’s same-index close. An up close is the anchor color; a down (or unchanged) close is the same hue a step darker.
Up bodies are hollow. Wick and border stay opaque so the overdraw still hides the dash under a hollow middle.
The script draws in front of the chart’s own bars and covers them, so you do not need to hide the symbol by hand. Open ATR and Close ATR are what the status line and Data Window report.
Settings
Lower timeframe — Auto (1/5 of chart), or Custom. Must be shorter than the chart.
ATR length — chart-bar window (default 14). Scaled onto the lower timeframe.
ATR multiplier — scales both ATR values before the cuts are placed.
Unsurprising chroma — how much color the consensus core keeps.
Price down darkening — how much darker a down slice is than an up slice.
Volume-hue anchors — falling / unchanged / rising volume.
Built around a 5-minute chart with Auto (or Custom 1). Color conversions use the OKLCh library. 指标

Economic News Release - USD Forex Factory Weekly 2026Economic News Release – USD Forex Factory Weekly
A compact, chart-integrated economic calendar designed for traders who need immediate visibility of scheduled U.S. economic events without leaving TradingView.
The indicator displays a weekly USD news table based on Forex Factory calendar classifications and is specifically engineered to remain functional during TradingView Bar Replay. Unlike calendar tools that reference the current real-world date, the displayed week is derived from the chart’s active/replay timestamp, allowing historical sessions to be reviewed with the corresponding embedded economic-event schedule.
Key functionality includes:
This Week / Next Week selector for quickly switching between the active calendar week and the following week.
Bar Replay compatibility — the calendar follows the historical replay cursor rather than the current date.
USD events classified by Forex Factory impact:
Red — High Impact
Orange — Medium Impact
Gray — Lower Impact
Silver — U.S. market/bank holidays
Independent filters for each impact category.
One row per economic event, preserving the individual time, event name, and impact classification.
Dynamic table sizing — only the rows required for the selected week are displayed, eliminating unnecessary empty space.
Adjustable table text size from Tiny through Huge.
Customizable table position and background transparency.
Event timestamps standardized to America/New_York / Eastern Time, appropriate for U.S. index and futures-market analysis.
Includes major macroeconomic releases, central-bank events, employment data, inflation data, sentiment releases, scheduled speeches, holidays, and other relevant USD calendar events contained in the embedded database.
The indicator is intended primarily as a contextual risk-management and historical-review tool. It can be used to identify when price action occurred around scheduled economic catalysts, distinguish ordinary trading periods from event-driven conditions, and perform more accurate historical session analysis in Bar Replay.
Important: Pine Script cannot directly retrieve live Forex Factory calendar data through arbitrary HTTP requests. Consequently, the calendar is embedded within the script and represents a maintained calendar snapshot. Future event dates, times, or classifications may be revised by the original calendar source and therefore require periodic script updates.
This indicator does not generate trade signals or predict market direction. It provides structured economic-calendar context directly on the chart. 指标

Range Breakout by AVRange Compression Breakout
Volatility compression and expansion system
Range Compression Breakout automatically detects periods of low-volatility consolidation, draws and maintains the range in real time, and signals when price transitions into expansion.
How it works
Compression is measured relative to the market's own recent behavior rather than a fixed price distance. In Adaptive Percentile mode, a range qualifies when its high-low span sits among the quietest percentile of its recent history — so the same settings work across futures, FX, crypto, and equities without retuning. ATR Multiple mode is also available for a fixed volatility-based threshold.
Once a range is detected, the box is dynamic. While price stays contained, the box expands to absorb new highs and lows, capturing the full churn of the consolidation instead of resetting on every probe.
Signals
Break — price closes decisively beyond the boundary plus a buffer, with optional multi-bar confirmation and an optional volume-spike filter.
Wick Long / Wick Short — a failed probe outside the range that closes back inside on a long wick, confirmed by the following bar, indicating mean reversion toward the midline.
A cooldown period after each break prevents the box from immediately reforming on the expansion move.
Settings
Four preset profiles — Tight Ranges for low-timeframe scalping, Normal Ranges for intraday, Swing Trading for multi-day consolidations, and Options Selling for extended sideways chop — each configuring lookback, tightness, minimum bars, confirmation, and cooldown. Custom mode exposes all parameters. Box fill, borders, midline, and signal colors are fully adjustable, and each signal type toggles independently.
Alerts
Range Detected, Range Breakout, Breakout with Volume Confirmation, and Range Reversal.
Notes
Volume confirmation should be left off on spot FX and other symbols reporting tick-based volume. Diagnostic values including the range-to-ATR ratio and compression state are available in the Data Window for calibration. 指标

Linear Regression Channel Visible Range Volume ProfileLR Channel VRVP — Linear Regression Channel + Visible Range Volume Profile
A multi-factor overlay that blends Linear-Regression-smoothed candles with a true Visible-Range Volume Profile, a statistical mean channel, Bollinger Band %, adaptive percentile bands, and auto-merging pivot Support/Resistance. Designed for traders who want a single clean visual that answers four questions at once: (1) Where is price relative to its statistical envelope? (2) Where has volume actually traded? (3) Where has the market accepted or rejected value? (4) Where are the extremes that are outside the standard deviation?
⚠️ Important note on the Volume Profile zone labels
The 68.2% and 95.45% Volume Profile zones are volume-coverage thresholds inspired by the 1σ/2σ probabilities of a normal distribution; they are not calculated standard deviations of the volume distribution. They are just shown as an analog representation of standard deviation.
The Volume Profile is not assumed to be normally distributed. The "±1σ" and "±2σ" labels are used as convenient shorthand because the 68.2% and 95.45% coverage percentages correspond to the familiar 1σ and 2σ bands of a Gaussian or Bell Curve. The actual values are computed by expanding outward from the POC until the specified percentage of traded volume is captured — a purely empirical calculation that makes no distributional assumption.
🔹 What's on the chart
Linear Regression Candles
The candles you see are not raw OHLC. Each of the four price points (open, high, low, close) is independently smoothed by a rolling linear regression over N bars (default 20). This removes intrabar noise while preserving the underlying trend slope, and produces candles whose shape reflects the smoothed market rather than the last tick.
Doji detection runs on the smoothed values: a candle is a doji when its body is ≤ 8% of its range and both upper and lower wicks are larger than the body. Dojis frequently appear at regression inflection points. On the chart, they are represented as yellow candles.
Static Mean Channel
A simple SMA(length) ± 2 × stdev(length) envelope (default 50). This is your statistical "normal" range. Price inside the channel = rotation. Price outside = extension. The channel fill is colored by regime (see below).
Visible-Range Volume Profile (right edge)
On every realtime tick the script rebuilds a volume profile across the currently visible bars. Each bar's volume is split into an up-volume / down-volume proxy based on whether the bar closed above or below its open, then distributed into price bins proportionally to the overlap between the bar's range and each bin. This is a proxy, not a true bid/ask tape read — it uses candle direction as a stand-in for aggressive buying vs. selling.
Three nested volume-coverage zones are drawn:
POC — Point of Control, the single bin with the highest traded volume. Solid yellow line extending left. The POC is a highest-volume price / acceptance reference, not a "fair value" in any valuation sense.
68.2% Value Area (VAH / VAL 34.1%) — dashed white lines. The volume-weighted band that captures 68.2% of traded volume around the POC. Comparable to a ±1σ analogy.
95.45% Extended Value Area (±47.7%) — solid purple lines. The band that captures 95.45% of traded volume around the POC. Comparable to a ±2σ analogy. I personally like to enter my trades at or outside of this area.
Bars outside the 95.45% zone are painted red to mark thinly traded / low-acceptance areas — price levels where the market spent little time and may be more prone to fast traversal. This is a low-acceptance highlight, not a proof of rejection.
Percentile Nearest Rank Bands
Symmetric grey dotted lines at mean ± PNR(|close − mean|, N). Unlike stdev bands, PNR uses the actual empirical distribution of price deviations, so it does not assume normality. On trending instruments this gives a much more honest "extreme" reading of price moves.
Support / Resistance (pivot-based, auto-merging)
Swing highs and lows are detected with a configurable lookback. When a new pivot lands within 0.5 × ATR of an existing level, the two are averaged into a single line instead of drawing a redundant one. Oldest levels are trimmed past the configured cap so the chart stays readable.
🔹 Candle colors — what each one means
🟢 Green (default bull) - Smoothed close > smoothed open, and LinReg close is inside the mean channel. Indicates a normal bullish bar in a neutral/slightly-bullish regime.
🔴 Red (default bear) - Smoothed close ≤ smoothed open and LinReg close is inside the mean channel. Indicates a normal bearish bar in a neutral/slightly-bearish regime.
🔵 Blue - LinReg close > upper band (bull bar) or LinReg close < lower band (bear bar). Indicates price has extended beyond the mean channel — early warning of a stretched move.
🟡 Yellow - Doji (body ≤ 8% of range with wicks on both sides) indecision. Often marks regression inflection points. Overrides all other colors.
🟦 Cyan (customizable) - Bollinger %B > 1, RSI overbought and price is outside both outer bands of the channels — or the mirror condition on the downside. These fully align three extreme conditions: oscillator stretched, price outside mean channel, price outside empirical PNR band. This is the strongest "everything is stretched" state. Dojis still override it.
Color priority (highest wins):
Doji → yellow
Extreme override enabled & condition met → cyan
LinReg close outside mean channel → blue
Otherwise → green / red
🔹 Background colors — what each one means:
🟩 Green vertical band ("Buy Zone BG") = Bollinger %B < 0 AND RSI < oversold threshold (30/40 depending on channel length). Price is trading below the lower Bollinger band and RSI confirms oversold. A classic mean-reversion / accumulation context.
🟥 Red vertical band ("Sell Zone BG") = Bollinger %B > 1 and RSI > overbought threshold (60/70 depending on channel length). Price is trading above the upper Bollinger band and RSI confirms overbought. Classic distribution / exhaustion context.
🟪 Purple vertical band ("Prime Accumulation Zone") where the BB% and RSI are both oversold threshold = Rare triple-confirmation zone: trend momentum is elevated in both directions, %B is depressed, and RSI is oversold. Marks high-conviction accumulation setups.
🟥 Dark red vertical band ("Prime Distribution Zone") = Percentile, Bollinger %B and RSI overbought threshold (Mirror of the above). High-conviction distribution / exhaustion setups.
The red and green backgrounds are frequent — they mark every overbought/oversold reading. The purple and dark-red backgrounds are rare and should be treated as elevated-conviction signals.
🔹 Channel fill color
The area between the upper and lower mean-channel bands is filled, and the fill changes color to reflect the current regime:
Channel Fill color
🟢 Green (translucent) = Price above mean and %B above its own average. Bullish regime — buyers in control.
🔴 Red (translucent) = Price below mean or %B below its own average. Bearish / neutral regime — sellers in control.
⚪ White (translucent) = Bollinger %B > 1 or %B < 0. Extreme regime — oscillator has broken out of its own band.
🔹 Volume Profile colors
Up-volume bars (inside VA) - Teal = Volume from bars closing above open — up-volume proxy
Down-volume bars (inside VA) - Orange = Volume from bars closing below open — down-volume proxy.
Bars outside 95.45% zone - Red = Thinly traded / low-acceptance area — possible rejection zone.
POC line - Yellow = Point of Control — highest-volume price / acceptance reference.
±1σ analogy (68.2% VA) - White dashed = 68.2% volume-coverage boundary.
±2σ analogy (95.45% EVA) - Purple solid = 95.45% volume-coverage boundary.
PNR bands - Grey dotted = Empirical percentile envelope around the mean.
🔹 How to read it
Start with the profile. POC = highest-volume price / acceptance reference. The 68.2% zone = normal rotation area. The 95.45% zone = the wider coverage band. Red bars = low-acceptance areas where price moved quickly and may do so again.
Check the fill. Green fill = bullish regime; red = bearish; white = stretched oscillator.
Look for candle confluence. A cyan candle appearing at or beyond the 95.45% VP boundary, near a pivot S/R level, and inside a purple background is the highest-probability reversal context this script identifies.
Use the backgrounds as context, not triggers. Green/red bands fire frequently and are noisy alone. Purple/dark-red bands are rare and pair well with a cyan candle and a structural level.
Trend direction comes from the slope of the smoothed candles and their position relative to the mean channel — not from any single bar.
🔹 Inputs reference and controls
Linear Regression Candles - LinReg period, doji sensitivity
Static Mean Channel - SMA length (also drives RSI and PNR length)
Percentile Nearest Rank - Sensitivity threshold (default 85)
Volume Profile - Rows, width, VA %, history depth, up/down colors, outside-95.45% color, label toggle, line-extension toggle.
Support & Resistance - Pivot lookback, max levels per side, ATR merge tolerance, line width, color, label toggle.
Extreme Oscillator - Candle Color, Enable toggle, custom color.
🔹 Notes & caveats
The Volume Profile reflects the currently visible chart range. Scroll or zoom and it redraws.
The profile recomputes on every realtime tick. Initial load on long-history charts may take a moment.
The 68.2% and 95.45% zones are volume-coverage thresholds, not calculated standard deviations of the volume distribution. The ±1σ / ±2σ labels are an analogy only.
Up-volume / down-volume is a candle-direction proxy, not a true bid/ask tape classification.
"Rejected" / "low-acceptance" areas are potential rejection zones, not confirmed ones — the profile shows where volume was thin, and thin areas are prone to fast traversal, not guaranteed to reverse.
Alerts are provided for the extreme-oscillator conditions (upper and lower).
This indicator is a contextual / analytical tool. It does not generate buy/sell signals.
Pair with a separate momentum oscillator pane if you want confirmation timing.
🔹 Credits
Built with Pine Script v6 using built-in ta.* functions. Logic is original. Feedback welcome. 指标

SuperTrend Regime Confluence📊 SUPERTREND REGIME CONFLUENCE
A trend-following strategy combining a volatility-adaptive SuperTrend with a
market-regime classifier and a five-factor confluence filter.
The three components aren't stacked arbitrarily. Each one fixes a specific,
well-known weakness of the others, which is why they're combined into a single
tool rather than used separately.
🧩 WHY THESE COMPONENTS ARE COMBINED
A standard SuperTrend has two weaknesses:
- Fixed ATR multiplier: too tight in volatile markets (premature flips), too
wide in quiet trends.
- It flips on every crossover regardless of conditions, causing whipsaws in
sideways markets.
This strategy addresses both:
1️⃣ Regime detection adapts the band.
An ADX plus ATR-ratio classifier labels each bar Trending, Volatile, or Ranging.
In Volatile conditions the multiplier widens (fewer false flips during
expansion); in Ranging conditions it tightens. The band reacts to conditions
instead of using one fixed setting.
2️⃣ The regime filter removes the worst environment.
Entries during the Ranging regime (where trend-following bleeds) can be skipped
entirely.
3️⃣ The confluence score gates each flip.
Rather than trading every SuperTrend flip, each candidate entry is scored 0 to
100. Only flips clearing a minimum score are taken.
Together: the classifier makes the band adaptive, the regime filter removes the
setting where the signal fails, and the score removes the weakest signals. Each
piece compensates for a limitation of the SuperTrend it's built on.
🧮 THE CONFLUENCE SCORE (rules-based, not machine learning)
A plain weighted sum of five factors, each contributing fixed points. It is
fully deterministic and documented in the code. No model, no training, no black
box:
- Volume surge (0 to 20): entry-bar volume vs its moving average
- Displacement (0 to 25): distance price moved beyond the band, in ATR units
- Trend alignment (0 to 20): signal direction vs a longer EMA
- Regime quality (0 to 15): more points in a clean Trending regime
- Prior distance (0 to 20): how far price held from the band before the flip
The sum (capped at 100) must exceed the Min Signal Score input to trigger entry.
🛡️ RISK MANAGEMENT AND SIZING
- Risk-based sizing: each position is sized so a stop-out risks a fixed percent
of equity.
- Capped at 90% of equity: no leverage, always a margin buffer (no liquidations).
- Selectable stops (ATR, Percent, or SuperTrend flip) and take-profits
(Risk:Reward, Percent, or None).
- Optional EMA filter, volume filter, entry cooldown, and long/short toggles.
- Default risk sits within TradingView's suggested 5 to 10 percent band. Lower it
for a more conservative profile.
⚙️ DEFAULT SETTINGS (as shown)
BTCUSDT, 4H, 6% risk per trade.
ATR length 10, base multiplier 3, regime lookback 40, ADX 14, ADX threshold 20.
Trend EMA 50, min signal score 65, ATR stop 6x, risk:reward 2.5, cooldown 5 bars.
Commission 0.06%, slippage 2 ticks.
Backtest shown: Jan 2020 to Sep 2026. Return +824%, max drawdown 24.55%, profit
factor 1.80, win rate 46.4%, 168 trades.
⚠️ NOTES ON USE
This is a trend-following system, so it performs best on instruments that trend
and expand in volatility. Expect drawdowns and losing streaks during extended
sideways periods, which is inherent to the approach.
Results shown are a historical backtest on a single instrument and do not
indicate future performance. Test on your own instrument, timeframe, and cost
assumptions before use. This is not financial advice. 策略
