Combined Advanced Blueprint + Hybrid Stop + GravityCombined Advanced Blueprint + Hybrid Stop + Gravity
Overview
This indicator is a comprehensive "Swiss Army Knife" trading system that combines the classic Traders Reality Blueprint (Moving Averages & Vector Zones) with advanced institutional volume detection (Gravity Squeeze & Sharks) and a Hybrid Trailing Stop for trade management.
It is designed to identify institutional footprints, trend direction, supply/demand zones, and volatility contractions in a single, all-in-one overlay.
🚀 Key Features
1. Gravity Squeeze & Shark Detection (Institutional Volume)
This module detects anomalies in volume and price action to identify where "Smart Money" is stepping in.
Shark Icons (🦈): Appear when the Negative Volume Index (NVI) detects significant accumulation during low volatility periods. This often signals a "defense" of a price level by institutions.
Shark Support (Blood) Zones: When a Shark is detected, a red box is drawn from the low of the candle. This represents an institutional "line in the sand." If price closes below this box, the zone is invalidated (broken).
Gravity Squeeze (⚡): Indicates a contraction in volatility (ATR compression), suggesting an explosive move is imminent.
Coils (🌀) & Hammers (🔨): Identifies specific price action patterns occurring on high relative volume.
2. The Blueprint Moving Averages
Includes the standard Traders Reality moving average sequence to identify trend state and dynamic support/resistance.
Red (8 EMA): Immediate trend.
White (21 EMA): Short-term trend (The "Baseline").
Blue (34 EMA): Trend confirmation.
Indigo (55 EMA) & Purple (89 EMA): Mid-term trend.
Orange (50 SMA) & Dark Orange (200 SMA): Major institutional levels (Golden/Death Cross).
Visual Crossovers: Arrows and shapes appear for 8/21 crosses, 8/34 crosses, and the 50/200 cross.
3. PVSRA (Price Volume Support Resistance Analysis)
Colors trade bars based on volume relative to the average, highlighting hidden liquidity.
Green/Red Bars: Volume is ≥ 200% of the average. (Climax action).
Blue/Violet Bars: Volume is ≥ 150% of the average.
Grey Bars: Average/Low volume.
Vector Zones: Automatically plots zones based on these high-volume candles to show where significant business was transacted.
4. Hybrid Trailing Stop
A volatility-based stop-loss system designed to keep you in the trend longer.
Calculation: Uses a combination of ATR (Average True Range) and manually input Implied Volatility (IV) to calculate a safe distance from price.
Visual: A Fuchsia line that trails behind price. When price closes across this line, the trend structure is considered broken.
5. Inflection Zones (Supply & Demand)
Auto-Drawing: Identifies Swing Highs and Swing Lows to draw Supply (Blue) and Demand (Red) boxes.
BOS (Break of Structure): When price breaks through a zone, the box is removed or converted, helping keep the chart clean.
6. Pivot Points & VWAP
Pivots: Displays multitimeframe pivots (Daily, Weekly, Monthly, etc.) including Traditional, Fibonacci, and Camarilla calculations.
VWAP: Includes Standard Deviation bands (1, 2, and 3 SD) anchored to Session, Week, Month, or even Earnings/Splits.
7. Keltner Channels & RSI Triggers
Entry Signals: Plots circles on the chart when RSI enters extreme zones (Overbought/Oversold) while price is interacting with the Keltner Channel bands.
🛠 Settings & Configuration
Gravity Squeeze & Sharks
Enable: Toggle the overlay on/off.
Min Volume: Set the threshold for volume analysis (Default: 300k).
Max ADX: Filters out signals if the trend is already too exhausted.
Inflection Zones
Swing Length: Sensitivity of the swing high/low detection.
History to Keep: How many historic zones to display before deleting old ones.
Pivot Levels
Timeframe: Auto-selects based on your chart, or force specific timeframes (e.g., Daily Pivots on a 15m chart).
Type: Choose between Traditional, Fibonacci, Woodie, etc.
Trailing Stop
Multiplier: Adjust how "loose" or "tight" the stop is (Default: 1.5 ATR).
IV %: Manually input the annual Implied Volatility for the asset for higher precision.
🎯 How to Trade (Strategy Ideas)
1. The Shark Defense:
Look for a Shark Icon (🦈).
Watch the red "Blood" box form.
Long Entry: If price retests the box and holds (does not close below it), this is a high-probability buy zone.
Stop Loss: A candle close below the red box.
2. The 8/21 & 8/34 Cross:
Use the Arrows generated by the moving averages.
Combine with Vector Candles: If you get a Bullish Cross (Up Arrow) immediately following a Green/Blue vector candle, the move is supported by volume.
3. The Squeeze Breakout:
Look for the Squeeze Icon (⚡) indicating low volatility.
Wait for the Hybrid Trailing Stop line to flip (e.g., price crosses above the Fuchsia line) to confirm the breakout direction.
Alerts
The script includes built-in alert conditions for automation:
8/21 Bullish/Bearish Cross
8/34 Bullish/Bearish Cross
Credits:
Core logic based on Traders Reality (Blueprint/PVSRA).
Gravity logic adapted from standard institutional volume analysis.
Compiled & Enhanced by Gemini.
אינדיקטורים ואסטרטגיות
Top-Down Market Bias ChecklistThis script allows users, to select whether a market is Bullish or Bearish on different timeframes. It simplifies the process of opening a textbox every time and writing in the values manually, it also simplifies on having to move the textbox every time when switching timeframes.
There is a Color Customization section at the bottom on the inputs when you open settings, where each user can change his colors depending on their preferences.
Meridian v2A comprehensive multi-timeframe trading system that combines statistical volatility levels, dynamic price ranges, momentum-based signals, and precision entry/exit zones.
Key Features:
StdDev Levels: Displays standard deviation bands from higher timeframes (4H, 1H default) to identify key support/resistance zones based on price volatility
Trading Ranges: Automatically plots dynamic support/resistance ranges using ATR calculations with adaptive zone fills
ZScore Momentum: Colors candles based on normalized price momentum relative to moving average, highlighting bullish/bearish conditions
60 Tick Lines: Draws horizontal lines at precise tick distances above/below current price for scalping entries
EMA System: Dual EMA crossover signals with optional volume confirmation and visual ribbon display
Trade Signals: Diamond markers for range breakout entries, triangle markers for EMA crossovers
Perfect for multi-timeframe analysis combining volatility structure, momentum, and precise price levels for confluence-based trading decisions.
RLPS -Simplified Long-Term Support/Resistance Levels (Shelters)// Introduction //
RLPS (Simplified Long-Term Shelters) is a streamlined indicator designed for traders who have already identified the preponderant long-term phase of their assets and want to efficiently track multiple assets using pre-calculated Fibonacci levels.
IMPORTANT: Before using this indicator, you need to have determined the date-price coordinates of the preponderant phase (i0→i1 pivots) for your asset(s). These coordinates can be obtained using our master RLP indicator (Long-Term Shelters), which automatically helps to calculates them, or through your own research and analysis.
// Theoretical Foundation //
Many traditional institutional investors use the latest higher-degree market phase that stands out from others (longest duration and greatest price change on daily timeframe) to base a Fibonacci retracement on whose levels they open long-term positions. These positions can remain open to be activated in the future even years in advance. The phase is considered valid until a new, more preponderant phase develops over time.
RLPS allows you to manually input these pre-identified phase coordinates and draw Fibonacci levels that serve as Long-Term Shelter Levels—marking future trading points (entries, exits, risk management) that remain valid for months and even years.
// Key Features //
• Supports up to 5 different assets with permanently stored phase coordinates
• Dropdown selector to quickly switch between configured assets
• No ZigZag calculation required—user provides pre-calculated coordinates
• Timeframe-agnostic: levels remain constant across all timeframes
• Works with any price source (exchange) regardless of historical data availability
• Asset Information table with visual validation (✅ Match / ❌ No Match)
• Long-Term Historical Prices (LTHP): add up to 5 psychological price levels per asset (historical highs/lows, annual opening prices, etc.)
• Customizable Fibonacci levels, colors, styles, and label formatting
• Logarithmic scale support for volatile assets like cryptocurrencies
// Quick Start Guide //
STEP 1: In TradingView, select "Bitcoin / U.S. dollar" from Bitstamp Exchange (BITSTAMP:BTCUSD).
STEP 2: Configure the chart to Daily (D) timeframe.
STEP 3: Load the RLPS indicator. Initially no drawing appears (fields are empty by default).
STEP 4: Open indicator settings and activate "Practice Asset Data Table" in the GENERAL section.
STEP 5: A table appears with sample data for 5 assets. Locate "Bitcoin on Bitstamp":
- i0 Date: 2020-03-13 18:00 | i0 Price: 3850.0
- i1 Date: 2021-11-10 18:00 | i1 Price: 69000.0
STEP 6: Copy this data to "ASSET 1 - IDENTIFICATION AND DATE-PRICE PIVOT COORDINATES".
STEP 7: Verify "Asset 1" is selected in the dropdown and close settings.
STEP 8: You should now see the yellow diagonal phase line, horizontal Fibonacci levels, and the validation table showing "✅ Match".
STEP 9: Navigate the chart to verify how Fibonacci levels align with historical support/resistance zones.
// Important Notes //
• The sample data in the Practice Table was validated in 02/2026 and serves as reference only.
• It is your responsibility to validate or update the preponderant phase of your assets over time.
• Use our master RLP indicator to automatically find and calculate preponderant phases, then transfer the coordinates here for permanent tracking.
• You can deactivate the Practice Table once you've copied the data you need.
// Shelter Indicators Ecosystem //
RLPS is part of a comprehensive ecosystem of indicators for price action analysis based on shelter levels:
RLPS (Simplified Long-Term Shelters): This indicator. Simplified version of RLP that allows manual input of previously identified preponderant phase coordinates. Ideal for permanent operations with multiple assets across different timeframes.
RLP (Long-Term Shelters): Automatically identifies the preponderant Zigzag phase that institutional investors use as a reference to project Fibonacci levels. These levels determine order placement over the following months and years.
RMP (Mid-Term Shelters): Provides the psychological shelter and resistance levels that institutional investors establish at the beginning of each year. These form the main framework that professionals use to plan entry and exit operations throughout the year.
RS (Weekly Shelters): Tactical structural analysis indicator designed to precisely track price action and manage positions during current weeks.
RID (Intra-Day Shelters): For intraday operations based on levels calculated from the daily opening price. Designed for 1H timeframes or lower, including scalping strategies.
By combining RLPS, RLP, RMP, RS, and RID, you obtain a multi-timeframe framework that provides certainty and clarity to apply strategies grounded in price action, across any time horizon: from scalping to long-term investments.
// Final Notes //
We sincerely regret to inform you that we have not included the Spanish translation previously provided in our indicators, due to our significant concern regarding the ambiguous rules on publication bans related to indicators.
Sharing motivates. Happy hunting in this great jungle!
Ayan EMAV HunterThe script involves 2 zones.
The Blue Zone is the Hunting Zone and the Red Zone helps to decide the which side to trade.
If the Blue Zone is above the Red Zone, we search for UpTrend Trades of 1:2 and we need to observe the candles with the Yellow Arrow which indicates Smart Money entering
Similarly, If the Blue Zone is below the Red Zone, we search for Bearish Trades with 1:2 Risk/Reward and we need to observe the candles with the Yellow Arrow which indicates Smart Money entering
If the Blue Zone lies within the Red Zone, then NO Trade, Just Observe
Please share your feedback if it can be refined
Trend Momentum v6Features
- Trend EMAs: plots Fast EMA and Slow EMA to visualize direction and strength.
- RSI Filter (optional): gates signals by RSI thresholds to reduce whipsaws.
- Multi-Timeframe (MTF): computes EMAs/RSI on a selected timeframe via request.security.
- Signals: triangle markers for Long/Short when fast EMA crosses slow EMA with optional RSI gating.
- Bar Coloring: green for up-trend, red for down-trend, neutral otherwise.
- Alerts: built-in alertcondition for Long Signal and Short Signal.
Inputs
- Signal timeframe: timeframe for EMAs/RSI; empty uses chart timeframe.
- Fast/Slow EMA length: trend speed vs smoothness (21/50 default).
- RSI length and thresholds: default RSI(14), thresholds at 50 for symmetry.
- Confirm signals on bar close: requires bar close confirmation to avoid intrabar flips.
- Show signal markers: enable/disable triangles.
- Color bars by trend: enable/disable bar coloring.
Signals
- Long: Fast EMA crosses above Slow EMA, optionally with RSI >= bull threshold.
- Short: Fast EMA crosses below Slow EMA, optionally with RSI <= bear threshold.
- Trend coloring: independent of cross signals; reflects current EMA relation plus optional RSI gating.
Tutorial
- Add to chart:
- Open TradingView → Pine Editor → paste the script → Save → Add to chart.
- Configure:
- Leave Signal timeframe empty for chart timeframe or choose higher TF (e.g., 1h while viewing 5m).
- Start with Fast EMA=21, Slow EMA=50; adjust for your market’s volatility.
- Keep RSI filter on with thresholds at 50 for balanced gating.
- Enable “Confirm signals on bar close” for stable, non-repainting entries.
- Interpret:
- Long triangle appears after a bullish EMA cross that meets RSI criteria (if enabled).
- Bars turn green when trendUp; red when trendDown; neutral when neither condition holds.
- Alerts:
- Add the indicator → Create Alert → Source: this indicator → Condition: Long Signal or Short Signal.
- Configure frequency (Once per bar close recommended when confirm is enabled).
- MTF guidance:
- For intraday, set Signal timeframe to a higher TF (15m–1h) to align entries with dominant trend.
- Using lookahead=barmerge.lookahead_off prevents future-data repainting; signals appear only when confirmed.
Customization
- Faster entries: lower Fast EMA (e.g., 13) or raise RSI bull threshold above 50 for stronger momentum.
- Smoother trend: raise Slow EMA (e.g., 100) to reduce choppiness.
- Stricter shorts: set RSI bear threshold below 50 (e.g., 45 or 40).
- Intrabar signals: disable “Confirm signals on bar close” to see crosses mid-bar (more responsive, more noise).
- Fixed indicator timeframe: if you want chart to render with gaps per fixed TF, set timeframe on indicator itself (e.g., timeframe="60") and optionally enable timeframe_gaps.
Best Practices
- Use with structure: apply on liquid instruments; combine with session/volatility filters if needed.
- Risk management: consider ATR-based stops and position sizing; signals are entries, not guarantees.
- Avoid overfitting: keep lengths and thresholds simple; validate across symbols and regimes.
Limitations
- Cross-based entries can lag at reversals and whipsaw in ranges; RSI gating helps but doesn’t eliminate noise.
- MTF aggregation can delay signals compared to the chart’s timeframe; this is expected behavior.
MTF StochRSI Confluence + Box (1m/3m/9m signals, +1H/3H display)This indicator is a multi-timeframe Stochastic RSI confluence tool designed to help identify high-probability BUY and SELL zones using short-term momentum alignment, while also providing higher-timeframe context at a glance.
Multi-timeframe StochRSI confluence indicator that triggers BUY/SELL signals only when 1m, 3m, and 9m align, with 1H and 3H shown for higher-timeframe context at a glance.
DXY vs Small-Cap Divergence [v6]It creates a dedicated panel to monitor the "tug-of-war" between the US Dollar (DXY) and the Russell 2000 (IWM).
As a swing trader, you are looking for Negative Correlation—specifically, the moment the DXY starts to fall while Small Caps maintain their strength.
How to Interpret This on Your Desktop:
Green Background: This highlights the exact bars where the DXY is dropping while the Russell 2000 is gaining ground. This can be your "Go" signal for the small caps that you are monitoring near pivots, prior levels, POC's, or value area highs or lows.
The Green Line (Bottom of the oscillator): When the line hits -0.8, it means the two assets are moving in nearly perfect opposite directions. For a gold bounce and small-cap rally, you want to see this line deep in the green.
The Red Line (Top of the oscillator): If this line stays near +0.8, it means the Dollar and Stocks are moving together. This usually indicates a "Liquidity Flush" where everything is being sold—stay cautious during these periods.
basechartpatternsLibrary "basechartpatterns"
Library having complete chart pattern implementation
getPatternNameById(id)
Returns pattern name by id
Parameters:
id (int) : pattern id
Returns: Pattern name
method find(points, properties, dProperties, ohlcArray)
Find patterns based on array of points
Namespace types: array
Parameters:
points (array) : array of chart.point objects
properties (ScanProperties type from SwSpace/abstractchartpatterns/1) : ScanProperties object
dProperties (DrawingProperties type from SwSpace/abstractchartpatterns/1) : DrawingProperties object
ohlcArray (array type from SwSpace/ohlc/1)
Returns: Flag indicating if the pattern is valid, Current Pattern object
method find(this, properties, dProperties, patterns, ohlcArray)
Find patterns based on the currect zigzag object but will not store them in the pattern array.
Namespace types: zg.Zigzag
Parameters:
this (Zigzag type from SwSpace/ZigzagLite/1) : Zigzag object containing pivots
properties (ScanProperties type from SwSpace/abstractchartpatterns/1) : ScanProperties object
dProperties (DrawingProperties type from SwSpace/abstractchartpatterns/1) : DrawingProperties object
patterns (array type from SwSpace/abstractchartpatterns/1) : Array of Pattern objects
ohlcArray (array type from SwSpace/ohlc/1)
Returns: Flag indicating if the pattern is valid, Current Pattern object
abstractchartpatternsLibrary "abstractchartpatterns"
Library having abstract types and methods for chart pattern implementations
method checkSize(filters, points)
checks if the series of pivots are within the size filter
Namespace types: SizeFilters
Parameters:
filters (SizeFilters) : SizeFilters object containing size criteria to be matched
points (array) : list of pivot points
Returns: true if matches the size filter, false otherwise
checkBarRatio(p1, p2, p3, properties)
checks if three zigzag pivot points are having uniform bar ratios
Parameters:
p1 (chart.point) : First pivot point
p2 (chart.point) : Second pivot point
p3 (chart.point) : Third pivot point
properties (ScanProperties)
Returns: true if points are having uniform bar ratio
getRatioDiff(p1, p2, p3)
gets ratio difference between 3 pivot combinations
Parameters:
p1 (chart.point)
p2 (chart.point)
p3 (chart.point)
Returns: returns the ratio difference between pivot2/pivot1 ratio and pivot3/pivot2 ratio
method inspect(points, stratingBar, endingBar, direction, ohlcArray)
Creates a trend line between 2 or 3 points and validates and selects best combination
Namespace types: array
Parameters:
points (array) : Array of chart.point objects used for drawing trend line
stratingBar (int) : starting bar of the trend line
endingBar (int) : ending bar of the trend line
direction (float) : direction of the last pivot. Tells whether the line is joining upper pivots or the lower pivots
ohlcArray (array type from SwSpace/ohlc/1) : Array of OHLC values
Returns: boolean flag indicating if the trend line is valid and the trend line object as tuple
method draw(this)
draws pattern on the chart
Namespace types: Pattern
Parameters:
this (Pattern) : Pattern object that needs to be drawn
Returns: Current Pattern object
method erase(this)
erase the given pattern on the chart
Namespace types: Pattern
Parameters:
this (Pattern) : Pattern object that needs to be erased
Returns: Current Pattern object
method pushWithLimit(this, p, maxItems)
push Pattern object to the array by keeping maxItems limit
Namespace types: array
Parameters:
this (array) : array of Pattern objects
p (Pattern) : Pattern object to be added to array
@oaram maxItems Max number of items the array can hold
maxItems (int)
Returns: Current Pattern array
method deepcopy(this)
Perform deep copy of a chart point array
Namespace types: array
Parameters:
this (array) : array of chart.point objects
Returns: deep copy array
DrawingProperties
Object containing properties for pattern drawing
Fields:
patternLineWidth (series int) : Line width of the pattern trend lines
showZigzag (series bool) : show zigzag associated with pattern
zigzagLineWidth (series int) : line width of the zigzag lines. Used only when showZigzag is set to true
zigzagLineColor (series color) : color of the zigzag lines. Used only when showZigzag is set to true
showPatternLabel (series bool) : display pattern label containing the name
patternLabelSize (series string) : size of the pattern label. Used only when showPatternLabel is set to true
showPivotLabels (series bool) : Display pivot labels of the patterns marking 1-6
pivotLabelSize (series string) : size of the pivot label. Used only when showPivotLabels is set to true
pivotLabelColor (series color) : color of the pivot label outline. chart.bg_color or chart.fg_color are the appropriate values.
deleteOnPop (series bool) : delete the pattern when popping out from the array of Patterns.
Pattern
Object containing Individual Pattern data
Fields:
dir (series int) : direction of the last pivot
points (array) : array of Zigzag Pivot points
trendLine1 (Line type from SwSpace/LineWrapper/1) : First trend line joining pivots 1, 3, 5
trendLine2 (Line type from SwSpace/LineWrapper/1) : Second trend line joining pivots 2, 4 (, 6)
properties (DrawingProperties) : DrawingProperties Object carrying common properties
patternColor (series color) : Individual pattern color. Lines and labels will be using this color.
ratioDiff (series float) : Difference between trendLine1 and trendLine2 ratios
zigzagLine (series polyline) : Internal zigzag line drawing Object
pivotLabels (array) : array containning Pivot labels
patternLabel (series label) : pattern label Object
patternType (series int) : integer representing the pattern type
patternName (series string) : Type of pattern in string
SizeFilters
Object containing properties for pattern size filters
Fields:
filterByBar (series bool) : If set filter the patterns by the bar range
minPatternBars (series int) : Used only when filterByBar is set to true. Minimum bars range for pattern size
maxPatternBars (series int) : Used only when filterByBar is set to true. Maximum bars range for pattern size
filterByPercent (series bool) : Filters patterns by percent of price if set
minPatternPercent (series int) : Used only when filterByPercent is set. Minimum pattern size in terms of percent of price
maxPatternPercent (series int) : Used only when filterByPercent is set. Maximum pattern size in terms of percent of price
ScanProperties
Object containing properties for pattern scanning
Fields:
offset (series int) : Zigzag pivot offset. Set it to 1 for non repainting scan.
numberOfPivots (series int) : Number of pivots to be used in pattern search. Can be either 5 or 6
errorRatio (series float) : Error Threshold to be considered for comparing the slope of lines
flatRatio (series float) : Retracement ratio threshold used to determine if the lines are flat
checkBarRatio (series bool) : Also check bar ratio are within the limits while scanning the patterns
barRatioLimit (series float) : Bar ratio limit used for checking the bars. Used only when checkBarRatio is set to true
avoidOverlap (series bool) : avoid overlapping patterns.
ignoreIfEntryCrossed (series bool) : Ignore the trade if close price does not fall within the price entry price range
allowedPatterns (array) : array of bool encoding the allowed pattern types.
allowedLastPivotDirections (array) : array of int representing allowed last pivot direction for each pattern types
themeColors (array) : color array of themes to be used.
filters (SizeFilters)
ZigzagLiteLibrary "ZigzagLite"
Lighter version of the Zigzag Library. Without indicators and sub-component divisions
method getPrices(pivots)
Gets the array of prices from array of Pivots
Namespace types: array
Parameters:
pivots (array) : array array of Pivot objects
Returns: array array of pivot prices
method getBars(pivots)
Gets the array of bars from array of Pivots
Namespace types: array
Parameters:
pivots (array) : array array of Pivot objects
Returns: array array of pivot bar indices
method getPoints(pivots)
Gets the array of chart.point from array of Pivots
Namespace types: array
Parameters:
pivots (array) : array array of Pivot objects
Returns: array array of pivot points
method getPoints(this)
Gets the array of chart.point from Zigzag Object
Namespace types: Zigzag
Parameters:
this (Zigzag) : Zigzag object
Returns: array array of pivot points
method calculate(this, ohlc, ltfHighTime, ltfLowTime)
Calculate zigzag based on input values and indicator values
Namespace types: Zigzag
Parameters:
this (Zigzag) : Zigzag object
ohlc (array) : Array containing OHLC values. Can also have custom values for which zigzag to be calculated
ltfHighTime (int) : Used for multi timeframe zigzags when called within request.security. Default value is current timeframe open time.
ltfLowTime (int) : Used for multi timeframe zigzags when called within request.security. Default value is current timeframe open time.
Returns: current Zigzag object
method calculate(this)
Calculate zigzag based on properties embedded within Zigzag object
Namespace types: Zigzag
Parameters:
this (Zigzag) : Zigzag object
Returns: current Zigzag object
method nextlevel(this)
Calculate Next Level Zigzag based on the current calculated zigzag object
Namespace types: Zigzag
Parameters:
this (Zigzag) : Zigzag object
Returns: Next Level Zigzag object
method clear(this)
Clears zigzag drawings array
Namespace types: array
Parameters:
this (array) : array
Returns: void
method clear(this)
Clears zigzag drawings array
Namespace types: array
Parameters:
this (array) : array
Returns: void
method drawplain(this)
draws fresh zigzag based on properties embedded in ZigzagDrawing object without trying to calculate
Namespace types: ZigzagDrawing
Parameters:
this (ZigzagDrawing) : ZigzagDrawing object
Returns: ZigzagDrawing object
method drawplain(this)
draws fresh zigzag based on properties embedded in ZigzagDrawingPL object without trying to calculate
Namespace types: ZigzagDrawingPL
Parameters:
this (ZigzagDrawingPL) : ZigzagDrawingPL object
Returns: ZigzagDrawingPL object
method drawfresh(this, ohlc)
draws fresh zigzag based on properties embedded in ZigzagDrawing object
Namespace types: ZigzagDrawing
Parameters:
this (ZigzagDrawing) : ZigzagDrawing object
ohlc (array) : values on which the zigzag needs to be calculated and drawn. If not set will use regular OHLC
Returns: ZigzagDrawing object
method drawcontinuous(this, ohlc)
draws zigzag based on the zigzagmatrix input
Namespace types: ZigzagDrawing
Parameters:
this (ZigzagDrawing) : ZigzagDrawing object
ohlc (array) : values on which the zigzag needs to be calculated and drawn. If not set will use regular OHLC
Returns:
PivotCandle
PivotCandle represents data of the candle which forms either pivot High or pivot low or both
Fields:
_high (series float) : High price of candle forming the pivot
_low (series float) : Low price of candle forming the pivot
length (series int) : Pivot length
pHighBar (series int) : represents number of bar back the pivot High occurred.
pLowBar (series int) : represents number of bar back the pivot Low occurred.
pHigh (series float) : Pivot High Price
pLow (series float) : Pivot Low Price
Pivot
Pivot refers to zigzag pivot. Each pivot can contain various data
Fields:
point (chart.point) : pivot point coordinates
dir (series int) : direction of the pivot. Valid values are 1, -1, 2, -2
level (series int) : is used for multi level zigzags. For single level, it will always be 0
ratio (series float) : Price Ratio based on previous two pivots
sizeRatio (series float) : ratio of current zigzag wave size in comparison to last zigzag wave in the same direction
barRatio (series float) : Bar Ratio based on previous two pivots
ZigzagFlags
Flags required for drawing zigzag. Only used internally in zigzag calculation. Should not set the values explicitly
Fields:
newPivot (series bool) : true if the calculation resulted in new pivot
doublePivot (series bool) : true if the calculation resulted in two pivots on same bar
updateLastPivot (series bool) : true if new pivot calculated replaces the old one.
Zigzag
Zigzag object which contains whole zigzag calculation parameters and pivots
Fields:
length (series int) : Zigzag length. Default value is 5
numberOfPivots (series int) : max number of pivots to hold in the calculation. Default value is 20
offset (series int) : Bar offset to be considered for calculation of zigzag. Default is 0 - which means calculation is done based on the latest bar.
level (series int) : Zigzag calculation level - used in multi level recursive zigzags
zigzagPivots (array) : array which holds the last n pivots calculated.
flags (ZigzagFlags) : ZigzagFlags object which is required for continuous drawing of zigzag lines.
ZigzagObject
Zigzag Drawing Object
Fields:
zigzagLine (series line) : Line joining two pivots
zigzagLabel (series label) : Label which can be used for drawing the values, ratios, directions etc.
ZigzagProperties
Object which holds properties of zigzag drawing. To be used along with ZigzagDrawing
Fields:
lineColor (series color) : Zigzag line color. Default is color.blue
lineWidth (series int) : Zigzag line width. Default is 1
lineStyle (series string) : Zigzag line style. Default is line.style_solid.
showLabel (series bool) : If set, the drawing will show labels on each pivot. Default is false
textColor (series color) : Text color of the labels. Only applicable if showLabel is set to true.
maxObjects (series int) : Max number of zigzag lines to display. Default is 300
xloc (series string) : Time/Bar reference to be used for zigzag drawing. Default is Time - xloc.bar_time.
curved (series bool) : Boolean field to print curved zigzag - used only with polyline implementation
force_overlay (series bool) : force drawing in price overlay
ZigzagDrawing
Object which holds complete zigzag drawing objects and properties.
Fields:
zigzag (Zigzag) : Zigzag object which holds the calculations.
properties (ZigzagProperties) : ZigzagProperties object which is used for setting the display styles of zigzag
drawings (array) : array which contains lines and labels of zigzag drawing.
ZigzagDrawingPL
Object which holds complete zigzag drawing objects and properties - polyline version
Fields:
zigzag (Zigzag) : Zigzag object which holds the calculations.
properties (ZigzagProperties) : ZigzagProperties object which is used for setting the display styles of zigzag
zigzagLabels (array)
zigzagLine (series polyline) : polyline object of zigzag lines
LineWrapperLibrary "LineWrapper"
Wrapper Type for Line. Useful when you want to store the line details without drawing them. Can also be used in scnearios where you collect lines to be drawn and draw together towards the end.
method draw(this)
draws line as per the wrapper object contents
Namespace types: Line
Parameters:
this (Line) : (series Line) Line object.
Returns: current Line object
method draw(this)
draws lines as per the wrapper object array
Namespace types: array
Parameters:
this (array) : (series array) Array of Line object.
Returns: current Array of Line objects
method update(this)
updates or redraws line as per the wrapper object contents
Namespace types: Line
Parameters:
this (Line) : (series Line) Line object.
Returns: current Line object
method update(this)
updates or redraws lines as per the wrapper object array
Namespace types: array
Parameters:
this (array) : (series array) Array of Line object.
Returns: current Array of Line objects
method delete(this)
Deletes the underlying line drawing object
Namespace types: Line
Parameters:
this (Line) : (series Line) Line object.
Returns: Current Line object
method get_price(this, bar)
get line price based on bar
Namespace types: Line
Parameters:
this (Line) : (series Line) Line object.
bar (int) : (series/int) bar at which line price need to be calculated
Returns: line price at given bar.
Line
Line Wrapper object
Fields:
p1 (chart.point)
p2 (chart.point)
xloc (series string) : (series string) See description of x1 argument. Possible values: xloc.bar_index and xloc.bar_time. Default is xloc.bar_index.
extend (series string) : (series string) If extend=extend.none, draws segment starting at point (x1, y1) and ending at point (x2, y2). If extend is equal to extend.right or extend.left, draws a ray starting at point (x1, y1) or (x2, y2), respectively. If extend=extend.both, draws a straight line that goes through these points. Default value is extend.none.
color (series color) : (series color) Line color.
style (series string) : (series string) Line style. Possible values: line.style_solid, line.style_dotted, line.style_dashed, line.style_arrow_left, line.style_arrow_right, line.style_arrow_both.
width (series int) : (series int) Line width in pixels.
obj (series line) : line object
utilsLibrary "utils"
Few essentials captured together (subset of arrayutils)
timer(timeStart, timeEnd)
finds difference between two timestamps
Parameters:
timeStart (int) : start timestamp
timeEnd (int)
Returns:
check_overflow(pivots, barArray, dir)
finds difference between two timestamps
Parameters:
pivots (array) : pivots array
barArray (array) : pivot bar array
dir (int) : direction for which overflow need to be checked
Returns: bool overflow
get_trend_series(pivots, length, highLow, trend)
finds series of pivots in particular trend
Parameters:
pivots (array) : pivots array
length (int) : length for which trend series need to be checked
highLow (int) : filter pivot high or low
trend (int) : Uptrend or Downtrend
Returns: int trendIndexes
get_trend_series(pivots, firstIndex, lastIndex)
finds series of pivots in particular trend
Parameters:
pivots (array) : pivots array
firstIndex (int) : First index of the series
lastIndex (int) : Last index of the series
Returns: int trendIndexes
getConsolidatedLabel(include, labels, separator)
Consolidates labels into single string by concatenating it with given separator
Parameters:
include (array) : array of conditions to include label or not
labels (array) : string array of labels
separator (simple string) : Separator for concatenating labels
Returns: string labelText
getColors(theme)
gets array of colors based on theme
Parameters:
theme (simple string) : dark or light theme
Returns: color themeColors
ohlcLibrary "ohlc"
Library having OHLC and Indicator type and method implementations.
getOhlcArray(o, h, l, c, highBeforeLow, highAfterLow, lowBeforeHigh, lowAfterHigh, barindex, bartime, indicators)
get array of OHLC values when called on every bar
Parameters:
o (float) : Open price
h (float) : High Price
l (float) : Low Price
c (float) : Close Price
highBeforeLow (float) : to be calculated based on lower timeframe. high price attained within the candle before reaching the lowest point.
highAfterLow (float) : to be calculated based on lower timeframe. high price attained within the candle after reaching the lowest point.
lowBeforeHigh (float) : to be calculated based on lower timeframe. low price attained within the candle before reaching the highest point.
lowAfterHigh (float) : to be calculated based on lower timeframe. low price attained within the candle after reaching the highest point.
barindex (int) : bar_index of OHLC data
bartime (int) : time of OHLC cata
indicators (array) : array containing indicator
Returns: Array of OHLC objects
pushWithLimit(this, item, maxItems)
Push items to OHLC array with maxItems limit
Parameters:
this (array)
item (OHLC) : OHLC Item to be pushed to the array
maxItems (int) : max Items the array can hold at a time
Returns: current object
pushWithLimit(this, item, maxItems)
Push items to Indicator array with maxItems limit
Parameters:
this (array)
item (Indicator) : Indicator Item to be pushed to the array
maxItems (int) : max Items the array can hold at a time
Returns: current object
unshiftWithLimit(this, item, maxItems)
Unshift items to OHLC array with maxItems limit
Parameters:
this (array)
item (OHLC) : OHLC Item to be unshifted to the array
maxItems (int) : max Items the array can hold at a time
Returns: current object
unshiftWithLimit(this, item, maxItems)
Unshift items to Indicator array with maxItems limit
Parameters:
this (array)
item (Indicator) : Indicator Item to be unshifted to the array
maxItems (int) : max Items the array can hold at a time
Returns: current object
method getPoints(indicators)
get array of points based on array of indicator values
Namespace types: array
Parameters:
indicators (array) : Array containing indicator objects
Returns: array of indicator points
method plot(indicator, xloc, line_color, line_style, line_width)
plots an array of Indicator using polyline
Namespace types: array
Parameters:
indicator (array) : Array containing indicator objects
xloc (string) : can have values xloc.bar_index or xloc.bar_time. Used for drawing the line based on either bars or time.
line_color (color) : color in which the plots need to be printed on chart.
line_style (string) : line style line.style_solid, line.style_dotted, line.style_dashed, line.style_arrow_right, line.style_arrow_left, line.style_arrow_both
line_width (int) : width of the plot line
Returns: array of plot polyline
Indicator
Object containing Indicator name and value
Fields:
name (series string) : Indicator Name
value (chart.point) : Indicator Value as a chart point
OHLC
Object containing OHLC and indicator values
Fields:
o (series float) : Open price
h (series float) : High Price
l (series float) : Low Price
c (series float) : Close Price
highBeforeLow (series float) : to be calculated based on lower timeframe. high price attained within the candle before reaching the lowest point.
highAfterLow (series float) : to be calculated based on lower timeframe. high price attained within the candle after reaching the lowest point.
lowBeforeHigh (series float) : to be calculated based on lower timeframe. low price attained within the candle before reaching the highest point.
lowAfterHigh (series float) : to be calculated based on lower timeframe. low price attained within the candle after reaching the highest point.
barindex (series int) : bar_index of OHLC data
bartime (series int) : time of OHLC cata
indicators (array) : array containing indicator
MA Smart SyncMA Smart Sync determines the market bias by evaluating the price position relative to a moving average channel on four independent timeframes and returning a confluence signal when a configurable number of them agree.
Unlike standard MTF trend indicators that rely on EMA crossovers or slope direction, this script builds a channel around each timeframe and classifies price into three discrete zones: above, below, or inside. The "inside" state acts as a neutral filter, preventing false confluence signals during consolidation — a key distinction from binary up/down dashboards.
The channel itself can be constructed using five different methods selectable from a single input: High/Low MA (separate MAs applied to high and low), Close ± ATR, Close ± Standard Deviation, Close ± percentage offset, or classic Bollinger Bands. All five use the same MA type and length inputs, making it straightforward to compare how different volatility envelopes behave on the same instrument without rebuilding the indicator.
How to use:
— Set four timeframes matching your trading plan (defaults: 15m, 1h, 4h, D).
— Choose the channel method that fits your instrument's volatility profile. ATR-based channels adapt well to forex; StdDev and Bollinger suit equities and indices.
— Set "Minimum Confluence" to 3 or 4. A value of 4 means all timeframes must agree before a signal fires.
— The background color and arrow labels update only when bias changes, keeping the chart clean.
— Use the status table (top-right) to monitor each timeframe independently and identify which TFs are lagging.
Daily 50 per cent (High Low Dinamic)📊 Daily 50% Mid – Dynamic High/Low
🔎 Description
The Daily 50% Mid is a clean and objective indicator that plots the daily equilibrium level, calculated as 50% of the distance between the daily high and daily low.
Unlike static levels, this indicator is fully dynamic: as new daily highs or lows are formed, the 50% level is recalculated in real time throughout the trading session.
⚙️ How it works
Automatically detects:
📈 Daily High
📉 Daily Low
Calculates the daily midpoint:
(
𝐷
𝑎
𝑖
𝑙
𝑦
𝐻
𝑖
𝑔
ℎ
+
𝐷
𝑎
𝑖
𝑙
𝑦
𝐿
𝑜
𝑤
)
/
2
(Daily High+Daily Low)/2
Continuously updates the levels while the trading day is in progress.
📐 What the indicator plots
🔴 Daily High line
🟢 Daily Low line
🟡 50% of the Daily Range (Daily Mid) line
🎯 Trading applications
The 50% daily midpoint is widely used as:
A daily balance / equilibrium zone
A pullback level in trending days
A rejection area in range-bound markets
A confluence level with:
VWAP
Daily open
Volume Profile
Price structure
⏱️ Recommended timeframes
Designed for intraday charts
(1m, 5m, 15m, etc.)
Ideal for day trading
Not recommended for daily charts
🧠 Notes
Works on any asset (indices, stocks, forex, crypto)
Automatically resets at the start of each trading day
No future repainting
StolenKernelFunctionsLibrary "StolenKernelFunctions"
This library provides non-repainting kernel functions for Nadaraya-Watson estimator implementations. This allows for easy substition/comparison of different kernel functions for one another in indicators. Furthermore, kernels can easily be combined with other kernels to create newer, more customized kernels.
rationalQuadratic(_src, _lookback, _relativeWeight, startAtBar)
Rational Quadratic Kernel - An infinite sum of Gaussian Kernels of different length scales.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_relativeWeight (simple float) : Relative weighting of time frames. Smaller values resut in a more stretched out curve and larger values will result in a more wiggly curve. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel.
startAtBar (simple int)
Returns: yhat The estimated values according to the Rational Quadratic Kernel.
gaussian(_src, _lookback, startAtBar)
Gaussian Kernel - A weighted average of the source series. The weights are determined by the Radial Basis Function (RBF).
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
startAtBar (simple int)
Returns: yhat The estimated values according to the Gaussian Kernel.
periodic(_src, _lookback, _period, startAtBar)
Periodic Kernel - The periodic kernel (derived by David Mackay) allows one to model functions which repeat themselves exactly.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period (simple int) : The distance between repititions of the function.
startAtBar (simple int)
Returns: yhat The estimated values according to the Periodic Kernel.
locallyPeriodic(_src, _lookback, _period, startAtBar)
Locally Periodic Kernel - The locally periodic kernel is a periodic function that slowly varies with time. It is the product of the Periodic Kernel and the Gaussian Kernel.
Parameters:
_src (float) : The source series.
_lookback (simple int) : The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars.
_period (simple int) : The distance between repititions of the function.
startAtBar (simple int)
Returns: yhat The estimated values according to the Locally Periodic Kernel.
Dynamic MA Convergence (Smooth MTF)DMC-MA (Dynamic MA Convergence) — Functional Details1. Multi-Timeframe (MTF) Monitoring LogicThis indicator doesn't just display a single MA; it constantly monitors the relationship between the "Current Timeframe" and its "Higher Timeframe (High-TF)" equivalent. When you switch charts, the indicator automatically selects the corresponding High-TF according to the following logic:Current Chart TFMonitored High-TF1 minute (1m)5 minutes (5m)5 minutes (5m)15 minutes (15m) *Optionally 30m15 minutes (15m)1 hour (1H)1 hour (1H)4 hours (4H)4 hours (4H)Daily (D)Daily (D)Weekly (W)Weekly (W)Monthly (M)2. Real-Time Status DetectionThe dashboard (table) and alerts categorize the distance and direction between the two MAs into four distinct states:Convergence: The short-term MA is moving toward the High-TF MA. This often indicates a "pullback" or "retracement" within a trend.Divergence: After converging, the MAs begin to separate again without crossing. This suggests a "trend continuation."Breakout / Breakdown: The short-term MA clearly crosses the High-TF MA. This indicates a potential "trend reversal" or shift in momentum.3. Smooth MTF Line (MA Interpolation)Standard MTF indicators often appear "stepped" or "jagged" when displaying higher timeframe data on lower timeframes. This script utilizes linear interpolation to calculate values for every single bar, resulting in a smooth, natural curve. This significantly improves the accuracy of price-action analysis and MA-touch detection.Technical Notes & CorrectionsLocalized Timeframe Labels:We have moved away from raw numerical IDs (like "60"). By setting the "Language" toggle to EN, all alert messages and table headers will display intuitive labels like "1H" instead of "60".5-Minute Chart Flexibility:Exclusively for the 5m chart, an option (Use 30m as High-TF) is included to switch the reference from 15m to 30m, catering to both scalpers and day traders.Calculation Integrity:The core detection algorithms (cross-detection and convergence direction) remain untouched, ensuring consistent logical performance.How to UseSet your preferred MA Length (Default: 20).Choose your Display Language (JP or EN).Configure Display Settings to show either the status of all timeframes or only the current one.
DMC-MA (Dynamic MA Convergence) — 機能詳細1. マルチタイムフレーム (MTF) 監視ロジック本インジケーターは、単一のMAを表示するのではなく、「現在の足」と「その一段上の上位足」のMAがどのような位置関係にあるかを常に監視します。チャートを切り替えると、以下の対応表に基づいて自動的に監視対象(上位足)が選択されます。表示中の時間足 (Current)監視対象の上位足 (High-TF)1分足 (1m)5分足 (5m)5分足 (5m)15分足 (15m) ※設定で30分に変更可15分足 (15m)1時間足 (1H)1時間足 (1H)4時間足 (4H)4時間足 (4H)日足 (D)日足 (D)週足 (W)週足 (W)月足 (M)2. リアルタイム・ステータス判定ダッシュボード(テーブル)およびアラートでは、MA同士の距離と方向から以下の4つの状態を判定します。収束 (Convergence): 短期MAが上位足MAへ向かって近づいている状態。押し目や戻りの形成を示唆します。拡散 (Divergence): 収束した後、交差せずに再び本来のトレンド方向へ離れていく状態。トレンドの再開を示唆します。上抜け・下抜け (Breakout/Down): 短期MAが上位足MAを明確にクロスした状態。トレンド転換の初動を示唆します。3. スムーズMTFライン (MA平滑化)通常、下位足チャートに上位足のMAを表示すると「階段状」にガタつきますが、本スクリプトは線形補間ロジックにより、バーごとに滑らかなラインを描画します。これにより、価格がMAにタッチしたかどうかの判定精度が向上しています。修正箇所と技術的な解説 / Correction & Technical Context時間足ラベルの言語対応:(JP) 以前の「60」などの数字表記を廃止しました。設定の「Language」をJPにすれば「1時間足」、ENにすれば「1H」と、アラートメッセージやテーブルの見出しが完全に切り替わります。(EN) Replaced raw numbers (e.g., "60") with localized labels. Setting the Language to "EN" displays "1H" across alerts and the dashboard.5分足の例外設定:(JP) 5分足を使用する場合のみ、上位足を15分ではなく「30分」に変更できるオプション(Use 30m as High-TF)を搭載しています。これにより、スキャルピングからデイトレードまで柔軟に対応可能です。ロジックの不変性:(JP) 判定アルゴリズム(交差判定、収束方向の計算)には一切変更を加えていません。導入方法移動平均線の期間(デフォルト20)を設定。表示言語(JP/EN)を選択。表示設定で、特定の時間足の状態を常時リストアップするか、現在の足のみ表示するかを選択。
ATR% Table BoxATR Label Box.
What this does
Shows a live ATR% box
Turns green if ATR% ≤ 5%
Turns red if ATR% > 5%
Updates only on the last bar (no clutter)
Momentum Average [SWT]
Momentum Average (MMA)
What is the Momentum Average? This is not your typical trend follower. MMA Pro is an algorithmic convergence tool designed for traders who seek to filter market noise and trade with the true momentum on their side. Its core engine allows you to fuse the "DNA" of up to three different moving averages into a single, high-precision "Master Line."
🛠️ Key Tool Benefits
Data Convergence: By averaging up to three different MA types (EMA, SMA, WMA, VWMA, etc.), the indicator eliminates the erratic signals of individual averages, offering a smoothed curve that reacts primarily to institutional movements.
Volatility Visualization (Cloud): Thanks to the "Trend Cloud" between the two primary averages, you can immediately visualize price expansion and contraction.
Visual Confirmation (Pivot Dots): Identify the exact candle where the market slope shifts, ensuring you stay on the right side of the trend.
⚠️ Usage Philosophy: A Confirmation Tool, Not a Signal Generator
It is vital to understand that MMA Pro is not a "blind signal" tool. It is not designed to be traded every time a dot appears. Its true power lies in serving as a high-quality filter and confirmation layer:
Bias Validation: Use it to confirm the direction of your primary strategy. If your system gives a "Buy," the MMA Pro should ideally show bullish momentum.
Entry Filtering: Avoid entries during "chop" or sideways markets when the "Master Line" is flat or pivot dots are frequently flipping.
Exit Management: Many traders use it as a visual Trailing Stop; if the slope changes against your position, it may be time to protect profits.
💡 User Tips:
Nasdaq 1m/5m: Try combining an EMA with a VWMA to capture intraday volume averaged with price action.
Aesthetics: Customize the "Pivot Dots" colors to match your chart theme (Light/Dark).
EMA 9/21 + SMA 50/200 | Long SignalsThis indicator displays EMA 9, EMA 21, SMA 50, and SMA 200 and generates long-only signals based on short-term momentum and price reclaim behavior.
Long Signals
EMA Cross (green triangle):
EMA 9 crosses above EMA 21 from below.
Reclaim Signal (orange triangle):
Price comes from below and closes above EMA 9 and EMA 21.
A new signal is only triggered after price has previously closed below EMA 21.
Important Note
This indicator uses no trend filter (e.g. SMA 200).
All signals are generated independent of the higher-timeframe trend.
Alerts
Separate alerts are available for both long signals.
⚠️ Not financial advice. This indicator is a technical tool and should be used together with proper risk management.
Midnight Open Retracement [LuxAlgo]The Midnight Open Retracement indicator highlights the 12:00 AM ET opening price and provides real-time probability statistics for price retracing to this level during the New York session.
Designed specifically with NQ (Nasdaq 100) futures data in mind, the tool helps traders identify high-probability "magnet" levels for New York open scalps based on historical performance.
🔶 USAGE
The Midnight Open is a cornerstone of ICT concepts, acting as a "true" daily open that often serves as a point of institutional re-accumulation or distribution. This script automates the identification of this level and provides a dashboard to help traders decide when to expect a retracement.
🔹 Identifying the Bias
The script compares the New York opening price (9:30 AM ET) to the Midnight opening price:
If NY opens above the Midnight Open, the indicator identifies a potential bearish retracement bias toward the level. If NY opens below the Midnight Open, the indicator identifies a potential bullish retracement bias toward the level.
🔹 Using as a Profit Target
Because the Midnight Open is retraced to frequently, it serves as an ideal Take Profit (TP) target for opening range scalps. The indicator marks the exact moment a retracement occurs with a visual marker, confirming the level has been tested.
🔶 DETAILS
The statistics integrated into this tool are based on extensive backtesting of NQ futures over 6-month periods. Understanding these probabilities allows traders to filter out low-conviction setups and focus on high-probability days.
🔹 The Core Probabilities
When price opens above the midnight level, it retraces to touch it 74% of the time. When price opens below the midnight level, it retraces to touch it 63% of the time.
🔹 Weekday Variance
Not all trading days are equal. The script accounts for "By Weekday" statistics:
High Probability (Wednesdays): On Wednesdays, retracement probabilities can jump as high as 89% for opens above the midnight level. Low Probability (Mondays): Mondays often exhibit "Avoid" criteria, with retracement probabilities frequently falling below 60%.
The dashboard dynamically updates the "Probability of Retracement" based on the current day of the week, helping you stay aligned with historical data.
🔶 SETTINGS
🔹 Session Settings
Timezone Mode: Choose between Exchange time or "America/New_York" (recommended for ICT concepts). Midnight Open Time: The specific time used to set the daily baseline. NY Open Time: The time used to determine the session opening bias. NY Session Range: Defines the boundary for the New York session box.
🔹 Visual Settings
Show Midnight Level: Toggles the horizontal line representing the midnight price. Show Retrace Circle: Displays markers on the chart when the retracement goal is met. Show NY Session Box: Draws a dynamic box for the NY session that changes color based on the current price relative to the open.
🔹 Dashboard Settings
Show Insights Report: Toggles the statistics dashboard on the chart. Position/Size: Controls the UI placement and scale of the data table.
Dynamic Trend-Based Fibonacci Extension💡 This indicator is a sophisticated, automated technical analysis tool designed to identify high-probability trend continuation setups using the principles of market structure and Fibonacci geometry. By algorithmically detecting "A-B-C" price structures (Pivot -> Impulse -> Retracement), it projects dynamic Fibonacci Extension levels to forecast potential price targets for the next impulsive move (Wave C to D). Unlike static drawing tools, this script adapts to market volatility and features an advanced invalidation engine to keep your charts clean and your risk managed.
✨ Originality and Utility
Traders often struggle with the subjectivity of drawing Fibonacci extensions manually. This script solves that by standardizing the identification of market structure using a proprietary ZigZag algorithm enhanced with Average True Range (ATR) for volatility-adjusted sensitivity.
Key unique features include:
Automated Structure Detection: Instantly spots Bullish (Higher High, Higher Low) and Bearish (Lower Low, Lower High) sequences without manual input.
Dynamic Invalidation: The script monitors price action in real-time. If price breaks the invalidation point (Point A), the structure is immediately "grayed out" or deleted, preventing you from trading based on broken setups.
Golden Zone Targeting: Highlights the high-probability reversal zone between the 1.5 and 1.618 extensions, often associated with the completion of a measured move.
JSON Alerting: Built-in support for algorithmic trading with structured JSON payloads (Entry, TP, SL) ready for webhook integration.
🔬 Methodology and Concepts
The core logic operates on a three-step algorithmic sequence:
1. Pivot Identification: The script uses a "ZigZag" approach to find significant swing highs and lows. It employs an ATR-based threshold (or fixed deviation) to filter out market noise, ensuring only significant structural points are considered.
2. Geometric Validation: It evaluates the last three pivot points (A, B, C) to confirm a valid trend structure.
Bullish Setup: Point C must be higher than Point A but lower than Point B (a valid retracement).
Bearish Setup: Point C must be lower than Point A but higher than Point B.
3. Projection Mathematics: Once a valid ABC structure is locked, the script calculates extension targets using the standard formula: Target = Price C + ((Price B - Price A) * Ratio) . It also supports Logarithmic Scale calculations for assets with exponential growth, such as cryptocurrencies, ensuring proportional accuracy over large price ranges.
🎨 Visual Guide
The indicator paints a clear, detailed roadmap on your chart. Here is how to interpret the visual elements:
● Structure Lines
Solid Line (A to B): Represents the initial "Impulse" leg of the move.
Dashed Line (B to C): Represents the "Retracement" or corrective leg.
Green Structures: Indicate Bullish setups (looking for long entries).
Red Structures: Indicate Bearish setups (looking for short entries).
Gray/Dimmed Structures: These are invalidated setups where the price has breached the Stop Loss level (Point A).
● Extension Levels (Targets)
The script projects the following key Fibonacci ratios extending from Point C:
0.618 (Wave 5): An early profit-taking level, often corresponding to a truncated 5th wave.
1.0 (Measured Move): Where the extension equals the length of the initial impulse (AB = CD pattern).
1.272 (Harmonic): A common extension level for corrective structures or deep pullbacks.
Golden Zone (1.5 - 1.618): A highlighted fill area. The 1.618 level (Solid Line) is the "Golden Ratio" and is statistically one of the most significant targets in trending markets, often labeled as "Wave 3".
● Labels
Points A, B, C: Clearly marks the swing points defining the structure.
Right-Side Labels: Display the Ratio (e.g., 1.618) and the exact Price Level for easy order placement.
📖 How to Use
This tool is best used as a trend-following system.
1. Trend Identification
Wait for a new Solid Colored Structure (Green or Red) to appear. This confirms that a valid ABC retracement has occurred.
2. Entry Strategy
The "Trigger" is generally the reversal from Point C. Aggressive traders enter near C, while conservative traders may wait for a breakout above B.
Stop Loss: Place your SL just beyond Point A . If price breaks A, the script will automatically gray out the structure, signaling invalidation.
3. Profit Taking
Use the projected extension lines as dynamic Take Profit (TP) zones:
TP1: 1.0 (The Measured Move).
TP2: The Golden Zone (1.5 to 1.618). This is often the strongest target for a Wave 3 impulsive move.
4. Automation
For automated traders, create an alert using the "Any alert() function call" option. The script outputs a JSON string containing the Action, Ticker, Entry Price, TP (1.618), and SL (Point A).
⚙️ Inputs and Settings
You can fully customize the script to fit your asset class and timeframe:
● ZigZag Detection
Pivot Lookback Depth: (Default: 5) Determines how many bars to check left/right for a pivot. Higher numbers find larger, more significant structures.
Use ATR-Based Threshold: (Default: True) Adapts the sensitivity to market volatility.
ATR Multiplier: (Default: 2.0) Adjusts how much price must reverse to form a new leg.
● Structure Invalidation
Enable Structure Invalidation: (Default: True) Toggles the logic that checks if Point A is breached.
Invalidation Action: Choose "Gray Out" to keep history visible but dimmed, or "Delete" to remove failed setups entirely.
● Fibonacci Settings
Use Logarithmic Scale: Essential for crypto or long-term timeframe analysis.
Show 0.618 / 1.0 / 1.272 / 1.618: Toggles individual levels on/off to declutter the chart.
Extend Lines Right: Extends the target lines into the future for better visibility.
● Display Settings
Keep Last N Structures: Controls how many historical structures remain on the chart to prevent visual clutter.
Show Elliott Wave Labels: Adds theoretical wave counts (e.g., "Wave 3") to the ratio labels.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
This indicator is grounded in Fractal Market Geometry and Elliott Wave Theory .
1. The Golden Ratio (Phi - 1.618):
Mathematically derived from the Fibonacci sequence, the 1.618 ratio is omnipresent in natural growth patterns. In financial markets, it represents the psychological "tipping point" of crowd behavior during an impulsive trend. This script emphasizes the 1.618 extension as the primary target for a "Wave 3," which is academically cited as typically the longest and strongest wave in a 5-wave motive sequence.
2. Harmonic AB=CD Patterns:
The inclusion of the 1.0 extension validates the "Measured Move" concept. Statistically, markets often move in symmetrical legs where the secondary impulse (CD) equals the magnitude of the primary impulse (AB).
3. Volatility Normalization (ATR):
By utilizing the Average True Range (ATR) for pivot detection, the script adheres to statistical volatility normalization. This ensures that the structures identified are statistically significant relative to the asset's current volatility regime, rather than relying on arbitrary percentage moves which fail across different asset classes.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.






















