Liquidity Sweep Hunter Algo [AlgoAlpha]🟠 OVERVIEW
Liquidity Sweep Hunter Algo identifies liquidity highs and lows across three different lookback periods and keeps them active until they are mitigated. This creates a persistent view of where resting liquidity has formed instead of only showing the latest swing points.
The indicator also displays a heatmap that highlights the relative strength of active liquidity levels and generates reversal signals after price sweeps multiple visible liquidity bands before reclaiming them. Optional trade drawings project a stop loss, reward target, and intermediate target levels directly on the chart.
🟠 CONCEPTS
Liquidity Level — A price extreme detected from fast, medium, and slow lookback windows. Matching levels are merged so nearby highs or lows are treated as the same liquidity area.
Liquidity Heatmap — A visual strength map where colour represents the relative strength of each active liquidity level compared to the other visible levels.
Multi-Level Liquidity Sweep — A reversal condition where price sweeps at least two visible liquidity bands and then closes back beyond the reclaim level within a limited number of bars. An optional strength filter can require the swept levels to exceed a minimum average strength.
🟠 FEATURES
Liquidity Heatmap — Displays active liquidity levels using a colour gradient that reflects their relative strength.
Multi-Level Sweep Signals — Plots bullish and bearish reversal labels after confirmed liquidity sweep and reclaim events.
Trade Projection Boxes — Draws entry, stop loss, reward zone, and target milestone levels after each signal.
Trade Progress Display — Fills the target area as price reaches successive target levels and marks completed trades with a check mark.
🟠 HOW TO USE
Watch the heatmap to identify where stronger liquidity has accumulated around current price.
Wait for a bullish or bearish sweep signal after price clears multiple liquidity bands and reclaims the area.
Use the optional trade projection as a visual reference for the calculated stop loss, reward target, and target milestones.
Increase the lookback values to focus on broader liquidity zones or decrease them to detect more local levels.
Adjust the sweep strength filter if you want signals only when stronger liquidity zones are involved.
🟠 CONCLUSION
Liquidity Sweep Hunter Algo combines persistent liquidity mapping, a relative strength heatmap, and multi-level liquidity sweep detection in a single indicator. It also provides optional trade projections that remain on the chart after each signal. Together these features help traders monitor where liquidity has formed, when it has been swept, and where price has reclaimed the area. Indicator

Last 20 Candles Visualizer & Dashboard📌 Last 20 Candles Visualizer & Dashboard
🌟 Overview
The Last 20 Candles Visualizer & Dashboard is a multi-timeframe analysis tool designed to give traders a clean, real-time overview of recent price action, daily key levels, candlestick pattern signals, and directional bias directly on their main chart.
Instead of manually uncluttering your chart or switching back and forth between timeframes, this script automatically plots important micro-level data over the last 20 candles while maintaining a high-level daily dashboard at the top right corner.
📊 Key Features
1. Daily Key Levels & Live Dashboard
Located conveniently in the top-right corner, the dashboard provides live monitoring for essential daily thresholds:
Current Price: Dynamic live market price.
TD High / TD Low (TDH / TDL): Today's High and Today's Low levels calculated directly from the Daily time period.
PD High / PD Low (PDH / PDL): Previous Day's High and Low levels.
PD Open / Close: Previous Day's Open and Close prices.
PDH - Price Diff: Displays the active dollar difference and percentage variance between the Current Price and the Previous Day High (Current Price - PDH). Formatted with explicit sign prefixing (+ or -) and color-coded green for positive values above PDH and red for values below PDH.
Bias vs PDH/PDL: Automatically evaluates overall daily directional bias based on current price position relative to the daily range:
BULLISH: Current price trading above PDH.
BEARISH: Current price trading below PDL.
NEUTRAL: Current price trading inside the Previous Day Range.
2. Last 20 Candles Data Overhead Labels
Displays structured, high-visibility labels positioned above the peak (high) of the last 20 candles tracking:
Open (O) & Close (C) Prices
Volume Split Estimations (Open Vol vs Close Vol)
Color-coded dynamically using Teal background tags for bullish closes and Maroon tags for bearish closes.
3. Visual Candle High/Low Levels
Draws custom horizontal micro-support and resistance line segments tracking the exact high and low levels for each of the last 20 recent bars.
4. Automatic Pattern Recognition
On-chart visual shape alerts for classic price-action setups:
Bullish & Bearish Engulfing Candles
Bullish Pinbars / Hammers & Bearish Shooting Stars
⚙️ Customizable Settings
Candle Levels Group: Toggle line visuals on/off or change the number of recent candles tracked (range: 1 to 50 bars).
Patterns Group: Enable or disable automatic candlestick pattern shape markers.
Dashboard Table Settings: Toggle dashboard table visibility and adjust table text sizes (Tiny, Small, Normal, Large).
I have created this to quickly glance PDH, PDL, TDH, TDL & Bias.
Happy Trading. Remember, NO indicator brings 100% results. DYOR. Indicator

Indicator

ATK/DEF Imbalance Power Liquidity Analysis EngineATK/DEF Imbalance Power Liq Analysis Engine is a market behavior analysis framework designed to evaluate swing high and swing low through the relationship between balance fl and imbalance powr.
Unlike traditional high and low point identification methods that mainly focus on pric location or histor turning areas, this indicator focuses on analyzing the internal strength characteristics behind pric movements by measuring the interaction between balanced conditions and directional imbalance.
The core concept of this framework is based on evaluating how pric behavior develops when bu and se pressure become balanced or imbalanced. By stu the intensity, deviation, and persistenc of these conditions, the indicator provides additional analytical information about the quality and behavioral characteristics of detec swing structures.
The engine combines several analytical components to evaluate high and low point behavior:
1. Balance and Imbalance Flo Analysis
The Balance Flo modu evaluates the relationship between positive and negative pric pressure using candle structure and pric movement characteristics.
This component measures the degree of directional imbalance and identifies whether market activity is showing stronger one-sided pressure or a more balanced condition.
The objecti is not to classify market direction, but to evaluate the internal strength distribution around pric struc.
2. Imbalance Power Measurement
The Imbalance Power modu measures the intensity of pressure differences between opposing forc.
By analyzing the magnitu of imbalance, the framework evaluates whether a swing high or swing low develod under strong pressure conditions or weaker participation conditions.
This provides a quantitative reference for comparing different structur points based on their internal behavioral characteristics.
3. Flo Strength Behavior Analysis
The Flo Behavior component studie changes in balance strength over time.
It evaluates whether flo conditions are increasing, decreasing, stabilizing, or shifting between different states.
This allows users to observe how pressure behavior changes around histor swing areas without relying only on pric leve.
4. Market Weight Capacity Evaluation
The Market Weight modu compares current imbalance strength against recent histor conditions.
This measurement provides context regarding the relative intensity of current flo behavior and helps distingu stronger and weaker activity environments.
5. Multi-Timeframe Imbalance Relationship
The framework evaluates short, medium, and longer fl conditions to display the relationship between different imbalance states.
This component provides additional context regarding whether different calculation periods show similar or conflicting pressure characteristics.
6. Swing High and Swing Low Behavioral Analysis
The indicator integrates imbalance and balance measurements directly with detected swing high and swing low structures.
Each structural point can display related flo information, including:
• Balance flo condition
• Imbalance strength level
• Flo behavior status
• Pressure change characteristics
• Structural activity reference
This approach focuses on stud the effectiveness and behavioral quality of high and low points rather than simply marking histor pric extremes.
Key Features:
• Balance and imbalance flo evaluation
• Swing high and swing low behavior analysis
• Candle-based pressure measurement
• Imbalance strength classification
• Flo behavior monitoring
• Market weight comparison
• Multi-period imbalance relationship analysis
• Structural point information display
• Analytical dashboard with calcu measurements
• Quantitative evaluation of pric behavior characteristics
ATK/DEF Imbalance Power Liq Analysis Engine is designed as a technical analysis rese tool for stu the relationship between pric structures, internal pressure distribution, and changing market behavior.
The displayed values represent calcu analytical measurements derived from histor price data. The framework is intended to provide additional context for stud market structure and liquidity behavior rather than providing tra instructions or directional decisions.
Indicator

[Kpt-Ahab] Candles Slot MachineHow the Game Works
Candles Slot Machine** is an automated slot machine simulation that runs directly on the PulseWire chart.
Each new game starts with 100 credits:
1. Disable Autoplay to reset the game and change the settings.
2. Set the maximum number of spins under Autoplay bars.
3. Select the wager per spin under Bet per spin.
4. Enable Autoplay to start the game.
5. Exactly one spin is completed at each confirmed close of a real-time bar.
The wager is deducted from the available credits on every spin. Three symbols are then generated, and any applicable payout is calculated.
A game ends when:
* the selected maximum number of spins has been reached, or
* there are not enough credits remaining for the next wager.
The final result remains visible for three fully completed bars. The next game then starts automatically with another 100 credits. The cumulative session statistics remain active until Autoplay is disabled, which resets the entire session.
Symbols and Payouts
Each symbol has its own probability:
* **Cherry:** 30%
* **Lemon:** 25%
* **Bell:** 18%
* **Star:** 13%
* **Seven:** 9%
* **Diamond:** 5%
Two matching symbols pay x1. This only returns the original wager, resulting in a net outcome of zero for that spin.
Three matching symbols pay:
* **Cherry:** x6
* **Lemon:** x8
* **Bell:** x12
* **Star:** x20
* **Seven:** x40
* **Diamond:** x100
Three Diamonds form the jackpot.
The payout model has a theoretical RTP of 92.53%. This value represents the expected long-term payout relative to all credits wagered. It does not guarantee any particular outcome for an individual game or a short session.
Random Generation
The reel symbols are generated using a combined pseudo-random calculation. The script uses, among other inputs:
* runtime random values
* individual game and spin numbers
* confirmed OHLCV data from the current bar
* bar closing time and bar index
Market data is used exclusively as additional entropy for the random-generation process. It is not evaluated as a trading signal, and there is no intended relationship between price direction and game results.
The script is not designed to simulate historical spins retroactively. New spins are executed exclusively on confirmed real-time bars.
Game Speed
The speed of the game depends directly on the selected chart timeframe because one spin is completed per confirmed bar close.
Examples:
* On a 1-minute chart, approximately one spin is completed per minute.
* On a 15-minute chart, approximately one spin is completed every 15 minutes.
* On a 1-hour chart, approximately one spin is completed per hour.
Exchange closures, missing market updates, or unconfirmed bars delay the next spin accordingly.
Indicator

STRX - AutoCorrelationSTRX – AutoCorrelation is a quantitative analysis tool designed to monitor real‑time correlations between up to five assets, using the Pearson correlation coefficient over a customizable period and timeframe. The script displays a correlation matrix as a heatmap table together with a structured textual reading, providing an immediate operational view of the strength and direction of relationships across assets.
The “Assets to Correlate” panel allows the user to select up to five instruments (for example Gold, US100, USDX, Silver, Platinum) and to enable or disable each slot individually, so the correlation set can be quickly adapted to different market contexts. Through the “Settings” panel, the user can define an independent calculation timeframe, the lookback period for the correlation, whether to show the textual reading table, and the position of the panel on the chart.
The matrix highlights, for each pair, the normalized correlation value between −1 and +1, with a color scheme that distinguishes positive and negative correlations and emphasizes their intensity. The textual reading table classifies each relationship as “Strong”, “Moderate”, “Weak” or “Negligible” and specifies the sign (“Positive” / “Negative” / “Independent moves”), helping the user assess co‑movements, diversification, hedging behavior and potential concentration of risk across the selected assets.
This indicator is intended as a decision‑support tool for multi‑asset analysis and does not generate standalone entry or exit signals. It does not constitute financial advice or a guarantee of performance; any trading or investment decisions remain solely the responsibility of the user. Indicator

