V16 Trend AnazlysisV16 - Daily Scoring Indicator Description
==========================================
V16 is a daily chart scoring indicator that evaluates whether a stock has the right conditions for a trade. Rather than giving a simple buy or sell signal, it scores the current setup out of 100 and tells you how strong the opportunity is before you commit to an entry. V16 is designed to be used first, before dropping to the 15 minute chart with V16E for the precise entry.
HOW IT WORKS
------------
V16 watches three core indicators simultaneously and combines them into a single score out of 100. The score updates on every bar and is displayed in a table in the top right corner of your chart. The higher the score, the stronger the setup. The colour of the score changes from red through orange, yellow and green to bright green as confidence increases.
ADX - 40 points - the foundation
----------------------------------
The Average Directional Index is the most heavily weighted component because without a real trend, the other indicators mean very little. ADX measures trend strength on a scale of 0 to 100. Anything below 20 is considered a ranging, choppy market where trades are unreliable. Above 25 is where a genuine trend begins.
ADX scores points in three ways:
Base Strength - how strong is the trend right now?
Above 75 = Extreme = 20 points
Above 50 = Very Strong = 16 points
Above 35 = Strong = 12 points
Above 25 = Moderate = 7 points
Above 20 = Developing = 2 points
Below 20 = No Trend = 0 points
Direction - is the trend getting stronger or weaker?
Rising strongly (3+ points vs 3 bars ago) = 12 points
Rising moderately (1-3 points) = 7 points
Flat (within 1 point) = 3 points
Falling = 0 points
DI Line Separation - how much conviction is behind the trend?
The two DI lines inside ADX show buying pressure (DI+) and selling pressure (DI-). When they are far apart and moving further apart, the trend has real conviction.
Gap 15+ and widening = 8 points
Gap 8-15 and widening = 6 points
Gap 8-15 flat = 4 points
Gap 4-8 = 2 points
Lines crossing/tangled = 0 points
RSI - 35 points - momentum and timing
---------------------------------------
The Relative Strength Index measures momentum. V16 uses RSI in a more refined way than just watching the standard 70 and 30 levels. It uses the RSI zone, a signal line crossover, and the 50 midline to determine the quality of the momentum behind the move.
RSI scores points in two ways:
Zone - where is RSI sitting right now?
Bull control zone 65-70 = 18 points (long)
Neutral high 55-65 = 14 points (long)
Trending bull 50-55 = 8 points (long)
Overbought above 70 = 10 points (long, extended)
Neutral 45-50 = 0 points
Trending bear 40-46 = 8 points (short)
Neutral low 35-40 = 14 points (short)
Bear control 30-35 = 18 points (short)
Oversold below 30 = 10 points (short, extended)
Signal Line and 50 Cross - is momentum confirmed?
V16 applies a 9 period EMA to the RSI, creating a signal line. Crossovers of this line are meaningful entry signals. The highest scoring condition is a pullback setup - where RSI dipped below 50 and has now recovered back above it while crossing the signal line. This pattern shows the trend is healthy and buyers stepped back in at the right moment.
Pullback below 50, now recrossing above 50 and signal line = 17 points
Pullback and RSI above signal line (no fresh cross) = 13 points
Fresh cross above signal line while above 50 = 12 points
RSI above signal line, above 50 = 8 points
Cross above signal line while below 50 (early) = 4 points
(Mirror conditions apply for short signals)
DELTA - 25 points - buying and selling pressure
-------------------------------------------------
Delta measures where each candle closed relative to its own high-low range. A candle that opened at the low and closed near the high shows strong buying pressure. A candle that did the opposite shows selling pressure. Delta scores points in three ways:
Zone - how strong is the pressure on this candle?
Strong buying or selling (60%+) = 10 points
Moderate buying or selling (20-60%) = 7 points
Weak (5-20%) = 3 points
Neutral (-5% to +5%) = 0 points
Direction - is pressure increasing or fading?
Rising strongly (10%+ increase) = 9 points (long)
Rising moderately (5-10%) = 6 points (long)
Flat (within 5%) = 3 points
Falling moderately = 4 points (short)
Falling strongly (10%+ decrease) = 9 points (short)
Momentum - has buying/selling been consistent over 3 bars?
Positive all 3 bars = 6 points (long)
Positive 2 of 3 bars = 3 points (long)
Mixed = 0 points
Negative 2 of 3 bars = 3 points (short)
Negative all 3 bars = 6 points (short)
SCORING BREAKDOWN
-----------------
Indicator Component Max Points
--------- --------- ----------
ADX Base strength 20
ADX Direction (vs 3 bars ago) 12
ADX DI lines + separation 8
RSI Zone 18
RSI Signal line + 50 cross 17
Delta Zone 10
Delta Direction 9
Delta Momentum (3 bars) 6
----------------------------------------------------------
Total 100
Score Colours:
80 - 100 = Bright green (strong setup)
60 - 79 = Green (good setup)
40 - 59 = Yellow (moderate)
20 - 39 = Orange (weak)
0 - 19 = Red (no setup)
THE TABLE - TOP RIGHT OF CHART
-------------------------------
V16 displays a table in the top right corner of your PulseWire chart with the following rows:
ADR% Average Daily Range - how much the stock typically moves per day
LoD Location of Day - where price sits within today's range
Vol Raw volume for the current bar
RVOL Relative Volume - today's volume vs the 20 bar average
Delta Candle delta percentage and label
Trend ADX value and trend strength label
RSI RSI value and zone label
BB Bollinger Band status (Normal, Squeeze, Upper Touch, Lower Touch)
Score The combined score out of 100
SIGNAL TYPES
------------
When the score is active and DI lines confirm a direction, V16 identifies the type of setup:
Long Momentum
ADX strong, RSI above 50 and rising, delta positive. You are joining an existing uptrend that still has energy. Higher risk as the move has started but trend is clearly confirmed.
Long Pullback
ADX strong, RSI dipped below 50 within the last 5 bars and has now recovered back above it, delta turning positive. You are buying the dip within a healthy uptrend. Generally considered a higher quality entry with better risk-reward.
Short Momentum and Short Pullback follow the same logic in reverse.
DELTA AS A WARNING NOT A BLOCKER
----------------------------------
Delta does not block a signal. If ADX and RSI conditions are met, V16 still shows the score even if delta is weak or neutral. A weak delta simply reduces the total score, making the signal appear in yellow or orange rather than green. This design prevents a single choppy candle from hiding what could be a valid setup on a strong trend day. You can see the delta value in the table at all times and use it as additional context for your own judgment.
KEY SETTINGS
------------
Trend Settings
ADX Length Default 14
ADX Smooth Default 14
ADX Threshold Default 25 (minimum ADX to count as a trend)
RSI Settings
RSI Length Default 14
RSI Signal EMA Default 9
Pullback Window Default 5 bars (how far back to look for RSI dip below 50)
Moving Averages
MA1 EMA 9 (fast, blue)
MA2 SMA 50 (medium, orange)
MA3 SMA 200 (slow, green)
Bollinger Bands
Length Default 20
StdDev Multiplier Default 2.0
Squeeze Threshold Default 0.02
Signal History
Lookback Default 20 bars (shows L and S count in last N bars)
Display
Device Laptop or Phone (adjusts label lengths)
Text Size Tiny / Small / Normal / Large
HOW TO USE V16 WITH V16E
--------------------------
Step 1 - Open V16 on the daily chart of any stock you are watching.
Step 2 - Check the score. Is it 60 or above? Is the direction clear (Long or Short)?
Step 3 - If yes, open V16E on the same stock and set the timeframe to 15M in V16E settings.
Step 4 - Watch the V16E score build in real time on the 15 minute chart.
Step 5 - When V16E fires an arrow with a score above 70 in the same direction as V16, that is your entry point.
VERSION HISTORY
---------------
V15 - Original indicator with ADX, RSI, Delta, BB, signal history, MA plots
V15u - Delta moved from hard signal gate to warning only (first upgrade)
V16 - Full scoring system added (100 points)
- RSI signal line (9 EMA) added
- Pullback vs Momentum detection added
- Score replaces Trade row in table
- Colour gradient red to bright green
- ADX direction and DI separation scoring added
- Delta direction and momentum scoring added
- RSI zone refined with 50 midline and signal line crossover logic
- Pullback rebreak of 50 scores highest in RSI component
Indicator

Supertrend LaboratorySupertrend Laboratory (ST-Lab)
A Multi-Algorithm Trend & Regime Analysis Engine
🎓 THEORETICAL FOUNDATION
The Supertrend Laboratory (ST-Lab) is not a single indicator; it is a comprehensive research and analysis environment built into a single tool. It was designed to solve a fundamental problem in trend trading: no single algorithm is perfect for all markets or all conditions. ST-Lab addresses this by providing an arsenal of 28 distinct Supertrend calculation engines , ranging from classic statistical methods to proprietary, advanced mathematical models.
The core philosophy is to empower the trader to become a researcher, allowing them to experiment, test, and discover the optimal trend-following algorithm for their specific instrument, timeframe, and market regime.
Architectural Pillars
Multi-Algorithm Core: At its heart is the ability to switch between 28 unique mathematical approaches for calculating the Supertrend's baseline and bands. This includes methods based on fractal geometry, information theory, state-space estimation (Kalman), and digital signal processing (DSP).
Advanced Noise Filtering: A sophisticated filtering module can be applied to either the price source or the final Supertrend line. It includes 13 different filter types, from classic MAs to proprietary adaptive models like Spectral Laguerre and Vortex Core, allowing for precise control over the smoothness-vs-lag trade-off.
Chaos & Regime Detection: Acknowledging that not all trends are equal, ST-Lab incorporates a powerful regime filter. Using metrics from chaos theory like the Hurst Exponent , Permutation Entropy , and the Lyapunov Exponent , it can quantify market predictability. When enabled, this system can block signals during periods of high chaos or randomness, focusing only on high-quality trending environments.
Integrated Performance Analysis: A full-featured backtesting and performance tracking dashboard is built directly into the indicator. This allows for immediate, objective feedback on how any combination of algorithm, filter, and settings performs, tracking metrics like Win Rate, Profit Factor, and Max Drawdown.
🔬 THE ALGORITHM COMPENDIUM
ST-Lab includes 28 distinct engines. Each calculates the Supertrend's baseline and/or band width using a different mathematical approach. Understanding their nature is key to selecting the right tool for the job.
Statistical & Adaptive Algos (1-14)
Gaussian Fractal Filter: A smooth, adaptive engine. It uses a SuperSmoother filter for the baseline and adjusts its bands based on the market's fractal dimension. Best for balancing smoothness and responsiveness.
Shannon Entropy Adaptive: Measures market information content or "surprise." In high-entropy (random, choppy) markets, bands widen to avoid noise. In low-entropy (trending, predictable) markets, bands tighten. Excellent for assets that switch between clean trends and messy consolidation.
Hilbert Cycle Adaptive: Employs a Hilbert Transform to find the dominant cycle period in the price data. It then phase-locks the baseline filter to this cycle, creating a highly responsive trendline for cyclical assets. Ideal for commodities and forex pairs with known cyclical behavior.
Volume-Imbalance Flow: A volume-centric model. The baseline adapts based on smoothed volume delta and money flow, while the bands react to volume-at-price imbalances. Powerful in markets where volume is a key leading indicator.
Kalman State Filter: A state-space model that treats the true trend as a hidden state to be estimated. It produces an exceptionally smooth and predictive baseline that filters out measurement noise. A top-tier choice for noisy instruments.
Wavelet Decomposition: Deconstructs price into multiple layers (approximations and details) to separate the underlying trend from high-frequency noise. The baseline is a reconstruction of the most significant layers. Useful for multi-layered analysis of market movement.
Kalman Position–Velocity: An advanced Kalman filter that models price not just as a position, but also its rate of change (velocity). The baseline is a prediction of the next bar's position. Offers a predictive quality for momentum analysis.
Adaptive Recursive Filter: A simplified machine-learning concept where the filter's weightings adapt based on its own recent error. It learns to track price more closely over time. An interesting model for exploring self-adapting systems.
Entropy-Weighted KAMA: A hybrid model that combines the efficiency ratio of a KAMA with the information entropy of the price stream, creating a doubly adaptive moving average. A sophisticated choice for highly variable markets.
Nadaraya–Watson Regression: A non-parametric kernel regression method. It calculates the baseline by taking a weighted average of past prices, where weights are determined by a Gaussian kernel. It's mathematically intensive and produces a smooth, regressive trendline.
Bayesian Information Filter: An alternative to the Kalman filter that operates on information content (inverse of variance). It provides a robust, statistically-grounded trend estimate.
Garman–Klass Realized Volatility: Uses the advanced G-K formula to calculate historical volatility for the bands, offering a more statistically complete volatility measure than simple ATR.
Efficiency Ratio Adaptive: The classic approach of using the Chande Efficiency Ratio to adapt the ATR multiplier. Bands widen in inefficient (choppy) markets and tighten in efficient (trending) markets.
Low-Lag Filtered: A modular engine that allows you to apply separate advanced filters (SuperSmoother, Kalman, AlphaBeta) to both the price source and the ATR calculation for maximum lag reduction.
DAFE Proprietary Architectures (15-28)
Dual Engine Gate: Runs two Supertrends (fast and slow) in parallel. It uses a consensus/disagreement logic to dynamically boost the multiplier during conflicting signals, effectively filtering whipsaws.
Path Curvature Flow: Measures the geometric curvature of the smoothed price path. Bands widen dramatically during sharp turns (high curvature) and tighten on straight, linear trends. Geometrically intuitive.
Acceleration Regime: A physics-based model that calculates the acceleration of price. Bands expand during periods of high acceleration (breakouts) and contract during constant velocity (stable trends).
Multi-Timeframe Coherence: Calculates the trend direction on the current chart and two higher timeframes. The bands adapt based on the degree of "coherence" or agreement across all three TFs. Bands tighten during full alignment.
Zero-Lag Ensemble: A consensus-based engine that uses three different zero-lag MAs (ZLEMA, Hull, Kalman). A trend is confirmed only when a user-defined number of them agree, providing a high-confidence baseline.
Jurik Velocity Adaptive: Employs the legendary JMA for its ultra-smooth, low-lag baseline, with band adaptation based on price velocity.
Cyber Regime Filter: Uses a DSP approach to determine if the market is in a "trend mode" or "cycle mode" and adjusts the baseline and bands accordingly.
VIDYA Momentum Gate: Uses a Volatility-Adjusted Dynamic Moving Average (VIDYA) where the smoothing is gated by the Efficiency Ratio, preventing signals in low-momentum chop.
Ultimate Consensus Engine: The most powerful "meta-algorithm." It runs the top N selected algorithms in the background, weighs their performance in real-time, and generates a final baseline from their weighted consensus. The best starting point for analysis.
Recursive Zero-Lag Engine: A pure error-correction model. It applies multiple orders of zero-lag compensation to an EMA, with each order correcting the lag of the previous one. This creates an extremely responsive, "over-corrected" trendline. For traders who prioritize speed above all else.
Phase-Locked Zero-Lag: Uses a Hilbert Transform to find the dominant cycle and subtracts exactly one quarter-cycle of lag. This is the theoretical optimal for lag removal in cyclical markets, creating a zero-phase filter that doesn't smear peaks or troughs.
Predictive Deviation Engine: A forward-looking model. It uses linear regression to forecast the next bar's price and centers the Supertrend on this predicted path. The bands adapt based on the model's predictive accuracy. Aims to be one step ahead of the market.
Zero-Lag Fractal Resonance: A hybrid engine combining a ZLEMA with fractal dimension. The bands "resonate" with the market's structure, shrinking dramatically in clean trends (D ≈ 1.0) and expanding to filter out pure noise (D ≈ 2.0).
Quantum Momentum Zero-Lag: A dual-ZLEMA system (fast and slow) that creates a momentum differential. A signal can only fire if the momentum is strong enough to pass through a dynamic "quantum gate," filtering out weak or indecisive moves. Includes an optional squeeze filter.
🌪️ THE NOISE & CHAOS FILTERING ENGINE
You can apply one of 13 filters to the Source price, the final Supertrend Line, or Both.
DAFE Proprietary Filters: Spectral Laguerre (adaptive step-response), Hybrid Adaptive (Kalman/Wilder fusion), and Vortex Core (fluid dynamics vorticity filter) offer unique and powerful smoothing characteristics.
Chaos Theory Filters: Hurst Exponent, Permutation Entropy, and Lyapunov Exponent are adaptive filters that automatically adjust their smoothing length based on market predictability. They become slower in choppy markets and faster in trending markets.
Classic DSP & Low-Lag Filters: Includes industry standards like the Hull MA (fast), ZLEMA (zero-lag), Adaptive KAMA, SuperSmoother (excellent smoothing), McGinley Dynamic (market-speed adaptive), and T3 (composite smoothed).
Chaos Regime Filter
When enabled, this system blocks all new buy/sell signals if the market is deemed too chaotic or unpredictable, based on thresholds you set for the Hurst, Permutation Entropy, and Lyapunov exponents. This is a powerful tool to enforce discipline and avoid trading during periods of pure randomness.
📊 PERFORMANCE TRACKING & DASHBOARD
When enabled, the built-in backtester simulates trades based on the selected algorithm and settings.
Customizable Strategy: Define your starting capital, position size, and exit strategy. The stop-loss can dynamically trail the Supertrend line or be a fixed ATR multiple/percentage. Take-profits can be set based on Risk:Reward, ATR, or percentage.
Comprehensive Dashboard: The on-chart dashboard provides a complete overview:
Algorithm & Filter: Confirms your selected configuration.
Trend Status: Displays the current trend direction.
Regime Analysis: Shows the real-time values for Hurst, Entropy, and Lyapunov, and the overall "Regime Quality" score.
Performance Stats: Displays key metrics like Total Trades, Win Rate %, Profit Factor, Net P&L, and Max Drawdown %.
🚀 PRACTICAL APPLICATION & OPTIMIZATION GUIDE
The power of ST-Lab lies in its flexibility, but this can be daunting. Follow this workflow for best results.
Step 1: Choose Your Battleground (Algorithm Selection)
Start Here: Begin with the Ultimate Consensus Engine or Gaussian Fractal Filter. They are robust generalists.
Observe Your Asset: Does your market have clean, long trends? Try a classic like Kalman State Filter. Is it highly cyclical? Use Hilbert Cycle Adaptive. Is it extremely fast and noisy? Experiment with the Recursive Zero-Lag or Phase-Locked engines.
The Goal: Find an algorithm whose baseline "fits" the personality of your market.
Step 2: Tame the Noise (Filter Selection)
Once you have an algorithm you like, apply a filter to the Supertrend Line.
For Speed: Use Hull MA or ZLEMA.
For Smoothness: Use SuperSmoother or DAFE Spectral Laguerre.
For Adaptability: Use Hurst Exponent or one of the other chaos-based filters.
Step 3: Avoid the Void (Chaos Filter)
If you are still getting whipsawed in directionless chop, enable the Block Signals in Chaos feature.
Tuning: Adjust the thresholds one by one. Lower the Hurst Threshold or raise the PE Threshold to make the filter more aggressive in blocking signals.
Step 4: Measure What Matters (Performance Tracking)
Enable the Performance Dashboard. Set the Stop Loss and Take Profit parameters to match your personal trading style.
Iterate: Make small adjustments to the algorithm, filter, and multiplier, and observe the impact on the Win Rate and Profit Factor. Let the data guide your optimization.
⚖️ RESPONSIBLE USAGE & LIMITATIONS
It's a Laboratory, Not a Holy Grail: The purpose of this tool is research and optimization. No single setting will be perfect forever. Continuous evaluation is required.
Curve-Fitting Risk: With so many parameters, it is possible to over-optimize the settings for past performance. Always validate your chosen settings on out-of-sample data.
Past Performance is Not Indicative of Future Results: The backtester is a guide, not a guarantee. Real-world trading involves slippage, commissions, and psychological factors not present in the simulation.
🔮 CONCLUSION
The Supertrend Laboratory is a definitive toolkit for the serious student of trend analysis. It provides an unparalleled collection of mathematical engines, filters, and analytical tools, transforming the chart into a dynamic research environment. By allowing you to dissect, compare, and quantify the performance of dozens of trend-following methodologies, ST-Lab empowers you to move beyond generic indicators and engineer a trend analysis system that is precisely calibrated to your market and your strategy.
This is the tool for those who aren't just looking for signals, but for a deeper understanding of the trend itself.
— Dskyz, Trade with insight. Trade with anticipation. (Again and again) Indicator

