Bollinger Bands Delta Matrix Analytics [BDMA] Bollinger Bands Delta Matrix Analytics (BDMA) v7.0
Deep Kinetic Engine – 5x8 Volatility & Delta Decision Matrix
1. Introduction & Concept
Bollinger Bands Delta Matrix Analytics (BDMA) v7.0 is an analytical framework that merges:
- Spatial analysis via Bollinger Bands (%B location),
- with a 4-factor Deep Kinetic Engine based on:
• Total Volume
• Buy Volume
• Sell Volume
• Delta (Buy – Sell) Z-Scores
and converts them into an expanded 5×8 decision matrix that continuously tracks where price is trading and how the underlying orderflow is behaving.
BDMA is not a trading system or strategy. It does not generate entry/exit signals.
Instead, it provides a structured contextual map of volatility, volume, and delta so traders can:
- identify climactic extensions vs. fakeouts,
- distinguish strong initiative moves vs. passive absorption,
- and detect squeezes, traps, and liquidity voids with a unified visual dashboard.
2. Spatial Engine – Bollinger S-States (S1–S5)
The spatial dimension of BDMA comes from classic Bollinger Bands.
Price location is expressed as Percent B (%B) and mapped into 5 spatial states (S-States):
S1 – Hyper Extension (Above Upper Band)
Price has pushed beyond the upper Bollinger Band.
Often associated with parabolic or blow-off behavior, late-stage momentum, and elevated reversal risk.
S2 – Resistance Test (Upper Zone)
Price trades in the upper Bollinger region but remains inside the bands.
Represents a sustained test of resistance, typically within an established or emerging uptrend.
S3 – Neutral Zone (Middle)
Price hovers around the mid-band.
This is the mean reversion gravity field where the market often consolidates or transitions between regimes.
S4 – Support Test (Lower Zone)
Price trades in the lower Bollinger region but inside the bands.
Represents a sustained test of support within range or downtrend structures.
S5 – Hyper Drop (Below Lower Band)
Price extends below the lower Bollinger Band.
Often aligned with panic, forced liquidations, or capitulation-type behavior, with increased snap-back risk.
These 5 S-States define the vertical axis (rows) of the BDMA matrix.
3. Deep Kinetic Engine – 4-Factor Z-Score & D-States (D1–D8)
The Deep Kinetic Engine transforms raw volume and delta into standardized Z-Scores to measure how abnormal current activity is relative to its recent history.
For each bar:
- Raw Buy Volume is estimated from the candle’s position within its range
- Raw Sell Volume is complementary to buy volume
- Raw Delta = Buy Volume – Sell Volume
- Total Volume = Buy Volume + Sell Volume
These 4 series are then normalized using a unified Z-Score lookback to produce:
1. Z_Vol_Total – overall activity and liquidity intensity
2. Z_Vol_Buy – aggression from buyers (attack)
3. Z_Vol_Sell – aggression from sellers (defense or attack)
4. Z_Delta – net victory of one side over the other
Thresholds for Extreme, Significant, and Neutral Z-Score levels are fully configurable, allowing you to tune the sensitivity of the kinetic states.
Using Z_Vol_Total and Z_Delta (plus threshold logic), BDMA assigns one of 8 Deep Kinetic states (D-States):
D1 – Climax Buy
Extreme Total Volume + Extreme Positive Delta → Buying climax or blow-off behavior.
D2 – Strong Buy
High Volume + High Positive Delta → Confirmed bullish initiative activity.
D3 – Weak Buy / Fakeout
Low Volume + High Positive Delta → Bullish delta without commitment, low-liquidity breakout risk.
D4 – Absorption / Conflict
High Volume + Neutral Delta → Aggressive two-way trade, strong absorption, war zone behavior.
D5 – Neutral
Low Volume + Neutral Delta → Low-energy environment with low conviction.
D6 – Weak Sell / Fakeout
Low Volume + High Negative Delta → Bearish delta without commitment, low-liquidity breakdown risk.
D7 – Strong Sell
High Volume + High Negative Delta → Confirmed bearish initiative activity.
D8 – Capitulation
Extreme Volume + Extreme Negative Delta → Panic selling or capitulation regime.
These 8 D-States define the horizontal axis (columns) of the BDMA matrix.
4. The 5×8 BDMA Decision Matrix
The core of BDMA is a 5×8 matrix where:
- Rows (1–5) = Spatial S-States (S1…S5)
- Columns (1–8) = Kinetic D-States (D1…D8)
Each of the 40 possible combinations (SxDy) is pre-computed and mapped to:
- a Status or Regime Title (for example: Climax Breakout, Bear Trap Spring, Capitulation Breakdown),
- a Bias (Climactic Bull, Neutral, Strong Bear, Conflict or Reversal Risk, and similar labels),
- and a Strategic Signal or Consideration (for example: High reversal risk, Wait for confirmation, Low probability zone – avoid).
Internally, BDMA resolves all 40 regimes so the current state can be displayed on the dashboard without performance overhead.
5. Key Regime Families (How to Read the Matrix)
5.1. Breakouts and Breakdowns
Climax Breakout (Top-side)
Spatial S1 with Kinetic D1 or D2
Bias: Explosive or Extreme Bull
Signal:
- Strong or climactic upside extension with abnormal bullish orderflow.
- Trend continuation is possible, but reversal risk is extremely high after blow-off phases.
Low-Conviction Breakout (Fakeout Risk)
S1 with D3 (Weak Buy, low liquidity)
Bias: Weak Bull – Caution
Signal:
- Breakout not supported by volume.
- Elevated risk of failed auction or bull trap.
Capitulation Breakdown (Bottom-side)
Spatial S5 with Kinetic D8
Bias: Climactic Bear (panic)
Signal:
- Capitulation-type selling or forced liquidations.
- Trend can still proceed, but snap-back or violent short-covering risk is high.
Initiative Breakdown vs. Weak Breakdown
- Strong, high-volume breakdown typically corresponds to D7 (Strong Sell).
- Low-volume breakdown often corresponds to D6 (Weak Sell or Fakeout) with potential for failure.
5.2. Absorption, Traps and Springs
Absorption at Resistance (Top-side conflict)
S1 or S2 with D4 (Absorption or Conflict)
Bias: Conflict – Extreme Tension
Signal:
- Heavy two-way trade near resistance.
- Potential distribution or reversal if sellers begin to dominate.
Bull Trap or Failed Auction
Typically S1 with D6 (Weak Sell breakdown behavior after a top-side attempt)
Indicates a breakout attempt that fails and reverses, often after poor liquidity structure.
Absorption at Support and Bear Trap (Spring)
S4 or S5 with D4 or D3
Bias: Conflict or Weak Bear – Reversal Risk
Signal:
- Aggressive buying into lows (spring or shakeout behavior).
- Potential bear trap if price reclaims lost territory.
5.3. Trend Phases
Strong Uptrend Phases
Typically seen when S2–S3 combine with strong bullish kinetic behavior.
Bias: Strong or Extreme Bull
Signal:
- Pullbacks into S3 or S4 with supportive kinetic states often act as trend continuation zones.
Strong Downtrend Phases
Typically seen when S3–S4 combine with strong bearish kinetic behavior.
Bias: Strong or Extreme Bear
Signal:
- Rallies into resistance with strong bearish kinetic backing may act as continuation sell zones.
5.4. Neutral, Exhaustion and Squeeze
Exhaustion or Liquidity Void
S1 or S5 with D5 (Neutral kinetics)
Bias: Neutral or Exhaustion
Signal:
- Spatial extremes without kinetic confirmation.
- Often marks the end of a move, with poor follow-through.
Choppy, Low-Activity Range
S3 with D5
Bias: Neutral
Signal:
- Low volume, low conviction market.
- Typically a low-probability environment where standing aside can be logical.
Squeeze or High-Tension Zone
S3 with D4 or tightly clustered kinetic values
Bias: Conflict or High Tension
Signal:
- Hidden battle inside a volatility contraction.
- Often precedes large directionally-biased moves.
6. Dashboard Layout & Reading Guide
When Show Dashboard is enabled, BDMA displays:
1. Title and Status Line
Name of the current regime (for example: Climax Breakout, Bear Trap Spring, Mean Reversion).
2. Bias Line
Plain-language summary of directional context such as Climactic Bull, Strong Bear, Neutral, or Conflict and Reversal Risk.
3. Signal or Strategic Notes
Concise guidance focused on risk and context, not entries. For example:
- High reversal risk – aggressive traders only
- Wait for confirmation (break or rejection)
- Low probability zone – avoid taking new positions
4. Kinetic Profile (4-Factor Z-Score)
Shows the current Z-Scores for Total Volume (Activity), Buy Volume (Attack), Sell Volume (Defense), and Delta (Net Result).
5. Matrix Heatmap (5×8)
Visual representation of S-State vs. D-State with color coding:
- Bullish clusters in a green spectrum
- Bearish clusters in a red spectrum
- Conflict or exhaustion zones in yellow, amber, or neutral tones
The dashboard can be repositioned (top right, middle right, or bottom right) and its size can be adjusted (Tiny, Small, Normal, or Large) to fit different layouts.
7. Inputs & Customization
7.1. Core Parameters (Bollinger and Z-Score)
- Bollinger Length and Standard Deviation define the spatial engine.
- Z-Score Lookback (All Factors) defines how many bars are used to normalize volume and delta.
7.2. Deep Kinetic Thresholds
- Extreme Threshold defines what is considered climactic (D1 or D8).
- Significant Threshold distinguishes strong initiative vs. weak or fakeout behavior.
- Neutral Threshold is the band within which delta is treated as neutral.
These thresholds allow you to tune the sensitivity of the kinetic classification to fit different timeframes or instruments.
7.3. Calculation Method (Volume Delta)
Geometry (Approx)
- Fast, non-repainting approach based on candle geometry.
- Suitable for most users and real-time decision-making.
Intrabar (Precise)
- Uses lower-timeframe data for more precise volume delta estimation.
- Intrabar mode can repaint and requires compatible data and plan support on the platform.
- Best used for post-analysis or research, not blind automation.
7.4. Visuals and Interface
- Toggle Bollinger Bands visibility on or off.
- Switch between Dark and Light color themes.
- Configure dashboard visibility, matrix heatmap display, position, and size.
8. Multi-Language Semantic Engine (Asia and Middle East Focus)
BDMA v7.0 includes a fully integrated multi-language layer, targeting a wide geographic user base.
Supported Languages:
English, Türkçe, Русский, 简体中文, हिन्दी, العربية, فارسی, עברית
All dashboard labels, regime titles, bias descriptions, and signal texts are dynamically translated via an internal dictionary, while semantic meaning is kept consistent across languages.
This makes BDMA suitable for multi-language communities, study groups, and educational content across different regions.
However, due to the heavy computational load of the Deep Kinetic Engine and TradingView’s strict Pine Script execution limits, it was not possible to expand support to additional languages. Adding more translation layers would significantly increase memory usage and exceed runtime constraints. For this reason, the current language set represents the maximum optimized configuration achievable without compromising performance or stability.
9. Practical Usage Notes
BDMA is most powerful when used as a contextual overlay on top of market structure (HH, HL, LH, LL), higher-timeframe trend, key levels, and your own execution framework.
Recommended usage:
- Identify the current regime (Status and Bias).
- Check whether price location (S-State) and kinetic behavior (D-State) agree with your trade idea.
- Be especially cautious in climactic and absorption or conflict zones, where volatility and risk can be elevated.
Avoid treating BDMA as an automatic green equals buy, red equals sell tool.
The real edge comes from understanding where you are in the volatility or kinetic spectrum, not from forcing signals out of the matrix.
10. Limitations & Important Warnings
BDMA does not predict the future.
It organizes current and recent data into a structured context.
Volume data quality depends on the underlying symbol, exchange, and broker feed.
Forex, crypto, indices, and stocks may all behave differently.
Intrabar mode can repaint and is sensitive to lower-timeframe data availability and your plan type.
Use it with extra caution and primarily for research.
No indicator can remove the need for clear trading rules, disciplined risk management, and psychological control.
11. Disclaimer
This script is provided strictly for educational and analytical purposes.
It is not a trading system, signal service, financial product, or investment advice.
Nothing in this indicator or its description should be interpreted as a recommendation to buy or sell any asset.
Past behavior of any indicator or market pattern does not guarantee future results.
Trading and investing involve significant risk, including the risk of losing more than your initial capital in leveraged products.
You are solely responsible for your own decisions, risk management, and results.
By using this script, you acknowledge that you understand these risks and agree that the author or authors and publisher or publishers are not liable for any loss or damage arising from its use.
지표 및 전략
Daily EMA TrendThis show whether price is above or below the set DAILY EMAs that you set. Default is 200, 100, 50 & 20.
SCOTTGO - Day Trade Stock Quote V4This Pine Script indicator, titled "SCOTTGO - Day Trade Stock Quote V4," is a comprehensive, customizable dashboard designed for active traders. It acts as a single, centralized reference point, displaying essential financial and technical data directly on your chart in a compact table overlay.
📊 Key Information Provided
The indicator is split into sections, aggregating various critical data points to provide a holistic picture of the stock's current state and momentum:
1. Ownership & Short Flow
This section provides fundamental context and short-interest data:
Market Cap, Shares Float, and Shares Outstanding: Key figures on the company's size and publicly tradable shares.
Short Volume %: Indicates the percentage of trading activity driven by short sellers.
Daily Change %: Shows the day's price movement relative to the previous close.
2. Price & Volatility
This tracks historical and immediate price levels:
Previous Close, Day High/Low: Key daily reference prices.
52-Week High/Low: Important long-term boundaries.
Earnings Date: A crucial fundamental date (currently displayed as a placeholder).
3. Momentum & Volume
These metrics are essential for understanding intraday buying and selling pressure:
Volume & Average Volume: The current trade volume compared to its historical average.
Relative Volume (RVOL): Measures how much volume is currently trading compared to the average rate for that time period (shown for both Daily and 5-Minute rates).
Volume Buzz (%): A percentage representation of how much current volume exceeds or falls below the average.
ADR % & ATR %: Measures of volatility.
RSI, U/D Ratio, and P/E Ratio: Momentum and valuation indicators.
4. Context
This provides background information on the security:
Includes the Symbol, Exchange, Industry, and Sector (note: some fields use placeholder data as this information is not always available via Pine Script).
⚙️ Customization
The dashboard is highly customizable via the indicator settings:
You can control the visibility of every single metric using the Section toggles.
You can change the position (Top Left, Top Right, etc.), size, and colors of the entire table.
In summary, this script is a powerful tool for day traders who need to monitor a large number of fundamental, technical, and volatility metrics simultaneously without cluttering the main chart area.
Daily ATR Dashboard - NIRALADaily ATR Dashboard: Volatility at a Glance
What is this?
The "Daily ATR Dashboard" is a simple, non-intrusive utility tool designed for intraday traders. It places a clean information table in the top-right corner of your chart, displaying the Daily Average True Range (DATR) for the current session and the previous two days.
Why is it useful?
Understanding daily volatility is crucial for setting realistic targets and stop-losses.
Know the Range: Instantly see how much the instrument typically moves in a day.
Context: Compare today's volatility with yesterday's and the day before to gauge if the market is expanding (becoming more volatile) or contracting (consolidating).
Clean Charts: Instead of plotting a messy ATR line indicator below your price action, this dashboard gives you the raw data you need without cluttering your workspace.
Features:
Real-Time Data: The "Today" row updates in real-time as the current daily candle develops.
Historical Context: Automatically fetches and displays the final DATR values for the previous two sessions ("Yesterday" and "Day Before").
Highlighted Current Day: The current day's data is highlighted in yellow for immediate visibility.
Customizable: You can adjust the ATR length (default is 14) and the text size to fit your screen perfectly.
How to Read It:
Today: The current volatility of the ongoing daily session.
Yesterday / Day Before: The finalized volatility of past sessions.
Tip: If "Today's" ATR is significantly lower than the previous days, expect potential expansion or a breakout soon. If it is significantly higher, the market may be overextended.
Settings:
DATR Length: The lookback period for the ATR calculation (Default: 14).
Text Size: Adjust the size of the table text (Tiny, Small, Normal, Large).
Detector Original + Tiempo + Filtro QEMAindicator for triying better entries
works better for m2 ustec
enjoy
Market Regime Flip (Dunk)This indicator is a trend regime flip tool built on top of MACD. Instead of reacting to every little wiggle, it waits for several bars in a row where the MACD stays either above or below zero (by default, 3 consecutive bars). When the MACD has been above zero for 3 bars, it declares a bull regime and marks that bar on the price chart with a green “BULL” triangle above the candle. When the MACD has been below zero for 3 bars, it declares a bear regime and marks that bar with a red “BEAR” triangle below the candle. It also lightly colors the chart background green in bull regimes and red in bear regimes, so you can see at a glance which side of the market you’re in.
In other words, it turns the MACD’s usual “above/below zero” behavior into a clean, slower-changing on/off regime switch. Instead of giving you constant signals, it focuses on the moments where momentum truly shifts and sticks around for a few bars, helping you avoid getting faked out by single-bar noise. The alerts are wired to those flip moments, so you can get notified when the market transitions from bearish to bullish (or vice versa) according to this MACD-based regime logic.
MSS + Multi FVG TrackerMSS + Multi FVG Tracker
Description
An advanced institutional trading tool that combines Market Structure Shift (MSS) detection with multi-level Fair Value Gap (FVG) tracking. This indicator identifies breakouts of previous swing highs/lows on higher timeframes, then systematically tracks and validates multiple FVGs within each trend direction, generating precise entry signals when price respects the gap structure.
How It Works
Higher Timeframe Trend Detection
The indicator analyzes a higher timeframe (default 15-minute) to determine the overall bias, displaying background colors that show bullish or bearish directionality. This ensures you only trade with institutional trend direction.
Market Structure Shift (MSS/BOS)
When price closes above a previous swing high (in uptrends) or below a previous swing low (in downtrends), a BOS (Break of Structure) is marked with a line and label. This signals that the institutional structure has shifted and a new trend impulse is beginning.
Multi-Level FVG Tracking
Once an MSS occurs:
The indicator begins scanning for Fair Value Gaps (gaps between candles where no trading occurred)
Bullish FVGs: Gaps above the closing price of a bearish candle (low > high )
Bearish FVGs: Gaps below the closing price of a bullish candle (high < low )
Multiple FVGs are tracked simultaneously (up to 5 configurable) across the same impulse
Intelligent FVG Validation
Each FVG is continuously monitored:
Invalidated: If price closes through the gap (below a bullish FVG or above a bearish FVG), it's automatically deleted
Touched: If price enters the gap zone, it's marked as "touched"
Signal Generated: When a touched FVG shows strong directional confirmation (bullish candle closing above the FVG top, or bearish candle closing below the FVG bottom), a LONG or SHORT signal is triggered
Key Features
HTF Trend Confirmation: Only trades aligned with higher timeframe bias (eliminates counter-trend noise)
Multi-FVG Architecture: Tracks up to 5 gaps per trend impulse simultaneously
Automatic Gap Invalidation: Removes FVGs that break below/above, keeping only valid levels
Smart Signal Generation: Entry signals require both FVG respect + directional confirmation
Color-Coded Structure: Bullish signals in green, bearish in red with instant visual clarity
Background Trend Visualization: Subtle background shading shows HTF bias at all times
Customizable Parameters: Adjust swing period, HTF timeframe, and max FVGs to track
Ideal For
ICT Smart Money traders using FVG + MSS methodologies
Institutional order flow analysts trading market structure
Multi-timeframe traders looking for confluence-based entries
Scalpers to swing traders on 5-minute to 1-hour charts
Anyone seeking high-probability setups with clear invalidation rules
Trading Applications
Scalp FVG reversals: Enter when price respects a touched FVG with confirmation
Trade impulses with structure: Follow MSS with FVG confluence for institutional-grade entries
Identify pullback opportunities: Track multiple FVGs during retracements for re-entry zones
Confirm breakout validity: Only take breaks when aligned with HTF trend + FVG structure
Avoid false breakouts: Invalidated FVGs signal that the move is losing structure
How to Use
Wait for the MSS: Background color shift + BOS line confirms market structure break
Monitor FVG Creation: Boxes appear as gaps form within the new impulse
Watch for Invalidation: Red boxes disappear if price breaks the gap—signal invalid
Wait for Touch + Confirmation: FVG must be touched AND show strong directional candle
Take the Signal: Triangle entry markers appear with audio/visual alerts
Clear Risk Management: Use the invalidated FVG level as your stop loss
Signal Strength Indicators
Strongest Setup: Multiple FVGs created + one respects while others invalidate (shows structure)
Medium Setup: Single FVG touched and confirmed
Weaker Setup: Quick touch with weak confirmation candle (wait for better structure)
Customization Options
HTF Timeframe: Change from 15-min to 5, 30, 60 min or higher for different trading styles
Swing Period: Adjust from 10 bars for faster detection to 20+ for structural shifts
Max FVGs: Track 1-5 simultaneous gaps (lower = cleaner, higher = more opportunities)
Colors: Customize bullish/bearish colors to match your chart theme
Default Settings Optimized For
NASDAQ futures and liquid forex pairs
5-minute to 1-hour timeframe trading
Smart Money / ICT methodology
High-probability impulse + gap trading
Pro Tips
The cleaner your chart (fewer invalidated FVGs), the stronger the structural move
Multiple valid FVGs in one impulse suggest institutional accumulation/distribution
HTF background color changes are early warnings of trend structure shift
Best setups occur when 2-3 FVGs exist and one shows clear confirmation
HL/LH Confirmation Strategy (Clean Market Structure)🚦 HL/LH Confirmation Strategy (Clean Market Structure)
This indicator is specifically designed to help traders identify a clean market structure by tracking the formation of Higher Lows (HL) and Lower Highs (LH). Rather than chasing new price extremes (new Highs or new Lows), the focus is on waiting for trend strength confirmation before considering an entry.
Key Strategy: Waiting for Trend Confirmation 💡
The core advantage of this indicator lies in its confirmation strategy:
For Uptrends (Bullish): The indicator doesn't signal just any low, but only when it detects a Higher Low (HL)—a low that is higher than the previous low. This is a crucial sign that the market has defended a level and is ready to continue moving up. This approach helps avoid chasing new lows and encourages entering trades after confirmation.
For Downtrends (Bearish): Similarly, the indicator looks for the formation of a Lower High (LH)—a high that is lower than the previous high. This suggests that buyers failed to breach the last resistance, signaling a potential continuation of the downside movement.
The indicator alternates between looking for an HL, then an LH, then an HL, visually mapping the Pivot swings and highlighting the moment of trend confirmation for potential trade entries.
Indicator Features ✨
Clear Structure Display: By drawing connecting lines between valid HL and LH points, the indicator visually maps the current market structure.
Pivot Detection: It uses an effective method for Pivot detection, with the sensitivity adjustable via the "Pivot Left" and "Pivot Right" parameters.
Custom Label Placement (Crucial Detail):
HL Label: Placed below the candle for better visual clarity of the bullish support area.
LH Label: Placed above the candle for better visual clarity of the bearish resistance area.
Customizable Colors: Full control over the background and text colors for HL and LH signals, as well as the thickness and color of the connecting lines between Pivot points.
⚙️ Input Parameters
Pivot Settings
Pivot Left / Pivot Right: Determine the number of bars to the left and right that must have lower/higher prices for a point to be declared a valid Pivot (Pivot High or Pivot Low). Increase these values to detect more significant, longer-term swings.
Signal Colors
HL Background/Text Color: Colors for the background and text of the Higher Low (HL) labels.
LH Background/Text Color: Colors for the background and text of the Lower High (LH) labels.
Line Settings
Line Color / Line Width: Allows customization of the appearance of the line connecting the detected HL and LH points.
Recommended Use
This indicator is ideal for traders practicing Price Action and strategies based on Market Structure. Use the HL signals as potential zones for long entries (buying) in an uptrend, and LH signals as zones for short entries (selling) in a downtrend, always after the point formation is confirmed.
Intraday Day-Trade Scanner//@version=5
indicator("Intraday Day-Trade Scanner", overlay=true)
// ----- Inputs -----
minFloat = input.int(10000000, "Min Float")
maxFloat = input.int(20000000, "Max Float")
minPrice = input.float(3, "Min Price")
maxPrice = input.float(50, "Max Price")
minRVOL = input.float(1.5, "Min Relative Volume")
minAtrPct = input.float(1.0, "Min ATR %")
maxAtrPct = input.float(5.0, "Max ATR %")
useLong = input.bool(true, "Long scan (above VWAP)")
useShort = input.bool(false, "Short scan (below VWAP)")
// ----- Data -----
float = request.financial(syminfo.tickerid, "FLOAT", "FQ")
avgVol = ta.sma(volume, 20)
rvol = volume / avgVol
atr = ta.atr(14)
atrPct = (atr / close) * 100
// VWAP
vwap = ta.vwap(close)
// ----- Conditions -----
floatOK = float >= minFloat and float <= maxFloat
priceOK = close >= minPrice and close <= maxPrice
rvolOK = rvol >= minRVOL
atrOK = atrPct >= minAtrPct and atrPct <= maxAtrPct
longOK = useLong and close > vwap
shortOK = useShort and close < vwap
qualified = floatOK and priceOK and rvolOK and atrOK and (longOK or shortOK)
// ----- Plot label on chart -----
plotshape(qualified,title ="Qualified Stock", text="SCAN HIT", style=shape.labelup, size=size.small, color=color.new(color.green, 0))
// ----- Alerts -----
alertcondition(qualified, title="Trade Candidate Found", message="This stock meets your day-trade scan criteria!")
EMA Crossover + Angle + Candle Pattern + Breakout (Clean)mrdfgdfew;qwiohj'fjpqwpodkqsk [pal
a'laoduasipdjascm[osfw0e9fj[ekf[pk[
pfi[0wejf[oewfkj[sofk
Turtle Unit CalculatorTurtle Unit Calculator
This Pine Script indicator calculates the exact quantity of an asset you should buy (your Unit Size) to ensure you risk a fixed amount of capital (e.g., 1%) per trade.
VWAP + Scaled VIX OverlayVWAP-VIX Fusion Overlay helps traders interpret volatility in real time by placing VIX and VWAP where they belong: side-by-side with price action.
It turns the invisible (fear, volatility pressure, momentum shifts) into something clearly visible — making entries, exits, and trend evaluation easier and more accurate.
SPY EMA + VWAP Day Trading Strategy (Market Hours Only)//@version=5
indicator("SPY EMA + VWAP Day Trading Strategy (Market Hours Only)", overlay=true)
// === Market Hours Filter (EST / New York Time) ===
nySession = input.session("0930-1600", "Market Session (NY Time)")
inSession = time(timeframe.period, "America/New_York") >= time(nySession, "America/New_York")
// EMAs
ema9 = ta.ema(close, 9)
ema21 = ta.ema(close, 21)
// VWAP
vwap = ta.vwap(close)
// Plot EMAs & VWAP
plot(ema9, "EMA 9", color=color.green, linewidth=2)
plot(ema21, "EMA 21", color=color.orange, linewidth=2)
plot(vwap, "VWAP", color=color.blue, linewidth=2)
// ----------- Signals -----------
long_raw = close > ema9 and ema9 > ema21 and close > vwap and ta.crossover(ema9, ema21)
short_raw = close < ema9 and ema9 < ema21 and close < vwap and ta.crossunder(ema9, ema21)
// Apply Market Hours Filter
long_signal = long_raw and inSession
short_signal = short_raw and inSession
// Plot Signals
plotshape(long_signal,
title="BUY",
style=shape.labelup,
location=location.belowbar,
color=color.green,
size=size.small,
text="BUY")
plotshape(short_signal,
title="SELL",
style=shape.labeldown,
location=location.abovebar,
color=color.red,
size=size.small,
text="SELL")
// Alerts
alertcondition(long_signal, title="BUY Alert", message="BUY Signal (Market Hours Only)")
alertcondition(short_signal, title="SELL Alert", message="SELL Signal (Market Hours Only)")
Adaptive Trend Navigator [ATH Filter & Risk Engine]Description:
This strategy implements a systematic Trend Following approach designed to capture major moves while actively protecting capital during severe bear markets. It combines a classic Moving Average "Fan" logic with two advanced risk management layers: a 4-Stage Dynamic Stop Loss and a macro-economic "Circuit Breaker" filter.
Core Concepts:
1. Trend Identification (Entry Logic) The script uses a cascade of Simple Moving Averages (SMA 25, 50, 100, 200) to identify the maturity of a trend.
Entries are triggered by specific crossovers (e.g., SMA 25 crossing SMA 50) or by breaking above the previous trade's high ("High-Water Mark" Re-Entry).
2. The "Circuit Breaker" (Crash Protection) To prevent trading during historical market collapses (like 2000 or 2008), the strategy monitors the Nasdaq 100 (QQQ) as a global benchmark:
Normal Regime: If the market is within 20% of its All-Time High, the strategy operates normally.
Crisis Regime: If the QQQ falls more than 20% from its ATH, the "Circuit Breaker" activates (Visualized by a Red Background).
Recovery Rule: In a Crisis Regime, new long positions are blocked unless the QQQ reclaims its SMA 200. This filters out "bull traps" in secular bear markets.
3. 4-Stage Risk Engine (Exit Logic) Once in a trade, the risk management adapts to the position's performance:
Stage 1: Fixed initial Stop Loss (default 10%) for breathing room.
Stage 2: Moves to Break-Even area once the price rises 12%.
Stage 3: Tightens to a trailing stop (8%) after 25% profit.
Stage 4: Maximizes gains with a tight trailing stop (5%) during parabolic moves (>40% profit).
Visual Guide:
SMAs: 25/50/100/200 period lines for trend visualization.
Red Background: Indicates the "Crisis Regime" where trading is halted due to broad market weakness.
Blue Background: Indicates a "Recovery Phase" (Crisis is active, but market is above SMA 200).
Red Line: Shows the dynamic Stop Loss level for active positions.
Settings: All parameters (SMA lengths, Drawdown threshold, Risk Stages) are fully customizable. The QQQ benchmark ticker can also be changed to SPY or other indices depending on the asset class traded.
sugarol sa goldthis indicator is only for those who have itchy hands who cannot wait for the zone. so, if you see the buy or sell indicator just press the buy and sell button and wait for your luck.
ES-SPX Premium PlotThis Pine Script indicator calculates and plots the premium (basis) between the E-mini S&P 500 futures (ES) and the S&P 500 cash index (SPX). It displays the difference as a line chart in a separate pane, helping traders identify fair value discrepancies, arbitrage opportunities, or market sentiment shifts driven by interest rates, dividends, and time to expiry. Apply to ES1! charts for real-time analysis.
Dynamic SMA Trend System [Multi-Stage Risk Engine]Description:
This script implements a robust Trend Following strategy based on a multiple Simple Moving Average (SMA) crossover logic (25, 50, 100, 200). What sets this strategy apart is its advanced "4-Stage Risk Engine" and a smart "High-Water Mark" Re-Entry system, designed to protect profits during parabolic moves while filtering out chop during sideways markets.
How it works:
The strategy operates on three core pillars: Trend Identification, Dynamic Risk Management, and Momentum Re-Entry.
1. Entry Logic (Trend Identification) The script looks for crossovers at different trend stages to capture early reversals as well as established trends:
Short-Term: SMA 25 crosses over SMA 50.
Mid-Term: SMA 50 crosses over SMA 100.
Macro-Trend: SMA 100 crosses over SMA 200.
2. The 4-Stage Risk Engine (Dynamic Stop Loss) Instead of a static Stop Loss, this strategy uses a progressive system that adapts as the price increases:
Stage 1 (Protection): Starts with a fixed Stop Loss (default -10%) to give the trade room to breathe.
Stage 2 (Break-Even): Once the price rises by 12%, the Stop is moved to trailing mode (10% distance), effectively securing a near break-even state.
Stage 3 (Profit Locking): At 25% profit, the trailing stop tightens to 8% to lock in gains.
Stage 4 (Parabolic Mode): At 40% profit, the trailing stop tightens further to 5% to capture the peak of parabolic moves.
3. Dual Exit Mechanism The strategy exits a position if EITHER of the following happens:
Stop Loss Hit: Price falls below the dynamic red line (Risk Engine).
Dead Cross: The trend structure breaks (e.g., SMA 25 crosses under SMA 50), signaling a momentum loss even if the Stop Loss wasn't hit.
4. "High-Water Mark" Re-Entry To avoid "whipsaws" in choppy markets, the script does not re-enter immediately after a stop-out.
It marks the highest price of the previous trade (Green Dotted Line).
A Re-Entry only occurs if the price breaks above this previous high (showing renewed strength) AND the long-term trend is bullish (Price > SMA 200).
Visuals:
SMAs: 25 (Yellow), 50 (Orange), 100 (Blue), 200 (White).
Red Line: Visualizes the dynamic Stop Loss level.
Green Dots: Visualizes the target price needed for a valid re-entry.
Settings: All parameters (SMA lengths, Stop Loss percentages, Staging triggers) are fully customizable in the settings menu to fit different assets (Crypto, Stocks, Forex) and timeframes.
Expected Move BandsExpected move is the amount that an asset is predicted to increase or decrease from its current price, based on the current levels of volatility.
In this model, we assume asset price follows a log-normal distribution and the log return follows a normal distribution.
Note: Normal distribution is just an assumption, it's not the real distribution of return
Settings:
"Estimation Period Selection" is for selecting the period we want to construct the prediction interval.
For "Current Bar", the interval is calculated based on the data of the previous bar close. Therefore changes in the current price will have little effect on the range. What current bar means is that the estimated range is for when this bar close. E.g., If the Timeframe on 4 hours and 1 hour has passed, the interval is for how much time this bar has left, in this case, 3 hours.
For "Future Bars", the interval is calculated based on the current close. Therefore the range will be very much affected by the change in the current price. If the current price moves up, the range will also move up, vice versa. Future Bars is estimating the range for the period at least one bar ahead.
There are also other source selections based on high low.
Time setting is used when "Future Bars" is chosen for the period. The value in time means how many bars ahead of the current bar the range is estimating. When time = 1, it means the interval is constructing for 1 bar head. E.g., If the timeframe is on 4 hours, then it's estimating the next 4 hours range no matter how much time has passed in the current bar.
Note: It's probably better to use "probability cone" for visual presentation when time > 1
Volatility Models :
Sample SD: traditional sample standard deviation, most commonly used, use (n-1) period to adjust the bias
Parkinson: Uses High/ Low to estimate volatility, assumes continuous no gap, zero mean no drift, 5 times more efficient than Close to Close
Garman Klass: Uses OHLC volatility, zero drift, no jumps, about 7 times more efficient
Yangzhang Garman Klass Extension: Added jump calculation in Garman Klass, has the same value as Garman Klass on markets with no gaps.
about 8 x efficient
Rogers: Uses OHLC, Assume non-zero mean volatility, handles drift, does not handle jump 8 x efficient
EWMA: Exponentially Weighted Volatility. Weight recently volatility more, more reactive volatility better in taking account of volatility autocorrelation and cluster.
YangZhang: Uses OHLC, combines Rogers and Garmand Klass, handles both drift and jump, 14 times efficient, alpha is the constant to weight rogers volatility to minimize variance.
Median absolute deviation: It's a more direct way of measuring volatility. It measures volatility without using Standard deviation. The MAD used here is adjusted to be an unbiased estimator.
Volatility Period is the sample size for variance estimation. A longer period makes the estimation range more stable less reactive to recent price. Distribution is more significant on a larger sample size. A short period makes the range more responsive to recent price. Might be better for high volatility clusters.
Standard deviations:
Standard Deviation One shows the estimated range where the closing price will be about 68% of the time.
Standard Deviation two shows the estimated range where the closing price will be about 95% of the time.
Standard Deviation three shows the estimated range where the closing price will be about 99.7% of the time.
Note: All these probabilities are based on the normal distribution assumption for returns. It's the estimated probability, not the actual probability.
Manually Entered Standard Deviation shows the range of any entered standard deviation. The probability of that range will be presented on the panel.
People usually assume the mean of returns to be zero. To be more accurate, we can consider the drift in price from calculating the geometric mean of returns. Drift happens in the long run, so short lookback periods are not recommended. Assuming zero mean is recommended when time is not greater than 1.
When we are estimating the future range for time > 1, we typically assume constant volatility and the returns to be independent and identically distributed. We scale the volatility in term of time to get future range. However, when there's autocorrelation in returns( when returns are not independent), the assumption fails to take account of this effect. Volatility scaled with autocorrelation is required when returns are not iid. We use an AR(1) model to scale the first-order autocorrelation to adjust the effect. Returns typically don't have significant autocorrelation. Adjustment for autocorrelation is not usually needed. A long length is recommended in Autocorrelation calculation.
Note: The significance of autocorrelation can be checked on an ACF indicator.
ACF
The multimeframe option enables people to use higher period expected move on the lower time frame. People should only use time frame higher than the current time frame for the input. An error warning will appear when input Tf is lower. The input format is multiplier * time unit. E.g. : 1D
Unit: M for months, W for Weeks, D for Days, integers with no unit for minutes (E.g. 240 = 240 minutes). S for Seconds.
Smoothing option is using a filter to smooth out the range. The filter used here is John Ehler's supersmoother. It's an advance smoothing technique that gets rid of aliasing noise. It affects is similar to a simple moving average with half the lookback length but smoother and has less lag.
Note: The range here after smooth no long represent the probability
Panel positions can be adjusted in the settings.
X position adjusts the horizontal position of the panel. Higher X moves panel to the right and lower X moves panel to the left.
Y position adjusts the vertical position of the panel. Higher Y moves panel up and lower Y moves panel down.
Step line display changes the style of the bands from line to step line. Step line is recommended because it gets rid of the directional bias of slope of expected move when displaying the bands.
Warnings:
People should not blindly trust the probability. They should be aware of the risk evolves by using the normal distribution assumption. The real return has skewness and high kurtosis. While skewness is not very significant, the high kurtosis should be noticed. The Real returns have much fatter tails than the normal distribution, which also makes the peak higher. This property makes the tail ranges such as range more than 2SD highly underestimate the actual range and the body such as 1 SD slightly overestimate the actual range. For ranges more than 2SD, people shouldn't trust them. They should beware of extreme events in the tails.
Different volatility models provide different properties if people are interested in the accuracy and the fit of expected move, they can try expected move occurrence indicator. (The result also demonstrate the previous point about the drawback of using normal distribution assumption).
Expected move Occurrence Test
The prediction interval is only for the closing price, not wicks. It only estimates the probability of the price closing at this level, not in between. E.g., If 1 SD range is 100 - 200, the price can go to 80 or 230 intrabar, but if the bar close within 100 - 200 in the end. It's still considered a 68% one standard deviation move.
Hurst Exponent - Detrended Fluctuation AnalysisIn stochastic processes, chaos theory and time series analysis, detrended fluctuation analysis (DFA) is a method for determining the statistical self-affinity of a signal. It is useful for analyzing time series that appear to be long-memory processes and noise.
█ OVERVIEW
We have introduced the concept of Hurst Exponent in our previous open indicator Hurst Exponent (Simple). It is an indicator that measures market state from autocorrelation. However, we apply a more advanced and accurate way to calculate Hurst Exponent rather than simple approximation. Therefore, we recommend using this version of Hurst Exponent over our previous publication going forward. The method we used here is called detrended fluctuation analysis. (For folks that are not interested in the math behind the calculation, feel free to skip to "features" and "how to use" section. However, it is recommended that you read it all to gain a better understanding of the mathematical reasoning).
█ Detrend Fluctuation Analysis
Detrended Fluctuation Analysis was first introduced by by Peng, C.K. (Original Paper) in order to measure the long-range power-law correlations in DNA sequences . DFA measures the scaling-behavior of the second moment-fluctuations, the scaling exponent is a generalization of Hurst exponent.
The traditional way of measuring Hurst exponent is the rescaled range method. However DFA provides the following benefits over the traditional rescaled range method (RS) method:
• Can be applied to non-stationary time series. While asset returns are generally stationary, DFA can measure Hurst more accurately in the instances where they are non-stationary.
• According the the asymptotic distribution value of DFA and RS, the latter usually overestimates Hurst exponent (even after Anis- Llyod correction) resulting in the expected value of RS Hurst being close to 0.54, instead of the 0.5 that it should be. Therefore it's harder to determine the autocorrelation based on the expected value. The expected value is significantly closer to 0.5 making that threshold much more useful, using the DFA method on the Hurst Exponent (HE).
• Lastly, DFA requires lower sample size relative to the RS method. While the RS method generally requires thousands of observations to reduce the variance of HE, DFA only needs a sample size greater than a hundred to accomplish the above mentioned.
█ Calculation
DFA is a modified root-mean-squares (RMS) analysis of a random walk. In short, DFA computes the RMS error of linear fits over progressively larger bins (non-overlapped “boxes” of similar size) of an integrated time series.
Our signal time series is the log returns. First we subtract the mean from the log return to calculate the demeaned returns. Then, we calculate the cumulative sum of demeaned returns resulting in the cumulative sum being mean centered and we can use the DFA method on this. The subtraction of the mean eliminates the “global trend” of the signal. The advantage of applying scaling analysis to the signal profile instead of the signal, allows the original signal to be non-stationary when needed. (For example, this process converts an i.i.d. white noise process into a random walk.)
We slice the cumulative sum into windows of equal space and run linear regression on each window to measure the linear trend. After we conduct each linear regression. We detrend the series by deducting the linear regression line from the cumulative sum in each windows. The fluctuation is the difference between cumulative sum and regression.
We use different windows sizes on the same cumulative sum series. The window sizes scales are log spaced. Eg: powers of 2, 2,4,8,16... This is where the scale free measurements come in, how we measure the fractal nature and self similarity of the time series, as well as how the well smaller scale represent the larger scale.
As the window size decreases, we uses more regression lines to measure the trend. Therefore, the fitness of regression should be better with smaller fluctuation. It allows one to zoom into the “picture” to see the details. The linear regression is like rulers. If you use more rulers to measure the smaller scale details you will get a more precise measurement.
The exponent we are measuring here is to determine the relationship between the window size and fitness of regression (the rate of change). The more complex the time series are the more it will depend on decreasing window sizes (using more linear regression lines to measure). The less complex or the more trend in the time series, it will depend less. The fitness is calculated by the average of root mean square errors (RMS) of regression from each window.
Root mean Square error is calculated by square root of the sum of the difference between cumulative sum and regression. The following chart displays average RMS of different window sizes. As the chart shows, values for smaller window sizes shows more details due to higher complexity of measurements.
The last step is to measure the exponent. In order to measure the power law exponent. We measure the slope on the log-log plot chart. The x axis is the log of the size of windows, the y axis is the log of the average RMS. We run a linear regression through the plotted points. The slope of regression is the exponent. It's easy to see the relationship between RMS and window size on the chart. Larger RMS equals less fitness of the regression. We know the RMS will increase (fitness will decrease) as we increases window size (use less regressions to measure), we focus on the rate of RMS increasing (how fast) as window size increases.
If the slope is < 0.5, It means the rate of of increase in RMS is small when window size increases. Therefore the fit is much better when it's measured by a large number of linear regression lines. So the series is more complex. (Mean reversion, negative autocorrelation).
If the slope is > 0.5, It means the rate of increase in RMS is larger when window sizes increases. Therefore even when window size is large, the larger trend can be measured well by a small number of regression lines. Therefore the series has a trend with positive autocorrelation.
If the slope = 0.5, It means the series follows a random walk.
█ FEATURES
• Sample Size is the lookback period for calculation. Even though DFA requires a lower sample size than RS, a sample size larger > 50 is recommended for accurate measurement.
• When a larger sample size is used (for example = 1000 lookback length), the loading speed may be slower due to a longer calculation. Date Range is used to limit numbers of historical calculation bars. When loading speed is too slow, change the data range "all" into numbers of weeks/days/hours to reduce loading time. (Credit to allanster)
• “show filter” option applies a smoothing moving average to smooth the exponent.
• Log scale is my work around for dynamic log space scaling. Traditionally the smallest log space for bars is power of 2. It requires at least 10 points for an accurate regression, resulting in the minimum lookback to be 1024. I made some changes to round the fractional log space into integer bars requiring the said log space to be less than 2.
• For a more accurate calculation a larger "Base Scale" and "Max Scale" should be selected. However, when the sample size is small, a larger value would cause issues. Therefore, a general rule to be followed is: A larger "Base Scale" and "Max Scale" should be selected for a larger the sample size. It is recommended for the user to try and choose a larger scale if increasing the value doesn't cause issues.
The following chart shows the change in value using various scales. As shown, sometimes increasing the value makes the value itself messy and overshoot.
When using the lowest scale (4,2), the value seems stable. When we increase the scale to (8,2), the value is still alright. However, when we increase it to (8,4), it begins to look messy. And when we increase it to (16,4), it starts overshooting. Therefore, (8,2) seems to be optimal for our use.
█ How to Use
Similar to Hurst Exponent (Simple). 0.5 is a level for determine long term memory.
• In the efficient market hypothesis, market follows a random walk and Hurst exponent should be 0.5. When Hurst Exponent is significantly different from 0.5, the market is inefficient.
• When Hurst Exponent is > 0.5. Positive Autocorrelation. Market is Trending. Positive returns tend to be followed by positive returns and vice versa.
• Hurst Exponent is < 0.5. Negative Autocorrelation. Market is Mean reverting. Positive returns trends to follow by negative return and vice versa.
However, we can't really tell if the Hurst exponent value is generated by random chance by only looking at the 0.5 level. Even if we measure a pure random walk, the Hurst Exponent will never be exactly 0.5, it will be close like 0.506 but not equal to 0.5. That's why we need a level to tell us if Hurst Exponent is significant.
So we also computed the 95% confidence interval according to Monte Carlo simulation. The confidence level adjusts itself by sample size. When Hurst Exponent is above the top or below the bottom confidence level, the value of Hurst exponent has statistical significance. The efficient market hypothesis is rejected and market has significant inefficiency.
The state of market is painted in different color as the following chart shows. The users can also tell the state from the table displayed on the right.
An important point is that Hurst Value only represents the market state according to the past value measurement. Which means it only tells you the market state now and in the past. If Hurst Exponent on sample size 100 shows significant trend, it means according to the past 100 bars, the market is trending significantly. It doesn't mean the market will continue to trend. It's not forecasting market state in the future.
However, this is also another way to use it. The market is not always random and it is not always inefficient, the state switches around from time to time. But there's one pattern, when the market stays inefficient for too long, the market participants see this and will try to take advantage of it. Therefore, the inefficiency will be traded away. That's why Hurst exponent won't stay in significant trend or mean reversion too long. When it's significant the market participants see that as well and the market adjusts itself back to normal.
The Hurst Exponent can be used as a mean reverting oscillator itself. In a liquid market, the value tends to return back inside the confidence interval after significant moves(In smaller markets, it could stay inefficient for a long time). So when Hurst Exponent shows significant values, the market has just entered significant trend or mean reversion state. However, when it stays outside of confidence interval for too long, it would suggest the market might be closer to the end of trend or mean reversion instead.
Larger sample size makes the Hurst Exponent Statistics more reliable. Therefore, if the user want to know if long term memory exist in general on the selected ticker, they can use a large sample size and maximize the log scale. Eg: 1024 sample size, scale (16,4).
Following Chart is Bitcoin on Daily timeframe with 1024 lookback. It suggests the market for bitcoin tends to have long term memory in general. It generally has significant trend and is more inefficient at it's early stage.






