Price Structure RSIOverview
Price Structure RSI is a market-structure oscillator that converts confirmed structural breaks into a cumulative directional series and then applies the Relative Strength Index calculation to that series.
Unlike a traditional RSI, which is calculated directly from price changes, this indicator measures how previously identified pivot highs and pivot lows are being broken.
The oscillator includes:
- market-structure-based RSI
- configurable RSI length
- configurable overbought and oversold levels
- Close or High/Low structure-break confirmation
- optional EMA, SMA, or WMA smoothing
- confirmed bullish and bearish signals
- dark and light colour presets
- gradient oscillator visualization
- simplified bullish and bearish historical W/L panels
- configurable target and stop distances
- configurable panel positions
- bullish and bearish alerts
The indicator is intended to help users examine whether recent market-structure breaks are producing stronger bullish or bearish pressure.
It does not predict future price movement and does not provide automatic instructions to enter or exit a trade.
Open-source reuse and credits
Price Structure RSI is a modified and expanded derivative of the open-source indicator "Market Structure RSI" by ClayeWeight.
The original pivot detection, stored structure levels, broken-structure accumulation, cumulative structure total, RSI transformation, moving-average selection, threshold-crossing signals, and alert framework were adapted from ClayeWeight's work.
This version adds:
- Pine Script v6 compatibility
- dark and light colour presets
- revised oscillator colours and gradient fills
- confirmed-bar signal processing
- configurable historical target and stop measurements
- next-bar outcome evaluation
- conservative same-bar target and stop handling
- separate bullish and bearish W/L panels
- configurable panel positioning and offsets
- additional input validation
- revised alert messages
The original source was published under the Mozilla Public License 2.0.
This modified version is also published open-source under the Mozilla Public License 2.0.
Core methodology
The indicator first identifies simple confirmed pivot highs and pivot lows.
A pivot high is identified when:
- the centre candle has a higher high than the candle before it
- the centre candle has a higher high than the candle after it
A pivot low is identified when:
- the centre candle has a lower low than the candle before it
- the centre candle has a lower low than the candle after it
Because the script evaluates historical candles, the pivot is recognized only after the necessary later candle has closed.
Confirmed pivot-high prices are stored in an array.
Confirmed pivot-low prices are stored in a separate array.
Structure breaks
The indicator checks whether stored pivot levels have been broken.
Users can select one of two Structure Break Type settings:
- Close
- High/Low
When Close is selected:
- a stored pivot high is considered broken when the previous candle closes above it
- a stored pivot low is considered broken when the previous candle closes below it
When High/Low is selected:
- a stored pivot high is considered broken when the previous candle high moves above it
- a stored pivot low is considered broken when the previous candle low moves below it
When one or more stored pivot highs are broken, positive values are added to the cumulative structure total.
When one or more stored pivot lows are broken, negative values are added to the cumulative structure total.
Broken levels are removed from their respective arrays so that the same structure level is not counted repeatedly.
Cumulative structure total
Each broken pivot high contributes:
- +1
Each broken pivot low contributes:
- -1
If several stored structure levels are broken together, several values can be added during the same calculation.
The script then calculates the cumulative sum of these positive and negative structure changes.
A rising structure total indicates that more stored pivot highs are being broken.
A falling structure total indicates that more stored pivot lows are being broken.
Structure RSI
The Relative Strength Index calculation is applied to the cumulative structure total rather than directly to price.
The default RSI Length is:
- 20
The resulting oscillator is called the Structure RSI.
Higher Structure RSI values indicate that bullish structure breaks have recently had greater influence on the cumulative series.
Lower Structure RSI values indicate that bearish structure breaks have recently had greater influence.
The Structure RSI should not be interpreted as a standard price RSI because its input is the cumulative structure-break series rather than normal closing-price changes.
Overbought and oversold levels
The default levels are:
- Overbought Level: 80
- Oversold Level: 20
The Oversold Level must remain below the Overbought Level.
The script displays an error when the oversold setting is equal to or above the overbought setting.
The levels are configurable and should be treated as analytical thresholds rather than universally optimal settings.
Bullish signal
A bullish signal occurs when the Structure RSI crosses upward through the selected Oversold Level.
The signal is confirmed only after the chart candle closes.
The bullish marker appears at the bottom of the oscillator pane.
A bullish signal indicates that the structure-based oscillator has recovered above its lower threshold.
It does not guarantee that price will continue higher.
Bearish signal
A bearish signal occurs when the Structure RSI crosses downward through the selected Overbought Level.
The signal is confirmed only after the chart candle closes.
The bearish marker appears at the top of the oscillator pane.
A bearish signal indicates that the structure-based oscillator has moved back below its upper threshold.
It does not guarantee that price will continue lower.
Moving average
An optional moving average can be applied to the Structure RSI.
Available moving-average types are:
- EMA
- SMA
- WMA
The default settings are:
- Moving Average Type: EMA
- Moving Average Length: 8
The moving average can be used to observe the smoother direction of the Structure RSI.
The moving average does not directly create the bullish or bearish threshold signals.
Hiding the moving average does not change the Structure RSI calculation.
Oscillator colours
The Structure RSI line changes colour according to its current position.
- Above the Overbought Level: bearish colour
- Below the Oversold Level: bullish colour
- Between the two levels: neutral grey
The oscillator also includes:
- a dashed overbought line
- a dashed oversold line
- a dotted 50 midline
- a neutral background fill between the main levels
- bullish and bearish gradient fills
- optional dark and light colour presets
The colour settings change presentation only.
They do not alter the structure calculation or signal logic.
Confirmed signals
Bullish and bearish signals are accepted only on confirmed chart bars.
The script does not finalize a signal solely because the Structure RSI temporarily crosses a threshold while the active candle is still open.
Values may still move while the current chart candle develops.
The final marker and alert are generated only after the candle closes with the crossing condition confirmed.
Historical W/L measurements
The indicator includes simplified historical bullish and bearish outcome measurements.
These measurements are not a complete PulseWire strategy backtest.
When no measurement is currently active, a confirmed signal can begin a new historical measurement.
For a bullish signal:
- the signal candle close becomes the recorded entry price
- the target is placed above the recorded entry
- the stop is placed below the recorded entry
For a bearish signal:
- the signal candle close becomes the recorded entry price
- the target is placed below the recorded entry
- the stop is placed above the recorded entry
Only one unresolved historical measurement is tracked at a time.
Target distance
Target Distance (%) controls the percentage distance between the recorded signal close and the historical target.
The default value is:
- 1.0%
For a bullish measurement:
- Target = Entry Price × (1 + Target Percentage)
For a bearish measurement:
- Target = Entry Price × (1 - Target Percentage)
The minimum allowed target distance is 0.1%.
Stop distance
Stop Distance (%) controls the percentage distance between the recorded signal close and the historical stop.
The default value is:
- 1.0%
For a bullish measurement:
- Stop = Entry Price × (1 - Stop Percentage)
For a bearish measurement:
- Stop = Entry Price × (1 + Stop Percentage)
The minimum allowed stop distance is 0.1%.
Next-bar evaluation
Target and stop evaluation begins on the bar after the signal.
The signal candle itself is not used to determine the result.
This prevents price movement that occurred earlier during the signal candle from being counted after the entry has been recorded at that candle's close.
Wins and losses
The tables use the following labels:
- W = Win
- L = Loss
A win means that the configured target was reached before the configured stop.
A loss means that the configured stop was reached before the configured target.
The displayed percentage is:
- Wins divided by completed Wins and Losses
Bullish and bearish measurements are counted separately.
Same-bar target and stop handling
A chart candle can sometimes touch both the target and stop.
Standard OHLC chart data does not reveal which level was reached first inside that candle.
When both levels are touched during the same bar, the script records a loss.
This conservative rule avoids automatically assuming the more favourable outcome.
The script does not reconstruct lower-timeframe intrabar movement.
One active measurement at a time
Only one unresolved historical measurement can be active.
When a measurement is already active:
- later bullish or bearish signals can still appear
- later signals can still trigger alerts
- later signals do not start another W/L measurement
- the active measurement remains open until its target or stop is reached
An opposite signal does not automatically close the existing measurement.
This means that not every displayed signal is included in the W/L panels.
Bull panel
The Bull panel displays results from completed bullish measurements.
The panel contains:
- Bull
- W: number of bullish targets reached first
- L: number of bullish stops reached first
- percentage of completed bullish measurements recorded as wins
The Bull panel position can be selected from the available chart locations.
Bear panel
The Bear panel displays results from completed bearish measurements.
The panel contains:
- Bear
- W: number of bearish targets reached first
- L: number of bearish stops reached first
- percentage of completed bearish measurements recorded as wins
The Bear panel position can be selected independently from the Bull panel.
Panel positions and offsets
The Bull and Bear panels can be placed at:
- top left
- top centre
- top right
- middle left
- middle centre
- middle right
- bottom left
- bottom centre
- bottom right
Row and column offsets can be used to move each panel within the available position grid.
Negative row values move the selected panel upward.
Positive row values move it downward.
Negative column values move it to the left.
Positive column values move it to the right.
The final position is restricted to the available PulseWire table locations.
The panels can overlap when both are assigned to the same effective position.
Meaning of the displayed percentage
The percentage represents the share of completed measurements where the configured target was reached before the configured stop.
It is not:
- a guaranteed win rate
- proof of future profitability
- a complete strategy result
- a recommendation to enter a trade
- a forecast of future performance
The historical measurement does not include:
- commissions
- spread
- slippage
- liquidity
- order execution
- position sizing
- account equity
- partial exits
- trailing stops
- market gaps
- order rejection
- overlapping positions
- complete intrabar sequencing
Historical results do not guarantee future results.
Alerts
The indicator includes two alert conditions:
- Bullish Signal
- Bearish Signal
The Bullish Signal alert is triggered when the Structure RSI crosses upward through the Oversold Level on a confirmed chart bar.
The Bearish Signal alert is triggered when the Structure RSI crosses downward through the Overbought Level on a confirmed chart bar.
When creating PulseWire alerts, use:
- Once Per Bar Close
This matches the confirmed signal logic.
How to Use
1. Apply the indicator
Add Price Structure RSI to a standard PulseWire chart.
The oscillator appears in a separate pane below the main price chart.
2. Begin with the default settings
The default configuration is:
- RSI Length: 20
- Overbought Level: 80
- Oversold Level: 20
- Structure Break Type: High/Low
- Moving Average Type: EMA
- Moving Average Length: 8
- Target Distance: 1.0%
- Stop Distance: 1.0%
Review the indicator with its default configuration before changing several settings simultaneously.
3. Select the structure-break type
Choose High/Low when a stored structure level should be considered broken as soon as the previous candle's high or low passes it.
Choose Close when the previous candle must close beyond the stored structure level.
High/Low is generally more responsive.
Close is generally more restrictive.
Neither setting is automatically more accurate.
4. Read the Structure RSI
Use the oscillator to observe the balance of recent broken pivot highs and pivot lows.
A rising oscillator indicates that bullish structure breaks are having greater recent influence.
A falling oscillator indicates that bearish structure breaks are having greater recent influence.
The oscillator can remain elevated or depressed during extended directional conditions.
5. Read the overbought area
When the Structure RSI moves above the Overbought Level, bullish structure-break pressure has pushed the oscillator into its upper region.
The bearish signal does not occur merely because the oscillator is above the level.
The bearish signal occurs only when the oscillator later crosses downward through the Overbought Level on a confirmed bar.
6. Read the oversold area
When the Structure RSI moves below the Oversold Level, bearish structure-break pressure has pushed the oscillator into its lower region.
The bullish signal does not occur merely because the oscillator is below the level.
The bullish signal occurs only when the oscillator later crosses upward through the Oversold Level on a confirmed bar.
7. Wait for the candle to close
Signals are confirmed at bar close.
Do not treat a temporary intrabar threshold crossing as a finalized signal.
Wait for the marker to remain after the chart candle closes.
8. Use the moving average
Enable the moving average to observe a smoother version of the Structure RSI.
Available types are:
- EMA
- SMA
- WMA
A shorter moving-average length reacts more quickly.
A longer moving-average length responds more slowly.
The moving average can provide visual context, but it is not part of the threshold-crossing signal condition.
9. Configure the target and stop distances
Set Target Distance (%) and Stop Distance (%) according to the historical measurement you want to study.
For example:
- Target: 1.0%
- Stop: 1.0%
This creates an equal-distance historical measurement.
Another example:
- Target: 2.0%
- Stop: 1.0%
This creates a larger target than stop.
These settings are research parameters and are not recommended trading settings.
10. Read the Bull panel
The Bull panel measures completed bullish signals.
- W means the bullish target was reached first
- L means the bullish stop was reached first
- the percentage shows bullish wins divided by completed bullish outcomes
Only signals that begin while no other measurement is active are included.
11. Read the Bear panel
The Bear panel measures completed bearish signals.
- W means the bearish target was reached first
- L means the bearish stop was reached first
- the percentage shows bearish wins divided by completed bearish outcomes
Only signals that begin while no other measurement is active are included.
12. Understand same-bar outcomes
When both the target and stop are touched during the same candle, the result is counted as a loss.
This is a conservative assumption because the chart's OHLC data cannot show which level was reached first.
13. Understand skipped measurements
A signal can appear while another historical measurement is still unresolved.
That signal can still:
- display a marker
- trigger an alert
However, it does not begin another historical measurement.
This is why the total W/L count may be lower than the total number of visible signals.
14. Position the panels
Choose separate positions for the Bull and Bear panels.
The default positions are:
- Bull panel: top left
- Bear panel: top right
Use the row and column offsets when small position adjustments are needed.
Avoid assigning both panels to the same final position unless overlapping panels are intended.
15. Select the colour preset
Use Dark Background on dark chart themes.
Use Light Background on light chart themes.
The preset changes moving-average and panel text colours.
It does not change the indicator calculations.
16. Create alerts
Create separate PulseWire alerts for:
- Bullish Signal
- Bearish Signal
Use Once Per Bar Close.
Test alerts on the intended symbol and timeframe before using them operationally.
17. Review broader market context
Use Price Structure RSI together with additional analysis such as:
- trend direction
- price structure
- support and resistance
- volume
- volatility
- liquidity
- market sessions
- recent swing highs and lows
- scheduled economic or company events
- risk management
A threshold crossing alone does not guarantee a reversal or continuation.
Suggested starting process
- Apply the indicator to a standard candlestick chart
- Keep RSI Length at 20
- Keep the levels at 80 and 20
- Begin with High/Low structure breaks
- Keep the EMA smoothing line enabled
- Use a target and stop distance of 1.0%
- Wait for confirmed bar-close signals
- Compare the oscillator with visible price structure
- Review the Bull and Bear panels separately
- Remember that only one active measurement is tracked
- Test several symbols and timeframes before drawing conclusions
- Use Once Per Bar Close for alerts
Limitations
- The indicator is derived from the open-source Market Structure RSI by ClayeWeight
- The central structure-break accumulation methodology is adapted from the original work
- Pivot identification is based on a simple three-candle relationship
- Pivots are identified only after the required later candle has closed
- The oscillator measures broken stored structure levels rather than normal price momentum
- The Structure RSI can behave differently from a standard price RSI
- The indicator does not determine whether a structure break is genuine or false
- The indicator does not measure volume, volatility, liquidity, or trend strength
- Signals are confirmed at bar close and may occur later than temporary intrabar conditions
- A bullish signal does not guarantee that price will rise
- A bearish signal does not guarantee that price will fall
- Only one unresolved historical measurement is tracked at a time
- Not every visible signal is represented in the W/L panels
- Opposite signals do not close active measurements
- Target and stop evaluation begins on the bar after the signal
- Same-bar target and stop contact is recorded as a loss
- The W/L panels are simplified historical measurements
- The displayed percentages are not complete backtest results
- Commissions, spread, slippage, liquidity, position sizing, and execution are not included
- Historical outcomes do not imply future results
- The indicator should not be used as the sole basis for a trading decision
Price Structure RSI is an analytical and research tool.
It does not provide financial advice, guaranteed signals, guaranteed win rates, or guaranteed results. Indicator