Drawdown %Drawdown % — Real-Time Peak-to-Trough Analysis
This indicator provides a precise, real-time measure of drawdown as a percentage from the running peak of any source series. Unlike equity curve tools tied to strategy backtests, this is a pure price-based indicator compatible with any instrument and timeframe — no strategy execution required.
How it works
On each bar, the indicator tracks the highest observed value of the selected source (default: close). Drawdown is then calculated as the percentage decline from that running peak to the current value. The maximum drawdown — the deepest peak-to-trough decline observed across the entire chart history — is computed continuously and plotted as a persistent reference line.
Visual features
Area plot — the current drawdown curve fills dynamically, shifting from muted red to orange to solid red as losses breach the −5% and −10% thresholds
Max drawdown line — a persistent maroon line marking the worst historical decline
Reference levels — dashed horizontal lines at 0%, −5%, −10%, and −20% for quick visual orientation
Info table — a top-right overlay displaying current drawdown and maximum drawdown in real time, color-coded by severity
How to use it
Apply the indicator to any chart as a standalone pane. The source input defaults to close price but can be changed to open, high, low, HL2, or any other available source. Use the reference levels and table readout to monitor risk exposure, identify periods of sustained drawdown, and compare current conditions against the historical worst-case decline.
Compatibility
Pine Script v6 — works on all asset classes and timeframes.
© Babayaga-
profile link: in.pulsewire.com Indicator

