Volume Surprise [LuxAlgo]The Volume Surprise tool displays the trading volume alongside the expected volume at that time, allowing users to spot unexpected trading activity on the chart easily.
The tool includes an extrapolation of the estimated volume for future periods, allowing forecasting future trading activity.
🔶 USAGE
We define Volume Surprise as a situation where the actual trading volume deviates significantly from its expected value at a given time.
Being able to determine if trading activity is higher or lower than expected allows us to precisely gauge the interest of market participants in specific trends.
A histogram constructed from the difference between the volume and expected volume is provided to easily highlight the difference between the two and may be used as a standalone.
The tool can also help quantify the impact of specific market events, such as news about an instrument. For example, an important announcement leading to volume below expectations might be a sign of market participants underestimating the impact of the announcement.
Like in the example above, it is possible to observe cases where the volume significantly differs from the expected one, which might be interpreted as an anomaly leading to a correction.
🔹 Detecting Rare Trading Activity
Expected volume is defined as the mean (or median if we want to limit the impact of outliers) of the volume grouped at a specific point in time. This value depends on grouping volume based on periods, which can be user-defined.
However, it is possible to adjust the indicator to overestimate/underestimate expected volume, allowing for highlighting excessively high or low volume at specific times.
In order to do this, select "Percentiles" as the summary method, and change the percentiles value to a value that is close to 100 (overestimate expected volume) or to 0 (underestimate expected volume).
In the example above, we are only interested in detecting volume that is excessively high, we use the 95th percentile to do so, effectively highlighting when volume is higher than 95% of the volumes recorded at that time.
🔶 DETAILS
🔹 Choosing the Right Periods
Our expected volume value depends on grouping volume based on periods, which can be user-defined.
For example, if only the hourly period is selected, volumes are grouped by their respective hours. As such, to get the expected volume for the hour 7 PM, we collect and group the historical volumes that occurred at 7 PM and average them to get our expected value at that time.
Users are not limited to selecting a single period, and can group volume using a combination of all the available periods.
Do note that when on lower timeframes, only having higher periods will lead to less precise expected values. Enabling periods that are too low might prevent grouping. Finally, enabling a lot of periods will, on the other hand, lead to a lot of groups, preventing the ability to get effective expected values.
In order to avoid changing periods by navigating across multiple timeframes, an "Auto Selection" setting is provided.
🔹 Group Length
The length setting allows controlling the maximum size of a volume group. Using higher lengths will provide an expected value on more historical data, further highlighting recurring patterns.
🔹 Recommended Assets
Obtaining the expected volume for a specific period (time of the day, day of the week, quarter, etc) is most effective when on assets showing higher signs of periodicity in their trading activity.
This is visible on stocks, futures, and forex pairs, which tend to have a defined, recognizable interval with usually higher trading activity.
Assets such as cryptocurrencies will usually not have a clearly defined periodic trading activity, which lowers the validity of forecasts produced by the tool, as well as any conclusions originating from the volume to expected volume comparisons.
🔶 SETTINGS
Length: Maximum number of records in a volume group for a specific period. Older values are discarded.
Smooth: Period of a SMA used to smooth volume. The smoothing affects the expected value.
🔹 Periods
Auto Selection: Automatically choose a practical combination of periods based on the chart timeframe.
Custom periods can be used if disabling "Auto Selection". Available periods include:
- Minutes
- Hours
- Days (can be: Day of Week, Day of Month, Day of Year)
- Months
- Quarters
🔹 Summary
Method: Method used to obtain the expected value. Options include Mean (default) or Percentile.
Percentile: Percentile number used if "Method" is set to "Percentile". A value of 50 will effectively use a median for the expected value.
🔹 Forecast
Forecast Window: Number of bars ahead for which the expected volume is predicted.
Style: Style settings of the forecast.
指标和策略
Realtime RenkoI've been working on real-time renko for a while as a coding challenge. The interesting problem here is building renko bricks that form based on incoming tick data rather than waiting for bar closes. Every tick that comes through gets processed immediately, and when price moves enough to complete a brick, that brick closes and a new one opens right then. It's just neat because you can run it and it updates as you'd expect with renko, forming bricks based purely on price movement happening in real time rather than waiting for arbitrary time intervals to pass.
The three brick sizing methods give you flexibility in how you define "enough movement" to form a new brick. Traditional renko uses a fixed price range, so if you set it to 10 ticks, every brick represents exactly 10 ticks of movement. This works well for instruments with stable tick sizes and predictable volatility. ATR-based sizing calculates the average true range once at startup using a weighted average across all historical bars, then divides that by your brick value input. If you want bricks that are one full ATR in size, you'd use a brick value of 1. If you want half-ATR bricks, use 2. This inverted relationship exists because the calculation is ATR divided by your input, which lets you work with multiples and fractions intuitively. Percentage-based sizing makes each brick a fixed percentage move from the previous brick's close, which automatically scales with price level and works well for instruments that move proportionally rather than in absolute tick increments.
The best part about this implementation is how it uses varip for state management. When you first load the indicator, there's no history at all. Everything starts fresh from the moment you add it to your chart because varip variables only exist in real-time. This means you're watching actual renko bricks form from real tick data as it arrives. The indicator builds its own internal history as it runs, storing up to 250 completed bricks in memory, but that history only exists for the current session. Refresh the page or reload the indicator and it starts over from scratch.
The visual implementation uses boxes for brick bodies and lines for wicks, drawn at offset bar indices to create the appearance of a continuous renko chart in the indicator pane. Each brick occupies two bar index positions horizontally, which spaces them out and makes the chart readable. The current brick updates in real time as new ticks arrive, with its high, low, and close values adjusting continuously until it reaches the threshold to close and become finalized. Once a brick closes, it gets pushed into the history array and a new brick opens at the closing level of the previous one.
What makes this especially useful for debugging and analysis are the hover tooltips on each brick. Clicking on any brick brings up information showing when it opened with millisecond precision, how long it took to form from open to close, its internal bar index within the renko sequence, and the brick size being used. That time delta measurement is particularly valuable because it reveals the pace of price movement. A brick that forms in five seconds indicates very different market conditions than one that takes three minutes, even though both bricks represent the same amount of price movement. You can spot acceleration and deceleration in trend development by watching how quickly consecutive bricks form.
The pine logs that generate when bricks close serve as breadcrumbs back to the main chart. Every time a brick finalizes, the indicator writes a log entry with the same information shown in the tooltip. You can click that log entry and TradingView jumps your main chart to the exact timestamp when that brick closed. This lets you correlate renko brick formation with what was happening on the time-based chart, which is critical for understanding context. A brick that closed during a major news announcement or at a key support level tells a different story than one that closed during quiet drift, and the logs make it trivial to investigate those situations.
The internal bar indexing system maintains a separate count from the chart's bar_index, giving each renko brick its own sequential number starting from when the indicator begins running. This makes it easy to reference specific bricks in your analysis or when discussing patterns with others. The internal index increments only when a brick closes, so it's a pure measure of how many bricks have formed regardless of how much chart time has passed. You can match these indices between the visual bricks and the log entries, which helps when you're trying to track down the details of a specific brick that caught your attention.
Brick overshoot handling ensures that when price blows through the threshold level instead of just barely touching it, the brick closes at the threshold and the excess movement carries over to the next brick. This prevents gaps in the renko sequence and maintains the integrity of the brick sizing. If price shoots up through your bullish threshold and keeps going, the current brick closes at exactly the threshold level and the new brick opens there with the overshoot already baked into its initial high. Without this logic, you'd get renko bricks with irregular sizes whenever price moved aggressively, which would undermine the whole point of using fixed-range bricks.
The timezone setting lets you adjust timestamps to your local time or whatever reference you prefer, which matters when you're analyzing logs or comparing brick formation times across different sessions. The time delta formatter converts raw milliseconds into human-readable strings showing days, hours, minutes, and seconds with fractional precision. This makes it immediately clear whether a brick took 12.3 seconds or 2 minutes and 15 seconds to form, without having to parse millisecond values mentally.
This is the script version that will eventually be integrated into my real-time candles library. The library version had an issue with tooltips not displaying correctly, which this implementation fixes by using a different approach to label creation and positioning. Running it as a standalone indicator also gives you more control over the visual settings and makes it easier to experiment with different brick sizing methods without affecting other tools that might be using the library version.
What this really demonstrates is that real-time indicators in Pine Script require thinking about state management and tick processing differently than historical indicators. Most indicator code assumes bars are immutable once closed, so you can reference `close ` and know that value will never change. Real-time renko throws that assumption out because the current brick is constantly mutating with every tick until it closes. Using varip for state variables and carefully tracking what belongs to finalized bricks versus the developing brick makes it possible to maintain consistency while still updating smoothly in real-time. The fact that there's no historical reconstruction and everything starts fresh when you load it is actually a feature, not a limitation, because you're seeing genuine real-time brick formation rather than some approximation of what might have happened in the past.
Pivot Regime Anchored VWAP [CHE] Pivot Regime Anchored VWAP — Detects body-based pivot regimes to classify swing highs and lows, anchoring volume-weighted average price lines directly at higher highs and lower lows for adaptive reference levels.
Summary
This indicator identifies shifts between top and bottom regimes through breakouts in candle body highs and lows, labeling swing points as higher highs, lower highs, lower lows, or higher lows. It then draws anchored volume-weighted average price lines starting from the most recent higher high and lower low, providing dynamic support and resistance that evolve with volume flow. These anchored lines differ from standard volume-weighted averages by resetting only at confirmed swing extremes, reducing noise in ranging markets while highlighting momentum shifts in trends.
Motivation: Why this design?
Traders often struggle with static reference lines that fail to adapt to changing market structures, leading to false breaks in volatile conditions or missed continuations in trends. By anchoring volume-weighted average price calculations to body pivot regimes—specifically at higher highs for resistance and lower lows for support—this design creates reference levels tied directly to price structure extremes. This approach addresses the problem of generic moving averages lagging behind swing confirmations, offering a more context-aware tool for intraday or swing trading.
What’s different vs. standard approaches?
- Baseline reference: Traditional volume-weighted average price indicators compute a running total from session start or fixed periods, often ignoring price structure.
- Architecture differences:
- Regime detection via body breakout logic switches between high and low focus dynamically.
- Anchoring limited to confirmed higher highs and lower lows, with historical recalculation for accurate line drawing.
- Polyline rendering rebuilds only on the last bar to manage performance.
- Practical effect: Charts show fewer, more meaningful lines that start at swing points, making it easier to spot confluences with structure breaks rather than cluttered overlays from continuous calculations.
How it works (technical)
The indicator first calculates the maximum and minimum of each candle's open and close to define body highs and lows. It then scans a lookback window for the highest body high and lowest body low. A top regime triggers when the body high from the lookback period exceeds the window's highest, and a bottom regime when the body low falls below the window's lowest. These regime shifts confirm pivots only when crossing from one state to the other.
For top pivots, it compares the new body high against the previous swing high: if greater, it marks a higher high and anchors a new line; otherwise, a lower high. The same logic applies inversely for bottom pivots. Anchored lines use cumulative price-volume products and volumes from the anchor bar onward, subtracting prior cumulatives to isolate the segment. On pivot confirmation, it loops backward from the current bar to the anchor, computing and storing points for the line. New points append as bars advance, ensuring the line reflects ongoing volume weighting.
Initialization uses persistent variables to track the last swing values and anchor bars, starting with neutral states. Data flows from regime detection to pivot classification, then to anchoring and point accumulation, with lines rendered globally on the final bar.
Parameter Guide
Pivot Length — Controls the lookback window for detecting body breakouts, influencing pivot frequency and sensitivity to recent action. Shorter values catch more pivots in choppy conditions; longer smooths for major swings. Default: 30 (bars). Trade-offs/Tips: Min 1; for intraday, try 10–20 to reduce lag but watch for noise; on daily, 50+ for stability.
Show Pivot Labels — Toggles display of text markers at swing points, aiding quick identification of higher highs, lower highs, lower lows, or higher lows. Default: true. Trade-offs/Tips: Disable in multi-indicator setups to declutter; useful for backtesting structure.
HH Color — Sets the line and label color for higher high anchored lines, distinguishing resistance levels. Default: Red (solid). Trade-offs/Tips: Choose contrasting hues for dark/light themes; pair with opacity for fills if added later.
LL Color — Sets the line and label color for lower low anchored lines, distinguishing support levels. Default: Lime (solid). Trade-offs/Tips: As above; green shades work well for bullish contexts without overpowering candles.
Reading & Interpretation
Higher high labels and red lines indicate potential resistance zones where volume weighting begins at a new swing top, suggesting sellers may defend prior highs. Lower low labels and lime lines mark support from a fresh swing bottom, with the line's slope reflecting buyer commitment via volume. Lower highs or higher lows appear as labels without new anchors, signaling possible range-bound action. Line proximity to price shows overextension; crosses may hint at regime shifts, but confirm with volume spikes.
Practical Workflows & Combinations
- Trend following: Enter longs above a rising lower low anchored line after higher low confirmation; filter with rising higher highs for uptrends. Use line breaks as trailing stops.
- Exits/Stops: In downtrends, exit shorts below a higher high line; set aggressive stops above it for scalps, conservative below for swings. Pair with momentum oscillators for divergence.
- Multi-asset/Multi-TF: Defaults suit forex/stocks on 1H–4H; on crypto 15M, shorten length to 15. Scale colors for dark themes; combine with higher timeframe anchors for confluence.
Behavior, Constraints & Performance
Closed-bar logic ensures pivots confirm after the lookback period, with no repainting on historical bars—live bars may adjust until regime shift. No higher timeframe calls, so minimal repaint risk beyond standard delays. Resources include a 2000-bar history limit, label/polyline caps at 200/50, and loops for historical point filling (up to current bar count from anchor, typically under 500 iterations). Known limits: In extreme gaps or low-volume periods, anchors may skew; lines absent until first pivots.
Sensible Defaults & Quick Tuning
Start with the 30-bar length for balanced pivot detection across most assets. For too-frequent pivots in ranges, increase to 50 for fewer signals. If lines lag in trends, reduce to 20 and enable labels for visual cues. In low-volatility assets, widen color contrasts; test on 100-bar history to verify stability.
What this indicator is—and isn’t
This is a structure-aware visualization layer for anchoring volume-weighted references at swing extremes, enhancing manual analysis of regimes and levels. It is not a standalone signal generator or predictive model—always integrate with broader context like order flow or news. Use alongside risk management and position sizing, not as isolated buy/sell triggers.
Many thanks to LuxAlgo for the original script "McDonald's Pattern ". The implementation for body pivots instead of wicks uses a = max(open, close), b = min(open, close) and then highest(a, length) / lowest(b, length). This filters noise from the wicks and detects breakouts over/under bodies. Unusual and targeted, super innovative.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Dynamic Market Structure (MTF) - Dow TheoryDynamic Market Structure (MTF)
OVERVIEW
This advanced indicator provides a comprehensive and fully customizable solution for analyzing market structure based on classic Dow Theory principles. It automates the identification of key structural points, including Higher Highs (HH), Higher Lows (HL), Lower Lows (LL), and Lower Highs (LH).
Going beyond simple pivot detection, this tool visualizes the flow of the trend by plotting dynamic Breaks of Structure (BOS) and potential reversals with Changes of Character (CHoCH). It is designed to be a flexible and powerful tool for traders who use price action and trend analysis as a core part of their strategy.
CORE CONCEPTS
The indicator is built on the foundational principles of Dow Theory:
Uptrend: A series of Higher Highs and Higher Lows.
Downtrend: A series of Lower Lows and Lower Highs.
Break of Structure (BOS): Occurs when price action continues the current trend by creating a new HH in an uptrend or a new LL in a downtrend.
Change of Character (CHoCH): Occurs when the established trend sequence is broken, signaling a potential reversal. For example, when a Lower Low forms after a series of Higher Highs.
CALCULATION METHODOLOGY
This section explains the indicator's underlying logic:
Pivot Detection: The indicator's core logic is based on TradingView's built-in ta.pivothigh() and ta.pivotlow() functions. The sensitivity of this detection is fully controlled by the user via the Pivot Lookback Left and Pivot Lookback Right settings.
Structure Calculation (BOS/CHoCH): The script identifies market structure by analyzing the sequence of these confirmed pivots.
A bullish BOS is plotted when a new ta.pivothigh is confirmed at a price higher than the previous confirmed ta.pivothigh.
A bearish CHoCH is plotted when a new ta.pivotlow is confirmed at a price lower than the previous confirmed ta.pivotlow , breaking the established sequence of higher lows.
The logic is mirrored for bearish BOS and bullish CHoCH.
Invalidation Levels: This feature identifies the last confirmed pivot before a structure break (e.g., the last ta.pivotlow before a bullish BOS) and plots a dotted line from it to the breakout bar. This level is considered the structural invalidation point for that move.
MTF Confirmation: This unique feature provides confluence by analyzing a second, lower timeframe. When a pivot (e.g., a Higher Low) is confirmed on the main chart, the script requests pivot data from the user-selected lower timeframe. If a corresponding trend reversal is detected on that lower timeframe (e.g., a break of its own minor downtrend), the pivot is labeled "Firm" (FHL); otherwise, it is labeled "Soft" (SHL).
KEY FEATURES
This indicator is packed with advanced features designed to provide a deeper level of market insight:
Dynamic Structure Lines: BOS and CHoCH levels are plotted with clean, dashed lines that dynamically start at the old pivot and terminate precisely at the breakout bar, keeping the chart clean and precise.
Invalidation Levels: For every structure break, the indicator can plot a dotted "Invalidation" line (INV). This marks the critical support or resistance pivot that, if broken, would negate the previous move, providing a clear reference for risk management.
Multi-Timeframe (MTF) Confirmation: Add a layer of confluence to your analysis by confirming pivots on a lower timeframe. The indicator can label Higher Lows and Lower Highs as either "Firm" (FHL/FLH) if confirmed by a reversal on a lower timeframe, or "Soft" (SHL/SLH) if not.
Flexible Pivot Detection: Fully adjustable Pivot Lookback settings for the left and right sides allow you to tune the indicator's sensitivity to match any timeframe or trading style, from long-term investing to short-term scalping.
Full Customization: Take complete control of the indicator's appearance. A dedicated style menu allows you to customize the colors for all bullish, bearish, and reversal elements, including the transparency of the trend-based candle coloring.
HOW TO USE
Trend Identification: Use the sequence of HH/HL and LL/LH, along with the trend-colored candles, to quickly assess the current market direction on any timeframe.
Entry Signals: A confirmed BOS can signal a potential entry in the direction of the trend. A CHoCH can signal a potential reversal, offering an opportunity to enter a new trend early.
Risk Management: Use the automatically plotted "Invalidation" (INV) lines as a logical reference point for placing stop losses. A break of this level indicates that the structure you were trading has failed.
Confluence: Use the "Firm" pivot signals from the MTF analysis to identify high-probability swing points that are supported by price action on multiple timeframes.
SETTINGS BREAKDOWN
Pivot Lookback Left/Right: Controls the sensitivity of pivot detection. Higher numbers find more significant (but fewer) pivots.
MTF Confirmation: Enable/disable the "Firm" vs. "Soft" pivot analysis and select your preferred lower timeframe for confirmation.
Style Settings: Customize all colors and the transparency of the candle coloring to match your chart's theme.
Show Invalidation Levels: Toggle the visibility of the dotted invalidation lines.
This indicator is a powerful tool for visualizing and trading with the trend. Experiment with the settings to find a configuration that best fits your personal trading strategy.
RSRCH: DC-VWMA Width Calc// Research intention of this script
// Objective : to find the direction of movement of index indicators
// Methodology : take the Donchian and VWMA input
// Compute Donchian and VWMA
// find the total width of Donchian = upper donchian value - lower donchian value
// Find the upper segment = upper donchian value - VWMA value
// find the lower segment = VWMA value - lower donchian value
// Plot them to see the trends glaringly.
// This works best with linebreak or Hiekin Ashi
Elliott Waves — Simple ZigZag (v1.4)🇷🇺 Описание (Russian)
Elliott Waves — Simple ZigZag — это лёгкий и наглядный индикатор для базовой разметки волн Эллиота.
Он автоматически определяет пивоты с помощью встроенных функций TradingView (pivothigh / pivotlow), соединяет их линиями и отмечает последние пять волн импульса (1–5).
📈 Основные функции:
Автоматическое построение зигзага на основе пивотов
Разметка волн Эллиота (1–5) по последним экстремумам
Настройка толщины и цвета линий
Настройка фона и цвета текста меток волн
Простая логика — без переоптимизации и лишней нагрузки
🎨 Настройки визуала:
Цвет и толщина линий
Цвет фона и текста меток для восходящих (1,3,5) и нисходящих (2,4) волн
Размер и отступ меток
💡 Как использовать:
Подходит для визуального анализа структуры рынка по волновому принципу
Не является автоматическим волновым счётчиком — помогает только визуализировать возможные импульсные участки
Работает на любых таймфреймах и инструментах
📘 Автор: Maximus
📅 Версия: v1.4
🇬🇧 Description (English)
Elliott Waves — Simple ZigZag is a lightweight and easy-to-read indicator designed for basic Elliott Wave visualization.
It automatically detects price pivots using TradingView’s built-in functions (pivothigh / pivotlow), connects them with lines, and marks the last five impulse waves (1–5).
📈 Main Features:
Automatic ZigZag construction based on pivots
Elliott Wave (1–5) labeling on the most recent price swings
Customizable line color and thickness
Customizable background and text color for wave labels
Minimalistic logic — fast, stable, and easy to interpret
🎨 Visual Settings:
Line color and thickness
Separate background/text colors for upward (1,3,5) and downward (2,4) waves
Adjustable label size and vertical offset
💡 How to Use:
Ideal for visual Elliott Wave structure analysis
Not an automated wave counter — helps highlight potential impulse patterns
Works on all timeframes and any instruments
📘 Author: Maximus
📅 Version: v1.4
Turtle soupHi all!
This indicator will show you turtle soups. The logic is that pivots detected from a higher timeframe, with the pivot lengths of left and right in the settings, will be up for 'grabs' by price that spents more than one candle above/below the pivot.
If only one candle is beyond the pivot it's a liquidity sweep or grab. Liquidity sweeps can be discovered through my script 'Market structure' (), but this script will discover turtle soup entries with false breakouts that takes liquidity.
The turtle soup can have a confirmation in the terms of a change of character (CHoCH). The turtle soup strategy usually comes with some sort of confirmation, in this case a CHoCH, but it can also be a market structure shift (MSS) or a change in state of delivery (CISD).
Turtle soups (pivots that have been 'taken') within a turtle soup will also be visible (but not have a turtle).
Alerts are available for when a turtle soup setup occurs and you can set the alert frequency of your liking (to get early signals with a script that might repaint or wait for a closed candle).
I hope that this description makes sense, tell me otherwise. Also tell me if you have any improvements or feature requests.
Best of trading luck!
The chart in the publication contains a 4 hour chart with a daily timeframe and confirmations with CHoCH.
Trendline MTF Optimized1️⃣ What the Script Does
The script automatically draws trendlines connecting pivot highs and lows for multiple timeframes on your chart.
Pivot highs → connect recent tops
Pivot lows → connect recent bottoms
It also shows a legend so you can see which line belongs to which timeframe.
Why it’s useful:
Helps spot trend direction across multiple timeframes at a glance.
Highlights support and resistance levels automatically.
Useful for scalpers, swing traders, and multi-timeframe analysis.
2️⃣ Inputs the User Can Adjust
Input What it Means for the User
Pivot Left Bars How many bars to the left the script checks to confirm a pivot. More bars → stronger pivot, slower reaction.
Pivot Right Bars How many bars to the right it checks. Similar effect as left bars.
Show Debug Pivot Labels Shows the exact pivot values on the chart. Good for learning or checking accuracy.
Show Legend Shows the small table with line symbols and timeframes. Helps you quickly know which line belongs to which timeframe.
3️⃣ Timeframes
The script automatically calculates pivot points for multiple timeframes:
1 min, 3 min, 5 min, 15 min, 30 min, 1 hour, 4 hours, 1 day
Each timeframe gets its own color and line thickness. This helps distinguish them visually.
4️⃣ How Trendlines Are Drawn
Pivot Highs (Red lines): Connects the previous top to the most recent top on that timeframe.
Pivot Lows (Green lines): Connects the previous bottom to the most recent bottom.
If there’s no previous pivot yet, it just starts the line at the first pivot detected.
Optional debug labels show the price and timeframe of each pivot.
User Benefit: You can instantly see short-term and long-term trendlines without manual drawing.
5️⃣ Legend Table
Shows which line corresponds to which timeframe.
Uses small bar symbols (▁▁▁▁▁, ▂▂▂▂▂, etc.) to match line thickness.
Placed at the top-right corner by default.
User Benefit: Even if the chart is cluttered, you always know which line represents which timeframe.
6️⃣ How a User Reads It on the Chart
Red line going down → recent highs are decreasing → short-term downtrend.
Green line going up → recent lows are increasing → short-term uptrend.
Multiple lines of different thickness/colors → different timeframes.
Crossovers of lines or areas where green and red lines converge → potential support/resistance zones.
7️⃣ User Actionable Tips
Adjust left/right bars for sensitivity:
Lower bars → trendlines react faster (good for scalping).
Higher bars → trendlines smoother (good for swing trades).
Use debug labels initially to see pivot points.
Check legend to quickly identify which line belongs to which timeframe.
Combine trendlines with other indicators (like RSI, ADX) for better signals.
✅ Summary for Users
“This script automatically draws support/resistance trendlines across multiple timeframes, labels pivots optionally, and shows a legend so you know which line belongs to which timeframe. Adjust pivot sensitivity to match your trading style.”
DCA Percent SignalOverview
The DCA Percent Signal Indicator generates buy and sell signals based on percentage drops from all-time highs and percentage gains from lowest lows since ATH. This indicator is designed for pyramiding strategies where each signal represents a configurable percentage of equity allocation.
Definitions
DCA (Dollar-Cost Averaging): An investment strategy where you invest a fixed amount at regular intervals, regardless of price fluctuations. This indicator generates signals for a DCA-style pyramiding approach.
Gann Bar Types: Classification system for price bars based on their relationship to the previous bar:
Up Bar: High > previous high AND low ≥ previous low
Down Bar: High ≤ previous high AND low < previous low
Inside Bar: High ≤ previous high AND low ≥ previous low
Outside Bar: High > previous high AND low < previous low
ATH (All-Time High): The highest price level reached during the entire chart period
ATL (All-Time Low): The lowest price level reached since the most recent ATH
Pyramiding: A trading strategy that adds to positions on favorable price movements
Look-Ahead Bias: Using future information that wouldn't be available in real-time trading
Default Properties
Signal Thresholds:
Buy Threshold: 10% (triggers every 10% drop from ATH)
Sell Threshold: 30% (triggers every 30% gain from lowest low since ATH)
Price Sources:
ATH Tracking: High (ATH detection)
ATL Tracking: Low (low detection)
Buy Signal Source: Low (buy signals)
Sell Signal Source: High (sell signals)
Filter Options:
Apply Gann Filter: False (disabled by default)
Buy Sets ATL: False (disabled by default)
Display Options:
Show Buy/Sell Signals: True
Show Reference Lines: True
Show Info Table: False
Show Bar Type: False
How It Works
Buy Signals: Trigger every 10% drop from the all-time highest price reached
Sell Signals: Trigger every 30% increase from the lowest low since the most recent all-time high
Smart Tracking: Uses configurable price sources for signal generation
Key Features
Configurable Thresholds: Adjustable buy/sell percentage thresholds (default: 10%/30%)
Separate Price Sources: Independent sources for ATH tracking, ATL tracking, and signal triggers
Configurable Signals: Uses low for buy signals and high for sell signals by default
Optional Gann Filter: Apply Gann bar analysis for additional signal filtering
Optional Buy Sets ATL: Option to set ATL reference point when buy signals occur
Visual Debug: Detailed labels showing signal parameters and values
Usage Instructions
Apply to Chart: Use on any timeframe (recommended: 1D or higher for better signal quality)
Risk Management: Adjust thresholds based on your risk tolerance and market volatility
Signal Analysis: Monitor debug labels for detailed signal information and validation
Signal Logic
Buy signals are blocked when ATH increases to prevent buying at peaks
Sell signals are blocked when ATL decreases to prevent selling at lows
This ensures signals only trigger on subsequent bars, not the same bar that establishes new reference points
Buy Signals:
Calculate drop percentage from ATH to buy signal source
Trigger when drop reaches threshold increments (10%, 20%, 30%, etc.)
Always blocked on ATH bars to prevent buying at peaks
Optional: Also blocked on up/outside bars when Gann filter enabled
Sell Signals:
Calculate gain percentage from lowest low to sell signal source
Trigger when gain reaches threshold increments (30%, 60%, 90%, etc.)
Always blocked when ATL decreases to prevent selling at lows
Optional: Also blocked on down bars when Gann filter enabled
Limitations
Designed for trending markets; may generate many signals in sideways/ranging markets
Requires sufficient price movement to be effective
Not suitable for scalping or very short timeframes
Implementation Notes
Signals use optimistic price sources (low for buys, high for sells), these can be configured to be more conservative
Gann filter provides additional signal filtering based on bar types
Debug information available in data window for real-time analysis
Detailed labels on each signal show ATH, lowest low, buy level, sell level, and drop/gain percentages
Asia Session Mechanical Entry by AleThis indicator executes fully mechanical trades at the start of the Asian session (default: 20:00 Argentina time).
Core logic:
Compares the closing prices of the previous two sessions at 20:00 and 09:00 to determine bias.
If both days move in the same direction, the indicator takes a mean-reversion trade (opposite to the last two days’ move).
If the days move in opposite directions, the trade follows the most recent day’s direction.
Execution details:
Entry price: exact session open or delayed by a user-defined number of candles.
Stop Loss: nearest swing high/low ± ATR multiplier buffer.
Take Profit: calculated from entry to SL distance, multiplied by user-defined RR ratio.
ATR value plotted for volatility reference.
Works on H1 charts for consistent candle timing.
Features:
Adjustable start/end session times.
Configurable ATR multiplier, RR ratio, and delay before entry.
Manual overrides for SL/TP levels.
Automatic daily reset for next session's logic.
Notes:
This tool is based on a classic session-reversion model enhanced with ATR-based filters, flexible timing, and manual overrides. It is designed for systematic execution and quick visual backtesting.
Trade Price – Spread Compensator OverlayDescription:
This indicator provides a clear visual representation of the bid/ask price spread. It allows traders to account for the difference between displayed chart prices and actual trading prices by offsetting candles by a specified number of pips.
Simply input the appropriate decimal unit that matches your instrument’s price format, then set the number of pips you wish to offset to reflect your typical spread.
For best results, use the Style settings to match the overlay candle colors with your chart’s default candles—this creates a seamless, integrated appearance.
The sell-stop drawings depicted in the chart example are there to help understand how to use this for managing your entry/stop loss position. It is not a part of the indicator, only the orange candle overlay is.
cashflowThe Cashflow GoldAI Strategy is an advanced price-action and indicator-based trading system designed for gold (XAUUSD).
It combines EMA crossover, RSI trend strength, ADX momentum confirmation, and Break of Structure (BOS) logic to identify high-confidence buy/sell zones.
The strategy includes:
✅ EMA-based trend direction (fast vs slow)
✅ RSI filtering for overbought/oversold control
✅ ADX confirmation for strong trend validation
✅ Pullback & BOS detection for precision entries
✅ Per-bar change logic for adaptive entry timing
✅ Session/day gating to control trading hours
✅ JSON alert integration for AI trading bots or webhooks
This script is Pine Script v6 compatible and optimized for automated alert-based trading setups such as AI trading bots, webhook systems, and VPS-linked executions.
Recommended Timeframes: 5m, 15m, 30m
Markets: XAUUSD, FX pairs, indices, and metals
Metallic Retracement ToolI made a version of the Metallic Retracement script where instead of using automatic zig-zag detection, you get to place the points manually. When you add it to the chart, it prompts you to click on two points. These two points become your swing range, and the indicator calculates all the metallic retracement levels from there and plots them on your chart. You can drag the points around afterwards to adjust the range, or just add the indicator to the chart again to place a completely new set of points.
The mathematical foundation is identical to the original Metallic Retracement indicator. You're still working with metallic means, which are the sequence of constants that generalize the golden ratio through the equation x² = kx + 1. When k equals 1, you get the golden ratio. When k equals 2, you get silver. Bronze is 3, and so on forever. Each metallic number generates its own set of retracement ratios by raising alpha to various negative powers, where alpha equals (k + sqrt(k² + 4)) / 2. The script algorithmically calculates these levels instead of hardcoding them, which means you can pick any metallic number you want and instantly get its complete retracement sequence.
What's different here is the control. Automatic zig-zag detection is useful when you want the indicator to find swings for you, but sometimes you have a specific price range in mind that doesn't line up with what the zig-zag algorithm considers significant. Maybe you're analyzing a move that's still developing and hasn't triggered the zig-zag's reversal thresholds yet. Maybe you want to measure retracements from an arbitrary high to an arbitrary low that happened weeks apart with tons of noise in between. Manual placement lets you define exactly which two points matter for your analysis without fighting with sensitivity settings or waiting for confirmation.
The interactive placement system uses TradingView's built-in drawing tools, so clicking the two points feels natural and works the same way as drawing a trendline or fibonacci retracement. First click sets your starting point, second click sets your ending point, and the indicator immediately calculates the range and draws all the metallic levels extending from whichever point you chose as the origin. If you picked a swing low and then a swing high, you get retracement levels projecting upward. If you went from high to low, they project downward.
Moving the points after placement is as simple as grabbing one of them and dragging it to a new location. The retracement levels recalculate in real-time as you move the anchor points, which makes it easy to experiment with different range definitions and see how the levels shift. This is particularly useful when you're trying to figure out which swing points produce retracement levels that line up with other technical features like previous support or resistance zones. You can slide the points around until you find a configuration that makes sense for your analysis.
Adding the indicator to the chart multiple times lets you compare different metallic means on the same price range, or analyze multiple ranges simultaneously with different metallic numbers. You could have golden ratio retracements on one major swing and silver ratio retracements on a smaller correction within that swing. Since each instance of the indicator is independent, you can mix and match metallic numbers and ranges however you want without one interfering with the other.
The settings work the same way as the original script. You select which metallic number to use, control how many power ratios to display above and below the 1.0 level, and adjust how many complete retracement cycles you want drawn. The levels extend from your manually placed swing points just like they would from automatically detected pivots, showing you where price might react based on whichever metallic mean you've selected.
What this version emphasizes is that retracement analysis is subjective in terms of which swing points you consider significant. Automatic detection algorithms make assumptions about what constitutes a meaningful reversal, but those assumptions don't always match your interpretation of the price action. By giving you manual control over point placement, this tool lets you apply metallic retracement concepts to exactly the price ranges you care about, without requiring those ranges to fit someone else's definition of a valid swing. You define the context, the indicator provides the mathematical framework.
IPDA Ranges – Pro
### IPDA Ranges – Pro
**Overview**
The **IPDA Ranges – Pro** indicator brings the core concepts of the Interbank Price Delivery Algorithm (IPDA) from ICT (Inner Circle Trader) mentorship to life on TradingView. Inspired by ICT's foundational video on (www.youtube.com), this tool visualizes multi-period price ranges (20, 40, or 60 days) to decode institutional order flow, identify discount/premium zones, and highlight algorithmic price delivery points.
IPDA, as explained by ICT, is the "source code" behind market structure—grading ranges into quadrants to reveal high-probability support/resistance, fair value gaps, and liquidity draws. By anchoring on daily highs/lows, it filters noise, anticipates retracements, and aligns price action with time-based delivery (e.g., during key sessions like 10 AM–2 PM ET). This indicator automates the process, making it easier to spot "permissible" moves without manual charting.
**Key Features**
- **Dynamic Ranges**: Plots customizable IPDA periods (IPDA20, IPDA40, IPDA60) based on daily highest highs and lowest lows. Equilibrium (50% midpoint) acts as the core reference for mean reversion.
- **Quadrant Breakdown**: Divides each range into 25% steps—lower quadrant (deep discount), 25%/75% lines (consequent encroachment edges), and upper quadrant (premium). Optional subquadrants (12.5% steps) for finer granularity.
- **Visual Modes**:
- **Boxes**: Shade discount (below equilibrium) and premium (above) areas for intuitive zoning.
- **Lines**: Clean horizontal lines for highs, lows, equilibrium, and quadrants—ideal for lower timeframes.
- **Mid-Zone Highlight**: Optional shading of the 25%–75% "fair value" zone (customizable color/opacity) to flag balanced delivery areas where bodies often respect levels.
- **Info Table**: Choose from:
- **Table A**: Labels current price location as "Discount" or "Premium" per range (green for mid-zone).
- **Table B**: Shows distance from equilibrium in % (e.g., "52.3%") for precise positioning.
- **Customization**:
- Toggle labels (high/low, quadrants, prices), line styles (solid/dotted/dashed), extensions, and table position.
- Colors for discount/premium, equilibrium, and zones.
- Alerts for mid-zone entry/exit to catch order flow shifts.
- **Performance**: Runs efficiently on any timeframe/symbol, pulling daily data via `request.security` for accuracy.
**How It Works**
1. **Range Calculation**: For each selected period (e.g., IPDA20), it fetches the highest high and lowest low over the past N daily bars. Equilibrium = (High + Low) / 2.
2. **Zoning**:
- **Discount**: Below equilibrium (institutional buying opportunity).
- **Premium**: Above equilibrium (potential selling pressure).
- **Quadrants**: 25% (q1) and 75% (q3) lines mark edges of the "mid-zone," where price often consolidates or traps retail before directional runs.
3. **Plotting**: On the last bar, draws boxes/lines from the range start to current bar. Labels show levels (e.g., "IPDA20 High @ 1.2345").
4. **Usage Example**: On EURUSD daily, enable IPDA20. If price pierces a premium wick's low into the lower quadrant during a bullish shift (per ICT), expect a run to liquidity—use the table's % reading to gauge strength (e.g., <25% = deep discount buy). Transpose to 5-min for entries aligning with FVGs or order blocks.
**Trading Tips**
- **Higher Timeframe Bias**: Use on daily/4H for structure; drop to 1H/15M for entries. Focus on bodies (not wicks) respecting quadrants—wicks signal traps.
- **ICT Alignment**: Pair with PD Arrays (premium/discount wicks) or Market Maker models. In trends, extend to IPDA40/60; ignore extremes unless full reversals occur.
- **Risk Management**: Target liquidity pools at equal highs/lows. Avoid overleveraging—IPDA shines in 7–10 AM ET for optimal delivery. Backtest random 20-day periods to validate.
- **Best For**: Forex, indices (e.g., NAS100), commodities (e.g., Gold). Test on demo first.
Special Thanks to toodegrees for sharing the original base script.
More features to be added.
**Disclaimer**
This indicator is for educational purposes only and does not constitute financial advice. Past performance isn't indicative of future results. Trading involves substantial risk—use at your own discretion. Hypothetical results may not reflect real-market factors like slippage or liquidity. Always consult a licensed advisor.
**Author**: © MadMonkTrading (Mozilla Public License 2.0)
**Version**: Pine Script v5 | Questions? Drop a comment below!
NY Session Divisions⭐NY Session Divisions - Professional Trading Session Manager
NY Session Divisions is an advanced trading indicator that professionally segments the New York trading day into precise sessions, providing institutional-grade market structure analysis with smart breakout detection and comprehensive filtering systems.
✨ KEY FEATURES
🕒 8 Professional Trading Sessions
- US Overnight Range (03:30-11:50)
- NY Pre-Open (16:45-17:00)
- NY First Session ORB (17:00-17:15)
- Premarket Range - Recommended by Mahdi Salari*
- NY Midday Range
- NY 2nd Pre-Open
- 2nd Session ORB
- US After Hours ORB
🎯 Advanced Trading Strategies
- School Run Strategy (SRS) by Tom Hougaard - Breakout-focused approach
- Anti-SRS Strategy - Range-trading methodology
- Dual Strategy System - Combine breakout and range trading for maximum flexibility
🔔 Smart Alert System
- Multi-timeframe confirmation
- Heiken Ashi candle validation
- Customizable alert conditions
- Sound notifications with detailed messages
- Post-close confirmation to avoid false signals
🛡️ Professional Filter Stack
- Ichimoku Baseline
- Divergence Detection - Advanced market analysis
- EMA 200 Filter - Trend alignment
- Ichimoku Baseline - Market structure
- ATR Filter - Volatility validation
- RSI Filter - Momentum confirmation
🎨 Advanced Visualization
- Clean session range displays
- Professional Heiken Ashi candles
- Smart breakout markers (Small/Tiny for signal strength)
- Take Profit lines with ATR-based calculations
- Customizable colors and opacity
🏆 WHY TRADERS LOVE THIS INDICATOR
✅ For Breakout Traders
- Precise session boundary detection
- Clean breakout signals with confirmation
- Multiple filter validation
✅ For Range Traders
- Clear session range identification
- Anti-SRS strategy for range-bound markets
- Support/Resistance level tracking
✅ For Professional Traders
- Institutional-grade session management
- Comprehensive filtering system
- Multi-timeframe analysis
- Customizable risk management
⚡ QUICK START GUIDE
Basic Setup (2 Minutes)
1. Enable Sessions** - Choose 1-2 sessions to start
2. Set Alerts - Configure your preferred notification method
3. Apply Filters - Enable EMA 200 and Ichimoku for starters
Advanced Configuration
- Combine SRS + Anti-SRS for comprehensive strategy
- Use multiple divergence filters for confirmation
- Customize TP lines based on your risk profile
- Drawing 1st and 2nd Session Close lines
PROFESSIONAL TIPS
Session Selection Strategy
- Start with Session 1 (US Overnight) for overall market trend identification
- Add Session 3 (NY First ORB) for opening momentum
- Use Session 4 (Premarket) for the best perfomance of the breakout strategy
Filter Optimization
- Conservative : EMA 200 + Ichimoku Baseline
- Balanced : Add ATR filter for volatility check 0.8 is enough
- Aggressive : Enable all filters for maximum confirmation but the number of signal and performance will decrease
Risk Management
- Use TP lines for automatic profit targets
- Combine with proper position sizing
- Always use stop losses
🔧 TECHNICAL SPECIFICATIONS
- Platform : TradingView Pine Script v6
- Markets : All US trading instruments (ES, NQ, YM, CL, etc.)
- Timeframes : 1min to Daily
- Auto DST Handling : Yes
- Real-time Processing : Yes
📊 PERFORMANCE FEATURES
- Zero Repaint - All signals confirmed after candle close
- Multi-Timeframe - Works across all chart timeframes
- Resource Optimized - Efficient calculation methods
- User Customizable - Complete control over all parameters
- Consistent Performance - Reliable session-based signals
- Professional Grade - Institutional-level analysis tools
- Continuous Updates - Regular improvements and enhancements
- Community Supported - Active user community and support
🔄 KEEP UPDATED
Click the Favorite Star ⭐ to receive update notifications and stay current with new features and improvements!
Professional traders don't guess - they analyze. NY Session Divisions gives you the analytical edge.
Happy Trading! 📈
Created with precision for serious traders
DISCLAIMER
This indicator is for educational and informational purposes only. It should not be considered as financial advice. Always practice proper risk management and test strategies in demo accounts before live trading. Past performance does not guarantee future results.
MESA Adaptive Ehlers Flow | AlphaNattMESA Adaptive Ehlers Flow | AlphaNatt
An advanced adaptive indicator based on John Ehlers' MESA (Maximum Entropy Spectrum Analysis) algorithm that automatically adjusts to market cycles in real-time, providing superior trend identification with minimal lag across all market conditions.
🎯 What Makes This Indicator Revolutionary?
Unlike traditional moving averages with fixed parameters, this indicator uses Hilbert Transform mathematics to detect the dominant market cycle and adapts its responsiveness accordingly:
Automatically detects market cycles using advanced signal processing
MAMA (MESA Adaptive Moving Average) adapts from fast to slow based on cycle phase
FAMA (Following Adaptive Moving Average) provides confirmation signals
Dynamic volatility bands that expand and contract with cycle detection
Zero manual optimization required - the indicator tunes itself
📊 Core Components
1. MESA Adaptive Moving Average (MAMA)
The MAMA is the crown jewel of adaptive indicators. It uses the Hilbert Transform to measure the market's dominant cycle and adjusts its smoothing factor in real-time:
During trending phases: Responds quickly to capture moves
During choppy phases: Smooths heavily to filter noise
Transition is automatic and seamless based on price action
Parameters:
Fast Limit: Maximum responsiveness (default: 0.5) - how fast the indicator can adapt
Slow Limit: Minimum responsiveness (default: 0.05) - maximum smoothing during consolidation
2. Following Adaptive Moving Average (FAMA)
The FAMA is a slower version of MAMA that follows the primary signal. The relationship between MAMA and FAMA provides powerful trend confirmation:
MAMA > FAMA: Bullish trend in progress
MAMA < FAMA: Bearish trend in progress
Crossovers signal potential trend changes
3. Hilbert Transform Cycle Detection
The indicator employs sophisticated DSP (Digital Signal Processing) techniques:
Detects the dominant cycle period (1.5 to 50 bars)
Measures phase relationships in the price data
Calculates adaptive alpha values based on cycle dynamics
Continuously updates as market character changes
⚡ Key Features
Adaptive Alpha Calculation
The indicator's "intelligence" comes from its adaptive alpha:
Alpha dynamically adjusts between Fast Limit and Slow Limit based on the rate of phase change in the market cycle. Rapid phase changes trigger faster adaptation, while stable cycles maintain smoother response.
Dynamic Volatility Bands
Unlike static bands, these adapt to both ATR volatility AND the current cycle state:
Bands widen when the indicator detects fast adaptation (trending)
Bands narrow during slow adaptation (consolidation)
Band Multiplier controls overall width (default: 1.5)
Provides context-aware support and resistance
Intelligent Color Coding
Cyan: Bullish regime (MAMA > FAMA and price > MAMA)
Magenta: Bearish regime (MAMA < FAMA and price < MAMA)
Gray: Neutral/transitional state
📈 Trading Strategies
Trend Following Strategy
The MESA indicator excels at identifying and riding strong trends while automatically reducing sensitivity during choppy periods.
Entry Signals:
Long: MAMA crosses above FAMA with price closing above MAMA
Short: MAMA crosses below FAMA with price closing below MAMA
Exit/Management:
Exit longs when MAMA crosses below FAMA
Exit shorts when MAMA crosses above FAMA
Use dynamic bands as trailing stop references
Mean Reversion Strategy
When price extends beyond the dynamic bands during established trends, look for bounces back toward the MAMA line.
Setup Conditions:
Strong trend confirmed by MAMA/FAMA alignment
Price touches or exceeds outer band
Enter on first sign of reversal toward MAMA
Target: Return to MAMA line or opposite band
Cycle-Based Swing Trading
The indicator's cycle detection makes it ideal for swing trading:
Enter on MAMA/FAMA crossovers
Hold through the detected cycle period
Exit on counter-crossover or band extremes
Works exceptionally well on 4H to Daily timeframes
🔬 Technical Background
The Hilbert Transform
The Hilbert Transform is a mathematical operation used in signal processing to extract instantaneous phase and frequency information from a signal. In trading applications:
Separates trend from cycle components
Identifies the dominant market cycle without curve-fitting
Provides leading indicators of trend changes
MESA Algorithm Components
Smoothing: 4-bar weighted moving average for noise reduction
Detrending: Removes linear price trend to isolate cycles
InPhase & Quadrature: Orthogonal components for phase measurement
Homodyne Discriminator: Calculates instantaneous period
Adaptive Alpha: Converts period to smoothing factor
MAMA/FAMA: Final adaptive moving averages
⚙️ Optimization Guide
Fast Limit (0.1 - 0.9)
Higher values (0.5-0.9): More responsive, better for volatile markets and lower timeframes
Lower values (0.1-0.3): Smoother response, better for stable markets and higher timeframes
Default 0.5: Balanced for most applications
Slow Limit (0.01 - 0.1)
Higher values (0.05-0.1): Less smoothing during consolidation, more signals
Lower values (0.01-0.03): Heavy smoothing during chop, fewer but cleaner signals
Default 0.05: Good noise filtering while maintaining responsiveness
Band Multiplier (0.5 - 3.0)
Adjust based on instrument volatility
Backtest to find optimal value for your specific market
1.5 works well for most forex and equity indices
Consider higher values (2.0-2.5) for cryptocurrencies
🎨 Visual Interpretation
The gradient visualization shows probability zones around the MESA line:
MESA line: The adaptive trend center
Band expansion: Indicates strong cycle detection and trending
Band contraction: Indicates consolidation or ranging market
Color intensity: Shows confidence in trend direction
💡 Best Practices
Let it adapt: Give the indicator 50+ bars to properly calibrate to the market
Combine timeframes: Use higher timeframe MESA for trend bias, lower for entries
Respect the bands: Price rarely stays outside bands for extended periods
Watch for compression: Narrow bands often precede explosive moves
Volume confirmation: Combine with volume for higher probability setups
📊 Optimal Timeframes
15m - 1H: Day trading with Fast Limit 0.6-0.8
4H - Daily: Swing trading with Fast Limit 0.4-0.6 (recommended)
Weekly: Position trading with Fast Limit 0.2-0.4
⚠️ Important Considerations
The indicator needs time to "learn" the market - avoid trading the first 50 bars after applying
Extreme gap events can temporarily disrupt cycle calculations
Works best in markets with detectable cyclical behavior
Less effective during news events or extreme volatility spikes
Consider the detected cycle period for position holding times
🔍 What Makes MESA Superior?
Compared to traditional indicators:
vs. Fixed MAs: Automatically adjusts to market conditions instead of using one-size-fits-all parameters
vs. Other Adaptive MAs: Uses true DSP mathematics rather than simple volatility adjustments
vs. Manual Optimization: Continuously re-optimizes itself in real-time
vs. Lagging Indicators: Hilbert Transform provides earlier trend change detection
🎓 Understanding Adaptation
The magic of MESA is that it solves the eternal dilemma of technical analysis: be fast and get whipsawed in chop, or be smooth and miss the early move. MESA does both by detecting when to be fast and when to be smooth.
Adaptation in Action:
Strong trend starts → MESA quickly detects phase change → Fast Limit kicks in → Early entry
Trend continues → Phase stabilizes → MESA maintains moderate speed → Smooth ride
Consolidation begins → Phase changes slow → Slow Limit engages → Whipsaw avoidance
🚀 Advanced Applications
Multi-timeframe confluence: Use MESA on 3 timeframes for high-probability setups
Divergence detection: Watch for MAMA/price divergences at band extremes
Cycle period analysis: The internal period calculation can guide position duration
Band squeeze trading: Narrow bands + MAMA/FAMA cross = high-probability breakout
Created by AlphaNatt - Based on John Ehlers' MESA research. For educational purposes. Always practice proper risk management. Not financial advice. Always DYOR.
Institutional Trading Suite Complete### Institutional Trading Suite Complete (ITS Pro) Indicator Description
#### Overview and Purpose
The **Institutional Trading Suite Complete (ITS Pro)** is an all-in-one overlay indicator designed for professional traders seeking a clean, comprehensive view of market structure across multiple timeframes and dimensions. Built for TradingView, this open-source tool integrates over a dozen institutional-grade features into a single, performance-optimized script, helping users identify key levels, trends, volume anomalies, and potential trade setups without cluttering the chart with multiple indicators.
Tailored for assets like forex, crypto, stocks, and indices, ITS Pro addresses the challenges of multi-timeframe analysis by combining price action tools (e.g., pivots, FVGs, order blocks), volume-based insights (PVSRA with vector zones), moving averages for trend confirmation, and statistical dashboards for quick context. Its purpose is to mimic institutional workflows—focusing on liquidity zones, fair value gaps, and average ranges—to spot high-probability entries/exits, risk areas, and market biases. For instance, a trader might use FVGs and order blocks for support/resistance while cross-referencing PVSRA vector candles for volume confirmation, all within one indicator.
This mashup isn't arbitrary; each component complements the others to create a layered analysis system. Volume tools (PVSRA) highlight momentum shifts that validate levels from pivots or psychological zones, while the dashboard provides at-a-glance metrics to tie everything together. By consolidating these, the indicator reduces lag and drawing object overhead (limited to 500 each for boxes/lines/labels), ensuring smooth performance on any timeframe.
#### Originality and Uniqueness
While individual elements like EMAs or pivots exist in basic forms on TradingView, ITS Pro's originality lies in its seamless integration and optimizations for institutional-style trading:
- **PVSRA with Clean Vector Zones**: An enhanced Price-Volume-Spread-Range Analysis that colors bars based on volume/spread ratios and draws limited, non-overlapping zones around "vector" candles (high-volume anomalies). This is unique in its lightweight implementation—capping zones to prevent clutter—allowing traders to spot climactic moves without full volume profile overhead.
- **Limited & Mitigated FVGs/Order Blocks**: Detects Fair Value Gaps and Order Blocks with strict limits (e.g., max 5 FVGs) and percentage-based mitigation (e.g., 50% fill removes the box), keeping the chart clean. Order blocks focus on swing-based bearish/bullish candles with body size filters, avoiding the noise of traditional pivot-based methods.
- **Liquidity Zones via Touch Counting**: A novel approach counting price touches within tolerance bands over a lookback, highlighting high/low liquidity areas only when a threshold is met—original for simplifying liquidity hunting without complex order flow data.
- **Multi-Timeframe Levels & Ranges**: Combines daily/weekly/monthly highs/lows/opens with average ranges (ADR/AWR/AMR) and price quartiles (dividing historical range into Q1-Q4 zones), providing a "big picture" structure not commonly bundled.
- **Dashboard & Alerts**: A customizable table summarizing key metrics (e.g., price bias, FVG/OB counts) with built-in alerts for crosses/breaks, making it a "control center" for the suite.
As open-source code, users can inspect, modify, or extend features (e.g., adjust tolerances or add symbols). It draws from concepts like ICT/Smart Money but refines them for efficiency, using Pine Script v6 optimizations like array limits and conditional drawings to handle high-bar counts without errors.
#### Credit and Acknowledgments
This script incorporates elements inspired by and adapted from the "Traders Reality" codebase, licensed under the Mozilla Public License 2.0 (mozilla.org). Original contributions include:
- Pattern formation by plasmapug.
- Rise retrace continuation to the upside by infernix, peshocore, and xtech5192.
- DST auto functions and psychological level refactor for DST by xtech5192.
- Range daily/weekly Hi/Lo added with research contributions from xtech5192.
While the code is open-source and free to use/modify, the "Traders Reality" name is protected—derivatives should not use "Traders Reality," "Pattern Watchers," or related names. Special thanks to the Traders Reality community for their foundational work on PVSRA, session handling with DST adjustments, and range calculations, which have been optimized and integrated here for enhanced performance.
#### How It Works
ITS Pro processes data in real-time, resetting calculations at timeframe changes (e.g., new days/weeks) and using security() for higher-timeframe fetches. Here's a breakdown of core features and underlying concepts:
- **PVSRA (Volume Analysis)**: Calculates average volume over 10 bars and spread-volume (range * volume). Bars are colored based on ratios: vector (≥2x avg or max spread-vol) for climaxes, strong (≥1.5x) for conviction. Zones are drawn around vectors with fixed extension (user-set bars) and capped count, using arrays for management. Optional symbol override (e.g., for crypto volume aggregation).
- **Exponential Moving Averages**: Standard EMAs (5,13,50,200,800 periods) with optional 50-period cloud. Labels show values at chart right for quick reference.
- **Daily Pivots**: Uses previous day's HLC for PP = (H+L+C)/3, R1/S1 = 2*PP - L/H, etc., up to R3/S3. M-levels are midpoints (e.g., M1 = (S1+S2)/2). Plotted as crosses with style options.
- **High/Low & Open Levels**: Fetches previous period's extremes/opens from D/W/M timeframes. Historical daily opens optional for steplines.
- **Average Ranges**: SMA of (high-low) over user lengths for ADR (daily), AWR (weekly), AMR (monthly). Projects ±50% from close as potential exhaustion levels.
- **Psychological Levels**: Rounds to multiples of spacing (e.g., 1000 for BTC), drawing limited lines (±count) around current price with dotted style.
- **Quarterly Price Zones**: Divides historical range (high-low over lookback) into 4 equal quartiles, drawing non-overlapping boxes for visual price distribution (Q1 bottom 25%, etc.).
- **Yearly Levels**: Annual high/low/open from 12M timeframe, plotted as steplines.
- **Market Sessions**: Time-based boxes for London/NY/Tokyo/Sydney with DST adjustments (US/UK/Sydney). Optional high/low lines per session, resetting at starts.
- **Fair Value Gaps (FVGs)**: Detects gaps where low > high (bullish) or high < low (bearish), drawing boxes. Mitigates when price penetrates % threshold, capping active FVGs.
- **Order Blocks**: Identifies last bearish candle before bullish swing low (or vice versa) with body size filter. Draws extendable boxes, limited count via array shift.
- **Liquidity Zones**: Counts touches near range highs/lows within % tolerance over lookback; draws if ≥threshold.
- **Dashboard**: Table on last bar showing price, levels, counts, bias (above/below PP). Custom position/size.
Alerts trigger on key crosses (e.g., PP break, vector candle).
#### How to Use It
Add ITS Pro via TradingView's indicators menu. Customize in the inputs tab—groups organize features for easy toggling (e.g., disable FVGs if not needed). Best on intraday charts (1m-1h) for stocks/crypto/forex, but scales to higher TFs.
- **Setup**: Adjust offsets for labels (e.g., 12 bars right). Enable extensions for lines/boxes. For PVSRA, override symbol if volume is unreliable (e.g., aggregate BTC exchanges).
- **Trading Examples**:
- **Bias & Trends**: Use EMA stack and PP for daily bias (above PP + golden cross = long). PVSRA vectors confirm entries.
- **Levels & Zones**: Trade bounces from order blocks/FVGs near psych levels or quarterly zones. Liquidity zones signal potential sweeps.
- **Ranges**: ADR highs/lows as take-profit; if price hits AWR early, expect expansion.
- **Sessions**: Focus entries during London/NY overlaps; session H/L as intraday S/R.
- **Dashboard/Alerts**: Monitor for "BULLISH ↑" bias; set alerts for R1 breaks or vectors.
Since it's open-source, fork the code to add features (e.g., custom alerts). Test on demo charts—feedback via comments! Developed for clean, pro analysis—happy trading!
Trend Pivot Retracements [TradeEasy]▶ OVERVIEW
Trend Pivot Retracements identifies market trend direction using a Donchian-style channel and dynamically highlights retracement zones during trending conditions. It calculates the percentage pullbacks from recent highs and lows, plots labeled zones with varying intensity, and visually connects key retracement pivots. The indicator also emphasizes price proximity to trend boundaries by dynamically adjusting the thickness of plotted trend bands.
▶ TREND DETECTION & BAND STRUCTURE
The indicator determines the current trend by checking for new 50-bar extremes:
Uptrend: If a new highest high is made, the trend is considered bullish.
Downtrend: If a new lowest low is made, the trend is considered bearish.
Uptrend Band: Plots the 50-bar lowest low as a trailing support level.
Downtrend Band: Plots the 50-bar highest high as a trailing resistance level.
Thickness Variation: The thickness of the band increases the further price moves from it, indicating overextension.
▶ RETRACEMENT LABELING SYSTEM
During a trend, the indicator monitors pivot points in the opposite direction to measure retracements:
Bullish Retracement:
Triggered when a pivot low forms during an uptrend.
Measures % pullback from the most recent swing high (searched up to 20 bars back).
Plots a bold horizontal line at the low and a dashed diagonal from the previous swing high.
Adds a “-%” label above the low; intensity is based on recent 50 pullbacks.
Bearish Retracement:
Triggered when a pivot high forms during a downtrend.
Measures % pullback from the previous swing low (up to 20 bars back).
Plots a bold horizontal line at the high and a dashed diagonal from the prior swing low.
Adds a “%” label below the high with gradient color based on the past 50 extremes.
▶ PIVOT CONNECTION LINES
Each retracement includes a visual connector:
A diagonal dashed line linking the swing extreme (20 bars back) to the retracement point.
This line visually traces the path of price retreat within the trend.
Helps traders understand where the retracement originated and how steep it was.
▶ TREND SWITCH SIGNALS
When trend direction changes:
A diamond marker is plotted on the new pivot confirming the trend shift.
Green diamonds signal new bullish trends at fresh lows.
Magenta diamonds signal new bearish trends at fresh highs.
▶ COLOR INTENSITY & CONTEXTUAL AWARENESS
To help interpret the magnitude of retracements:
The % labels are color-coded using a gradient scale that references the max of the last 50 pullbacks.
Stronger pullbacks result in deeper color intensity, signaling more significant corrections.
Trend bands also use standard deviation normalization to adjust line thickness based on how far price has moved from the band.
This creates a visual cue for potential exhaustion or volatility extremes.
▶ USAGE
Trend Pivot Retracements is a powerful tool for traders who want to:
Identify trend direction and contextual pullbacks within those trends.
Spot key retracement points that may serve as entry opportunities or reversal signals.
Use visual retracement angles to understand market pressure and trend maturity.
Read dynamic band thickness as an alert for price stretch, potential mean reversion, or breakout setups.
▶ CONCLUSION
Trend Pivot Retracements gives traders a clean, visually expressive way to monitor trending markets, while capturing and labeling meaningful retracements. With adaptive color intensity, diagonal connectors, and smart trend switching, it enhances situational awareness and provides immediate clarity on trend health and pullback strength.
💪 Trend Health Monitor v2 (fixed)Good. I worked extremely hard on this indicator.
It tells you whether the current trend is likely to continue — so you can decide whether to **hold your position to maximize profits** or not.
Puell Multiple Variants [OperationHeadLessChicken]Overview
This script contains three different, but related indicators to visualise Bitcoin miner revenue.
The classical Puell Multiple : historically, it has been good at signaling Bitcoin cycle tops and bottoms, but due to the diminishing rewards miners get after each halving, it is not clear how you determine overvalued and undervalued territories on it. Here is how the other two modified versions come into play:
Halving-Corrected Puell Multiple : The idea is to multiply the miner revenue after each halving with a correction factor, so overvalued levels are made comparable by a horizontal line across cycles. After experimentation, this correction factor turned out to be around 1.63. This brings cycle tops close to each other, but we lose the ability to see undervalued territories as a horizontal region. The third variant aims to fix this:
Miner Revenue Relative Strength Index (Miner Revenue RSI) : It uses RSI to map miner revenue into the 0-100 range, making it easy to visualise over/undervalued territories. With correct parameter settings, it eliminates the diminishing nature of the original Puell Multiple, and shows both over- and undervalued revenues correctly.
Example usage
The goal is to determine cycle tops and bottoms. I recommend using it on high timeframes, like monthly or weekly . Lower than that, you will see a lot of noise, but it could still be used. Here I use monthly as the example.
The classical Puell Multiple is included for reference. It is calculated as Miner Revenue divided by the 365-day Moving Average of the Miner Revenue . As you can see in the picture below, it has been good at signaling tops at 1,3,5,7.
The problems:
- I have to switch the Puell Multiple to a logarithmic scale
- Still, I cannot use a horizontal oversold territory
- 5 didn't touch the trendline, despite being a cycle top
- 9 touched the trendline despite not being a cycle top
Halving-Corrected Puell Multiple (yellow): Multiplies the Puell Multiple by 1.63 (a number determined via experimentation) after each halving. In the picture below, you can see how the Classical (white) and Corrected (yellow) Puell Multiples compare:
Advantages:
- Now you can set a constant overvalued level (12.49 in my case)
- 1,3,7 are signaled correctly as cycle tops
- 9 is correctly not signaled as a cycle top
Caveats:
- Now you don't have bottom signals anymore
- 5 is still not signaled as cycle top
Let's see if we can further improve this:
Miner Revenue RSI (blue):
On the monthly, you can see that an RSI period of 6, an overvalued threshold of 90, and an undervalued threshold of 35 have given historically pretty good signals.
Advantages:
- Uses two simple and clear horizontal levels for undervalued and overvalued levels
- Signaling 1,3,5,7 correctly as cycle tops
- Correctly does not signal 9 as a cycle top
- Signaling 4,6,8 correctly as cycle bottoms
Caveats:
- Misses two as a cycle bottom, although it was a long time ago when the Bitcoin market was much less mature
- In the past, gave some early overvalued signals
Usage
Using the example above, you can apply these indicators to any timeframe you like and tweak their parameters to obtain signals for overvalued/undervalued BTC prices
You can show or hide any of the three indicators individually
Set overvalued/undervalued thresholds for each => the background will highlight in green (undervalued) or red (overvalued)
Set special parameters for the given indicators: correction factor for the Corrected Puell and RSI period for Revenue RSI
Show or hide halving events on the indicator panel
All parameters and colours are adjustable
TriAnchor Elastic Reversion US Market SPY and QQQ adaptedSummary in one paragraph
Mean-reversion strategy for liquid ETFs, index futures, large-cap equities, and major crypto on intraday to daily timeframes. It waits for three anchored VWAP stretches to become statistically extreme, aligns with bar-shape and breadth, and fades the move. Originality comes from fusing daily, weekly, and monthly AVWAP distances into a single ATR-normalized energy percentile, then gating with a robust Z-score and a session-safe gap filter.
Scope and intent
• Markets: SPY QQQ IWM NDX large caps liquid futures liquid crypto
• Timeframes: 5 min to 1 day
• Default demo: SPY on 60 min
• Purpose: fade stretched moves only when multi-anchor context and breadth agree
• Limits: strategy uses standard candles for signals and orders only
Originality and usefulness
• Unique fusion: tri-anchor AVWAP energy percentile plus robust Z of close plus shape-in-range gate plus breadth Z of SPY QQQ IWM
• Failure mode addressed: chasing extended moves and fading during index-wide thrusts
• Testability: each component is an input and visible in orders list via L and S tags
• Portable yardstick: distances are ATR-normalized so thresholds transfer across symbols
• Open source: method and implementation are disclosed for community review
Method overview in plain language
Base measures
• Range basis: ATR(length = atr_len) as the normalization unit
• Return basis: not used directly; we use rank statistics for stability
Components
• Tri-Anchor Energy: squared distances of price from daily, weekly, monthly AVWAPs, each divided by ATR, then summed and ranked to a percentile over base_len
• Robust Z of Close: median and MAD based Z to avoid outliers
• Shape Gate: position of close inside bar range to require capitulation for longs and exhaustion for shorts
• Breadth Gate: average robust Z of SPY QQQ IWM to avoid fading when the tape is one-sided
• Gap Shock: skip signals after large session gaps
Fusion rule
• All required gates must be true: Energy ≥ energy_trig_prc, |Robust Z| ≥ z_trig, Shape satisfied, Breadth confirmed, Gap filter clear
Signal rule
• Long: energy extreme, Z negative beyond threshold, close near bar low, breadth Z ≤ −breadth_z_ok
• Short: energy extreme, Z positive beyond threshold, close near bar high, breadth Z ≥ +breadth_z_ok
What you will see on the chart
• Standard strategy arrows for entries and exits
• Optional short-side brackets: ATR stop and ATR take profit if enabled
Inputs with guidance
Setup
• Base length: window for percentile ranks and medians. Typical 40 to 80. Longer smooths, shorter reacts.
• ATR length: normalization unit. Typical 10 to 20. Higher reduces noise.
• VWAP band stdev: volatility bands for anchors. Typical 2.0 to 4.0.
• Robust Z window: 40 to 100. Larger for stability.
• Robust Z entry magnitude: 1.2 to 2.2. Higher means stronger extremes only.
• Energy percentile trigger: 90 to 99.5. Higher limits signals to rare stretches.
• Bar close in range gate long: 0.05 to 0.25. Larger requires deeper capitulation for longs.
Regime and Breadth
• Use breadth gate: on when trading indices or broad ETFs.
• Breadth Z confirm magnitude: 0.8 to 1.8. Higher avoids fighting thrusts.
• Gap shock percent: 1.0 to 5.0. Larger allows more gaps to trade.
Risk — Short only
• Enable short SL TP: on to bracket shorts.
• Short ATR stop mult: 1.0 to 3.0.
• Short ATR take profit mult: 1.0 to 6.0.
Properties visible in this publication
• Initial capital: 25000USD
• Default order size: Percent of total equity 3%
• Pyramiding: 0
• Commission: 0.03 percent
• Slippage: 5 ticks
• Process orders on close: OFF
• Bar magnifier: OFF
• Recalculate after order is filled: OFF
• Calc on every tick: OFF
• request.security lookahead off where used
Realism and responsible publication
• No performance claims. Past results never guarantee future outcomes
• Fills and slippage vary by venue
• Shapes can move during bar formation and settle on close
• Standard candles only for strategies
Honest limitations and failure modes
• Economic releases or very thin liquidity can overwhelm mean-reversion logic
• Heavy gap regimes may require larger gap filter or TR-based tuning
• Very quiet regimes reduce signal contrast; extend windows or raise thresholds
Open source reuse and credits
• None
Strategy notice
Orders are simulated by TradingView on standard candles. request.security uses lookahead off where applicable. Non-standard charts are not supported for execution.
Entries and exits
• Entry logic: as in Signal rule above
• Exit logic: short side optional ATR stop and ATR take profit via brackets; long side closes on opposite setup
• Risk model: ATR-based brackets on shorts when enabled
• Tie handling: stop first when both could be touched inside one bar
Dataset and sample size
• Test across your visible history. For robust inference prefer 100 plus trades.
Advanced MTF Dashboard with RSIThis is essentially an entire trading analysis workstation condensed into one indicator that gives you institutional-grade multi-timeframe analysis in a clean, actionable format