YURI VWAP Sigma EngineSession VWAP with volume weighted deviation bands, and a read on whether today's bands are wide or narrow for this point in the session. The bands are the ordinary part. The comparison against the clock is the part that is not available anywhere else, and it is the reason this exists.
WHAT THE BANDS ARE
VWAP is the average price every share traded at today, weighted by size. It is the benchmark institutional execution is measured against, which is most of why price keeps coming back to it. The bands are the volume weighted standard deviation of that same distribution, so they widen as the session builds disagreement and stay tight when it does not.
The deviation readout is the first number. "1.8 sigma above VWAP" says you are paying more than almost anyone else did today. Whether that is a breakout or a bad fill is a separate question this does not answer.
THE PROBLEM WITH BAND WIDTH
Band width on its own cannot be read, and the reason is structural rather than a matter of tuning. Width is a function of how far into the session you are. Sigma at 09:45 is small on every day that has ever been recorded, and sigma at 15:30 is large on every day that has ever been recorded, because the distribution simply has more in it by then. An absolute width therefore tells you the time of day and almost nothing about the day.
Comparing today's width at 10:15 against the width at 10:15 on each of the last twenty sessions removes the part that belongs to the clock. What is left belongs to today: this session is running wider than it normally is by now, or tighter.
Two details make that comparison mean anything. Width is measured relative to VWAP rather than in points, because the same instrument at 400 and at 700 does not produce comparable point spreads. And the comparison window is short on purpose, twenty sessions by default, so the reference is the volatility regime you are actually trading in rather than an average across several of them. A quiet day inside a violent month should not read as wide.
THE DISCLAIMER THAT TURNS INTO A FEATURE
Every VWAP band implementation carries the same warning: the bands are unreliable in the first fifteen to thirty minutes, because there is not enough volume in the distribution yet and they come out far too narrow.
Half of that stops mattering here. The under sampling applies equally to today and to every session today is being compared against, because they are being compared at the same point on the same clock with the same amount of data behind them. The absolute number early in the session is still meaningless. The comparison is not.
The half that does not go away is that a percentile built from six bars moves around far more than one built from sixty, and comparing like for like removes the bias without removing that. Measured across sixty sessions the percentile moves roughly eleven points a bar in the first half hour against roughly one point a bar after midday. So the early read is tagged rather than hidden. The first half hour is when a read on the session is actually worth having, and a noisy number that says it is noisy beats waiting until lunchtime for a number the session has already made obvious.
WHY NOT THE BUILT IN
The built in VWAP will draw the same bands, and if bands are all you want then use it. What it cannot do is tell you what today's width means, because that requires holding the width from previous sessions slot by slot and comparing like for like. The bands here are the input to that. The output is the state, the percentile, the multiple of a typical day, and the dotted envelope showing where the outer band sat at this exact point of the session on a median day.
THE PART THAT ACTUALLY MATTERS
A state has to hold for several bars before it gets named.
Drop that and this becomes a threshold that flips every time the percentile wobbles across the line, and within a week you have learned to ignore it. The hold period is the difference between a session read and a flicker. It is exposed in the inputs, it resets at every session open because the state describes today rather than yesterday, and there is no correct setting, only the one that matches how often you are willing to change your mind.
READING IT
Blue line is VWAP. Solid grey lines are the inner and outer bands, at one and two sigma by default.
Dotted line is the typical day. It is where the outer band sat at this point of the session across the comparison window. Today's band outside the dotted line is an expansion, inside it is a quiet day, and the distance between them is the whole read made visible without looking at a number.
The band shading carries the state. Orange is wide, blue is narrow, teal is normal, grey means there is no read yet.
The table gives the multiple of a typical day, the state with its percentile in brackets, how many sessions the comparison is actually running against, the current deviation in sigma, the distance from VWAP in percent, and how many times price has touched each outer band today.
The bracketed percentile is worth watching on its own because it moves before the label does. A percentile climbing through the middle seventies tells you the state is about to be named while the hold period is still counting.
Two words appear in the state that are not states. Forming means the session has just opened and the label has reset but not yet held long enough to be named, so the percentile is live and the label is not. Early means you are still inside the window where the percentile is built on very few bars, and it is a tag on the number rather than a different number.
SETTINGS THAT MATTER
Sessions to compare against sets the reference. Shorter reacts to the current regime and will call a wide day normal once wide days become the regime. Longer is a more stable reference and slower to accept that the regime has changed.
The wide and narrow percentiles are separate inputs. There is no reason a wide day and a quiet day have to be equally rare in your reading of the market, and if you want one side more sensitive, move that one and leave the other alone.
Sessions needed before it reads is a floor on the sample. Below it the table says warming up rather than computing a percentile out of four numbers.
Minutes before the read is trusted moves the early tag and nothing else. It changes no number and hides no reading. Set it to zero if you would rather judge the sample size yourself.
The anchor controls the VWAP reset only. The clock comparison needs a daily anchor, since a weekly or monthly anchor has no session clock to normalise against, and the table says so rather than printing a number that does not mean anything.
WHAT IT WILL NOT DO
It does not generate entries or exits, and it is not a forecast. A wide session is not a short and a narrow one is not a breakout setup. Width describes how much disagreement the session has built, not which side wins it, and the same reading precedes both a reversal and a trend continuation often enough that treating it directionally is a mistake the indicator cannot stop you making.
It needs real volume. On instruments where the feed reports tick counts instead, VWAP and everything built on it are approximations, and spot FX in particular has no consolidated volume at all.
It needs a clock, though not necessarily a closing bell. On a symbol that never closes the exchange day still rolls over, so the comparison runs against that boundary and produces a read rather than refusing one. Whether the roll of a twenty four hour day marks anything real for the instrument in front of you is your judgement to make, not the script's.
The comparison history is built as the script runs across the chart, so the read needs the comparison window plus the minimum sample to have gone past before it says anything. On a fresh chart that is the first few weeks of visible history, not the first bar.
This is context for a decision, not the decision.
Indicator

Indicator

AM TBR - NQ Stats## Summary
Credit. All historical statistics shown by this indicator are transcribed from the AM TBR study published by NQ Stats — a 10-year analysis of 2,572 NQ sessions (2016–2026). The research design and data analysis are entirely their work; this script is an independent live reconstruction of that methodology
AM TBR anchors a Time-Based Range at the 08:00 New York open, projects ±0.25 standard-deviation levels from that open using a rolling 20-day sample standard deviation of prior session % net changes, and tracks a single, well-defined statistical event in real time: does price touch either level, and if so, does it revert to the TBR Open before 12:00 New York?
Once a touch occurs, the indicator overlays historical context for that exact situation — reversion probability conditional on the hour of the touch, typical adverse excursion (MAE) zones, continuation (MFE) targets after reversion, and time-based cumulative milestones — so you can see at a glance whether the current session is behaving like a typical reverting session or drifting into historically non-reverting territory.
This is a statistical study tool, not a trading system. It does not generate buy/sell signals and makes no claims about future performance.
## What the indicator draws on the chart
At 08:00 New York every weekday the script anchors the TBR Open (drawn as a dashed line extended to 12:00), the two ±0.25σ touch levels, and an optional faint σ ladder at ±0.5 / 0.75 / 1.0 / 1.5 / 2.0 for scale. A light background tint marks the active 08:00–12:00 window.
On the first touch of either level, a marker stamps the exact time (resolved to the minute via lower-timeframe data where available) and shaded MAE zones appear on the touched side. These zones are anchored at the TBR Open — not at the touch level — matching the source study's measurement convention. Reading them from the open outward: the grey zone (TYPICAL) ends at the historical median MAE of sessions that went on to revert; blue (DEEP) ends at the reverted P75; orange (STRETCHED) at the reverted P90; red (RISK) at the median MAE of sessions that never reverted; and the dark zone (NON-REV) extends to the non-reverted P75. The practical reading: while price holds inside grey/blue, the session is taking normal heat for an eventual reversion; pushing through orange into red means the extension now looks more like the historical failures than the historical successes.
If price reverts to the TBR Open before 12:00, the target label flips to REVERTED with the time, and three dotted MFE lines appear on the far side of the open at the historical median (green), P75 (yellow), and P90 (orange) continuation distances — how far past the open reverting sessions historically travelled. At 12:00 the session settles as Reverted, No Reversion, or No Touch.
## Reading the dashboard, row by row
**σ (20d sample).** The rolling standard deviation currently in force, shown both as a percentage and converted to points (e.g. "1.55% ≈ 450.50"). The points figure is your conversion key for every σ value in the table: multiply any σ number by it to get a price distance. A 0.445σ median MAE with σ ≈ 450 points means roughly 200 points of adverse excursion from the open.
**TBR Open (08:00).** The anchor price. Every level, zone, and statistic is measured from here.
**First Touch.** Which level was hit first, the exact time, and the hour band it falls into (08:xx, 09:xx, 10:xx, or 11:xx). The band drives everything below it, because the source study's strongest finding is that reversion odds depend heavily on when the first touch happens.
**Band Reversion Rate.** The historical percentage of sessions with a same-side touch in the same hour band that reverted to the open before 12:00, with its sample size. Colour reflects strength: green at 75%+ (08:xx touches), teal 65–75% (09:xx), orange 45–65%, red below. A ⚠ marks bands where the historical sample is tiny (10:xx and 11:xx, with 48 and 11 touches respectively across ten years) — treat those rates as directional at best.
**Outcome.** The live state machine: Waiting (levels drawn, no touch), Touched — Pending, Reverted ✓ with the reversion time, No Reversion ✗, or No Touch.
**MAE (σ from open).** Your session's maximum adverse extension so far, in σ units measured from the TBR Open, with a context tag comparing it against the reverted-MAE distribution for your band: "≤ p50" means the current heat is smaller than the median reverting session took; "p50–p75" and "p75–p90" mean progressively deeper but still within the range most reverting sessions survived; "> p90 ⚠" means the extension now exceeds nine in ten historical reversions; "≥ non-rev p50 ⚠" means it has reached territory more typical of sessions that never came back. The background shifts green → orange → red accordingly. This row is the single fastest health-check in the table.
## The stat block in depth
The dark header names the exact historical slice being displayed — for example "+0.25 · 08:xx — |σ| FROM TBR OPEN" means every number below describes sessions where +0.25 was touched first during the 08:00 hour, with all distances in σ units from the TBR Open. Signs follow the study's convention: for a +0.25 touch, MAE values print positive (heat is above the open) and MFE prints negative (continuation is below the open); for a −0.25 touch the signs flip.
Each row shows n, Mean, Median, P75, and P90 of a distribution:
**MAE Rev** — adverse excursion of sessions that ultimately reverted. This is the "survivable heat" distribution and the source of the grey/blue/orange zone boundaries. Median well below mean tells you the distribution is right-skewed: most reverting sessions took modest heat, a minority took a lot.
**MAE N-Rev** — maximum extension of sessions that never reverted by 12:00. Compare its median against the MAE-Rev P90: the gap between them is the discrimination region. For 08:xx +0.25 touches, reverting sessions' P90 heat was about 0.96σ while non-reverting sessions' median run was about 1.53σ — extensions between those two values are where the historical populations genuinely separate.
**MFE** — how far beyond the TBR Open reverting sessions continued after reverting. These are the three dotted target lines on the chart. The n here equals the reverted count, since only reverting sessions have an MFE. The large gap between median and P90 (0.69σ vs 1.99σ for 8am +0.25 touches) says continuation is occasionally explosive but usually moderate — which is why the lines are labelled as escalating reference distances rather than a single target.
To convert any cell to points, multiply by the σ-in-points figure from the top of the table.
## The cumulative section
**By 09:00 / 10:00 / 11:00 / 12:00** rows show the source study's cumulative reversion distribution: the percentage of all touched sessions (same side) that had already reverted by that clock time. These figures rise by construction — they are a running total of reversion times, ending at the overall band rate. When your touch is in the 08:xx band, the 8am-focus curve is used (27.9 → 68.2 → 76.1 → 78.4% for +0.25); otherwise the all-sessions curve applies. The Clock column counts down to each checkpoint and to the 12:00 Hard Stop.
Interpreting these correctly matters: a rising cumulative number is not "the odds are improving." The useful live question is conditional — if the session is still pending at a checkpoint, the chance of reverting before 12:00 equals (Final − Cum) ÷ (100 − Cum). Worked from the all-sessions +0.25 curve: still pending at 09:00 leaves roughly a 69% chance of reverting by noon; still pending at 10:00, about 34%; still pending at 11:00, about 10%. The longer a touched session goes without resolving, the more it historically resembles the sessions that never resolved.
## Inputs reference
**Setup group.** *SDEV Lookback* (default 20) sets how many completed daily sessions feed the standard deviation; 20 matches the source study, and changing it moves the levels while decoupling them from the reference statistics. *Touch Level (σ)* (default 0.25) sets the projected level distance — the levels will draw correctly at any value, but all displayed probabilities and distributions were generated for ±0.25 specifically and no longer describe other settings. *TBR Colour* and *Label Size* control appearance. *Keep previous sessions on chart* retains prior sessions' drawings instead of clearing at each new 08:00, useful for visually reviewing recent history (drawings beyond PulseWire's object limits are recycled oldest-first).
**Levels group.** *Show σ Ladder* toggles the ±0.5–2.0σ reference lines and *Ladder Colour* styles them. *Show MAE Zones after touch* toggles the shaded zone map; *Zone Labels* independently toggles the text tags on those zones, worth switching off on busy charts. *Show MFE Targets after reversion* toggles the three continuation lines.
**Dashboard group.** *Show Dashboard* toggles the table; *Show Cumulative Milestones* toggles its bottom section if you prefer a shorter table; *Position* and *Text Size* place and scale it.
**Alerts.** Two alert conditions are provided — "Level Touched" and "Reverted to Open." Create them from the standard alert dialog by selecting this indicator and the desired condition; "Once Per Bar" is the natural frequency for both.
## How the statistics were generated (methodology and source)
The probabilities and distribution values displayed by this indicator are **not computed from your chart**. They are transcribed reference statistics from an independently published, publicly available 10-year statistical study of NASDAQ-100 E-mini futures (NQ) covering 2016–2026 (published by NQ Stats). That study's methodology, which this indicator reproduces live:
- **2,572 total sessions** analysed; **2,545 touched** a ±0.25σ level within the window (1,252 touched +0.25 first, 1,293 touched −0.25 first).
- **σ definition:** rolling 20-day *sample* standard deviation of prior session % net changes; the level is projected as TBR Open × (1 ± 0.25 × σ/100).
- **Window:** 08:00–12:00 New York time; a session "reverts" if price returns to the TBR Open after the touch and before 12:00.
- **Headline rates:** 74.0% of +0.25 touches and 74.6% of −0.25 touches reverted, strongly conditional on touch hour: roughly 79% for 08:xx, 69.5% for 09:xx, 39.6% for 10:xx, 9.1% for 11:xx.
- **MAE and MFE** are measured in |σ| units from the TBR Open. Where the study published no distribution rows for a band (MFE for 10/11:xx touches; MAE for 11:xx), the nearest earlier band's values are substituted and documented in the code.
**What is computed live from your chart:** the σ value, the TBR Open, all level and zone prices, touch and reversion detection and timing, and the running MAE. The geometry is yours; the probabilities are the study's, projected onto your chart's coordinates.
## Detection details
On chart timeframes of 1 minute and above, 1-minute intrabar data timestamps the first touch to the exact minute and sequences same-bar events correctly, so a pre-touch dip to the open is never miscounted as a reversion. Where 1-minute history is unavailable (deep chart history), detection falls back to chart-bar resolution with a documented tiebreak. Reversion means trading at or through the TBR Open price.
## Recommended use
NQ / MNQ futures (the reference statistics are NQ-specific; other symbols will run but the statistics will not apply), on 1–15 minute timeframes that divide evenly into an hour so the 08:00 anchor aligns exactly. The most robust historical context comes from 08:xx touches (n ≈ 1,500); late-morning touches carry small samples and wide uncertainty.
## Limitations and honest caveats
Historical frequencies are not probabilities of future outcomes; regimes drift. The live σ may differ slightly from the study's around continuous-contract roll dates, since roll adjustments perturb close-to-close % changes — statistics are σ-relative so behavioural context transfers, but exact prices may differ marginally from the original research. Sub-minute event ordering is unknowable at any bar resolution, and MAE on the reversion bar can be slightly overstated when the adverse extreme printed after the open-cross within the same bar; the underlying 1-minute study shares the same granularity limits. Source values were transcribed from the published tables and not independently re-derived; one internal inconsistency in the source (a single P90 cell differing between two of its tables) is documented in the code with the more internally consistent value chosen.
This indicator is for educational and analytical purposes only and is not financial advice.
---
*Open-source under the Mozilla Public License 2.0. The statistical reference values are transcribed from publicly published research as described above; the live reconstruction, detection engine, and visualisation are original work.* Indicator