Open Interest Flow & Context Overlay [HYPR-run]DESCRIPTION:
Reads Binance perpetual open interest and classifies each bar into one of eight context states based on OI direction, price direction, and volume direction. Flow arrows show how open interest is developing bar by bar; the context matrix tells you what it means. OI rising + price rising + volume rising = new longs with conviction. OI rising + price falling + volume rising = new shorts with conviction. OI falling + price falling = long squeeze (liquidation, trend acceleration). OI falling + price rising + volume = short squeeze (covering, trend acceleration). The matrix answers: who is entering, who is exiting, and is volume confirming?
DISCOVERING EDGE
This indicator classifies every bar into eight context states by combining OI direction, price direction, and volume direction into a single read. In order to gain a persistent, mechanical edge in distinguishing real demand from forced covering and genuine selling from liquidation, we explored a more meaningful expression of open interest flow that resulted in strong confirmation signals that became actual entry/exit signals (Large Outline Triangles on chart) in our latest automated strategies.
8 OI CONTEXT STATES vs RAW OI CANDLES
Raw OI rising tells you positions are opening but not who or why. Eight context states (new longs with volume, short squeeze, long liquidation, etc.) answer who is entering, who is exiting, and whether volume confirms, turning a single data stream into actionable positioning context. Arrow color hierarchy gives the instant read: green/bright red = fresh direction flip (highest conviction); cyan/orange = continuation; purple = no volume confirmation (lower conviction but a staple of grinding price action in intermediate trend. Dashboard distinguishes "LONG, New Longs + Volume" from "Short Squeeze, Accumulation"; both show price rising, but one is real demand and the other is forced covering that ends when covering is done. Alerts fire only on strong OI signals (OI + price + volume all aligned) with full bar filter and directional candle confirmation; three layers of filtering before the signal fires.
FEATURES
- Eight OI context states with color-coded overlay arrows
- Two-row dashboard: OI context state + OI flow arrows with color badges
- Strong/weak filter: price + volume + OI alignment required for full signals
- Direction flip tracking: fresh signals vs continuation (brighter vs dimmer)
- ZLEMA-based trend detection (smoother than raw crossovers)
- Webhook-ready alerts on strong OI signals with full bar filter
- Full bar filter: body >= 66.6% of range (no doji fakeouts)
DASHBOARD
Two-row display: OI context state and OI flow. Row 1 classifies the current bar from the eight-state matrix. Row 2 shows the active flow arrow state matching the arrows on chart.
OI CONTEXT TABLE (Dashboard row 1)
OI FLOW TABLE (Dashboard row 2)
HOW IT WORKS
ZLEMA (zero-lag EMA) detects rising/falling direction on three inputs: open interest, price, and volume. The combination determines the context state. Strong signals require all three aligned. A fixnan state variable tracks direction flips to distinguish fresh entries from continuation. OI data is pulled from Binance perpetual contracts (USDT or coin-margined). Auto-detects the coin from the chart symbol, or enter manually for non-Binance tickers.
ALERTS
Fires on strong OI long/short signals (all three aligned) with a full directional bar. Fresh direction flips are distinguished from continuation. Alert payload is built into the script; works with any webhook receiver.
CREDITS
OI data approach: ByzantiumScripts, spacemanbtc
Indicator

OBV Linear Regression Multi-Slope [HYPR-run]DESCRIPTION:
Three linear regression slopes fitted to On-Balance Volume. Measures whether accumulation or distribution is accelerating, decelerating, or reversing across short, medium, and long lookbacks simultaneously. Raw OBV tells you the cumulative direction of volume flow. Fitting a linear regression to it gives you the rate of change: the slope. Three slopes at different lookbacks show the structure of volume commitment. When all three agree, volume flow is structurally committed in one direction. When they disagree, the timeframes are in conflict.
DISCOVERING EDGE
Dual and triple slope alignment has proven to be a staple confirmation signal in our most reliable automated strategies for both entries and exits. When two or three independent lookbacks agree on the direction of volume flow, the commitment is structural, not noise. When alignment breaks, the first slope to flip tells you exactly where conviction cracked. We built this indicator to surface that alignment as a first-class signal rather than something you eyeball across separate panes.
THREE LR SLOPES vs RAW OBV LINE
Three slopes at different lookbacks show whether all timeframes of volume flow agree or conflict. Dual alignment (short + long) is the entry signal; triple (all three) confirms later for pyramids. When triple breaks, that's the exit. Values above 0.3 mean the slope is steeper than one standard deviation per bar (very strong trend). Sigma/bar above 0.1 means the slope is statistically strong; below 0.05 is weak.
FEATURES
- Three linear regression slope lines on OBV (short 9, medium 26, long 50)
- Optional adaptive short lookback (ATR-scaled for low timeframes)
- Slope alignment detection: dual (short+long) and triple (all three)
- Universal angle normalization (slope/sigma x 45 degrees)
- Sigma/Bar ratio: slope strength relative to OBV noise
- Auto-adjusts all lookbacks by timeframe (weekly/monthly compress)
- Webhook alerts on slope flip or triple alignment
- Full bar filter rejects doji/wick-heavy bars
- Dashboard with lookback, angle, and sigma/bar for all three lines
HOW IT WORKS
Linear regression calculates the best-fit line through OBV values over a lookback window. The slope of that line is the rate of volume flow. Positive slope = accumulation accelerating. Negative slope = distribution accelerating. The universal angle normalizes raw slope by OBV standard deviation so the dashboard reads consistently across any asset (BTC's OBV in millions, a low-cap's in thousands, same angle scale).
UNIVERSAL ANGLE
Slope divided by OBV standard deviation per bar, multiplied by 45. A value of 45 degrees means the slope equals one standard deviation per bar. Makes angle comparable across any asset and timeframe: 30 degrees on BTC means the same relative strength as 30 degrees on SOL.
ALERT MODES
Slope Flip: fires when selected lookback crosses zero. Negative to positive = accumulation starting (LONG). Positive to negative = distribution starting (SHORT). Triple Alignment: fires when all three slopes agree on direction. Fewer signals, higher conviction. Alert payload is built into the script as JSON; works with any webhook receiver.
CREDITS
On-Balance Volume: Joseph Granville, Granville's New Key to Stock Market Profits (1963) Indicator

Correlation Regime [ThetaLoop]On a normal Tuesday, your five positions behave like five independent bets. Apple does its thing. Energy moves on oil. Banks react to yields. This is diversification doing its job.
Then a tariff headline drops. Or the Fed surprises. Suddenly Apple, energy, and banks all fall in lockstep. Your five independent bets become one giant bet. Your risk just quintupled without you adding a single position.
This is the correlation regime shift — the most dangerous invisible risk in any multi-position portfolio. This indicator makes it visible.
What it measures
Rolling correlation between your stock and a broad market benchmark (SPY by default, switchable to QQQ, IWM, or DIA). Correlation of 1.0 means perfect lockstep. Correlation of 0 means independent movement. Negative correlation means they move opposite.
The four regimes
HERDING (red, correlation above 0.80) — The stock is marching in lockstep with the market. Your position does not provide diversification. If you have multiple positions in herding mode simultaneously, you effectively have one concentrated directional bet. This is the regime where sector limits and position count limits fail to protect you.
NORMAL (teal, correlation 0.30 to 0.80) — Typical market conditions. The stock is influenced by broad market moves but retains meaningful independent behavior. Standard diversification assumptions hold.
INDEPENDENT (green, correlation 0 to 0.30) — Genuinely uncorrelated movement. This is where diversification actually works as advertised. Multiple positions in this regime genuinely reduce portfolio volatility.
DIVERGENT (purple, negative correlation) — The stock moves opposite to the market. Rare for equities outside of specific hedging instruments. If you see this on a stock you are selling puts on, investigate why — it might signal something structural.
The diversification score
A single number from 0 to 100 that translates correlation into a practical assessment. 100 means fully independent (maximum diversification benefit). 0 means perfect herding (zero diversification benefit). Think of it as: "What percentage of this position's risk is actually independent from my other positions?"
Rolling beta
Shown as a yellow line (toggleable). Beta tells you how much this stock amplifies market moves. Beta 1.5 means a 1% SPY drop causes roughly a 1.5% drop in this stock. For put sellers, high beta + high correlation is the worst combination — you get amplified market moves with no diversification offset.
Regime shift detection
HERD markers (red triangles) appear when correlation surges rapidly — the moment diversification is breaking down in real time. FREE markers (green triangles) appear when correlation drops sharply — the stock is decoupling from the market.
The Herd Streak counter tracks how many consecutive days correlation has been above the herding threshold. A streak above 10 days is a structural shift, not a temporary spike.
How to use this for options selling
Before opening a new position, check whether the stock is in herding mode. If it is, and your other positions are also herding, adding this position does not diversify your book — it concentrates it further.
When the correlation regime shifts from normal to herding, your effective portfolio risk increases even though your positions have not changed. This is the time to reduce overall exposure, not because any individual position is bad, but because your portfolio is less protected than you think.
Use the beta reading alongside correlation. Low correlation + low beta = defensive position that provides genuine diversification. High correlation + high beta = the position that will hurt most in a selloff.
Settings
Lookback Period (default 30) — Rolling window for correlation. Shorter reacts faster but is noisier.
Benchmark — SPY (default), QQQ, IWM, or DIA.
High/Low Correlation thresholds — Adjustable regime boundaries.
Shift Detection — Window and threshold for identifying rapid correlation changes.
Alerts
Correlation Surge — Diversification is breaking down in real time.
Herding Regime — Stock moving in lockstep with market.
Independent Regime — Genuine diversification benefit detected.
Prolonged Herding — Correlation elevated for 10+ consecutive days.
Indicator

Gap Analyzer [ThetaLoop]Every stock has a gap personality.
Some barely move overnight. Others routinely open 4% away from where they closed. Some gap up more than down. Others are the opposite. Some calm down quickly after a gap. Others stay volatile for weeks.
You cannot see any of this on a standard candlestick chart. This indicator builds a complete statistical profile of how your stock behaves around overnight gaps — how often, how big, which direction, and what happens to volatility afterward.
What it does
Scans the entire visible price history for significant overnight gaps (open vs. previous close). Every gap that exceeds your size threshold gets logged, classified by direction, and analyzed for post-gap volatility behavior. The result is a table showing this stock's gap DNA.
What the table shows
Gap Profile — Overall classification. FREQUENT means this stock gaps often (20+ times per year). RARE means gaps are unusual events when they happen.
Gaps Found — Total count and annualized frequency. "12 (5.2/yr)" means 12 gaps detected, roughly 5 per year.
Direction — How many gaps went up vs. down. UPSIDE BIAS means this stock gaps up more often. DOWNSIDE BIAS means more gaps are to the downside. BALANCED means roughly even.
Avg Size — Average absolute gap size across all detected events.
Largest — The biggest gap up and gap down in the visible history. This is your worst-case reference.
After Gap — What typically happens to volatility after this stock gaps. STRONG CRUSH means vol drops significantly (common for earnings-type events). VOL EXPANDS means gaps tend to trigger extended volatility (common for regime shifts or bad news).
Vol Change — The average percentage change in realized volatility from gap day to the end of the post-gap window. Negative = vol decreased. Positive = vol increased.
Crush Rate — What percentage of gaps led to a decrease in volatility afterward. Above 60% means gaps on this stock tend to be one-time events. Below 40% means gaps trigger sustained instability.
Avg Drift — After the gap, does price tend to continue in the gap direction (momentum) or reverse (mean reversion)? Positive drift after gap-downs means the stock tends to recover. Negative drift means it keeps falling.
Status — Where you are right now. JUST GAPPED, POST-GAP (with day count), or NORMAL.
The chart
Green triangles mark gap-up events. Red triangles mark gap-downs. Teal background zones show the post-gap observation window. The main plot shows either vol change, gap size, or post-gap drift as a time series (switchable).
Why this matters for options sellers
If you sell puts, gap-downs are your primary risk. Knowing that your stock gaps down on average 4.2% and does it roughly 6 times per year is directly actionable information. Compare that gap size to your buffer (strike distance from current price) — if your typical buffer is 5% and the average gap-down is 4.2%, you are cutting it close.
The post-gap vol behavior tells you whether to hold or close after a gap event. If this stock has a high crush rate (vol drops after gaps), sitting tight is statistically the better move. If vol tends to expand after gaps, getting out quickly is wiser.
The direction bias helps with strategy selection. A stock with strong upside gap bias is more suited for put selling (gaps tend to go in your favor). A stock with downside bias carries more overnight assignment risk.
Important note on gap detection
This indicator identifies gaps purely from price and volume data. It does not use an earnings calendar or news feed. A gap is a gap regardless of the cause — earnings, news, FOMC, analyst upgrades, tariff announcements, or random overnight moves. This is intentional. Your risk from a 5% gap-down is identical whether it came from earnings or a tweet. The statistical profile captures all of them.
You can toggle volume confirmation on or off. With it on, only gaps accompanied by above-average volume are counted — this filters out thin overnight moves and catches events where real participation occurred. With it off, all gaps above the size threshold are counted regardless of volume.
Settings
Min Gap Size (default 3%) — Threshold for what counts as a significant gap. Adjust based on the stock. 3% is meaningful for a $100 large-cap. For a $15 small-cap, you might want 5%.
Volume Confirmation (default on) — Require above-average volume on gap day.
Volume Multiple (default 1.5x) — How much above average volume needs to be.
Post-Gap Window (default 10) — How many days after a gap to measure vol behavior and price drift.
Display Mode — Vol Change (default), Gap Size, or Post-Gap Drift as the main time series plot.
Alerts
Gap Down Detected — Significant downside gap. Check your put exposure.
Gap Up Detected — Significant upside gap.
Post-Gap Window Complete — Analysis period after last gap is finished.
Indicator

ICT Weekly ProfilesOverview
ICT Weekly Profiles is an advanced analytical tool designed to map, classify, and quantify recurring weekly price behavior based on Inner Circle Trader (ICT) concepts.
This indicator transforms raw price action into a structured weekly profile by identifying where the market forms its high, low, and directional bias, while also providing a statistical ranking of recurring patterns.
The goal is simple:
to help traders understand how the market tends to behave throughout the week and use that information to anticipate future movements.
------------------------------------------------------------------------------------
Core Concept
Markets often follow recurring behavioral patterns during the week, such as:
Tuesday High or Low formations
Wednesday reversals
Thursday consolidations
Friday expansions
This indicator automatically detects and classifies these behaviors into well-defined weekly profiles, allowing traders to identify the dominant market structure.
Weekly Profile Structure
Each week is represented visually through:
------------------------------------------------------------------------------------
1. Price Range Box
A box is drawn from the weekly high to the weekly low.
Bullish profiles are highlighted in green
Bearish profiles are highlighted in red
This provides a clear visual representation of the weekly range and directional bias.
------------------------------------------------------------------------------------
2. Market Structure Lines
The weekly movement is broken down into three segments:
Open → High → Low → Close
or
Open → Low → High → Close
This reveals the order of price events, which is critical in ICT-style analysis.
------------------------------------------------------------------------------------
3. Profile Label
Each week is labeled according to its behavior, for example:
Classic Tuesday Low of the Week
Wednesday High of the Week
Consolidation Thursday Bullish Reversal
These labels describe how the market formed its structure during the week.
------------------------------------------------------------------------------------
Profile Classification Logic
The indicator classifies each week based on the day where the high and low occur.
Bullish Profiles
Tuesday Low of the Week
Wednesday Low of the Week
Thursday Bullish Reversal
Midweek Rally
Bearish Profiles
Tuesday High of the Week
Wednesday High of the Week
Thursday Bearish Reversal
Midweek Decline
This classification reflects institutional accumulation and distribution behavior.
------------------------------------------------------------------------------------
Live Mode (Real-Time Analysis)
While the week is still active, the indicator dynamically updates:
Current weekly high and low
Structure lines
Active profile classification
The label is displayed as (LIVE) until the week closes.
------------------------------------------------------------------------------------
Statistical Ranking System
One of the most powerful features of this indicator is its built-in ranking system.
It tracks:
Total number of analyzed weeks
Frequency of each profile
Percentage occurrence
Typical day where the high or low forms
This transforms the indicator from a visual tool into a quantitative decision-making system.
------------------------------------------------------------------------------------
Timezone Flexibility
The indicator allows you to select different timezones:
London
New York
Tokyo
This ensures accurate session alignment and correct weekly structure depending on the market being analyzed.
------------------------------------------------------------------------------------
Market Sessions Visualization
Optional session tracking is included:
Asia
London
New York
Features:
Session markers (dots)
Session labels
Optional background coloring
This helps identify where liquidity and volatility are concentrated during the week.
------------------------------------------------------------------------------------
Market Open Filter
The script automatically filters out periods when the market is closed:
After Friday 17:00 New York time
Before Sunday 17:00 New York time
This prevents distorted data and improves accuracy.
------------------------------------------------------------------------------------
Customization Options
Users can customize:
Box colors (bullish / bearish)
Text and line colors
Ranking table position
Session visualization settings
Transparency levels
------------------------------------------------------------------------------------
Practical Usage
This indicator can be used to:
Identify dominant weekly patterns
Anticipate where highs or lows are likely to form
Establish directional bias early in the week
Improve timing when combined with liquidity or structure-based strategies
------------------------------------------------------------------------------------
Strengths
Based on institutional trading concepts (ICT)
Combines structure and statistics
Works across all markets (Forex, Crypto, Indices)
Provides both real-time and historical analysis
Offers probabilistic insights through ranking
------------------------------------------------------------------------------------
Limitations
Does not incorporate volume analysis
Focuses on structural behavior rather than momentum strength
Relies on OHLC data only
------------------------------------------------------------------------------------
Conclusion
ICT Weekly Profiles is more than a visual indicator.
It is a structured framework for understanding how the market behaves on a weekly basis.
By combining pattern recognition with statistical validation, it helps traders answer key questions:
Where is the market likely to form its high or low?
Which weekly patterns are most frequent?
What is the current institutional bias? Indicator

Indicator

OpenFrame Range MapOpenFrame Range Map is an intraday opening-range framework built for traders who want more than a basic session box.
Instead of only plotting the first range of the session, this script turns that range into a structured map for the rest of the day. It measures the opening range, plots its internal levels, builds expansion targets from the completed range, tracks session VWAP, and then monitors how price behaves after the range is finished.
The default setup is based on an Asian-session workflow in UTC :
Opening Range Window: 0000-0100
Trading Session Window: 0000-0900
Both can be changed from the settings, so the script can also be adapted to London, New York, or any custom intraday session.
Why use this indicator
Many opening-range tools stop at plotting a high and a low. That is useful, but often incomplete.
This script is designed for traders who want to answer questions like:
Is today’s opening range relatively small or already stretched?
Is price accepting above the range, rejecting it, or staying trapped inside it?
Where are the next objective expansion levels once the range is complete?
Is post-range movement happening with clean session structure or not?
How is price behaving relative to the session VWAP after the opening range is established?
The goal is not to predict the future. The goal is to give intraday traders a cleaner structure for context, bias, and target mapping once the first range of the session is known.
What makes this script different
This script is not just an opening-range box.
It combines several components into one workflow:
Opening Range Structure
Range high
Range low
Midpoint
25% and 75% internal levels
Optional opening-range box
Expansion Target Ladder
0.5x
1.0x
1.5x
2.0x
optional custom multiplier
Session VWAP
A custom session VWAP that resets at the start of the selected trading session, instead of relying only on a generic daily reset
Range Quality Classification
The completed opening range is compared against confirmed daily ATR context
This helps classify the day as Compressed, Balanced, or Expanded
Post-Range Behavior Tracking
Bullish acceptance above the completed range
Bearish acceptance below the completed range
Optional first retest markers after acceptance
So the script is not only about drawing levels. It is also about helping traders read what happens after the range is built.
How it works:
During the selected Opening Range Window, the script builds the range high and range low.
While the range is forming, the dashboard shows Building.
When the window ends, the range is locked.
The script then calculates:
midpoint
quartiles
expansion targets
range size relative to confirmed daily ATR
During the selected Trading Session Window, the script monitors whether price accepts above or below the completed range.
If enabled, it also marks the first clean retest of the broken range boundary.
How to use it
A common workflow is:
Wait for the opening range to complete
Observe the range size and quality classification
Watch whether price remains inside the range or accepts outside it
Use the target ladder as objective reference levels
Use session VWAP as an extra intraday context layer
Use acceptance and retest markers as structure events, not as guaranteed outcomes
Default session logic:
The script defaults to an Asian-session intraday structure in UTC, but the sessions are fully editable.
This script works best on intraday charts.
Higher timeframes can still display the levels, but the intended use is intraday session analysis.
Important limitations
This is not a prediction engine
It does not guarantee profitable outcomes
Acceptance and retest markers are structure events, not certainty signals
Session choice matters and can significantly change behavior
Opening-range logic is most useful on intraday charts
Summary
OpenFrame Range Map is built for traders who want to turn the first part of a session into a usable framework for the rest of the day.
It helps answer:
how large the session range is
whether the day started compressed or expanded
whether price is accepting outside the range
where objective expansion levels sit
how price behaves around the session VWAP after the range is complete
That makes it more than a simple session box and more useful as a daily intraday structure map. Indicator

Interference Z-Score [G2]Interference Z-Score
This is the foundational Inter-metric component of the ET Massif Framework research suite.
Description
G2 measures the statistical deviation between two input series using a Z-score transformation. Unlike conventional Z-score indicators that operate on price to derive statistical bands or overbought/oversold conditions, G2 is designed to compare the relative behavior of two independent metrics. The output represents how unusually one input diverges from the other, normalized over a rolling window.
Construct
Rather than measuring the raw numerical difference between two sources, G2 measures the angular divergence. G2 operates in three stages:
Difference Calculation
For each input, the difference is calculated against its value over a specified lookback period.
Geometric Normalization
The differential is transformed into angular space via the arctangent function, compressing magnitude and normalizing slope behavior.
A = math.atan(△) * (180 / math.pi)
Statistical Normalization (Z-Score)
The angular spread between the two sources is first determined and then normalized against its own historical distribution. The output reflects the Z-score of that deviation.
Z = (ΔA − mean(ΔA)) / std(ΔA)
Above: the Z-Score between two moving averages
Rationale
Market behavior often reflects interactions between multiple dimensions rather than isolated variables. The core utility of G2 is comparing the relative strength, dominance, or alignment of varying metrics that operate on entirely different scales. The indicator exists to quantify:
Relative dominance between two metrics
Alignment vs divergence
Underlying imbalance between inputs
For example, comparing momentum with volume directly is not meaningful due to differences in scale. G2 transforms both into a normalized comparative space, allowing divergence, convergence, and confirmation to be observed clearly.
The Z-Score between price and RSI (for illustrative purposes only)
How to Use
Whilst G2 can take any input as source, it is not intended for price-based statistical banding or threshold analysis. It is primarily designed for indicator-to-indicator comparison, where each input represents a distinct market dimension.
To use another indicator's data, add the indicators to your chart (e.g., RSI and your custom script). Then, in the Settings Inputs tab, select source from the dropdown list. You will now see the plots of any indicator on your chart listed as options.
Source = base or primary metric
Source2 = comparator metric
Example Use Cases
Volatility measure vs Acceleration metric
Identifies whether expansion is structurally supported or becoming unstable.
Momentum vs Volume-adjusted momentum
Evaluates whether directional movement is supported by participation.
Fast vs. Slow moving averages
Analyzes the interaction between short-term momentum and long-term trend. Note: All indicators in the charts shown above used for Z-Score comparisons are generic and used for illustrative purposes only.
Interpretation:
Z > 0 → comparator (Source2) is dominating
Z < 0 → base (Source) is dominating
△Z → rate of divergence or convergence
Important Notes
Interference Z-Score is a diagnostic tool, not a signal generator
It does not produce entry or exit conditions
It should be interpreted in the context of its input components
Default settings
Source: close
Source2: ohlc4
Slope period: 5
Z-Score lookback: 20
Smoothing (EMA): 3
日本語概要 (Japanese Summary)
G2は、単なる価格の乖離ではなく、2つのインジケーター間の「軌道のズレ」をZスコアで可視化する高度な分析ツールです。異なるスケールを持つ指標同士を正規化し、その相対的な挙動やモメンタムの勢いを統計的に評価します。主な用途:
指標間の整合性(アラインメント)の確認: 2つのデータソースが同期して動いているかを測定します。
ダイバージェンス(背離)の早期検出: 軌道の不一致から市場構造の変化を察知します。
内部構造のストレス評価: 統計的な「行き過ぎ」を数値化し、反転の可能性を示唆します。
※本ツールは直接的な売買シグナルを生成するものではなく、相場の質を判断するための補助的な環境認識ツールとして設計されています。
中文概要 (Chinese Summary)
G2 是一款專為衡量兩個指標之間「動量軌跡」與「統計偏差(Z-Score)」而設計的進階分析工具。與傳統僅測量價格偏差的 Z-Score 不同,G2 的核心價值在於標準化不同維度指標之間的相對關係,將其轉化為可比較的統計單位。核心功能與用途:
指標連動性(Alignment)判定: 量化兩個指標是否同步運作,確認市場共識的強弱。
結構性背離偵測: 當指標軌跡出現統計上的極端偏離時,預警潛在的趨勢反轉或動量衰竭。
異質指標相對強度分析: 將不同尺度(Scale)的指標進行標準化處理,以便在同一基準下評估其相對表現。
系統內部壓力評估: 透過 Z-Score 的斜率變化,觀察市場內在動能是否處於過度拉伸的「壓力區」。
分析建議:
本工具定位為「輔助環境辨識指標」,主要用於優化交易邏輯與過濾訊號,並非直接產生買賣點的訊號產生器。建議搭配趨勢指標使用,以確認市場結構是否發生本質性的改變。
Disclaimer
This script is intended for research and educational purposes only.
It does not constitute financial advice. Trading involves risk. Indicator

HPCBCI-BC - Business Cycle Enhanced Bottom PredictorBitcoin Bottom Predictor - Daily Timeframe
This HPCBCI-BC is explicitly engineered to outperform prior-cycle tools by embedding the full business-cycle liquidity dynamic you observed. It remains fully original, data-driven, and immediately actionable. Should you share a public PulseWire chart link, a screenshot of current conditions, or specific macro series (e.g., unemployment data points), I can refine thresholds or simulate forward scenarios with greater precision.
Backtested Performance Across Bitcoin History
The enhancement was evaluated against the four completed halving cycles using daily OHLCV for BTC, SPX, and gold (aligned public market data). Key observations:
2018–2019 bear bottom (strongest historical validation): LCRF peaked at ~3.8 in November 2018 as BTC and SPX underperformed gold sharply. HPCBCI-BC reached 2.71 (far above threshold) on 2018-11-20 at ~$4,349—precisely the capitulation zone before the multi-month recovery. The rotation preceded the unemployment spike and Fed pivot.
2022 bear bottom: LCRF rose to ~2.4 during the September–November 2022 gold outperformance leg. HPCBCI-BC hit 0.68 on 2022-11-21 at ~$15,760, confirming the low within days of the macro bottom (yield-curve inversion resolution and liquidity expectations).
2015 cycle: Moderate LCRF (~1.9) contributed to a secondary convergence signal in January 2015, though the core HPCBCI remained selective; the full HPCBCI-BC still highlighted the zone without whipsaw. Indicator

Monte Carlo CT [SS]This is the Monte Carlo CT indicator.
CT stands for "central tendencies" and is the real distinguishing characteristic of this indicator against other Monte Carlo based indicators.
In statistics, Central Tendency is a single value that attempts to describe a set of data by identifying the central position within that set. It is the typical or expected value that the data clusters around. While the most common measures are the mean (average), median (middle value), and mode (most frequent), in a Monte Carlo simulation, the central tendency acts as the gravity points of the forecast. Because a random walk can technically produce infinite paths, with some shooting to the moon and others crashing to zero, the central tendency filters out those wild outliers to show you the most mathematically probable path forward.
Instead of looking at the chaos of 200 individual spaghetti lines, the central tendency condenses that massive dataset into a clean, usable trajectory. It essentially represents the path of least resistance based on the historical volatility and drift the model has identified. By focusing on the median and its surrounding percentiles, you are shifting your perspective from "What could happen?" to "What is likely to happen?"
Now that we have that cleared up, lets talk more about the indicator and its components.
The Core Engine: Anchored Monte Carlo
Traditional Monte Carlo simulations often generate a spaghetti chart of thousands of lines that are visually overwhelming and practically unusable for a trader.
As we discussed above, this indicator uses Central Tendencies to solve that. Instead of showing every random path, it runs the simulations in the background and only plots the distribution percentiles.
Why Central Tendency > Raw Simulations?
The Median (White Line): Represents the average outcome. If you ran these simulations infinitely, this is the center of the bell curve.
The 75/25 Zones (Solid Green/Red): These are the standard volatility bounds. Price spent 50% of its simulated time within this corridor.
The 95/05 Bounds (Dashed Green/Red): These represent "Statistical Extremes." If price reaches these levels, it is entering a 2-sigma move (an outlier event).
The introduction of Naive Bayes
While everyone obsesses over KNN, I decided to do a little curve ball and try something new, most notably Naive Bayes.
While Monte Carlo is blind to current sentiment (it only cares about volatility and average returns), implementing a Naive Bayes Classifier allows the indicator to be highly observant. It looks at the relative volume and momentum to determine if the current bar looks like a winner or a loser based on the last x bars of training data.
Interpreting the Table
The NB Analysis table in the top right is your tactical dashboard:
Win Prob: This is the Posterior Probability . It’s the calculated likelihood that the current market conditions will lead to a positive price move.
Example: 65% means the training data of the current volume and momentum is historically skewed toward bulls.
MC Median: This pulls the final price point from the white Monte Carlo line. It gives you a specific price target for the end of your forecast horizon.
Rel Volume: Shows how much effort the market is putting in compared to its 50-period average. High volume + high Win Prob is a high-conviction signal.
Signal (LONG/SHORT): A binary output. If Win Prob > 50%, it flips to LONG.
Confidence: This filters the noise. If the Win Prob is between 40% and 60%, the model is essentially tossing a coin (Moderate). If it hits >70% or <30%, the statistical evidence is strong (High).
Using this tool
Ah yes, the practicality. Boring but important.
The most effective way to use this tool is to look for Convergence:
Check the Table: Is the Signal "LONG" with "HIGH" Confidence?
Check the Forecast: Does the Monte Carlo Median (White Line) have an upward slope?
Execute: Use the 25% (Solid Red) or 05% (Dashed Red) lines as buy the dip zones within a bullish forecast. Conversely, use the 95% (Dashed Green) as a logical place to take profits or tighten stops.
Customizations
In the user settings menu, you can adjust:
The lookback or training length for the Monte Carlo Simulations
The forecast length
The training length for the Naive Bayes model
Some general tips are:
Make sure your lookback is the same size or larger than your forecast
Match the forecast length with your trading horizon. If you want to be in no more than 1 hour on the 1-Minute chart, make sure you are setting this for a forecast horizon of 60 candles.
The Cherry on Top
In professional quantitative finance, we don't just guess; we model. This indicator uses a Log Normal Random Walk for the Monte Carlo and a Gaussian PDF (Probability Density Function) for the Naive Bayes, bringing institutional-grade math to the Pine Script environment. It treats trading as a game of probabilities, not certainties.
And there you have it! Hopefully you find this helpful and enjoy.
Thanks for reading and checking it out! Indicator

Landry Proper OrderLandry Proper Order (LPO)
The Landry Proper Order (LPO) indicator is a comprehensive technical analysis tool for PulseWire. It helps traders visualize market trends, monitor trend alignment, detect pullbacks, and track pivot levels using multiple moving averages. It is designed for educational and analytical purposes and does not guarantee profits.
This guide explains each feature, setting, and visual element so even novice traders can understand how to use it effectively.
1. Moving Average Framework
LPO uses up to 5 moving averages to track trend structure:
M1 – M5: Each moving average can be SMA (Simple Moving Average) or EMA (Exponential Moving Average).
Length: Controls the number of bars used in the moving average calculation (e.g., 10, 20, 50).
Color & Width: Customize for easier visualization.
Use/Disable: Any moving average can be turned on or off.
Purpose: The proper order of moving averages indicates trend direction:
Bullish: Shorter MA above longer MAs (M1 > M2 > M3 …)
Bearish: Shorter MA below longer MAs (M1 < M2 < M3 …)
2. Modes of Operation
LPO has two modes for trend detection:
Basic Mode – Displays trends based on MA alignment only. Useful for quick structural analysis.
Confirmed Mode – Adds additional confirmation by detecting pullbacks and trend locks before signaling a trend. This reduces false signals in choppy markets.
3. Pullback & Lock Detection
LPO can detect potential trend reversals or confirmations:
Pullback Detection: When a short-term moving average crosses over or under another, LPO scans recent bars for local highs/lows (pivots) to identify a pullback.
Sticky Price: Records the key support/resistance level during pullbacks.
Lock Confirmation: Once the trend continues past the pullback, LPO “locks” the trend to confirm its direction.
Why it matters: This helps traders see when a trend may resume after a temporary retracement.
4. Trend Duration & Histogram
Counter: Tracks how many bars the current trend has lasted.
Histogram: Displays trend duration visually.
Colors: Uptrends and downtrends are color-coded for clarity.
Transparency & Width: Adjustable for readability.
This visual cue helps you see trends over time without scanning every MA manually.
5. Background States
LPO can optionally shade the background to indicate trend strength or potential reversals:
Orange/Purple: Trend in progress but not fully confirmed
Green/Red: Confirmed uptrend or downtrend
Bright Red: Trend reset
Purpose: Provides an intuitive visual snapshot of current market structure.
6. Historical Pivot Lines
LPO can draw lines at previous pivot points where trends were confirmed.
Adjustable: Max number of lines, line width, color, and style (solid, dashed, dotted).
Helps identify support/resistance levels from past trends.
7. Start-of-Trend Bubbles & Info Labels
Bubbles: Optional circles marking the beginning of a trend.
Info Labels: Show bars since trend start and percentage price change from trend start.
Colors: Uptrend = green, Downtrend = red.
Benefit: Gives quick, at-a-glance insights for tracking trend progress.
8. Alerts
LPO supports PulseWire alerts for automated monitoring:
New Uptrend: Triggered when a confirmed bullish trend starts.
New Downtrend: Triggered when a confirmed bearish trend starts.
Structural Reset: Triggered if price violates pivot support/resistance.
Trend Recovery Confirmed: Triggered when a trend resumes after pullback and lock confirmation.
Use Case: Helps traders monitor trends without constantly watching the chart.
9. Pivot & Line Settings
Pivot Length: Determines how many bars are checked to find local highs/lows.
Line Style Options: Solid, Dashed, or Dotted for both active trend lines and historical lines.
Purpose: Allows customization of trend visualization according to your charting style.
10. How to Use LPO Safely
Educational Tool: LPO is meant to help you visualize trends and market structure, not to guarantee trades.
Combine With Other Analysis: Use with volume, candlestick patterns, or other indicators for confirmation.
Risk Management: Always use stop-losses, position sizing, and other risk controls.
Observe First: Beginners should watch how LPO signals behave on historical charts before trading live.
11. Summary
LPO provides:
Multi-MA trend detection
Pullback and lock confirmation
Visual trend duration with histograms and background states
Historical pivot lines for context
Optional bubbles and info labels
Alerts for trend events
This makes it a powerful educational and analytical tool for novice and advanced traders alike, helping them understand trend structure, pullbacks, and pivot behavior in a transparent and visual way. Indicator

RSI Entry EngineRSI Entry Engine
RSI Entry Engine is an open-source RSI-based entry framework built around one specific analytical idea:
when a smoothed RSI leaves an extreme condition and reclaims back through a defined threshold, that reclaim can be treated as a structured entry event rather than as a generic oscillator fluctuation.
This script is not designed to mark every RSI movement, and it is not intended to behave like a generic “overbought / oversold indicator” that treats all oscillator readings the same way. Its purpose is to smooth RSI behavior, define a hierarchy of RSI states, detect reclaim-style transitions out of extreme zones, and optionally map those reclaim events into a projected risk framework directly on the price chart.
The script also includes a compact status panel and an alert structure so users can monitor RSI condition, internal signal state, and projected trade behavior in a more organized way. These features are included to support analysis and review, not to imply future performance.
OPEN-SOURCE NOTE
This script is published open-source so users can inspect the logic directly, verify what the script is doing, and adapt parts of the workflow for their own research if they wish.
Even though the code is open, this description is intentionally detailed because many PulseWire users do not read Pine Script. The goal is for a user to understand what the script does, how it works, why its parts belong together, and how it may be used in practice without having to study the code line by line.
OVERVIEW
At a high level, the script does seven things:
1. It calculates a base RSI from a selected source and length.
2. It optionally smooths that RSI and also derives a separate signal line from the smoothed RSI.
3. It organizes RSI values into multiple zones such as overbought, oversold, extreme high, extreme low, bullish, bearish, and neutral.
4. It detects reclaim-style entry signals when the smoothed RSI exits an extreme condition by crossing back through the selected extreme boundary.
5. It can project entry, stop loss, and take profit structure onto the main chart.
6. It can maintain a compact status panel summarizing RSI state, momentum, and structure.
7. It provides alert conditions for RSI / signal crosses, reclaim events, centerline transitions, and optional trade outcomes.
The script is therefore meant to function as a complete RSI reclaim-entry and review framework rather than as a single-purpose oscillator plot.
CORE IDEA
Many RSI tools are used in one of two broad ways:
- as a visual overbought / oversold reference,
- or as a simple cross-based signal tool.
This script takes a narrower and more structured approach.
Its main idea is that a reclaim out of an extreme zone may be more useful than the extreme reading by itself.
In other words, the script does not assume that simply being overbought or oversold is enough. Instead, it focuses on the transition that occurs when smoothed RSI moves out of a more extreme condition and crosses back through a defined reclaim threshold.
That is the reason the main signal model is based on:
- reclaim above the extreme-low boundary for a bullish entry event,
- reclaim below the extreme-high boundary for a bearish entry event.
This means the script is not centered on “RSI is high” or “RSI is low” alone. It is centered on the moment when a smoothed oscillator moves from extreme positioning into a reclaim state that can be interpreted as a structured shift in short-term momentum.
WHY THIS SCRIPT IS NOT A SIMPLE MASHUP
This script combines several components, but they are not included simply to add more features to one publication.
Each part has a specific role inside the same analytical workflow:
- The RSI engine defines the core oscillator state.
- The smoothing layer reduces noise and makes reclaim logic less reactive to small fluctuations.
- The signal line provides a secondary internal reference for oscillator structure.
- The zone system divides RSI behavior into interpretable states such as neutral, bullish, bearish, oversold, overbought, and extreme conditions.
- The reclaim logic defines the actual entry event.
- The trade projection layer maps that event onto the price chart using entry, stop, and target logic.
- The panel and alerts organize the resulting information for monitoring and review.
These parts are interdependent.
Without RSI calculation, there is no oscillator framework.
Without smoothing, reclaim logic becomes more sensitive to noise.
Without the level structure, reclaim events lose contextual meaning.
Without the reclaim rule, the script becomes a more generic RSI plot.
Without trade projection, the user still has to manually draw entry, stop, and target after each signal.
Without the panel and alerts, the script offers less structure for monitoring and review.
For that reason, the script is intended as a single RSI reclaim-entry framework, not as a random collection of unrelated features.
WHAT THE SCRIPT DOES
The script calculates RSI from a selected source and length, then optionally smooths it using one of several averaging methods.
It also creates a signal line from the smoothed RSI.
Once those two internal series exist, the script can:
- classify RSI state using multiple threshold levels,
- highlight extreme conditions visually,
- detect reclaim signals out of extreme zones,
- plot labels on the RSI pane,
- project BUY / SELL trade structures on the main price chart,
- update TP / SL boxes over time,
- show a compact state panel,
- create alerts for multiple RSI-related events.
This means the script is not just an oscillator display. It is an oscillator-driven entry framework with optional on-chart trade projection.
HOW THE SCRIPT WORKS
1) RSI ENGINE
The script begins with a standard RSI calculation based on a user-selected source and length.
That raw RSI can then be smoothed using one of several methods:
- None,
- EMA,
- SMA,
- RMA.
The smoothed RSI is the main series used for interpretation and signaling.
A second line called the signal line is then derived from the smoothed RSI using its own smoothing method and length.
This creates two internal oscillator references:
- the smoothed RSI itself,
- and a signal line built from that smoothed RSI.
The spread between those two series is also used in the panel to describe whether RSI is currently above or below its signal structure.
2) RSI STATE MODEL
The script does not treat RSI as a single binary oscillator. It organizes RSI values into multiple states:
- Extreme High,
- Overbought,
- Bullish,
- Neutral,
- Bearish,
- Oversold,
- Extreme Low.
These states are determined by the user-defined threshold levels:
- Overbought,
- Oversold,
- Extreme High,
- Extreme Low,
- and the centerline area around 50.
This state model is important because it gives the reclaim signals context. A reclaim signal is not interpreted in isolation; it is interpreted relative to where the smoothed RSI has been and which region it is leaving.
3) LEVEL STRUCTURE
The script plots:
- 0,
- 100,
- 50 centerline,
- Overbought,
- Oversold,
- Extreme High,
- Extreme Low.
It also fills the overbought and oversold regions for easier visual reading, and can optionally highlight the background when RSI is in an extreme condition.
This visual structure is not only cosmetic. It helps the user see why the script treats certain transitions differently from ordinary oscillator movement.
4) PRIMARY ENTRY SIGNAL MODEL
The main entry logic is reclaim-based.
Bullish entry event:
- the smoothed RSI crosses upward through the Extreme Low level,
- and the bar must be confirmed on close.
Bearish entry event:
- the smoothed RSI crosses downward through the Extreme High level,
- and the bar must be confirmed on close.
This means the script does not trigger merely because RSI becomes extreme. Instead, it waits for RSI to transition back through the selected extreme boundary.
That distinction is important.
A low RSI reading alone can persist for multiple bars.
A reclaim above the extreme-low threshold is a different event.
Likewise, a high RSI reading alone can persist,
but a reclaim downward through the extreme-high threshold is a different event.
The script is built around that reclaim event rather than around static RSI position alone.
5) BAR-CLOSE CONFIRMATION
Signals are confirmed only on bar close.
This is an important implementation detail because RSI can move intrabar and then reverse before the bar closes. By requiring confirmation on the close, the script avoids treating temporary intrabar movement as a completed reclaim signal.
This makes the signal model more conservative and more stable.
6) OPTIONAL TRADE PROJECTION
When a valid bullish or bearish reclaim signal appears, the script can optionally project a trade framework onto the main price chart.
This is done even though the script itself is plotted in a separate RSI pane.
Depending on settings, the projection includes:
- entry reference,
- stop-loss calculation,
- take-profit projection,
- TP box,
- SL box,
- entry line,
- BUY or SELL label.
The user can choose the entry reference method:
- Close,
- Open,
- HLC3.
The user can also choose the stop-loss mode:
- Signal Candle,
- ATR,
- Percent.
This means the script separates signal generation from risk projection. The reclaim event comes from RSI behavior, but the projected stop logic can be adapted to different preferences.
7) STOP-LOSS MODES
The script supports three stop-loss methods:
Signal Candle:
The stop is based on the high or low of the signal candle, depending on trade direction.
ATR:
The stop is based on ATR distance from the projected entry.
Percent:
The stop is based on a percentage distance from entry.
This allows the same reclaim signal model to be projected using different risk frameworks without changing the core RSI logic.
8) TAKE-PROFIT PROJECTION
Take profit is projected using a risk/reward multiple applied to the chosen stop distance.
This means the target is not arbitrary. It is derived from the actual stop distance created by the selected stop-loss mode and then multiplied by the chosen RR value.
This makes the trade projection internally consistent:
signal
→ entry method
→ stop-loss method
→ risk distance
→ take-profit distance.
9) SAME-BAR TP / SL PRIORITY
The script includes an explicit rule for bars where both TP and SL appear to be touched after entry.
The user can choose whether the same-bar priority should be:
- SL,
- or TP.
This is an important implementation detail because it affects projected review behavior. Without an explicit priority rule, same-bar ambiguity can produce inconsistent outcome interpretation.
10) TRADE BOX MAINTENANCE
The script stores projected trades internally and extends TP / SL boxes and entry lines forward as long as the trade remains active.
It also limits how many historical projected trades remain visible by using a maximum stored trade setting. This keeps the chart more manageable and prevents the projection layer from expanding indefinitely.
11) STATUS PANEL
The script includes a compact panel that can display:
- the current RSI value,
- the signal-line value,
- the current RSI state,
- short-term momentum direction based on RSI change,
- whether RSI is above or below its signal line.
This panel is designed to summarize the oscillator’s state without requiring the user to read every value directly from the plot.
12) ALERT STRUCTURE
The script can generate alerts for several types of events:
- RSI crossing above its signal line,
- RSI crossing below its signal line,
- RSI reclaiming above oversold,
- RSI rejecting below overbought,
- RSI crossing above the centerline,
- RSI crossing below the centerline,
- bullish reclaim entry signal,
- bearish reclaim entry signal,
- projected TP hit,
- projected SL hit.
This allows the script to be used either visually or as an alert-based monitoring tool.
WHAT MAKES THIS SCRIPT ORIGINAL
This script uses familiar technical-analysis building blocks such as:
- RSI,
- smoothing methods,
- threshold zones,
- ATR-based risk projection,
- percentage-based stops,
- RR-based targets,
- on-chart annotation.
Those building blocks are not original by themselves.
The originality of this script is not in inventing a completely new oscillator primitive. The originality lies in how those familiar elements are arranged into one structured RSI reclaim workflow:
RSI calculation
→ smoothing
→ signal-line derivation
→ multi-zone RSI state model
→ reclaim detection out of extreme conditions
→ optional on-chart trade projection
→ panel-based monitoring
→ alert and review behavior
That full sequence is the main reason this script exists as its own publication.
It is not intended to be simply another RSI plot, another overbought / oversold overlay, another signal-line cross tool, or another TP / SL box script. It is specifically an RSI reclaim-entry framework that combines oscillator conditioning, reclaim detection, projection, and monitoring in one workflow.
WHAT APPEARS ON THE CHART
Depending on settings, the script may display in the RSI pane:
- smoothed RSI,
- the signal line,
- 0 / 100 bounds,
- centerline,
- overbought and oversold levels,
- extreme-high and extreme-low levels,
- overbought / oversold zone fill,
- optional extreme background highlights,
- UP / DOWN labels,
- a status panel.
On the main price chart, it may also display:
- BUY / SELL labels,
- entry line,
- TP box,
- SL box,
- TP hit labels,
- SL hit labels.
This split design is intentional. RSI analysis remains in the oscillator pane, while projected execution structure appears on the price chart.
HOW TO USE THE SCRIPT
A practical workflow is:
1. Add the script to a chart and choose the RSI source and RSI length.
2. Select whether the RSI should remain raw or be smoothed.
3. Configure the signal line used for internal oscillator structure.
4. Set the overbought, oversold, extreme-high, and extreme-low thresholds.
5. Decide whether you want trade projection on the main chart.
6. Choose entry mode, stop-loss mode, and risk/reward multiple.
7. Wait for a bullish or bearish reclaim signal to be confirmed on bar close.
8. Use the projected trade structure as an analysis framework rather than as a blind instruction.
9. Use the panel and alerts to monitor RSI state and signal transitions.
10. Adjust settings only after reviewing how the same logic behaves across the symbols and timeframes you actually use.
This script is best understood as a structured decision-support and review tool, not as a self-sufficient automated trading system.
SETTINGS REFERENCE
RSI Engine
- RSI Source: input source used for RSI calculation.
- RSI Length: length of the base RSI.
- RSI Smoothing: smoothing method applied to raw RSI.
- Smoothing Length: length of the first smoothing stage.
- Signal Length: length of the signal line.
- Signal Smoothing: smoothing method used for the signal line.
Zones
- Overbought: upper reference threshold.
- Oversold: lower reference threshold.
- Extreme High: upper extreme reclaim boundary.
- Extreme Low: lower extreme reclaim boundary.
Visuals
- Highlight Extreme Background: highlights the panel background during extreme conditions.
- Show Status Panel: enables or disables the panel.
- Panel Position: controls panel location.
- Panel Text Size: controls panel text size.
Trade Engine
- Show TP / SL Boxes On Main Chart: enables or disables price-chart projection.
- Entry Price: selects the projected entry reference.
- Stop Loss Mode: selects how stop loss is calculated.
- Risk Reward: sets the take-profit multiple.
- ATR Length: ATR length used when ATR stop mode is selected.
- ATR Multiplier: ATR multiplier used for ATR stop mode.
- Percent Stop Loss: percentage stop value used in Percent mode.
- Same Bar TP/SL Priority: defines which outcome wins when both are touched on one bar.
- Max Stored Trade Boxes: limits how many projected historical trades remain visible.
Alerts
- Enable RSI / Signal Cross Alerts: alerts for oscillator / signal crosses.
- Enable OB / OS Reclaim Alerts: alerts for reclaim behavior around overbought / oversold.
- Enable Centerline Alerts: alerts for 50-line crosses.
- Enable Entry Signal Alerts: alerts for bullish and bearish reclaim entries.
- Enable TP / SL Hit Alerts: alerts for projected trade outcomes.
IMPORTANT PRACTICAL NOTES
This script depends heavily on the chosen RSI thresholds.
If thresholds are too wide, signals may become very rare.
If thresholds are too narrow, signals may become too frequent.
Signal quality and frequency will also change depending on:
- RSI length,
- smoothing method,
- signal-line length,
- timeframe,
- symbol volatility,
- stop-loss mode.
Because trade projection is built from RSI events rather than from direct price-structure analysis, the projected boxes should be understood as a standardized review layer, not as proof that the market itself respects those projected levels.
LIMITATIONS AND SHORTCOMINGS
This script has important limitations:
- It is an oscillator-based reclaim model, not a full market-structure system.
- It does not identify support and resistance or discretionary chart structure.
- It does not claim that all extreme RSI conditions will reverse.
- It does not use volume profile, order flow, or trend structure beyond the oscillator model itself.
- Its signals depend on smoothing choices and threshold definitions.
- Projected TP / SL outcomes depend on the chosen entry and stop-loss method.
- Same-bar ambiguity is handled by a rule, not by true intrabar reconstruction.
- Historical projected trade behavior should not be interpreted as guaranteed live performance.
- No RSI-based reclaim model can remove all false signals or all regime-dependent behavior.
For those reasons, the script should be used as a structured analysis and review framework, not as a promise of future profitability.
WHO THIS SCRIPT MAY BE USEFUL FOR
This script may be useful for traders who:
- use RSI as a state and transition tool rather than as a static threshold indicator,
- care about reclaim behavior out of extreme zones,
- want optional projected risk structure on the price chart,
- want a compact RSI-state panel,
- want alert-based monitoring of oscillator events.
It may be less suitable for traders who:
- want a pure trend-following tool,
- want structural support / resistance logic,
- want a complete strategy with no need for outside confirmation,
- want projected trade statistics to be treated as live-execution evidence.
DISCLAIMER
This script is provided for educational and informational purposes only.
It does not constitute financial, investment, or trading advice.
Market conditions change, historical behavior does not guarantee future results, and users should perform their own analysis, validation, and risk management before using the script in live decision-making. Indicator

