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
Indikatoren und Strategien
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.
Sai & Deb DMISai & Deb DMI with horizontal lines. Existing DMI lines are used and various levels can be drawn between 0 and 100 to see the trend reversals.
Wick Statistics (Intra-Day)Data box that shows smallest, largest, and average wick point size during specified time ranges.
Candle Type Analyzerthis indicator identifies the different types of candle which are divided into 4 four types
1.marubozu candle
2.normal candle
3.pinbar/doji candle
4.special marubozu candle
1.maru candle - having body >70% of total length
2.normal candle - having body >=30% and <=70% of total length
3.pinbar/doji candle - having body <30% of total length
4.special marubozu candle - a.green candle - closing within top 10% of total length
b.red candle - closing within bottom 10% of total length
total length of a candle = measured from high to low of the candle
you can give labels for each candle type on top of the candle
1.marubozu candle - M
2.normal candle - N
3.pinbar/doji candle - P
4.special marubozu candle - S
try making the colour of labels with one colour only for better and faster coordination with the mind
EMA Core Bounce FX (MTF safe Daily Logic)Daily chart core bounce strat
tested works well with the ! H version
CANDLE STRUCTURE FILTER PRO by HeruprastCandle Structure Filter
CANDLE STRUCTURE FILTER PRO is a price-action-based indicator that filters trading signals using candle body strength, wick ratio, and EMA trend alignment. It only generates non-repainting BUY/SELL signals on strong candles with valid structure, aligned with the selected trend EMA, and confirmed by an EMA Gap Filter to avoid sideways or choppy market conditions.
Designed for scalping to intraday trading, especially effective on volatile instruments like XAUUSD, with automatic calibration based on timeframe and instrument characteristics.
Liquidity Sweep Strategy (RR 1:2)This free indicator from its strategic department has a 60% profit target of 2% and a loss target of 1%.
Buy LineBuy Line based on volatility at highest close in period and an additional configurable multiplier on top
ZenAlgo - GridOverview and anchoring logic
This indicator constructs a price grid based on a dynamically or manually defined price swing. The entire calculation starts by defining two anchor points that represent a completed directional move. These anchors can be selected in two ways:
Manually, by specifying a start time and an end time, where the indicator uses the candle corresponding to those times and selects either wick highs or lows depending on direction.
Automatically, by detecting significant swing points derived from recent price extremes over a configurable historical window.
The chosen anchors form a reference segment between point A and point B. This segment defines both direction and magnitude of the move. All subsequent levels and zones are derived relative to this segment, ensuring the grid adapts to current market structure rather than using fixed price distances.
Difference from traditional grid and Fibonacci tools
Unlike fixed price grids or standard Fibonacci tools that require manual anchoring and remain static once drawn, this indicator continuously derives its grid from the most relevant completed price swing. Instead of treating levels as independent horizontal prices, all values are expressed as proportions of a single measured move, allowing the grid to automatically rescale and realign as market structure evolves.
Market structure detection and directional context
Before the grid itself is drawn, the script continuously evaluates price structure using swing detection over two different sensitivities. Larger swings establish the dominant structural direction, while smaller swings can optionally be shown for internal context.
Swing highs and swing lows are detected by comparing historical highs and lows over a rolling window.
When price crosses above or below the most recent structural level, the script classifies the event as either a continuation in the same direction or a change in direction.
This structural state determines whether the grid is treated as upward or downward and influences the visual orientation of labels and zones.
This step matters because retracement and extension levels only have meaning when referenced to a clearly defined directional move.
Primary range construction between anchors
Once the anchor points are established, the indicator measures the vertical price distance between them. This distance is treated as a normalized range rather than an absolute value. Every level drawn afterward is positioned as a proportional offset of this range.
If the second anchor is above the first, the grid is considered bullish.
If the second anchor is below the first, the grid is considered bearish.
Colors and label orientation adapt automatically to this direction.
By normalizing the range, the grid remains comparable across assets and timeframes.
Retracement and extension level placement
The indicator plots a predefined set of proportional levels between and beyond the anchor points. Each level represents a fraction or multiple of the original move.
Lower values correspond to deeper retracements toward the origin of the move.
Mid-range values represent partial pullbacks within the move.
Higher values extend beyond the move, projecting potential continuation zones.
Each level is drawn as a horizontal line extending into future bars, accompanied by a label. Labels can be shown either as descriptive names or as raw proportional values, depending on user preference.
Zone construction instead of single levels
Rather than relying only on precise price lines, the indicator groups selected proportions into zones. This reflects the observation that price interaction typically occurs across ranges rather than at exact prices.
A retracement zone highlights an area between two closely spaced proportional levels.
A projection zone marks a continuation region beyond the measured move.
These zones are drawn as shaded areas extending forward in time.
Visual reference points
The indicator explicitly marks the two anchor points on the chart.
Point A represents the origin of the measured move.
Point B represents the completion of that move.
This allows the user to visually verify which price swing the grid is derived from.
How to interpret the values
All plotted levels express proportional relationships to the measured move, not independent price predictions.
Lower proportional values indicate proximity to the start of the move.
Mid-range values represent partial retracements.
Higher values indicate projected continuation areas.
How to best use this indicator
This indicator serves as a structural reference tool rather than a signal generator.
Apply it after a clear directional swing has formed.
Use higher-timeframe context to validate anchor selection.
Combine the grid with price behavior and other contextual tools.
Limitations and disclaimers
This indicator is purely proportional and structure-based.
It does not incorporate volume, volatility regimes, or fundamental data.
Automatic anchoring may differ from subjective swing selection.
Levels and zones represent reference areas, not guaranteed reaction points.
The indicator describes price structure and proportional relationships only.
Entropy Divergence (No Repaint) [PhenLabs]📊 Entropy Divergence (No Repaint)
Version: PineScript™ v6
📌 Description
The Entropy Divergence Scalper (EDS) is a sophisticated trading indicator that applies information theory to market analysis. By calculating Shannon Entropy on price returns, it identifies periods when market behavior becomes more predictable and orderly—the ideal conditions for divergence-based trading.
Traditional divergence indicators generate signals regardless of market conditions, leading to many false signals during chaotic, high-entropy periods. EDS solves this by acting as an intelligent filter: it only triggers signals when entropy drops below your specified threshold, indicating that the market has entered a more structured, tradeable state.
This indicator is built with a strict non-repainting guarantee. All signals use barstate.isconfirmed and only appear after bar close, giving you reliable signals you can trust for live trading.
🚀 Points of Innovation
Shannon Entropy integration measures market randomness using information theory mathematics
Dual divergence engine detects both RSI and Volume divergences simultaneously
Entropy-filtered signals eliminate noise by only triggering in low-entropy (predictable) market conditions
100% non-repainting architecture ensures all signals are confirmed and historically accurate
Multi-layer confirmation combines entropy state, RSI divergence, and volume divergence for higher probability setups
Dynamic color visualization provides instant visual feedback on current market entropy state
🔧 Core Components
Shannon Entropy Calculator: Bins price returns into histograms and calculates entropy using H(X) = -Σ p(x) × log₂(p(x))
RSI Divergence Detector: Identifies when price makes lower lows while RSI makes higher lows (bullish) or price makes higher highs while RSI makes lower highs (bearish)
Volume Divergence Detector: Spots increasing volume interest at price lows (bullish) or decreasing conviction at price highs (bearish)
Pivot Detection System: Uses configurable lookback periods to identify and track price, RSI, and volume pivots
Signal Classification Engine: Labels signals as RSI, VOL, or RSI+VOL based on which divergences triggered
🔥 Key Features
Entropy Threshold Control: Set your preferred entropy level (default 2.5) to filter out signals during chaotic market periods
Configurable Smoothing: EMA smoothing on entropy values reduces noise while maintaining signal responsiveness
Flexible Pivot Detection: Adjust left/right lookback bars to tune sensitivity for different trading styles
Divergence Search Range: Control how far back the indicator looks for divergence patterns (20-200 bars)
Minimum Pivot Distance: Prevents false signals from pivots that are too close together
Complete Alert System: Four alert conditions for bullish signals, bearish signals, any signal, and low entropy zone entry
🎨 Visualization
Dynamic Entropy Line: Color gradient shifts from green (low entropy/tradeable) to orange (high entropy/chaotic)
Entropy Threshold Line: Dashed reference line shows your configured entropy threshold
Low Entropy Zone Fill: Background highlighting indicates when market is in tradeable low-entropy state
Scaled RSI Plot: RSI overlay scaled to fit the entropy pane for easy correlation analysis
Normalized Volume Bars: Volume displayed as columns normalized against 20-period average
Signal Labels: Clear LONG/SHORT labels with divergence type (RSI, VOL, or RSI+VOL)
Information Table: Real-time display of entropy value, state, RSI, and current signal status
📖 Usage Guidelines
Entropy Lookback Period — Default: 20, Range: 5-100 — Controls how many bars are used for entropy calculation; higher values provide smoother readings but slower response
Histogram Bins — Default: 10, Range: 5-50 — Number of bins for probability distribution; more bins provide finer granularity
Low Entropy Threshold — Default: 2.5, Range: 0.5-4.0 — Signals only trigger when entropy drops below this value; lower settings are more selective
Entropy Smoothing — Default: 3, Range: 1-10 — EMA smoothing applied to raw entropy values for noise reduction
RSI Length — Default: 14, Range: 5-50 — Standard RSI calculation period
Pivot Lookback Left — Default: 5, Range: 2-20 — Bars to the left for pivot detection
Pivot Lookback Right — Default: 2, Range: 1-10 — Bars to the right for pivot confirmation; lower values produce faster signals
Divergence Search Range — Default: 60, Range: 20-200 — Maximum bars to look back for divergence comparison
Min Bars Between Pivots — Default: 5, Range: 3-30 — Minimum distance between pivots for valid divergence detection
✅ Best Use Cases
Scalping during low-volatility consolidation periods when entropy drops and price becomes more predictable
Swing trade entry timing by waiting for divergence signals in low-entropy market conditions
Trend reversal identification when both RSI and Volume divergences align with low entropy readings
Multi-timeframe confirmation by checking entropy state on higher timeframes before taking signals
Filtering existing strategies by adding entropy as a confirmation layer to reduce false signals
⚠️ Limitations
Signals appear with a delay due to pivot confirmation requirements (pivotLookbackRight bars after pivot forms)
May generate fewer signals during strongly trending markets where entropy remains elevated
Entropy threshold requires optimization for different instruments and timeframes
Not designed for high-frequency trading due to bar-close confirmation requirement
Divergences can fail in extremely strong trends where momentum overwhelms the signal
💡 What Makes This Unique
First indicator to combine Shannon Entropy filtering with multi-factor divergence detection
Information theory approach provides mathematical foundation for identifying tradeable market states
Triple confirmation requirement (low entropy + divergence + bar close) significantly reduces false signals
Non-repainting guarantee makes it suitable for strategy backtesting and live trading
Open-source PineScript v6 code allows traders to understand and customize the methodology
🔬 How It Works
Step 1 — Entropy Calculation: The indicator calculates logarithmic returns, bins them into a histogram, and computes Shannon Entropy to measure market randomness
Step 2 — Entropy Filtering: When smoothed entropy drops below the threshold, the market is considered to be in a tradeable low-entropy state
Step 3 — Pivot Detection: The system continuously tracks price, RSI, and volume pivots using configurable lookback parameters
Step 4 — Divergence Analysis: When a new pivot is confirmed, the indicator compares it against previous pivots to detect bullish or bearish divergences
Step 5 — Signal Generation: A final signal only triggers when low entropy conditions coincide with a confirmed divergence pattern on a closed bar
💡 Note:
This indicator is designed for educational purposes and technical analysis. Always use proper risk management and never risk more than you can afford to lose. The non-repainting guarantee means signals will only appear after bar close—watch the indicator in real-time to verify this behavior. For optimal results, consider combining EDS signals with support/resistance levels and overall market context.
Double Bollinger Bands Strategy_investalotDual Bollinger Band Swing Trading System Indicator Setup
• Bollinger Band 1: Period 20, Deviation 2
• Bollinger Band 2: Period 20, Deviation 0.7
• Timeframe: Daily (Primary)
• Markets: NSE Equity – Liquid Large & Mid Caps
Market Conditions
• 20 SMA must slope upward for long trades • Price must hold above 200 DMA
• Avoid flat or sideways markets
Buy Setup – Trend Continuation
1. Strong impulse move into upper BB (20,2)
2. Pullback into zone between BB (20,0.7) and 20 SMA 3. Bullish candle confirmation inside value zone
Entry Rules
• Buy above bullish confirmation candle high
• Volume should be at least average or higher
Stop Loss Rules
• Initial SL below 20 SMA
• Aggressive SL below BB (20,0.7) lower
Targets & Exit
• Target 1: Upper BB (20,0.7)
• Target 2: Upper BB (20,2)
• Trail SL to 20 SMA once price enters momentum zone
Risk Management
• Risk per trade: 0.5% – 1% of capital
• Maximum 3 open swing trades at a time
Trade Avoidance Rules
• Avoid earnings weeks
• Avoid low volume stocks
• Avoid trades when price remains inside BB (20,0.7)






