Daily EMA60 Standard Error Table-zrbb-Quickly estimate the stop-loss range required for daily-chart trading.
快速估算日线级别交易需要的止损范围
In quantitative finance / stock market research, "3 standard errors" (requiring a t-statistic ≥ 3, corresponding to roughly a 99.7% confidence level) has a few main uses:
1. Raising the significance bar to guard against data snooping
This is the most important application. When quant researchers backtest large numbers of factors, strategies, or parameter combinations, the conventional 95% confidence threshold (about 2 standard errors) is often too lenient — if you test hundreds or thousands of parameter combinations, some will look "significant" purely by chance (the multiple comparisons problem).
Researchers like Marcos López de Prado have proposed raising the significance threshold to a t-stat ≥ 3 (i.e., 3 standard errors) as a rule of thumb to substantially reduce the probability of "false discoveries" — mistaking luck for real alpha — and to combat backtest overfitting.
2. Building more conservative confidence intervals
For estimating parameters like strategy returns or factor exposures (beta):
Mean ± 1 SE → roughly 68% confidence interval
Mean ± 2 SE → roughly 95% confidence interval
Mean ± 3 SE → roughly 99.7% confidence interval (assuming approximate normality)
Using 3 SE means you require very strong evidence before drawing a conclusion, reducing the risk of mistaking noise for signal.
3. An important distinction to keep in mind
Standard Error (SE) and Standard Deviation (SD) are not the same thing:
Standard deviation measures the volatility of returns themselves (commonly used in Bollinger Bands, risk measures, etc.)
Standard error measures the uncertainty of an estimate (such as an average return or a beta coefficient); SE = SD / √n, so the larger the sample size, the smaller the SE
These two concepts are often conflated, but when judging whether a strategy's historical average return is truly significant, it's the standard error you should use — not the standard deviation of returns.
A practical caveat: even using 3 standard errors as a threshold is just a rule of thumb to reduce overfitting risk — it doesn't eliminate it entirely. Out-of-sample validation, economic rationale, and transaction cost considerations remain essential. Statistical significance alone doesn't guarantee a strategy will actually work in live trading.
在股市/量化投资研究里,"3倍标准误差"(即要求 t 统计量 ≥ 3,对应约 99.7% 的置信区间)主要有几个用途:
1. 提高策略显著性门槛,对抗数据窥探(data snooping)
这是最重要的应用场景。量化研究员在回测大量因子、策略参数组合时,常规的 95% 置信区间(约 2 倍标准误差)门槛太宽松——如果你测试了成百上千种参数组合,总会有一些"看起来显著"其实纯属巧合(多重比较问题)。
Marcos López de Prado 等人在量化文献中提出:把显著性门槛提高到 t-stat ≥ 3(即 3 倍标准误差),可以大幅降低"假发现"(把纯粹运气当作真实alpha)的概率,是应对回测过拟合的一种经验法则。
2. 构建更保守的置信区间
对于策略收益率、因子暴露(beta)等参数的估计:
均值 ± 1倍SE → 约68%置信区间
均值 ± 2倍SE → 约95%置信区间
均值 ± 3倍SE → 约99.7%置信区间(假设近似正态分布)
用3倍SE意味着你要求证据非常强才愿意下结论,减少"把噪音当信号"的风险。
3. 需要注意的一个关键区分
标准误差(Standard Error, SE)和标准差(Standard Deviation, SD)不是一回事:
标准差衡量的是收益率本身的波动性(常用于布林带、风险度量)
标准误差衡量的是"某个估计量"(比如平均收益、beta系数)的不确定性,SE = SD / √n,样本量越大SE越小
很多人会混用这两个概念,但在判断"这个策略的历史平均收益是否真实显著"时,该用的是标准误差,而不是收益率的标准差。
实际应用提醒:即便用3倍标准误差作门槛,也只是降低过拟合风险的经验法则,不能完全消除。样本外验证、经济学逻辑支撑、交易成本考量仍然必不可少——单纯统计显著不代表策略在实盘中一定有效。 Indicator

Mag 7 ORB DashboardThe 15/30 Minute ORB & Market Sentiment Dashboard is an all-in-one tool designed to help traders identify key opening-range levels, potential breakout zones, and the broader market’s directional bias. The indicator plots both the 15-minute and 30-minute Opening Range Breakouts, giving you clearly defined levels to monitor as price establishes its early-session range. It also automatically projects price target levels from 50% to 200% beyond the Opening Range, helping traders identify potential measured-move objectives and areas where momentum may continue as price breaks away from the range.
The built-in market sentiment dashboard tracks the Magnificent 7 stocks, SPY, and QQQ, showing whether each symbol is trading above or below its respective ORB. Green readings indicate strength and price trading above the ORB, while red readings indicate weakness and price trading below the ORB. The dashboard then provides an overall market sentiment view, allowing you to quickly see whether the broader market is showing bullish or bearish ORB participation. Whether you are trading stocks, options, futures, or simply analyzing market direction, this indicator combines Opening Range Breakout levels, projected price targets, and real-time market breadth into one streamlined tool to help you quickly understand where the market is breaking, where price may be headed, and whether the broader market is confirming the move. Indicator

Chart Date Range StampA screenshot that cannot be dated afterwards.
PulseWire's time axis spells out the YEAR only where a year boundary happens to fall inside
the current view, and there is no setting that changes that -- the axis label density is chosen
automatically from the zoom level. (Chart settings -> Scales -> Date format governs the CROSSHAIR
label, not the axis.) So the full date exists only on hover, and hover is exactly what a
screenshot does not capture.
This puts the date INTO the chart image: a one-cell table carrying the date of the leftmost and
the rightmost visible bar. Whatever the axis decided to print, the screenshot now states its own
range.
IT FOLLOWS SCROLL AND ZOOM, because it reads `chart.left_visible_bar_time` /
`chart.right_visible_bar_time` rather than the data. THAT IS ALSO ITS ONE COST: those two
builtins make the WHOLE script recalculate on every visible-range change, not just on a new bar.
Here that is one table cell and the cost is nothing -- but it is the reason this stays a
standalone file and is never folded into an indicator that computes anything. Adding these
builtins to a real detector would re-run its state machine on every scroll.
TIMEZONE: dates are formatted in the SYMBOL'S EXCHANGE timezone, which is what the axis labels
use. If the chart is set to display a different timezone the two can disagree by one day right at
a boundary bar; `tzOverride` exists for that case.
The range is BAR times, not wall-clock: on a daily chart the right value is the date of the last
visible bar, so a chart scrolled into the future whitespace still reports the last real bar.
IT STARTS BLANK, for a moment, and that is deliberate. Those builtins are na until the chart has
told the script what is on screen, which has not happened on the first calculation. There is no
honest fallback available: the obvious one, the current bar's own `time`, would print the same
date on BOTH sides -- and "2026-07-27 -> 2026-07-27" is not a partial answer, it is a confident
wrong one, on the single file whose whole job is to state a range correctly. So the write is
gated rather than faked. Blank for one calculation, never wrong. Indicator