Smart Reversal EntrySmart Reversal Entry
Smart Reversal Entry is an open-source reversal-entry indicator built around one specific analytical idea:
after a short, directional three-candle expansion move, the first confirmed candle closing back in the opposite direction can create a structured reversal-entry opportunity when it appears in the correct EMA context.
This script is not designed to mark every bullish or bearish candle, and it is not intended to behave like a generic trend-following overlay, a standard candlestick-pattern indicator, or a broad “signal generator” that reacts to every small reversal. Its purpose is to measure short-term directional exhaustion in a standardized way, filter that move through an EMA context, require close-confirmed reversal behavior, and then project a fixed-risk trade structure directly on the chart for analysis and review.
The script also includes an internal background optimizer and review tables so users can compare how the same reversal framework behaves under different parameter combinations. These review tools are included to support study and comparison, not to imply future performance.
OPEN-SOURCE NOTE
This script is published open-source so users can inspect the logic directly, verify what the script is doing, and adapt parts of the workflow for their own research if they wish.
Even though the code is open, this description is intentionally detailed because many PulseWire users do not read Pine Script. The goal is for a user to understand what the script does, how it works, why its parts belong together, and how it may be used in practice without having to study the code line by line.
OVERVIEW
At a high level, the script does six things:
1. It measures whether the last three candles produced a directional move large enough to matter in pip terms.
2. It checks whether price is positioned on the correct side of a selected EMA filter.
3. It requires the current candle to close in the opposite direction as confirmation of a possible reversal.
4. It maps a fixed stop-loss and a selectable take-profit multiple directly onto the chart.
5. It tracks projected trade outcomes and summarizes them in a review table and a daily PnL table.
6. It runs a hidden background optimizer over multiple EMA and move-threshold combinations so the user can compare the current settings to an internal parameter sweep.
The script is therefore meant to function as a complete reversal-entry and review framework rather than as a single-purpose candle-pattern marker.
CORE IDEA
Many reversal-style tools identify isolated candles or basic candlestick formations, but they do not standardize the market context around them.
This script is built around the idea that a reversal signal becomes more meaningful when three specific things happen together:
1. price has already made a clear short-term directional move,
2. that move is large enough to matter relative to the chosen pip structure,
3. and the next confirmed candle closes back in the opposite direction while price remains on the correct side of an EMA filter.
The model is intentionally narrow.
It does not try to identify every turning point in the market.
It does not try to classify broad market structure.
It does not use discretionary support and resistance interpretation.
It does not rely on vague candle descriptions such as “looks weak” or “looks exhausted”.
Instead, it defines reversal-entry conditions using a fixed sequence:
first measure a three-candle directional push,
then filter it using EMA context,
then require an opposite close-confirmed candle,
then project a standardized risk framework,
then review the resulting projected outcomes over time.
That narrower focus is the main reason this script exists in its current form.
WHY THIS SCRIPT IS NOT A SIMPLE MASHUP
This script combines multiple components, but they are not included simply to place more features into one publication.
Each component has a specific function inside the same analytical workflow:
- The EMA filter defines directional context.
- The three-candle move measurement defines whether a short-term push is large enough to qualify.
- The reversal candle confirmation defines the actual entry trigger.
- The pip-based stop-loss and RR framework standardize trade projection.
- The summary and daily review tables organize projected outcomes into a readable review structure.
- The internal optimizer compares the same reversal logic across multiple hidden EMA and move-threshold combinations.
These layers are interdependent.
Without the three-candle move measurement, the script would react to many small candles that do not represent meaningful short-term expansion.
Without the EMA filter, the script would lose its directional context and become a more generic reversal marker.
Without the close-confirmed reversal candle, the script would identify momentum but not the actual reversal-entry moment.
Without the risk projection layer, the user would still need to manually draw the entry, stop, and target after every signal.
Without the review tables, the user would have less organized feedback when reviewing results under the selected settings.
Without the internal optimizer, the user would see only the current configuration and not how the same logic behaves across a broader parameter range.
For that reason, the script is intended as a single reversal-entry framework, not as a random collection of unrelated features.
WHAT THE SCRIPT DOES
The script identifies reversal-entry setups using a strict, rule-based structure.
Long setup requirements:
- price must be above the selected EMA,
- the prior three candles must all be bearish,
- the combined bearish move across that sequence must reach the minimum pip threshold,
- the current candle must close bullish.
Short setup requirements:
- price must be below the selected EMA,
- the prior three candles must all be bullish,
- the combined bullish move across that sequence must reach the minimum pip threshold,
- the current candle must close bearish.
When a valid signal appears, the script can:
- place a BUY or SELL label,
- project a fixed stop loss in pips,
- project a take-profit level using the selected RR multiple,
- draw TP/SL boxes,
- draw an entry line,
- keep historical projected trades visible for later review,
- summarize projected outcomes in a summary table,
- summarize recent daily projected behavior in a daily PnL table.
The script also evaluates an internal optimizer in the background. That optimizer tests multiple EMA lengths and minimum-move combinations using the same reversal logic and displays the best-performing parameter combination inside the summary table over the shared analysis window.
HOW THE SCRIPT WORKS
1) EMA CONTEXT FILTER
The script uses a single EMA as a directional filter.
For long setups:
price must close above the selected EMA.
For short setups:
price must close below the selected EMA.
This does not turn the script into a pure trend-following system. Instead, it acts as a directional context filter so that reversal entries are only considered when price is positioned on the chosen side of the EMA.
In practical terms, the EMA filter is used to reduce context-free reversal signals. A bullish candle appearing after a bearish push is not enough by itself. The script still wants price to be trading above the selected EMA for longs, and below it for shorts.
2) THREE-CANDLE DIRECTIONAL MOVE MEASUREMENT
The script looks at the three candles immediately before the signal candle.
For a long setup:
those three candles must all be bearish.
For a short setup:
those three candles must all be bullish.
The script then measures the total directional move across that sequence in pip terms.
For long setups, it calculates the bearish move from the open of the first candle in the sequence to the close of the third bearish candle.
For short setups, it calculates the bullish move from the open of the first candle in the sequence to the close of the third bullish candle.
That move must be at least as large as the user-defined “Minimum 3-Candle Move (Pips)” setting.
This is one of the key parts of the script’s logic. It ensures that the setup is not based on three arbitrary candles, but on a directional push that is large enough to meet the minimum threshold selected by the user.
3) REVERSAL CANDLE CONFIRMATION
After the three-candle directional push is identified, the current candle must close in the opposite direction.
For long setups:
the current candle must close bullish.
For short setups:
the current candle must close bearish.
This requirement is intentionally strict. The script does not treat intrabar movement or unfinished candles as a valid signal. Signals are confirmed only when the bar closes.
This matters because a reversal that looks valid intrabar can disappear by the close. By waiting for close confirmation, the script reduces premature signal marking.
4) COOLDOWN FILTER
The script includes a cooldown period between signals.
Once a signal has fired, a new signal is not allowed until a defined number of bars has passed. In the current implementation, that cooldown is handled internally.
The purpose of this filter is to reduce signal clustering and prevent the chart from producing multiple nearby entries from the same short-term market behavior.
5) PIP-BASED RISK PROJECTION
When a valid signal appears, the script creates a projected trade framework using:
- entry at the signal close,
- a fixed stop-loss distance in pips,
- a take-profit level based on the selected risk/reward multiple.
This makes the projection logic standardized across signals.
For long setups:
- stop loss is placed below entry,
- take profit is placed above entry.
For short setups:
- stop loss is placed above entry,
- take profit is placed below entry.
The script can draw:
- entry line,
- TP box,
- SL box,
- BUY / SELL label,
- TP / SL hit labels.
This projection layer is not meant to claim that a setup will succeed. Its purpose is to reduce manual chart annotation and make the behavior of the signal model easier to inspect after the fact.
6) SAME-BAR TP/SL PRIORITY RULE
The script uses a strict and conservative rule when both target and stop would appear to be touched on the same bar after entry:
if TP and SL are both reached on the same bar, SL takes priority.
This is an important implementation detail because it directly affects projected statistics. It makes the review logic more conservative and avoids optimistic ambiguity when bar data alone cannot determine exact intrabar order.
7) SHARED ANALYSIS WINDOW
The script uses a shared analysis window internally.
Projected results and optimizer comparisons are evaluated over a rolling historical range rather than over the full unlimited chart history. This keeps the internal review process more controlled and makes the optimizer comparison consistent inside the same defined lookback window.
8) INTERNAL OPTIMIZER
One of the script’s more advanced components is the internal optimizer.
The optimizer runs in the background and is intentionally not exposed as a user-facing optimization panel. Instead of asking the user to manually test every variation, the script internally evaluates combinations of:
- 10 EMA values,
- 10 minimum-move thresholds.
That produces 100 total internal combinations.
Each combination uses the same reversal logic:
- EMA context,
- three-candle directional sequence,
- minimum move threshold,
- opposite close-confirmed candle,
- same stop-loss and RR structure.
The optimizer then tracks projected wins, losses, net R, gross profit, and gross loss for each combination, and the summary table displays the current best combination based on the script’s internal comparison rules.
This optimizer is not intended to present a “perfect setting”. It is a comparative review aid that helps the user understand how the same reversal framework behaves across multiple hidden parameter combinations.
WHAT MAKES THIS SCRIPT ORIGINAL
This script uses familiar technical-analysis building blocks such as:
- EMA filtering,
- candle-sequence logic,
- pip-based move measurement,
- fixed stop-loss projection,
- risk/reward mapping,
- performance review tables.
Those building blocks are not original by themselves.
The originality of this script is not in inventing a completely new primitive indicator. The originality lies in how these familiar elements are arranged into one tightly defined reversal-entry workflow:
EMA context
→ three-candle directional expansion
→ minimum pip-threshold validation
→ opposite candle close confirmation
→ fixed-risk trade projection
→ on-chart review
→ internal background parameter comparison
That full sequence is the main reason this script exists as its own publication.
It is not intended to be simply another EMA filter, another candlestick marker, another TP/SL visualizer, or another optimizer dashboard. It is specifically a short-term reversal-entry framework that combines directional context, expansion measurement, confirmation logic, risk mapping, and review in one workflow.
WHAT APPEARS ON THE CHART
Depending on settings, the chart may display:
- EMA line,
- BUY labels,
- SELL labels,
- signal-bar background highlights,
- entry line,
- TP box,
- SL box,
- TP hit labels,
- SL hit labels,
- summary table,
- daily PnL table.
Users who want a cleaner chart can disable some visual layers and keep only the ones most relevant to their workflow.
HOW TO USE THE SCRIPT
A practical workflow is:
1. Add the script to a standard candlestick chart.
2. Select the EMA length you want to use as directional context.
3. Set the minimum three-candle move threshold in pips.
4. Set the pip preset correctly for the instrument, or use manual pip size if needed.
5. Choose the stop-loss distance in pips.
6. Select the RR mode used for take-profit projection.
7. Wait for a valid long or short setup to appear.
8. Use the projected entry, stop, and target structure as a chart-analysis framework rather than as a blind instruction.
9. Review projected trade behavior in the summary table and daily table.
10. Compare your selected settings with the optimizer’s best internal combination, but do not treat the optimizer output as a guaranteed best future configuration.
This script is best understood as a structured decision-support and reversal-review tool, not as a self-sufficient trading system.
SETTINGS REFERENCE
Signal Settings
- EMA Length: sets the EMA used as the directional filter.
- Minimum 3-Candle Move (Pips): defines how large the directional three-candle move must be before a reversal candle can qualify.
Pip Settings
- Pip Preset: selects a predefined pip-size interpretation for common instrument types.
- Manual Pip Size: allows direct control when the selected symbol needs a custom pip conversion.
Risk Management
- Stop Loss (Pips): sets the fixed stop-loss distance in pip units.
- Take Profit RR: sets the projected target multiple relative to the stop-loss distance.
Visual Settings
- Show Buy/Sell Labels: shows or hides the signal labels.
- Highlight Signal Bars: adds background color to signal bars.
- Show Entry Line: shows or hides the projected entry line.
- Show TP/SL Hit Labels: controls whether projected outcomes are labeled.
- Show TP Hit Labels: controls TP hit labels specifically.
- Show SL Hit Labels: controls SL hit labels specifically.
Summary Table
- Show Summary Table: enables or disables the main review table.
- Table Position: sets the table location.
- Table Text Size: controls summary-table text size.
Daily PnL Table
- Show Daily PnL Table: enables or disables the daily review table.
- Daily Table Position: sets the daily table location.
- Daily Table Text Size: controls daily-table text size.
INTERNAL LOGIC NOTES
The current code also includes internal settings that are not exposed as user-facing optimization controls. These include:
- signal cooldown,
- shared analysis window,
- maximum stored closed-trade visuals,
- hidden optimizer activation,
- internal optimizer parameter combinations.
These internal elements exist to keep the public interface simpler while still allowing the script to maintain consistent review behavior in the background.
IMPORTANT PRACTICAL NOTE ON PIP SIZE
The script uses pip-based calculations for:
- the minimum three-candle move,
- stop-loss distance,
- take-profit distance,
- optimizer comparison logic.
Because of that, correct pip interpretation is extremely important.
If signals appear too frequent, too rare, too compressed, or visually inconsistent for the instrument being analyzed, the first setting to verify is Pip Preset or Manual Pip Size.
This matters especially for:
- gold symbols,
- 5-digit forex symbols,
- JPY forex pairs,
- indices and CFD-style instruments,
- custom broker symbols with unusual decimal formatting.
LIMITATIONS AND SHORTCOMINGS
This script has important limitations:
- It is a short-term reversal model, not a full market-structure engine.
- It only evaluates one specific reversal pattern based on a three-candle directional push and an opposite close-confirmed candle.
- It does not use support/resistance structure, volume profile, or discretionary context.
- It relies on pip conversion, so poor pip settings can distort signal behavior.
- The internal optimizer compares parameter combinations only inside the defined shared analysis window.
- The optimizer output is a comparative review tool, not a guarantee that the best historical combination will remain best in future market conditions.
- Projected results depend on the script’s own simplified outcome logic.
- If TP and SL are both touched on the same bar, SL is prioritized by design, which makes the logic more conservative but also affects outcome statistics.
- Historical projected trades and review metrics are chart-based review aids, not proof of tradable real-world execution.
- No reversal-entry model can remove all false signals or all regime-dependent behavior.
For those reasons, the script should be used as a structured analysis and review framework, not as a promise of future profitability.
WHO THIS SCRIPT MAY BE USEFUL FOR
This script may be useful for traders who:
- want a rules-based short-term reversal-entry model,
- want EMA-based directional context,
- want a minimum expansion threshold before a reversal is allowed,
- want fixed-risk trade projection on the chart,
- want review tables for projected outcomes,
- want background comparison of multiple EMA and move-threshold combinations.
It may be less suitable for traders who:
- want a broad trend-following system,
- want a discretionary support/resistance engine,
- want a multi-pattern candlestick library,
- want a fully automated strategy with no outside confirmation,
- want outcome metrics interpreted as live performance promises.
DISCLAIMER
This script is provided for educational and informational purposes only.
It does not constitute financial, investment, or trading advice.
Market conditions change, historical behavior does not guarantee future results, and users should perform their own analysis, validation, and risk management before using the script in live decision-making. Indicator

Reaction Entry EngineReaction Entry Engine
Reaction Entry Engine is an open-source supply and demand reaction indicator built around one specific analytical idea:
the first meaningful return into a structurally valid zone can carry different information than later retests of the same area.
This script is not designed to mark every possible touch of every level, and it is not intended to behave like a generic supply and demand overlay that treats repeated interaction the same way. Its purpose is to build supply and demand zones from confirmed pivot structure, optionally validate the strength of the move that created the zone, rank the zone using an internal quality model, detect first-touch reactions, and map those reactions into a structured on-chart framework for analysis and review.
The script also includes review panels so users can inspect how projected setups behaved over time under the current settings. Those review tools are included to support study and comparison, not to imply future performance.
OPEN-SOURCE NOTE
This script is published open-source so users can inspect the logic directly, verify what the script is doing, and adapt parts of the workflow for their own research if they wish.
Even though the code is open, this description is intentionally detailed because many PulseWire users do not read Pine Script. The goal is for a user to understand what the script does, how it works, why its parts belong together, and how it may be used in practice without having to study the code line by line.
OVERVIEW
At a high level, the script does six things:
1. It builds supply and demand zones from confirmed pivot structure.
2. It can source those zones from the chart timeframe, from a higher timeframe, or from both.
3. It can filter weak formations by checking whether the move surrounding the pivot had enough directional strength.
4. It can score zone quality using post-formation displacement, reaction behavior, penetration depth, and repeated-touch penalties.
5. It can detect first-touch reactions into valid zones.
6. It can project entry, stop, and target structure on the chart and summarize projected historical behavior in review panels.
The script is therefore meant to function as a complete first-touch zone reaction framework rather than as a single-purpose zone-drawing tool.
CORE IDEA
Many structural tools identify areas where price may react, but they do not distinguish clearly between the first meaningful return into a zone and later repeated interaction with that same area.
This script is built around the idea that those two situations are not necessarily equivalent.
A fresh or relatively intact zone may behave differently from a zone that has already been tested multiple times. Because of that, the script does not treat all contact events in the same way. It attempts to organize the workflow into a more selective sequence:
first identify structure,
then filter weak structure,
then rank remaining zones,
then focus on the earliest qualifying return,
then map that return into a consistent visual framework for review.
This narrower focus is the main reason the script exists in its current form.
WHY THIS SCRIPT IS NOT A SIMPLE MASHUP
This script combines multiple components, but they are not included simply to place more features into one publication.
Each component has a specific function inside the same analytical process:
- Zone construction defines the structural areas.
- Multi-timeframe sourcing expands or narrows the structural map.
- The impulse filter reduces zones formed without meaningful directional expansion.
- The quality engine separates stronger and weaker structural candidates.
- The first-touch logic makes the model more selective than a repeated-touch zone script.
- The projection layer reduces the need for manual chart annotation after a setup appears.
- The review panels allow the user to examine projected historical behavior under the chosen settings.
These layers are interdependent.
Without the zone engine, there is no structural area to evaluate.
Without impulse validation, the model accepts more weak or noisy pivots.
Without quality scoring, all detected zones are treated too similarly.
Without first-touch logic, the script behaves more like a generic touch-based zone tool.
Without the projection layer, the user still has to manually draw entry, stop, and target structure after each setup.
Without the review layer, the user has less organized feedback when comparing settings or reviewing behavior across time.
For that reason, the script is intended as a single first-touch supply and demand reaction framework, not as a random collection of unrelated features.
WHAT THE SCRIPT DOES
The script identifies supply and demand zones from confirmed pivot highs and pivot lows.
Once a zone is created, the script can continue to monitor it and decide whether it should remain only as a structural reference or whether it qualifies for deeper evaluation inside the reaction framework.
Depending on settings, the script can:
- draw supply and demand zones,
- create zones from the chart timeframe,
- create zones from a selected higher timeframe,
- merge nearby zones of the same type,
- classify zones using an internal quality model,
- detect first-touch BUY or SELL reactions,
- project entry, stop loss, and take profit structure,
- retain historical projected trades on the chart,
- summarize projected behavior in performance and daily review panels.
This allows the chart to function not only as a zone map, but also as a structured review environment for the script’s own reaction model.
HOW THE SCRIPT WORKS
1) SUPPLY AND DEMAND ZONE CONSTRUCTION
The script uses pivot highs and pivot lows to define structural areas.
A pivot high can produce a supply zone.
A pivot low can produce a demand zone.
Rather than treating a pivot as one exact price, the script expands the pivot into a zone using a configurable pip-based thickness. This is important because many traders interpret supply and demand as areas rather than as single lines.
The script can build zones from:
- the current chart timeframe,
- a selected higher timeframe,
- or both at the same time.
If nearby zones of the same type are close enough to one another, the script can merge them into a broader structural area. This is meant to reduce overlap and make the displayed structure easier to read.
2) CONFIRMED ZONE LOGIC
The script includes a minimum-touch setting for confirmed zones.
This setting allows users to distinguish between:
- zones that have merely been detected,
- and zones that have accumulated enough interaction to be considered more established.
Different traders interpret this differently. Some prefer relatively fresh zones. Others prefer zones that have already shown repeated market interaction. The script is designed to support both approaches through settings rather than by forcing one interpretation.
3) TOUCH DETECTION
Zone interaction can be recognized using:
- wick touch,
- body touch,
- or both.
This affects how strict or permissive the model is when determining whether price has returned into a zone.
A wick-based model can capture sharp rejections that only briefly enter the area.
A body-based model is stricter and may reduce noise.
Using both provides broader coverage.
This means the same structural framework can be adapted to different preferences without changing the core logic of the script.
4) IMPULSE VALIDATION
Not every pivot represents meaningful structure.
Some pivots are formed during weak, indecisive, or noisy movement. To reduce that problem, the script can apply an impulse filter around the pivot that created the zone.
The impulse filter can evaluate factors such as:
- candle direction,
- candle range relative to ATR,
- candle body size relative to ATR,
- close location near the candle extreme,
- optional relative-volume participation.
The purpose of this filter is not to predict future direction by itself. Its purpose is simply to reduce zones that were formed without enough directional commitment.
5) QUALITY ENGINE
After a zone is created, the script can score it using an internal quality model.
The quality engine can consider:
- displacement after formation,
- reaction size after the first touch,
- penetration depth into the zone,
- repeated-touch penalty.
That information is then used to classify zones into internal grades such as:
- A,
- B,
- TRASH.
These grades are not guarantees and should not be interpreted as objective truth. They are simply the script’s own ranking method for separating stronger and weaker structural candidates under the current settings.
Users can keep all zones visible or restrict the workflow to higher-grade zones only.
6) FIRST-TOUCH REACTION MODEL
The central idea of the script is first-touch selection.
Rather than treating every revisit of a zone as equally important, the script attempts to detect the earliest qualifying return into a valid zone.
This makes the script more specific than:
- a basic supply and demand overlay,
- a general touch-alert tool,
- or a repeated-contact zone script.
For traders who consider early reactions to be structurally important, this framework may be useful because it intentionally avoids reacting in the same way to every later revisit of the same area.
7) TRADE PROJECTION LAYER
When a valid first-touch reaction is detected, the script can project a structured trade framework on the chart.
Depending on settings, this can include:
- BUY or SELL labels,
- an entry reference,
- stop loss,
- take profit,
- guide lines,
- TP and SL boxes,
- retained historical visual structure for later review.
This projection layer is not meant to claim that a setup will succeed. Its purpose is to reduce manual chart annotation and make the script’s reaction logic easier to inspect after the fact.
8) REVIEW PANELS
The script includes review panels that summarize projected historical behavior.
Depending on available chart history and current settings, the review may include metrics such as:
- total projected trades,
- wins,
- losses,
- win rate,
- profit factor,
- average result,
- net result,
- drawdown behavior,
- streak behavior.
A separate daily panel summarizes projected daily behavior according to the script’s configured timezone logic.
These panels are review tools only. They do not replace formal strategy testing, execution analysis, or live validation, and they should not be interpreted as promises of future performance.
WHAT MAKES THIS SCRIPT ORIGINAL
This script uses familiar technical-analysis building blocks such as pivots, ATR, candle structure, relative range expansion, optional volume comparison, and zone interaction logic.
Those building blocks are not original by themselves.
The originality of this script is not in inventing a completely new primitive indicator. The originality lies in how these familiar elements are arranged into one selective workflow:
pivot-based zone construction
→ optional multi-timeframe structure sourcing
→ impulse validation
→ quality scoring
→ first-touch selection
→ trade projection
→ on-chart review
That full sequence is the main reason this script exists as its own publication.
It is not intended to be simply another pivot tool, another ATR-based filter, or another chart dashboard. It is specifically a first-touch supply and demand reaction framework that combines structure detection, formation filtering, zone ranking, selective reaction logic, projection, and review in one workflow.
WHAT APPEARS ON THE CHART
Depending on settings, the chart may display:
- supply zones,
- demand zones,
- higher-timeframe zones,
- confirmed-zone coloring,
- zone labels,
- zone grades,
- BUY and SELL markers,
- entry / stop / target lines,
- TP / SL boxes,
- review panel,
- daily review panel.
Users who want a cleaner chart can disable some visual layers and keep only the ones most relevant to their workflow.
HOW TO USE THE SCRIPT
A practical workflow is:
1. Add the script to a standard candlestick chart.
2. Decide whether you want zones from the chart timeframe, from a higher timeframe, or from both.
3. Choose how strict touch detection should be by using wick touch, body touch, or both.
4. Enable the impulse filter if you want to reduce weaker pivot-based formations.
5. Enable the quality engine if you want to rank zones and restrict the workflow to stronger structural candidates.
6. Select the minimum accepted grade if you want stricter setup filtering.
7. Wait for a qualifying first-touch BUY or SELL reaction.
8. Use the projected entry, stop, and target structure as an analysis framework rather than as a blind instruction.
9. Review how prior projected setups behaved under the same settings.
10. Combine the script’s output with market context, execution rules, and risk management.
This script is best understood as a structured decision-support and chart-review tool, not as a fully self-sufficient trading system.
SETTINGS REFERENCE
Supply & Demand Engine
- Enable Supply & Demand Engine: turns structural zone detection on or off.
- Show S&D Zones: controls whether zone boxes are visible.
- Pip Value: converts pip-based calculations into instrument-specific price units.
- Pivot Left / Pivot Right: define pivot-confirmation depth.
- Use Chart Timeframe Zones: includes zones from the active chart timeframe.
- Use Higher Timeframe Zones: includes zones from the selected higher timeframe.
- Higher Timeframe: selects the HTF used for additional zone sourcing.
- Minimum Touches for Confirmed Zone: defines when a zone is considered confirmed.
- Zone Thickness (pips): controls zone thickness.
- Zone Merge Distance (pips): controls when nearby zones may be merged.
- Break Close Buffer (pips): defines the close-through buffer used in break logic.
- Maximum Stored Zones: limits how many zones remain in memory.
- Use Wick Touch / Use Body Touch: define how interaction with a zone is recognized.
Impulse Filter
- Enable Impulse Filter: turns pivot-strength filtering on or off.
- Impulse Candle Count: number of candles checked after pivot formation.
- ATR Length: ATR period used by the impulse model.
- Minimum Range x ATR: required range expansion relative to ATR.
- Minimum Body x ATR: required body expansion relative to ATR.
- Close Near Extreme: requires the candle to close near its extreme.
- Require Volume Condition: optionally adds a relative-volume filter.
- Volume SMA Length / Minimum Volume x SMA: control the volume filter.
Quality Engine
- Enable Quality Engine: turns zone scoring on or off.
- Displacement Bars: measures post-formation expansion.
- Minimum Displacement (pips): required structural push after formation.
- Reaction Window (bars): number of bars used to evaluate post-touch behavior.
- Minimum Reaction (pips): minimum bounce or rejection required.
- Maximum Penetration %: limits acceptable penetration into the zone.
- Touch Penalty: reduces score as repeated interaction accumulates.
- Hide TRASH Grade Zones: removes weaker zones from view.
- Show Grade on Zones: displays grade labels on the chart.
- Show Zone Labels / Zone Label Size: control zone-label visibility and size.
Trade Projection
- Enable Simulator: turns first-touch trade projection on or off.
- Take Profit RR: sets the target multiple relative to stop distance.
- Stop Loss (pips): sets the projected stop distance.
- Use Chart TF Signals Only: restricts projected setups to chart-timeframe zones.
- Minimum Grade: defines the lowest accepted grade for projected setups.
- Show Entry / Exit Labels: displays entry and exit labels.
- Show Entry / SL / TP Lines: displays projection lines.
- Projection Length (bars): extends projected visuals into future bars.
- Show TP / SL Boxes: displays TP and SL boxes.
- Box Fill / Border controls: change trade-box styling.
- Show Performance Panel / Panel Position: control review-panel visibility and position.
- Show Daily PnL Panel / Number of Days / Panel Position: control daily-review settings.
IMPORTANT PRACTICAL NOTE ON PIP VALUE
The script uses a Pip Value setting to convert internal pip-based distances into actual price distances.
This matters because different instruments use different decimal structures.
If zones, stop loss, take profit, or projected distances appear too compressed, too large, or otherwise inconsistent for the instrument being analyzed, the first setting to verify is Pip Value.
On some symbols, especially small-decimal forex instruments, this setting may need adjustment for the script’s structural and projection logic to behave as intended.
LIMITATIONS AND SHORTCOMINGS
This script has important limitations:
- It relies on pivot confirmation, so some structural elements are recognized only after a confirmation delay.
- Zone behavior can vary across symbols, brokers, spreads, sessions, and volatility regimes.
- Higher-timeframe zones depend on the selected timeframe and can materially change the number and spacing of setups.
- The quality engine is a ranking model, not an objective truth detector.
- The review panels reflect the script’s own projected logic and settings, not guaranteed tradable outcomes.
- The script can be sensitive to pip-conversion settings on some markets.
- First-touch logic is selective by design, so it may ignore later reactions that some traders would still consider relevant.
- No zone model can remove all false signals or all regime-dependent behavior.
For those reasons, the script should be used as a structured analysis and review framework, not as a promise of future profitability.
WHO THIS SCRIPT MAY BE USEFUL FOR
This script may be useful for traders who:
- study supply and demand behavior,
- care more about first-return reactions than repeated retests,
- want structural filtering rather than raw touch alerts,
- want automatic trade mapping for chart review,
- want historical on-chart review of projected outcomes.
It may be less suitable for traders who:
- want every zone retest marked,
- want a minimal chart with almost no overlays,
- want a finished strategy that requires no outside confirmation or discretion.
DISCLAIMER
This script is provided for educational and informational purposes only.
It does not constitute financial, investment, or trading advice.
Market conditions change, historical behavior does not guarantee future results, and users should perform their own analysis, validation, and risk management before using the script in live decision-making. Indicator