AlgoStorm COT Positioning Index (COT-X)AlgoStorm COT Positioning Index (COT-X)
An institutional positioning engine that normalizes weekly CFTC Commitment of Traders data into a 0–100 COT Index for Commercials, Large Speculators, and Small Traders — with extreme-positioning zones, a raw net-positions mode, and automatic contract mapping for the major futures markets.
The AlgoStorm COT Positioning Index (COT-X) indicator is designed for swing and position traders who want to know who actually holds the futures market before committing to a directional thesis. The COT report is the only public record of that: commercial hedgers, large speculative funds, and the small-trader crowd. Raw net positions are nearly impossible to compare across time, so COT-X normalizes each group with Larry Williams' COT Index. When Commercials — the cohort with physical-market information — reach a positioning extreme against price, that has historically been worth knowing.
DATA TIMING — READ BEFORE LOADING
CFTC data is a TUESDAY snapshot published FRIDAY around 3:30pm ET. Everything on this indicator is at least three days behind the market by design. It is positioning CONTEXT for swing and position decisions over days to weeks — it is not, and cannot be, an execution signal . Alerts fire on the bar where a new report lands.
Technical Architecture: Week-Indexed Positioning Engine
Official Data Pipeline: Sources CFTC series through PulseWire's official LibraryCOT (Legacy report). Net positioning per group = Long − Short, requested per side and differenced in the script — nothing is approximated from price.
Williams Index Normalization: COT Index = 100 × (net − lowest net) / (highest net − lowest net) over the lookback window. Default 26 weeks (Williams' six-month setting); 156 weeks reproduces his classic three-year read. Values of 80+ mark historically extreme long positioning for that group; 20 and below, extreme short.
Week-Slot Ring Buffer: The lookback is counted in WEEKS, not chart bars. One slot is appended per weekly boundary and the live week's slot is refreshed in place, so the index reads identically on daily and weekly charts — a detail most COT scripts get wrong by measuring the lookback in bars.
Automatic Contract Mapping: The chart's futures root (ES, NQ, CL, GC, 6E, ZN and the other majors) is converted to its CFTC contract code automatically. A manual code-override input covers anything the auto-mapping misses, and an on-chart warning explains exactly what to do when a symbol has no COT series — the script never fails silently.
Report Selection: Futures-only report by default, with a toggle for the Futures + Options combined report.
Features & Functionality
Three Trader Cohorts: Commercials and Large Speculators plotted by default, Small Traders (the classic fade cohort) optional — each independently toggleable.
Extreme-Positioning Zones: Configurable thresholds (default 80/20) with a neutral-zone fill, plus an optional background tint whenever Commercials reach an extreme.
Net Positions Mode: Switches the pane to raw Long − Short contract counts with a zero line, for traders who want the unnormalized picture.
Positioning Table: Net position, index value, and extreme state for each cohort at a glance.
Alert Suite: Four conditions — Commercials entering the long- or short-extreme zone, Large Speculators entering the long- or short-extreme zone. Confirmed closes only.
Honest limitations: positioning extremes can persist for months — an extreme is a condition, not a trigger . The Legacy report's groups are broad; the Disaggregated report splits producers from swap dealers, and this version deliberately ships the Legacy read that the classic COT literature is built on. Use Daily or Weekly charts — the index builds one value per week, and intraday charts add nothing.
Open-source under CC BY-NC-SA 4.0. Educational tool — not financial advice. Indicator

Correlation Matrix [AFD]Correlation Matrix turns the active chart into a one-to-many cross-asset relationship monitor. It compares the chart symbol with up to eight instruments and brings slower and faster return correlation, fitted return sensitivity, matched spread distance, pair-specific correlation history, and data availability into one dashboard.
It is designed to answer practical research questions: Which selected markets have been moving with or against the chart symbol? Has recent co-movement departed from the slower relationship? How sensitive has the chart symbol been to each comparison? Is the matched spread unusually displaced for that pair? Is the reading supported by enough shared observations to interpret responsibly?
Built-in Symbol sets and Measurement presets provide repeatable samples. A Measurement preset selects a requested timeframe and Long/Short windows; it never changes the chart candles or requires a matching chart timeframe. Custom can follow the chart or request a fixed measurement timeframe. Optional rebased lines use a separate visual baseline. All outputs are descriptive measurements, not automated decisions.
What It Is Useful For
Cross-asset mapping: Place an index, sector, currency, commodity, rate-sensitive instrument, volatility index, or digital asset on the chart and compare it with a preset universe or a Custom basket. This helps organize intermarket context around one common reference symbol.
Relationship-change monitoring: Treat Long Correlation as the slower context sample and Short Correlation as the faster sample. Correlation Difference shows how far the faster coefficient sits above or below the slower one, while the two coefficients preserve their direction and sign. It is a comparison of two estimates, not a formal regime or significance test.
Benchmark and proxy research: Compare correlation with Beta to separate consistency of co-movement from fitted magnitude of response. This can help screen which selected benchmark, sector, or macro proxy has historically had the closest relationship to the chart symbol. It is not factor attribution.
Candidate-hedge research: Screen for relationships that have been negative across the selected windows, then use Beta and Data Coverage as sensitivity and sample context. The output can narrow further research; it does not select a hedge, calculate contract quantities, or account for liquidity, basis, carry, costs, or portfolio constraints.
Relative-value triage: Use Spread to identify a matched relationship that is unusually displaced from its own Long-window average, then use correlation, History, and usable-sample counts to judge whether the observation deserves investigation. Spread is not a cointegration test, regression residual, stationarity test, or mean-reversion forecast.
Exposure-overlap review: Chart one holding at a time against a Custom basket to identify potentially redundant co-movement or sensitivity. This is useful for screening concentration questions, but it is not a portfolio covariance engine or risk model.
Sample-integrity review: Read Data Coverage and the usable Long/Short return counts before interpreting a coefficient, especially across different sessions, holidays, young listings, or sparse feeds. These are availability disclosures, not confidence or quality scores.
Event and baseline comparison: Rebase percentage paths from Session Open, Rolling N Bars, Year Open, or a Fixed Date to inspect divergence after a session boundary, calendar reset, or chosen event. These chart lines are visual comparisons and never feed the statistics.
Capabilities
Eight configurable comparison slots. In Custom mode, each slot has a symbol, optional display name, color, Enabled switch, and Show comparison line switch. Blank slots remain hidden; an invalid or unavailable symbol displays No data without stopping valid rows.
Five built-in Symbol sets: United States Indices, Risk On / Off, Major Foreign Exchange Pairs, Energy & Metals, and Crypto. Custom values are retained while a set temporarily supplies eight symbols and ticker-derived names. Risk On / Off supplies comparison instruments; it does not classify the market.
Three Measurement presets plus Custom: Scalper requests 1 minute with Long 60 / Short 15; default Intraday requests 5 minutes with Long 78 / Short 20; Swing requests 1 day with Long 120 / Short 20. Swing on a 30-minute chart is an intended configuration, not an error: chart candles remain 30 minutes while completed 1-day observations drive measurements. Custom exposes the timeframe and both windows.
Long Correlation, Short Correlation, Main Correlation, Correlation Difference, Long-window Beta, signed Spread z-score, optional History percentile, and Data Coverage. Tooltips disclose usable Long/Short returns and fresh-versus-eligible coverage counts.
Contextual hover help on every dashboard heading and cell. It explains metric definitions, sample requirements, and unavailable states, with additional detail for Beta direction and fitted sensitivity, active Spread form and position, History's prior range and average, and Data Coverage endpoint counts.
Context, Compact, Full, Minimal, and Custom dashboard views; an independent Correlation Difference switch; custom column overrides; nine table positions; slot, absolute Long Correlation, or absolute Spread sorting; and Heat or Mono cells.
Optional rebased comparison lines with Auto from measurement preset, Session Open, Rolling N Bars, Year Open, and Fixed Date baselines. Seven appearances, a shared baseline marker, configurable line-end labels, and one-slot gap shading are included.
Separate dashboard and comparison-line visibility switches. Measurements continue while either visual layer is hidden. Status text identifies chart and effective measurement timeframes; its tooltip also identifies the requested timeframe, completed higher-timeframe sampling, lower-timeframe fallback, active windows, adjusted Short window, and visual line baseline.
Dashboard text, colors, backgrounds, transparency, alternating rows, borders, frame, line width/transparency, marker styling, label styling, gap colors, and a global master-opacity control can be adjusted without changing measurements.
How the Statistics Work
Correlation is computed on log returns, never on raw price levels. Correlating two trending price series directly can produce a spuriously high reading that reflects their shared trend rather than how their returns move together.
Pearson correlation has no universal market timeframe or lookback. The effective measurement timeframe and window define the observations. A 120-bar window with 1-minute measurements and the same window with 5-minute measurements are different samples and can produce different coefficients.
Correlation runs from +100% through 0% to -100%. It standardizes direction and consistency of linear co-movement; it does not imply equal-sized returns. Correlation Difference is computed as Short minus Long and displayed as a rounded signed number in percentage points.
Beta uses Long-window matched returns and direct covariance/comparison-return variance. From the chart symbol's perspective, Beta +1.20 describes a fitted 1.20-unit chart-symbol log-return response per 1.00 unit of comparison-symbol return in that sample. It is directional and asymmetric, and is benchmark beta only when the comparison is the intended benchmark.
Spread is a signed population z-score of an equal-weight matched log spread. Non-negative Long Correlation selects log(chart) minus log(comparison); negative Long Correlation selects log(chart) plus log(comparison). Separate histories are maintained for the ratio and product forms. The tooltip identifies the active form and whether the latest spread is above or below its matched Long-window average.
When the chart symbol is selected as its own comparison under the same request context, the ratio log-spread has zero variation. Its z-score is therefore unavailable rather than 0.0; after warm-up, identical requested data with measurable return variation produce +100% correlation, zero Difference, and Beta 1.
History ranks the current Main Correlation against only that pair's prior valid Main Correlation readings in the Historical window. A tie-aware midrank makes an all-tie sample read 50/100. It describes relative position inside the pair's own history, not statistical confidence or a forecast.
Data Coverage is fresh comparison endpoints divided by eligible Long-window measurement positions after the comparison first appears in loaded data. A carried timestamp is not counted twice. Coverage is distinct from the usable matched returns reported in the tooltips and does not alter any statistic.
Shared-Endpoint Alignment and Confirmation
At each chart-base measurement observation, the script selects the latest completed comparison endpoint known by that base close and maps it to the nearer current or preceding base close; a tie remains on the current close. A return pair is created only between consecutive accepted endpoint pairs when both base and comparison timestamps strictly advance.
Missing bars, holidays, and session gaps accumulate both instruments from the same prior shared endpoint instead of pairing different elapsed intervals. The accumulated interval remains one observation; it is not duration-normalized or split into synthetic bars. An unmatched observation writes one unavailable window position. A star marks a latest fresh comparison endpoint mapped to the preceding base close.
A complete configured measurement window, at least three usable returns, and measurable variation are required before Pearson is shown. Beta requires measurable comparison-return variance. Blank results are intentional when these conditions are not met.
Equal-timeframe requests use lookahead off and statistical snapshots commit on chart confirmation. Fixed higher measurement timeframes use completed bars: every requested price and timestamp field is offset by one measurement bar before lookahead is enabled. The chart timeframe does not need to match. A requested measurement timeframe below the chart falls back to the chart timeframe and produces an amber warning.
The chart-base request retains the active chart's complete ticker context. A slot set to the chart symbol reuses that exact context; other nonblank comparisons inherit applicable session, price-adjustment, currency, and futures modifiers. PulseWire ignores modifiers that do not apply to a comparison instrument. Changing an applicable modifier can change requested prices, timestamps, measurements, coverage, and rebased lines.
The comparison lines are a ratio, not a 1:1 price overlay
The optional chart lines do not plot the other symbol's raw price or its correlation. Each line is tied to the chart symbol's measurement-timeframe price, then moved forward by the percentage change of the compared symbol from that line baseline:
That is a ratio calculation, not a 1:1 mirror of price. Every drawn line uses the same baseline rule when measurement data is available, so its percentage path shares the chart's scale regardless of what either instrument costs.
Comparison line starting point is visual only. Auto from measurement preset uses Session Open for Scalper, Intraday, and Custom, and Year Open for Swing. Fixed Date sets the first base boundary on or after the date. Rolling N Bars moves the shared boundary. Each comparison waits for fresh eligible data, so a line can begin after the marker, remain blank, or jump as a rolling window changes. No line setting changes any dashboard measurement.
Settings
Quick Setup: Measurement preset selects timeframe and Long/Short windows without changing or requiring a matching chart. Dashboard view and Show correlation difference control columns. Symbol set controls the universe. Show dashboard and Show comparison lines control visual layers. Comparison line starting point controls rebased visuals.
Symbols and slots: Custom is the default Symbol set. On an SPY chart, the starting Custom symbols are QQQ, DIA, and IWM; the remaining slots are blank. These are examples, not recommendations. A blank display name derives the ticker automatically. Built-in sets override retained Custom symbols and names until Custom is selected again.
Custom measurements: Blank Custom timeframe follows the chart; a fixed selection at or above the chart holds its requested sampling without changing candles. Long defaults to 120 (range 10-1000); Short to 20 (range 5-200). If Short is not below Long, effective Short becomes Long minus one and appears in amber. Long changes Long, Difference, Beta, Spread, and Coverage; Short changes Short and Difference.
Main Correlation and History: Main correlation window defaults to Short and selects the existing Long or Short result used by Main Correlation, History, and line-end correlation text. Historical comparison defaults off. Its window defaults to 750 and accepts 100-5000 effective measurement positions; History remains blank until the full measurement window exists.
Dashboard views and columns: Default Context shows Symbol, Long, Short, Spread, and Coverage; Compact shows Symbol, Short, and Spread; Full shows Symbol, Long, Short, Beta, Spread, Coverage, and enabled History; Minimal shows Symbol and Main; Custom uses individual metric switches. Custom columns can override any view. Difference is independently on by default.
Dashboard layout: Nine positions default to Top Right. Sorting uses Slot order, strongest absolute Long, or widest absolute Spread. Cells use Heat or Mono. Text, colors, backgrounds, transparency, row shading, borders, and frame are adjustable.
Comparison line style: Solid is the default; Dashed, Dotted, Step, Step with diamonds, Points, and Crosses are available. Width defaults to 2 and transparency to 50. Area, histogram, and column modes are intentionally excluded because they can obscure candles or distort the price scale.
Starting-point details: Rolling N Bars defaults to 120 and accepts 10-1000 effective measurement bars. Each line waits for its first fresh valid endpoint at or after the shared rolling boundary. Fixed Date is editable and defaults to 1 January 2026. The optional shared marker has style, color, transparency, and width controls.
Gap shading and labels: Gap shading can fill between chart price and one selected rebased slot with separate chart-above/chart-below colors and transparency. Line-end labels can include display name, Main Correlation, and Spread, with size and slot/custom text-color controls.
Global appearance: Master opacity adds fade to table cells/text, lines, marker, fill, and labels; table border and frame keep their own colors. Appearance, visibility, ordering, and baseline controls do not alter calculations.
What It Does Not Do / Limitations
This is a one-to-many dashboard: every row compares one instrument with the active chart symbol. It is not a full pairwise matrix among all eight comparisons, a covariance matrix, portfolio optimizer, factor model, value-at-risk calculation, or position-sizing engine.
Correlation measures a historical linear relationship in returns. It does not establish causation, forecast persistence, detect nonlinear dependence, or label a pair bullish or bearish.
Correlation Difference is not a hypothesis test or statistical regime detector. The indicator does not calculate p-values, confidence intervals, statistical significance, or multiple-comparison adjustments.
Beta is a backward-looking fitted sensitivity with the chart symbol as the dependent return series. It is not symmetric and is not a dollar-, volatility-, or contract-neutral hedge ratio.
Spread is an equal-weight log ratio/product z-score selected by the sign of Long Correlation. It does not establish cointegration, stationarity, fair value, or an expectation of mean reversion.
History percentile and its Low-to-High context bands are relative only to that pair's prior Main Correlation. They are not confidence levels, relationship grades, decision rules, or forecasts.
Data Coverage measures fresh endpoint availability, not data accuracy, sample quality, or statistical reliability. Markets with different sessions can supply fewer usable returns, and an interval accumulated across a gap remains one observation.
Results depend on PulseWire's feed, exchange and session coverage, loaded history, selected symbols, applicable chart modifiers, effective measurement timeframe, and window lengths. Changing session, price adjustment, currency conversion, supported futures settings, or other applicable data settings can change the values.
The indicator requires standard, time-based candles. Non-standard chart types and tick charts halt with a runtime message because the measurement contract requires ordinary time-based OHLC bars rather than synthetic or tick-built observations.
Blank Custom timeframe follows the chart. Built-in presets and fixed Custom timeframes do not require a chart match. A request below the chart falls back to the chart timeframe; a fixed higher timeframe excludes the developing measurement bar and can update up to one confirming chart bar later.
Blank cells indicate insufficient measurement history, matched returns, or variation. A line can begin after its marker or remain blank when no fresh baseline observation exists. Rebased lines can stretch autoscale, and Rolling N Bars can jump as its denominator moves.
The implementation keeps eight static comparison requests plus one chart-base request. Disabling a slot changes the display but does not remove its request or reduce the fixed request cost.
This measurement-only build does not generate alerts, classify relationships, automate decisions, execute orders, or provide position- or risk-management instructions.
Design and Originality
Pearson correlation, covariance, Beta, and z-scores are standard statistics. This implementation integrates an eight-instrument universe, independent measurement and visual baselines, two return windows, causal shared-endpoint matching, sample disclosures, direct Beta, separate ratio/product spread histories, prior-only tie-aware History, sortable views, and fresh-boundary rebased lines.
The components share one confirmed measurement clock and interpretation surface. They combine slower/faster relationship context, fitted sensitivity, availability, spread displacement, pair history, and normalized paths without importing an external correlation series or creating a classification state.
Open-source License
This is an open-source publication. The source is licensed under the Mozilla Public License 2.0 (MPL 2.0) and includes AuctionFoundry attribution. Reuse in another PulseWire publication must first satisfy PulseWire's open-source reuse rules; once those rules are met, the MPL 2.0 terms apply.
Disclaimer
For educational and informational purposes only. Not financial advice. Indicator

Fib-Weighted Volume ProfilesFib-Weighted Volume Profiles combines Fibonacci retracement levels with a swing-based volume profile on the most recent confirmed pivot leg. Instead of drawing Fib levels in isolation, this indicator shows how much of the swing's traded volume accumulated near each Fib price — helping you spot high-confluence support, resistance, and reaction zones.
What makes it different
Volume-weighted Fib analysis on the active swing leg (not a fixed session profile)
POC (Point of Control), 70% Value Area, and horizontal volume histogram
Golden Pocket zone (0.618–0.66) highlighted for OTE / pullback trading
Confluence star ratings (★ to ★★★) based on volume %, POC proximity, and Golden Pocket
Ghost POC lines from prior swings for historical liquidity context
Optional HTF EMA trend filter to fade counter-trend levels
Developing swing extension (SH* / SL*) before pivot confirmation
Built-in alerts for strong Fib confluence, POC touch, and Golden Pocket volume
How it works
Detects the latest swing using confirmed pivot highs/lows (default 5 left / 5 right bars — no repaint).
Builds a volume profile across that swing range using configurable price bins.
Plots standard Fib levels (0, 0.236, 0.382, 0.5, 0.618, 0.786, 1) and measures the % of total swing volume near each level.
Colors and line weight reflect volume strength: strong (≥20%), medium (≥10%), weak.
When POC aligns with a Fib level, labels merge into a single POC+Fib tag.
Value Area box turns green/red on breakout; dashed style indicates a developing (unconfirmed) swing.
Chart elements
Yellow dashed line — POC (highest volume price in the swing)
Blue box — Value Area (~70% of volume); dashed border = developing leg
Purple box — Golden Pocket (0.618–0.66)
Grey histogram — Volume distribution by price bin
Colored Fib lines — Volume strength at each retracement level
P-1, P-2 labels — Ghost POC from previous swings
SH / SL — Swing high / low markers (asterisk = developing)
Recommended settings
Stocks / Forex (15m–1H): Bin Count 24–32, Pivot 5/5
Crypto (5m–15m): Bin Count 32, enable LTF Volume Distribution if on higher TF
No volume data (some CFDs): Enable "Synthetic Profile If No Volume" — Fib + swing only, or equal-weight approximation
Crowded labels: Increase "Label Horizontal Spacing" to 12–16 bars
Alerts
Strong 0.618 Volume — volume confluence at the 0.618 Fib level
Strong Fib Confluence — any Fib level exceeds the strong threshold (default 20%)
POC First Touch — price touches POC for the first time in the current swing
Golden Pocket + Volume — price in Golden Pocket with strong zone volume
Limitations
Designed for the latest swing leg — not a full-session anchored profile.
Very long swings are trimmed to Max Bar Range (default 500) for performance.
LTF volume applies to the current bar only; history uses chart-timeframe volume.
Pivot settings affect swing detection — adjust for your market and timeframe.
Drawing limits (500 lines/labels/boxes) may clip visuals on extremely active charts.
Disclaimer: This indicator is for educational and analytical purposes only. It does not constitute financial, investment, or trading advice. Past volume distribution patterns do not guarantee future price behavior. Always manage risk and do your own research before making trading decisions.
Indicator

Echo Vector PVSRA Volume### Credits and licence
The starting point for the relative-volume and volume-spread classification framework was the open-source “Traders Reality PVSRA Volume Suite,” originally created by infernix with library integration by peshocore, under the Mozilla Public License 2.0.
This derivative is independently named and does not use the Traders Reality or Pattern Watchers names as its branding.
The imported library calculation has been replaced with script-level calculations. This implementation adds configurable volume tiers, price-extension filters, volume divergence, optional divergence lines, extreme-volume event detection, body-recovery measurements, expanded alerts, and simplified historical outcome tables.
### Overview
Echo Volume Structure is a volume-analysis indicator that classifies candles according to:
* reported volume;
* candle direction;
* candle range;
* volume multiplied by candle range;
* body size;
* price extension from a configurable EMA.
The classifications are displayed as colour-coded volume columns in a separate pane.
Users can optionally apply the same classification colours to the candles on the main price chart.
The script also includes:
* regular bullish and bearish volume divergence;
* divergence markers and configurable lines;
* extreme-volume event diamonds;
* body-recovery tracking;
* simplified divergence target/stop outcomes;
* recovery statistics;
* configurable alerts.
The indicator identifies when its mathematical conditions are present. It does not establish why the activity occurred and does not predict what price will do afterward.
### Data source
By default, the indicator uses OHLC and volume data from the active chart symbol and timeframe.
The requested values include:
* open;
* high;
* low;
* close;
* volume.
The data is requested with lookahead disabled.
### Symbol override
Users can optionally analyze data from a different symbol instead of the active chart symbol.
The override can also contain a combination of compatible feeds, such as multiple exchange symbols added together.
Adding several data feeds can increase processing requirements.
When symbol override is enabled, users should confirm that the selected source is meaningfully related to the active chart.
Differences in exchange activity, trading hours, price scale, market structure, and volume reporting can cause the classifications to differ from those produced by the chart symbol.
### Volume-spread calculation
The script calculates a volume-spread value by multiplying candle volume by the candle’s high-to-low range.
This allows the classification process to consider both:
* the amount of reported volume;
* the price range produced during that volume.
A candle may qualify for an elevated classification because its volume is unusually high, its volume-spread value is unusually large, or it meets a combination of volume, body-size, and price-extension conditions.
### Candle-classification hierarchy
The script applies a fixed priority hierarchy.
When a candle qualifies for more than one classification, the highest active tier determines its colour.
The hierarchy from highest to lowest is:
1. Echo Peak Up or Echo Valley Down;
2. Ultra Up or Ultra Down;
3. Echo Surge Up or Echo Surge Down;
4. Echo Pulse Up or Echo Pulse Down;
5. Normal Up or Normal Down.
The classifications are internal analytical categories. They are not measurements of trade quality and do not guarantee reversal or continuation.
### Default colour key
The default candle classifications and colours are:
* Echo Peak Up — bright green;
* Echo Valley Down — bright red;
* Ultra Up — dark green;
* Ultra Down — dark red;
* Echo Surge Up — lime green;
* Echo Surge Down — light red;
* Echo Pulse Up — blue;
* Echo Pulse Down — fuchsia;
* Normal Up — light grey;
* Normal Down — dark grey;
* Extreme Volume Event — yellow diamond;
* Bullish Volume Divergence — turquoise upward triangle;
* Bearish Volume Divergence — coral-red downward triangle.
All classification, divergence, and line colours can be adjusted in the indicator settings.
### Echo Peak Up — bright green
An Echo Peak Up candle is bright green by default.
It requires:
* an up candle;
* volume at or above the selected multiple of the longer-term average volume;
* a candle body above the selected multiple of its average body size;
* price above the selected EMA by more than the configured standard-deviation distance.
The longer-term volume, body, EMA, and deviation settings are independently configurable.
Echo Peak Up identifies an unusually large bullish candle occurring while price is extended above its recent mean.
It may be examined as possible climactic or blow-off activity, but it does not prove that a market top has formed.
Price may continue rising after an Echo Peak Up candle.
### Echo Valley Down — bright red
An Echo Valley Down candle is bright red by default.
It requires:
* a down candle;
* volume at or above the selected multiple of the longer-term average volume;
* a candle body above the selected multiple of its average body size;
* price below the selected EMA by more than the configured standard-deviation distance.
Echo Valley Down identifies an unusually large bearish candle occurring while price is extended below its recent mean.
It may be examined as possible climactic or exhaustion activity, but it does not prove that a market bottom has formed.
Price may continue falling after an Echo Valley Down candle.
### Ultra Up — dark green
An Ultra Up candle is dark green by default.
It occurs when:
* the candle closes above its open;
* volume reaches the selected Ultra multiple of the longer-term average;
* the candle does not meet all the additional body-size and price-extension requirements of Echo Peak Up.
Ultra Up identifies exceptionally high reported volume on an up candle relative to the selected baseline.
It does not determine whether the activity represents accumulation, distribution, continuation, short covering, or reversal.
### Ultra Down — dark red
An Ultra Down candle is dark red by default.
It occurs when:
* the candle closes at or below its open;
* volume reaches the selected Ultra multiple of the longer-term average;
* the candle does not meet all the additional body-size and price-extension requirements of Echo Valley Down.
Ultra Down identifies exceptionally high reported volume on a down candle relative to the selected baseline.
It does not determine whether the activity represents accumulation, distribution, liquidation, continuation, or reversal.
### Echo Surge Up — lime green
An Echo Surge Up candle is lime green by default.
It is an up candle that meets at least one of the following conditions:
* volume reaches the selected Surge multiple of the recent average volume;
* the candle’s volume-spread value reaches or exceeds the highest previous volume-spread value within the selected lookback.
The candle must not already qualify for Echo Peak Up or Ultra Up.
Echo Surge Up identifies elevated volume or volume-spread activity on an up candle.
It is not an automatic bullish entry signal and does not guarantee that price will continue rising.
### Echo Surge Down — light red
An Echo Surge Down candle is light red by default.
It is a down candle that meets at least one of the following conditions:
* volume reaches the selected Surge multiple of the recent average volume;
* the candle’s volume-spread value reaches or exceeds the highest previous volume-spread value within the selected lookback.
The candle must not already qualify for Echo Valley Down or Ultra Down.
Echo Surge Down identifies elevated volume or volume-spread activity on a down candle.
It is not an automatic bearish entry signal and does not guarantee that price will continue falling.
### Echo Pulse Up — blue
An Echo Pulse Up candle is blue by default.
It occurs when:
* the candle closes above its open;
* volume reaches the selected Pulse multiple of the recent average;
* the candle does not qualify for Echo Peak Up, Ultra Up, or Echo Surge Up.
Echo Pulse Up represents moderately elevated volume on an up candle relative to the selected lookback.
It does not guarantee that upward movement will continue.
### Echo Pulse Down — fuchsia
An Echo Pulse Down candle is fuchsia by default.
It occurs when:
* the candle closes at or below its open;
* volume reaches the selected Pulse multiple of the recent average;
* the candle does not qualify for Echo Valley Down, Ultra Down, or Echo Surge Down.
Echo Pulse Down represents moderately elevated volume on a down candle relative to the selected lookback.
It does not guarantee that downward movement will continue.
### Normal Up — light grey
A Normal Up candle is light grey by default.
It closes above its open but does not meet any enabled elevated-volume classification.
A normal classification does not mean that the candle is unimportant. It means only that the selected relative-volume and volume-spread thresholds were not reached.
### Normal Down — dark grey
A Normal Down candle is dark grey by default.
It closes at or below its open but does not meet any enabled elevated-volume classification.
A normal classification does not mean that the candle is unimportant. It means only that the selected relative-volume and volume-spread thresholds were not reached.
### How to interpret the colours
The colour describes the candle’s direction and the relative-volume tier detected by the script.
For example:
* bright green identifies Echo Peak Up;
* bright red identifies Echo Valley Down;
* dark green identifies Ultra Up;
* dark red identifies Ultra Down;
* lime green identifies Echo Surge Up;
* light red identifies Echo Surge Down;
* blue identifies Echo Pulse Up;
* fuchsia identifies Echo Pulse Down;
* light grey identifies Normal Up;
* dark grey identifies Normal Down.
The colour should be interpreted together with price location and market structure.
An elevated-volume up candle near resistance may have a different context from the same classification during a breakout.
An elevated-volume down candle near support may have a different context from the same classification during an established decline.
The colour identifies the configured mathematical condition. It does not identify the intent of market participants and is not an instruction to buy or sell.
### How to use the indicator
Apply the indicator to a liquid symbol with usable volume data.
A practical workflow is:
1. Review the broader price trend and market structure.
2. Observe the normal volume behaviour of the selected symbol and timeframe.
3. Identify where elevated-volume colours appear relative to support, resistance, breakouts, failed breakouts, and extended price movement.
4. Compare the direction of each classified candle with subsequent price behaviour.
5. Note whether the event is isolated or part of a sequence of elevated-volume candles.
6. Review any bullish or bearish divergence marker while accounting for its pivot-confirmation delay.
7. Inspect yellow extreme-volume diamonds and whether price later crosses their recovery level.
8. Use the historical tables only as simplified chart-based measurements.
9. Test alerts on the intended symbol and timeframe.
10. Combine the indicator with independent price, volatility, liquidity, and risk analysis.
Do not treat an individual colour, triangle, diamond, ratio, or alert as an automatic trade instruction.
### Example use of an Echo Peak Up candle
When a bright-green Echo Peak Up candle appears, consider:
* whether price is already extended above its recent mean;
* whether the candle appears near established resistance;
* whether the candle closes strongly or leaves a large wick;
* whether subsequent candles continue higher or fail to maintain progress;
* whether similar high-volume activity appeared earlier;
* whether a bearish divergence is also present.
The condition identifies unusual volume, body size, and price extension. It does not prove a reversal.
### Example use of an Echo Valley Down candle
When a bright-red Echo Valley Down candle appears, consider:
* whether price is already extended below its recent mean;
* whether the candle appears near established support;
* whether the candle closes strongly or leaves a large wick;
* whether subsequent candles continue lower or recover;
* whether similar high-volume activity appeared earlier;
* whether a bullish divergence is also present.
The condition identifies unusual volume, body size, and price extension. It does not prove a reversal.
### Example use of Surge and Pulse candles
Echo Surge and Echo Pulse candles identify lower relative-volume tiers than Echo Peak, Echo Valley, and Ultra candles.
A sequence of lime-green or blue up candles during a breakout can show repeated elevated activity.
A sequence of light-red or fuchsia down candles during a decline can show repeated elevated activity.
The same colours near failed breakouts or important support and resistance may have a different context.
The classifications describe relative volume and direction, not future price outcomes.
### Main-chart candle colouring
When main-chart candle colouring is enabled, the script applies the classification colour to the corresponding candles on the price chart.
When disabled, the original price-chart colours remain unchanged while the classified volume columns continue to appear in the indicator pane.
### Background preset
The Dark Background and Light Background options adjust the table text colour for visibility.
The preset does not change the candle-classification colour palette.
Individual candle and line colours can be changed separately.
### Volume moving average
An optional simple moving average can be displayed over the volume columns.
The moving-average period is configurable.
The visible moving average provides an additional reference for current volume, but it is separate from some of the internal classification averages.
Changing the visible moving-average period does not automatically change the internal Peak, Valley, Ultra, Surge, or Pulse thresholds.
### Regular volume divergence
The divergence module compares confirmed pivots in price with confirmed pivots in volume.
It identifies two regular divergence conditions:
* bullish volume divergence;
* bearish volume divergence.
The conditions show structural disagreement between price pivots and volume pivots.
They do not guarantee that price will reverse.
### Bullish volume divergence — turquoise upward triangle
A turquoise upward triangle marks a confirmed bullish volume divergence.
The condition requires:
* price to form a lower confirmed low;
* volume to form a higher confirmed low.
This means price reached a lower pivot while the volume pivot did not form a corresponding lower low.
Users may examine the condition together with:
* nearby support;
* reduced downward progress;
* candle structure;
* broader trend;
* subsequent volume classifications.
Price can continue lower after bullish volume divergence is confirmed.
### Bearish volume divergence — coral-red downward triangle
A coral-red downward triangle marks a confirmed bearish volume divergence.
The condition requires:
* price to form a higher confirmed high;
* volume to form a lower confirmed high.
This means price reached a higher pivot while the volume pivot did not form a corresponding higher high.
Users may examine the condition together with:
* nearby resistance;
* reduced upward progress;
* candle structure;
* broader trend;
* subsequent volume classifications.
Price can continue higher after bearish volume divergence is confirmed.
### Divergence pivot strength
The Divergence Pivot Strength setting is applied to both the left and right sides of each pivot.
Higher values generally produce:
* fewer pivots;
* broader pivot structures;
* later confirmation;
* fewer divergence markers.
Lower values generally produce:
* more pivots;
* narrower structures;
* earlier confirmation;
* greater sensitivity to short-term noise.
There is no universal pivot value that is suitable for every symbol and timeframe.
### Divergence confirmation delay
A divergence is not known on the exact historical pivot bar.
The script must wait for the selected number of right-side bars before the pivot can be confirmed.
Once confirmed, the triangle is displayed on the earlier pivot bar.
For example, a pivot strength of 5 requires five later bars before confirmation.
The marker therefore appears earlier on the historical chart than the time at which the condition became available.
### Divergence lines in the indicator pane
Optional panel lines connect the previous and current volume pivots associated with the divergence structure.
Users can configure:
* bullish line colour;
* bearish line colour;
* line width;
* solid, dashed, or dotted style.
These lines help users inspect the change in volume pivots.
They do not project future movement.
### Divergence lines on the price chart
Optional price-chart lines provide a visual reference between price points associated with the volume-pivot locations.
Users can configure their colour, width, and style independently from the panel lines.
These lines are visual aids and should not be interpreted as projected support, resistance, or a forecast of future price movement.
### Extreme Volume Event — yellow diamond
A yellow diamond identifies an Extreme Volume Event.
The condition requires a combination of:
* an already elevated-volume classification;
* volume at least four times the rolling average of recent qualifying elevated-volume candles;
* the highest volume within the recent 50-bar period;
* a candle range above the recent average range.
The rolling event-volume average becomes available only after the script has collected 30 qualifying elevated-volume observations.
The diamond identifies an unusually large volume-and-range event under the selected rules.
It does not prove:
* manipulation;
* institutional activity;
* accumulation;
* distribution;
* liquidation;
* an imminent reversal.
### Extreme-event recovery level
When an Extreme Volume Event occurs, the script calculates a configurable level inside the candle’s body.
At the default 50% setting, the recovery level is the midpoint between the candle’s open and close.
It is not the midpoint of the full high-to-low candle range.
A recovery is counted when closing price crosses the body-based level within the selected recovery lookback.
A wick touching the level without a qualifying close-to-close crossing does not count as a recovery.
A recorded recovery does not guarantee continued movement beyond the level.
### Recovery lookback
The Recovery Lookback setting controls how many bars are allowed for price to cross the active recovery level.
If the level is not crossed within the selected number of bars, that event is no longer tracked as unresolved.
The script tracks only one unresolved recovery event at a time.
If a new yellow-diamond event appears before the earlier event is resolved, the active recovery level is replaced by the newer event.
### Historical divergence outcome table
The left table displays:
* Wins;
* Losses;
* Ratio.
When no earlier hypothetical outcome is active, a confirmed bullish or bearish divergence creates a new measurement.
The script records the confirmation-bar closing price and calculates:
* a fixed percentage target;
* a fixed percentage stop.
For a bullish divergence:
* the target is above the recorded close;
* the stop is below the recorded close.
For a bearish divergence:
* the target is below the recorded close;
* the stop is above the recorded close.
The script records which threshold is detected first.
Only one hypothetical divergence outcome is tracked at a time.
A new divergence is ignored while an earlier outcome remains unresolved.
### Same-bar target and stop behaviour
The target is checked before the stop.
If both the target and stop are reached during the same chart bar, the script records the case as a win.
The script does not reconstruct the lower-timeframe path within that candle, so it cannot determine which level was actually reached first.
This is a material limitation of the table.
### Meaning of the win ratio
The displayed ratio is the number of recorded wins divided by the total number of recorded wins and losses.
It is a simplified historical chart measurement.
It is not equivalent to PulseWire Strategy Tester results and does not model:
* commissions;
* slippage;
* spread;
* realistic order execution;
* position sizing;
* portfolio equity;
* liquidity;
* overlapping trades;
* all intrabar sequencing possibilities.
The ratio depends on:
* the symbol;
* timeframe;
* available chart history;
* divergence pivot strength;
* target percentage;
* stop percentage.
The displayed results do not imply future performance.
### Extreme-event recovery table
The right table displays:
* Recovered;
* Ratio.
Recovered is the number of yellow-diamond events for which closing price crossed the configured body-recovery level within the selected lookback.
The ratio is the number of recovered events divided by the total number of detected yellow-diamond events.
This is a simplified event measurement.
It is not:
* a reversal probability;
* an accuracy score;
* a trading win rate;
* evidence that future events will behave similarly.
### Alerts
Alerts are available for:
* any elevated-volume candle;
* Echo Peak Up;
* Echo Valley Down;
* Ultra Up or Ultra Down;
* Echo Surge Up or Echo Surge Down;
* Echo Pulse Up or Echo Pulse Down;
* bullish volume divergence;
* bearish volume divergence.
The general elevated-volume alert activates when any non-normal classification is detected.
### Current-bar behaviour
Volume, high, low, and close can continue changing while the current chart candle remains open.
As a result, candle classifications may appear, change tier, change colour, or disappear before the candle closes.
Extreme Volume Event conditions may also change while the current candle remains open.
Pivot divergence requires right-side confirmation, but the confirmation bar itself may still be open when the condition first becomes true.
Users seeking stable alerts should generally configure PulseWire alerts for bar-close execution.
### Suggested starting settings
A practical starting process is:
1. Begin with the default settings on a liquid symbol.
2. Observe how frequently each colour appears.
3. Review the relationship between elevated-volume candles and nearby price structure.
4. Keep the default volume multiples until several historical examples have been inspected.
5. Enable chart-candle colouring only if it improves readability.
6. Enable the volume moving average for additional context.
7. Review divergence triangles while accounting for their confirmation delay.
8. Treat yellow diamonds as extreme-volume markers rather than proof of manipulation.
9. Treat both tables as simplified research measurements.
10. Test alerts before relying on them.
### Adjusting the volume tiers
Increase a tier’s volume multiple to make that classification less frequent.
Decrease the multiple to make it more frequent.
Changing the Echo Peak and Echo Valley body, EMA, or deviation settings affects how strictly the script defines price extension and candle size.
More restrictive values generally produce fewer classifications.
Less restrictive values generally produce more classifications.
Settings should be reviewed separately for each market and timeframe.
### What this implementation adds
Compared with the referenced open-source starting framework, this implementation adds or replaces:
* script-level volume calculations;
* script-level volume-spread calculations;
* configurable multi-tier candle classifications;
* longer-term extreme-volume thresholds;
* candle-body filters;
* EMA-extension filters;
* standard-deviation extension measurements;
* independently configurable classification colours;
* dark- and light-background table presets;
* optional main-chart candle colouring;
* regular price-versus-volume divergence;
* configurable divergence markers and lines;
* optional price-chart divergence references;
* Extreme Volume Event diamonds;
* body-based recovery measurements;
* recovery statistics;
* simplified divergence target/stop outcomes;
* expanded alert conditions.
These modules are combined to study relative volume, price response, divergence, and subsequent recovery within one indicator.
### Limitations
* Reported volume differs between exchanges, brokers, markets, and symbols.
* Some markets provide tick volume rather than centralized transaction volume.
* Combined or overridden data feeds can produce different results from the active chart.
* The classification tiers depend on configurable averages, lookbacks, and thresholds.
* An elevated-volume candle does not reveal the identity or intent of market participants.
* Echo Peak Up does not confirm a market top.
* Echo Valley Down does not confirm a market bottom.
* Ultra, Surge, and Pulse classifications are relative-volume categories, not trade-quality grades.
* Candle classifications may change before the current candle closes.
* Pivot divergence is delayed by the selected right-side confirmation length.
* Confirmed divergence markers are displayed on earlier pivot bars.
* Price-chart divergence lines are visual references and not projections.
* Extreme volume does not prove manipulation.
* Extreme-event detection requires sufficient qualifying historical samples.
* The recovery calculation uses body-based levels and closing-price crossings.
* Only one unresolved recovery event is tracked at a time.
* The historical tables are simplified measurements and not full strategy backtests.
* Only one unresolved divergence outcome is tracked at a time.
* Same-bar target and stop sequencing is not reconstructed.
* The outcome tracker checks the target before the stop.
* The indicator does not account for commissions, slippage, spread, liquidity, position sizing, or realistic execution.
* The indicator should not be used as the sole basis for a trading decision.
This indicator is an analytical tool and does not provide financial advice or guaranteed trading outcomes.
Indicator

MACD Pro: Presets by Trading Style with Trend and Chop Filters-------DESCRIPTION
There is no single best MACD setup. The right one depends on your timeframe and on how you trade.
Gerald Appel built the indicator around 12, 26 and 9 for daily and weekly charts. Put those numbers on a fast intraday chart and the signal lags behind the price action. MACD Pro carries the tested setup for each trading style, and it will pick one for you based on the chart you are on.
----------THE PRESETS
Swing (4H, daily, weekly) uses 12, 26 and 9. This is the original setup. It finds macro trends and major reversals without catching every bit of market noise.
Day trading (5m, 15m, 1H) uses 8, 17 and 9. Balanced responsiveness. It cuts the lag on intraday charts while keeping enough smoothing to avoid constant whipsaws.
Intraday momentum (3m, 5m) uses 5, 13 and 1. Dropping the signal length to 1 turns the signal into a direct zero-line cross, which is the sweet spot for catching quick intraday momentum pushes.
Scalping (1m, 3m) uses 3, 10 and 1. Maximum sensitivity to short-term price bursts. High frequency and noisy, so it demands strict risk management.
"Auto by timeframe" reads your chart and loads the right setup for you. Move from a 5-minute chart to a daily chart and the settings follow you. Custom is there when you want your own numbers.
-----------WHY A SIGNAL LENGTH OF 1 IS HANDLED DIFFERENTLY
An exponential average of one period returns the input unchanged. That means at a signal length of 1, the signal line sits exactly on top of the MACD line and a crossover can never fire.
In that mode the script hides the signal line and switches the trigger over to the zero-line cross. The table on the pane tells you which mode is running.
--------------THE FILTERS
200 EMA trend filter. Longs only while price is above the 200 EMA, shorts only while price is below it. A crossover that passes prints a solid triangle. A crossover that fails prints a hollow circle, so you still see that it happened and can judge it yourself.
Chop filter. The MACD is a trend-following momentum tool. In a sideways range, crossovers fire over and over, and every one of them is a whipsaw. When ADX sits under your threshold, the pane shades gray and crossovers are marked as failed. Rely on crossovers only when price is expanding or breaking out.
----------------THE HISTOGRAM AS AN EARLY WARNING
The histogram measures the distance between the MACD line and the signal line. When those bars start shrinking toward zero, momentum is exhausting, even before any crossover happens.
Bars print bright while the histogram is expanding and fade to translucent while it is contracting. A bright green run turning pale is your cue to tighten stops or take something off the table. Yellow dots mark two shrinking bars in a row if you want it called out explicitly.
--------------PAIR IT WITH STRUCTURE
Never take a MACD entry on its own. Line the signals up with breaks of support and resistance, or with an opening range breakout backed by above-average volume. The more elements in agreement, the more confidence you can carry into the trade.
---------------ALERTS
- Filtered bullish signal
- Filtered bearish signal
- Upside momentum exhausting
- Downside momentum exhausting
-----------------NOTES
Written in Pine Script version 6. Every setting is editable, so nothing here is locked to my preferences.
Indicator

Indicator

YURI Breadth Regime EngineAn index is capitalisation weighted. A handful of large members can hold the whole thing up while most of the list quietly breaks down underneath, and the price chart will not show you that, because the price chart is the weighted number. The count is a different number. This reads the count and tells you when the two have stopped agreeing.
THE TWO THINGS IT MEASURES
The level is how much of the list is participating right now. The default series is the percentage of S&P 500 members trading above their own 200 day moving average. Four bands: washout below 20, weak below 40, neutral below 60, strong above it. Below 20 has historically been forced selling rather than opinion, because most of the list is under its own annual average at the same time. Those readings cluster near the end of declines rather than the start. That is an observation about where they have occurred, not an instruction to buy them.
The participation read is a different question: is the index outrunning its own members. That is a question about speed rather than position, so each series measures how far it has moved over the same window and that move gets ranked against its own history. Percent for the index, because a 50 point move meant something different at 2000 than it does at 7000. Points for breadth, which is already bounded at 0 and 100. The gap between the two ranks is what gets read, and ranking is what makes a price and a percentage comparable at all.
Index in the top of its own distribution of moves while breadth is in the bottom of hers is thinning. Fewer names are carrying it. Breadth moving up harder than the index is broadening, and it is what the back end of a washout looks like.
Ranking positions instead of moves is the obvious way to build this and it does not work, which is worth saying because the failure is instructive. An index drifts upward, so its position rank pins at the top of its range for months at a time. That builds a permanent bias into the gap, and it quietly collapses the whole read into "breadth is low", which is something the level already tells you. A move measured over a fixed window is centred on its own history by construction, so it has neither problem.
WHY BOTH, AND NOT JUST THE LEVEL
The level tells you where participation is. It does not tell you which way it is going relative to price, so a level read is equally happy at 55 on the way up and 55 on the way down. The participation read tells you the direction of the disagreement but has no sense of absolute position, so it will call thinning at 75 and at 35 without distinguishing between them, and those are very different markets. Neither one is sufficient. Read together, the level says how much of the list is in, and the rank gap says whether that number is keeping up.
THE PART THAT ACTUALLY MATTERS
A new participation state has to hold for several bars before it replaces the current one.
Drop that and this becomes a threshold that flips every time the rank gap wobbles across the line, and within a month you have learned to ignore it. The hold period is the difference between a regime read and a flicker. It is exposed in the inputs. One bar makes it reactive and noisy, ten makes it stubborn and late, and there is no correct answer, only the one that matches how often you are willing to change your mind.
READING IT
The line is the breadth percentage, coloured by band. Red zone is washout, teal zone is strong.
Orange triangle near the top of the pane: participation just turned thinning.
Teal triangle near the bottom: participation just turned broadening.
The table carries the live reading, the current band, how many bars breadth has been sitting under the washout line, and the participation state with the raw rank gap in brackets. That bracketed number is worth watching on its own, because it moves before the label does. A gap climbing through the high twenties tells you the state is about to be named while the hold period is still counting.
SETTINGS THAT MATTER
The breadth series and the index have to be the same index or the comparison is noise. The default pairing is INDEX:S5TH against SP:SPX. If you switch to a Nasdaq or Russell breadth series, switch the index with it.
The move window sets what counts as "has moved". Shorter makes the participation read sensitive to swings inside a trend, longer makes it a read on the trend itself. The ranking window sets how much history each move is judged against, and nothing reads at all until both windows have filled.
The thinning and broadening gaps are separate inputs because there is no reason the two sides have to share a number. Left equal at 30 they fire about as often as each other, so if you want one side more sensitive, move that one and leave the other alone.
WHAT IT WILL NOT DO
It does not generate entries or exits, and it is not a forecast. It describes the state of participation as of the current bar, and what you do with that is your method, not mine.
The breadth series prints once a day and has no intraday history. On an intraday chart the daily value is pulled instead, so the line steps rather than curves and the current day's value keeps moving until the close. It settles when the day does. Daily or higher is where this is meant to run.
If the external series is unavailable on your plan or your symbol, the pane turns orange and the table reads NA rather than plotting a flat line that could be mistaken for a real value.
Breadth is a coincident measure of participation, not a leading one. Washouts are identifiable in hindsight far more cleanly than they are while you are standing in one, and a thinning read can persist for months in a market that keeps going up. This is context for a decision, not the decision.
Indicator

Risk calculatorScript Name
Risk Calculator
Purpose
A trading tool that calculates position size (lot/coin quantity) based on a fixed percentage risk of the account balance. The script visualizes entry, stop-loss, and take-profit levels on the chart and displays detailed trade statistics in a table.
Core Workflow
User Input: balance, maximum risk percentage, entry/stop/take prices (manually confirmed on the chart).
Direction Detection: analyzes price positions to determine if the trade is LONG (take > stop) or SHORT (take < stop). Invalid combinations trigger "SETUP ERROR".
Key Metrics Calculation:
Maximum loss in dollars (max_loss_usd)
Distance from entry to stop and take in points and percentages
Position Sizing (two scenarios):
If stop percentage < max risk: volume = balance / entry price (entire balance at risk, but stop triggers earlier)
Otherwise: volume = max loss / distance to stop (risk strictly limited to the set percentage)
Profit/Loss Calculation in dollars and risk/reward ratio (RR).
Visual Elements Rendering on the last confirmed or real-time bar:
Green profit zone (between entry and take)
Red loss zone (between stop and entry)
Horizontal level lines with labels
Information table in the bottom-right corner
Technologies / Libraries Used
Pine Script v6 — PulseWire's native scripting language
Built-in functions:
input.float(), input.price() — data input
math.round_to_mintick() — rounding to minimum tick size
math.abs() — absolute value
table.new(), table.cell() — table creation
box.new() — rectangular areas
line.new() — trend lines
label.new() — text labels
Input Data
Balance ($) — account balance in USD (default: 1000)
Max Risk (%) — maximum risk per trade as percentage of balance (preset options: 0.25, 0.5, 0.75, 1, 2, 3, 5)
ENTRY — entry price (confirmed by clicking on the chart)
STOP — stop-loss price (confirmed by clicking on the chart)
TAKE — take-profit price (confirmed by clicking on the chart)
Output Data
Chart Visuals:
Colored profit (green) and loss (red) zones
Horizontal lines with price labels
Information Table (bottom-right corner):
Balance
Maximum risk in % and $
Trade amount in $
Volume in coins
Stop in % and $ (loss)
Take in % and $ (profit)
Risk/Reward ratio (1:X)
Key Features
Automatic position sizing with strict risk limitation
Level visualization directly on the chart for clear analysis
Flexible setup via manual price input on the chart
Risk/Reward ratio display (RR) for trade efficiency assessment
Support for both directions (LONG and SHORT) with automatic detection
Error protection: handles invalid price combinations (displays "ERROR" in the table)
Error Handling & Exceptions
Invalid price layouts (e.g., LONG with take < stop or entry outside the range) display "ERROR" in all table cells instead of numbers.
The direction variable is set to "SETUP ERROR", which blocks calculations and shows errors across all table fields.
The err flag checks for errors and replaces all numeric values with "ERROR" strings.
Dependencies & Environment Requirements
Platform: PulseWire (web or desktop application)
Pine Script Version: v6
Timeframe: any (script is timeframe-independent)
Ticker: any (cryptocurrencies, stocks, forex, etc.)
No additional installations required — the script runs natively within PulseWire
Implementation Details
Objects (lines, boxes, table) are created once on the last bar using barstate.islastconfirmedhistory and the objects_created flag to prevent redrawing on chart updates.
Visual elements are drawn with a 30-bar horizontal offset to the right for convenient label placement.
All calculations are performed in real-time as input parameters change. Indicator

Indicator

Indicator