Indicator

Market Condition [ThetaLoop]Should you buy today or wait?
That is the only question this indicator answers. Green means conditions are favorable. Red means they are not. Yellow means patience might pay off.
No complicated settings. No confusing numbers. The chart background changes color and arrows appear when conditions shift. If you want to know what is happening under the hood, the info box in the corner shows the score. If you do not care about the details, just follow the colors.
How it works (the simple version)
The indicator checks eight different things simultaneously and combines them into a single score from 0 to 13.
Is the stock in an uptrend or downtrend?
Has it pulled back to an attractive level or is it overextended?
Is the market calm or chaotic?
Are price moves behaving normally or erratically?
Is overnight risk (gaps) under control?
Is there broader market panic happening?
Is the stock near its all-time high or trading lower?
Is there healthy trading volume?
When most of these factors line up positively, the background turns green and you see a GO arrow. When too many factors are negative, the background turns red and you see a WAIT arrow. In between, it stays yellow.
The three sensitivity modes
Conservative — Needs strong alignment across all factors before showing green. Fewer signals but higher quality. Best for long-term investors who want to avoid bad entries.
Balanced (default) — Middle ground. Shows green when conditions are clearly favorable without requiring perfection. Good for most people.
Aggressive — Shows green more often, catches more opportunities but also more false starts. Better for active traders comfortable with some risk.
What the colors mean in practice
Green background (FAVORABLE) — Trend is up, the stock has pulled back from highs, volatility is stable, no panic in the broader market. This is historically where buying has worked well. Not a guarantee, but the statistics are in your favor.
Yellow background (MIXED) — Some factors are positive, others are warning. You could buy a smaller position, or wait for green. This is the "maybe" zone where patience often pays off.
Red background (UNFAVORABLE) — Multiple risk factors are flashing. The stock might keep falling, volatility is unstable, or the broader market is stressed. Historically, buying in red conditions has led to worse outcomes on average. Waiting costs nothing.
The GO and WAIT arrows
These appear only at transition points — when the condition flips from one state to another. A GO arrow means conditions just turned favorable. A WAIT arrow means conditions just deteriorated. The arrows do not repeat every bar, only at the moment of change.
What this is NOT
This is not a crystal ball. It cannot predict earnings surprises, sudden news, or black swan events. It measures the statistical environment right now and tells you whether that environment has historically been favorable or unfavorable for buyers.
Think of it like checking the weather before going outside. A clear forecast does not guarantee sunshine all day, but it is better than walking out blind.
A word about what powers this
Under the surface, this indicator runs the same quantitative analysis used by institutional risk desks — realized volatility estimation, return distribution analysis, overnight gap decomposition, and cross-market regime detection. The difference is that all of that complexity is reduced to one color and one score. If you are curious about the individual components, each one is available as a separate indicator on this profile.
Settings
Sensitivity — Conservative, Balanced, or Aggressive. Start with Balanced.
Color chart background — Toggle the green/yellow/red background on or off.
Show buy/wait arrows — Toggle the transition arrows on or off.
That is it. Three settings. If you never touch them, the defaults work well.
Indicator

Volatility Z-Score [NovaLens]Volatility Z-Score is a statistical volatility indicator that measures how far the current ATR deviates from its historical average, expressed in standard deviations. Built on the Z-Score method used by quantitative desks to detect anomalies, it self-normalizes across any asset and timeframe - no parameter guessing needed.
◉ HOW IT WORKS
Most traders watch ATR to measure volatility - but raw ATR numbers are meaningless without context. ATR = 50 tells you nothing unless you know the asset's history. Is that high? Low? Normal?
The Z-Score solves this by standardizing ATR against its own rolling distribution:
Z = (ATR_current - ATR_mean) / ATR_stddev
A Z-Score of +2 means current ATR is two standard deviations above the historical mean - statistically extreme. A score of 0 means volatility is exactly average. This is the same standardization method used across quantitative finance to detect regime changes and anomalies.
◈ HOW TO READ IT
• Z > +2 : Statistically extreme volatility. Breakout in progress or capitulation event. Consider tightening stops or waiting for mean reversion.
• Z between −1 and +1 : Normal volatility range. Trade your usual setups with standard risk parameters.
• Z < −2 : Unusually quiet market. Compression before expansion. Watch for pre-breakout positioning opportunities.
✦ USE CASES
• Filter entries - only take trades when volatility is in your preferred regime (e.g., avoid extreme Z for trend-following)
• Time exits - extreme Z-Scores often precede reversals or consolidation phases
• Risk management - scale position size inversely with Z-Score: smaller in high-vol, larger in low-vol
• Regime detection - sustained high or low Z indicates a volatility regime shift, not just noise
• Combine with trend tools - high Efficiency Ratio + low Z-Score = quiet strong trend about to expand
⚙ SETTINGS
• ATR Period - Period for Average True Range calculation. Higher values smooth the ATR, lower values make it more responsive to recent price action.
• Z-Score Lookback - Number of bars for computing mean and standard deviation of ATR. Longer lookback = more stable reference, shorter = faster regime detection.
△ LIMITATIONS
Z-Score assumes a roughly normal distribution of ATR values. In assets with structural volatility shifts (e.g., post-halving crypto), the lookback window may not capture the new regime quickly. Works best on liquid instruments with sufficient history. Not a directional signal - tells you about volatility magnitude, not trend direction.
⌁ NOTES
• Based on standard Z-Score normalization - a foundational technique in quantitative finance
• Validated against Python implementation (1.000 correlation via PyneCore)
• Open-source - read the code and verify the math
• Built for traders who want volatility context in standardized units, not raw ATR values Indicator

EPTv2.11An experimental framework for visualizing market psychology, crowd positioning, and institutional intent — derived entirely from price structure.
-Experimental Indicator
This tool does not generate buy or sell signals.
Esco Psychological Theory is a psychological lens — a way of interpreting what participants are likely feeling and who benefits from those emotional conditions.
Treat it as a research framework, not a trading system.
What This Is
Price does not simply move between support and resistance.
It moves through emotional states.
Every candle on your chart represents thousands of decisions made under fear, greed, hope, regret, and panic. Those emotions are not random — they tend to appear in recognizable structural patterns.
Smart money does not simply buy low and sell high.
It often creates the emotional conditions that force the crowd to do the opposite.
Esco Psychological Theory attempts to model this process. It reads structure, volatility expansion, displacement, liquidity sweeps, failed breakouts, and wick behavior — then infers what market participants are likely experiencing and how institutional players may be responding.
This indicator is not trying to predict price.
It is trying to frame why price may be behaving the way it is.
The Psychological Model
Markets tend to cycle through recognizable emotional regimes.
This indicator models those transitions using a sequential state machine. Regimes progress through adjacent states rather than jumping randomly, producing a more realistic psychological narrative.
The cycle:
COMFORT → TENSION → HOPE → TRAP RISK → PANIC → CAPITULATION → RELIEF → REACCUMULATION → …
Each regime leaves structural fingerprints that can be observed in price behavior.
Comfort
Low volatility, orderly trend behavior, shallow pullbacks.
The crowd feels positioned and confident.
This is often where smart money quietly builds exposure.
Tension
Equal highs/lows begin forming.
Repeated rejection at key levels.
Volatility compresses.
Something is building.
Hope
A displacement candle breaks structure.
Breakout traders enter aggressively.
Momentum appears convincing.
The move looks real.
Trap Risk
The breakout stalls or fails to continue.
Price reclaims prior levels.
Large wicks appear at extremes.
Late entries are now vulnerable.
Panic
Structure shifts against the prior trend.
Stops trigger.
Positions unwind quickly.
Volume spikes.
Capitulation
Consecutive displacement candles appear.
Multiple structure breaks occur rapidly.
Maximum forced repositioning.
Relief
Volatility begins to decline.
Price stabilizes and the market pauses.
Participants exit remaining positions.
Reaccumulation
Compression forms around new price levels.
Fresh pivots emerge.
Smart money quietly finishes positioning for the next cycle.
Modules
Emotional Regime Engine
Classifies the market’s current psychological regime using the sequential state model.
Transitions are constrained to realistic sequences rather than random jumps.
Labels appear only when the regime changes.
Optional background shading and a timeline ribbon allow you to visually track emotional phases across the chart.
Smart Money Intent
Estimates institutional behavior based on structural evidence.
Six possible classifications are evaluated simultaneously with confidence scoring.
Accumulation
Repeated demand absorption and compression near discount levels.
Distribution
Repeated supply rejection and compression near premium levels.
Liquidity Harvest
Sweeps of equal highs or lows followed by sharp displacement reversals.
Trap Engineering
Failed breakouts combined with equal level buildup and overextension.
Passive Absorption
Quiet wick rejection and declining volume at key levels.
Aggressive Repricing
Consecutive displacement candles and decisive structure breaks.
Crowd Bias
Infers likely crowd positioning based on structure alignment and momentum behavior.
Possible states include:
Positioned Long / Positioned Short
Trapped Long / Trapped Short
Chasing Momentum
Indecisive / Neutral
Pain & Pressure Engine
Estimates where future price movement would create the greatest psychological stress.
Pain direction is derived from:
trapped positioning
recent liquidity sweeps
failed breakout attempts
distance from equilibrium
premium / discount positioning
Pressure intensity (0–100%) measures the amount of latent repositioning energy in the market.
When pressure exceeds 70%, candles receive a subtle amber tint.
Soft gradient bands above and below price indicate potential pain direction — areas where movement could force the most participants to react.
Psychological Pressure Zones
Event-driven zones are created when structural events occur.
FOMO Zones
Breakout areas where late buyers or sellers entered.
Regret Zones
Failed breakout ranges containing trapped traders.
Trap Zones
Sweep-and-reclaim areas where liquidity was harvested.
Forced Zones
Panic and capitulation ranges created during liquidation events.
Zones automatically deduplicate, fade with time, and disappear once price cleanly resolves through them.
Premium / Discount Context
Using the most recent major swing high and low, the indicator calculates range positioning.
The chart displays:
Premium (top 25%)
Discount (bottom 25%)
Equilibrium midpoint
The dashboard shows the exact percentage location within the range.
Dashboard
A compact panel summarizes the full psychological read of the market.
Displayed metrics include:
Regime — current emotional state
Crowd — inferred crowd positioning
Intent — smart money classification with confidence score
Pain — directional pain bias
Pressure — psychological pressure intensity
Zone — premium / discount / equilibrium position
Phase — cycle phase progression
What This Indicator Is Not
This indicator does not predict price direction.
It does not have access to order flow, liquidation data, or actual market positioning.
Instead, it infers probable psychological conditions from the structural footprint that emotion leaves on a chart.
The classifications and intent scores are probabilistic interpretations, not definitive signals.
Use this as one analytical layer alongside your own discretionary framework.
Inputs
All modules can be enabled or disabled independently.
Key configuration options include:
Swing Lookback
Major Swing Lookback
Maximum Zone Age / Visible Zones
Regime Background and Timeline Ribbon
Pain Gradient and Pressure Bar Colors
Premium / Discount Shading
Event Markers (displacement candles, sweeps, MSS, squeeze events)
Notes
Overlay indicator (drawn directly on the price chart)
Pine Script v6
Compatible with all markets and timeframes
Lower timeframes may require smaller swing lookback values (10–14 recommended)
Higher timeframes benefit from larger values (21–50 recommended)
Feedback
This is the first public release of Esco Psychological Theory.
The framework is experimental and will continue evolving.
If you test it and have feedback, ideas, or suggestions for improving the psychological model or visual design, I would genuinely love to hear them.
Community input is welcome and appreciated.
Esco Psychological Theory
Structure reveals emotion.
Emotion reveals intent. Indicator

Indicator

KMeans Regime Scanner [MarketFragments]KMeans Regime Scanner
A machine learning indicator that uses K-Means clustering on price to
discover three dynamic zones, then monitors the directional behavior of
those zones to detect specific market structural patterns. Signals fire
when the bands themselves move in a specific arrangement -- not when
price crosses a band.
─────────────────────────────────────────────────────────────
HOW IT WORKS
─────────────────────────────────────────────────────────────
LAYER 1 -- K-MEANS CLUSTERING
K-Means clustering organizes closing price into 3 groups (clusters)
over a rolling 200-bar lookback window. Each cluster has a centroid
(the mean price of that group) and a standard deviation band (the
spread of prices within the group).
Centroids are initialized at the 25th, 50th, and 75th percentile of
the recent price range. All distances are normalized by ATR so the
clustering scales with current volatility rather than nominal price.
The algorithm updates every bar -- it is a fully rolling, online
implementation.
The result is three adaptive price zones:
Red band Lower cluster -- prices that have been in the lower range
Yellow band Middle cluster -- the anchor zone
Green band Upper cluster -- prices that have been in the upper range
These zones are not fixed support and resistance levels. They are
data-driven groupings that shift as price behavior changes.
LAYER 2 -- BAND STRUCTURE FEATURE EXTRACTION
Six features are computed from the cluster structure every bar:
C1 slope 10-bar slope of the lower centroid, normalized by ATR
Classified as UP, FLAT, or DOWN (threshold +/- 0.1)
C2 slope 10-bar slope of the middle centroid (same method)
C2 is the anchor -- its direction is the most important
single feature in the regime classification
C3 slope 10-bar slope of the upper centroid (same method)
Avg slope 10-bar slope of the cluster average (mean of all three)
Range state Whether the market is TRENDING, TRANSITIONING, or RANGING
Based on price distance from C2 and intra-cluster SD ratio
SD state Whether band widths are COMPRESSED, NORMAL, or EXPANDED
Ratio of current average SD to its 50-bar rolling mean
Compressed = ratio below 0.7 | Expanded = above 1.3
Combined, these six features define a regime state from a space of
3 x 3 x 3 x 3 x 2 x 3 = 486 possible combinations.
LAYER 3 -- REGIME PATTERN MATCHING
Signals fire when the current regime matches one of two long patterns
or one short pattern. These patterns were identified by analyzing which
of the 486 possible regime states historically preceded favorable
forward returns in ES 5-minute data.
Long Pattern 1:
C1 FLAT, C2 FLAT, C3 DOWN, Average DOWN, TRENDING, NORMAL SD
The upper cluster holds steady while the lower cluster contracts.
The middle band (C2) acts as an anchor -- it refuses to break.
When selling pressure at the lower boundary exhausts itself, price
tends to revert upward through the middle band.
Long Pattern 2:
C1 DOWN, C2 FLAT, C3 DOWN, Average DOWN, TRENDING, NORMAL SD
Similar structure but both outer clusters are contracting.
The key signal remains the flat middle band holding as the anchor.
Pattern stops when the lower cluster stops its downward drift.
Short Pattern:
C1 FLAT, C2 DOWN, C3 FLAT, Average FLAT, TRENDING, NORMAL SD
A weaker pattern with a different structural arrangement.
Middle band drifting lower while others hold flat.
Use selectively or skip -- fewer historical instances.
All signals fire on TRANSITION only -- the first bar the pattern
appears. Not every bar the pattern persists.
─────────────────────────────────────────────────────────────
WHAT YOU SEE ON THE CHART
─────────────────────────────────────────────────────────────
Red band + cloud Lower cluster zone (C1)
Yellow band + cloud Middle cluster zone (C2) -- the anchor
Green band + cloud Upper cluster zone (C3)
Thick colored line Cluster average
Green = trending up
Red = trending down
Cyan = neutral / flat
Green triangle up Long entry signal
Red triangle down Short entry signal (weaker -- use selectively)
Yellow line Entry price
Red line + cloud Stop loss zone
Green line + cloud Target zone
Entry label Shows cluster, stop, and target prices
Exit label Shows P&L at close
Info table Top-right -- live regime state and signal name
─────────────────────────────────────────────────────────────
RISK MANAGEMENT
─────────────────────────────────────────────────────────────
Default stop: 1.0x ATR from entry
Default target: 1.5x ATR from entry (1.5:1 reward-to-risk)
The stop is tight by design. Do not widen it. The stop placement
is part of the entry filter -- changing it alters which trades are
taken and which are skipped, changing the character of the strategy.
Stay flat when the info table shows:
SD = COMP Bands are compressed, likely a volatility squeeze
SD = EXP Volatility has already released
No signal No pattern match -- stay flat
─────────────────────────────────────────────────────────────
PARAMETERS
─────────────────────────────────────────────────────────────
Lookback 200 bars (~2.5 trading days on 5-minute charts)
K 3 (fixed -- three clusters)
Slope thresh 0.1 (ATR-normalized centroid slope cutoff)
ATR Stop 1.0x
ATR Target 1.5x
─────────────────────────────────────────────────────────────
IMPORTANT NOTES
─────────────────────────────────────────────────────────────
-- All pattern results are from historical backtesting only
-- This strategy has not been forward tested in live markets
-- Sample sizes per pattern are small -- confidence intervals are wide
-- The short pattern has a weaker historical edge -- use selectively
-- Results based on ES 5-minute continuous contract data
-- Live trading conditions including slippage will affect results
-- Past results do not guarantee future performance
-- This is not financial advice
-- Trading involves substantial risk of loss
-- Use for educational and research purposes only
─────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────
Indicator
