Gold Toolkit 22 [MatsukazeAlgo]🇬🇧 ENGLISH
A modular indicator that consolidates 22 Gold-specialized analysis tools into a single script. Each module can be toggled independently — enable one or two at a time for focused analysis. The shared infrastructure provides session awareness, Dollar Index correlation, and psychological price level detection across every module. Designed exclusively for XAUUSD on intraday timeframes.
Concepts
Modular Architecture -- Most indicators serve a single purpose: one trend filter, one oscillator, one pattern detector. For Gold traders who use multiple tools, this means loading 5–10 separate indicators, each consuming chart resources and requiring independent configuration. A modular architecture solves this by housing all tools within a single script, sharing a common infrastructure layer. Each module runs its own logic but inherits the same session detection, DXY feed, and psychological level engine. The result is consistent behavior across all tools without duplicate calculations.
Session-Dependent Behavior -- Gold does not trade the same way at all hours. The Asia session (19:00–03:00 ET) is characterized by tight ranges and stop runs that reverse at the London open. The London session (03:00–09:00 ET) produces directional breakouts driven by European institutional flow. The New York session (09:00–17:00 ET) carries the highest volume and tends to either continue the London move or reverse it sharply. An indicator that applies the same parameters across all three sessions is ignoring 60% of the context. Every module in this toolkit reads the current session and adjusts its signal thresholds accordingly. Asia signals require stronger confirmation. London signals favor trend continuation. NY signals weight volume more heavily.
Inverse Dollar Correlation -- Gold is priced in US Dollars. When the Dollar strengthens, Gold tends to fall. When the Dollar weakens, Gold tends to rise. This inverse relationship is not perfect on every bar, but over any meaningful sample it dominates. The toolkit reads TVC:DXY (US Dollar Index) daily data on every bar. Bull signals across all modules require a weak Dollar context (DXY close below open). Bear signals require a strong Dollar context. This single filter eliminates a substantial number of false signals that would otherwise fire against the macro trend.
Psychological Price Levels -- Gold reacts consistently at $50 and $100 round numbers. Institutional orders cluster at $4,500, $4,550, $4,600, and similar levels. When price approaches these levels, the toolkit tightens sensitivity and marks signals with a ★ indicator. A Stop Run Reversal scoring 85/100 at $4,550 is qualitatively different from the same score at $4,537 — the psychological level adds an independent layer of institutional confluence.
Modules
The 22 modules are organized into five categories. Each module is a complete analysis tool.
Trend Modules
01 ML Supertrend — A Supertrend variant with a session-learning engine. Tracks flip outcomes per session and adjusts the band multiplier over time. Sessions with low win rates get wider bands (fewer signals). Sessions with high win rates get tighter bands (more signals). Volume surge filter and RSI confirmation prevent signals in thin markets. The dashboard shows per-session win rates, current adapted multiplier, and learning state.
04 Parabolic SAR — Standard SAR calculation with two additions: age-based transparency fading and momentum scoring. Fresh SAR dots are fully opaque. As the trend ages, dots fade toward transparency, giving a visual read on trend maturity without cluttering the chart. The momentum score measures the distance between price and SAR relative to ATR. A high score means price is accelerating away from the SAR. A collapsing score warns of an impending flip. Multi-timeframe alignment check confirms whether the higher timeframe SAR agrees.
05 ACN Trend — An adaptive coral noise filter that outputs a smoothed trend line with risk zones above and below. The noise score quantifies how choppy the current market is. When noise exceeds the threshold, the background shades as a warning to avoid trading. The conviction meter is the inverse of noise — a high conviction reading means clean trend conditions. Bull/Bear signal counts per session track which sessions produce the most reliable signals for your timeframe.
09 Anchored Channels — A dual-layer channel system. Macro channels connect confirmed swing pivots and project forward with band widths derived from maximum deviation. Micro channels fit a short-term linear regression to the most recent bars. When price breaks the macro channel, it is classified as BRK (breakout). When price returns to the channel boundary, it is PB (pullback). When the micro channel aligns with the macro direction, it is CONT (continuation). The MTF screener checks two higher timeframes for directional agreement. A status badge labels the overall trend bias.
18 Asymmetric Trend — Uses different thresholds for entering and exiting a trend. The entry threshold is tight — price must move strongly to flip the trend. The exit threshold is wide — the trend persists through normal retracements. This asymmetry reduces whipsaws in ranging markets while catching genuine trend changes quickly. Gradient fill between the trend line and price shows acceleration visually. Reversal diamond markers appear at flip points with session tags and trend age.
Reversal Modules
02 Stop Run Reversal — Detects when price pierces a range boundary (liquidity grab) and reverses. Each event is scored 0–100 based on wick ratio, penetration depth, volume spike, DXY alignment, and session context. Zone boxes mark the reversal area with reference, invalidation, and target lines. A pending state tracker monitors setups that have not yet confirmed, preventing premature signals. Session and DXY tags on each label provide immediate context.
06 Arc Momentum — A non-linear RSI oscillator. Instead of plotting RSI as a flat line, the oscillator curves toward price in an arc. When the arc flips direction, a signal fires. Divergence detection compares RSI pivot extremes against price pivot extremes and flags when they disagree. The momentum zone classification (Overbought / Bull / Neutral / Bear / Oversold) shades the background for a quick visual read on the current state.
11 Harmonic Patterns — Scans for five harmonic patterns: Bat, Gartley, Butterfly, Crab, and Shark. Both bullish (XABCD with D at bottom) and bearish (XABCD with D at top) configurations are detected. Each pattern is scored based on session quality, DXY alignment, and proximity to psychological levels. Fibonacci projection levels are drawn at the PRZ (Potential Reversal Zone) showing 0.382, 0.618, 1.0, 1.272, and 1.618 targets. The tolerance parameter controls how strictly the Fibonacci ratios must match the textbook definitions.
16 RSI Swing Structure — Uses RSI overbought and oversold zones to define swing points. When RSI enters OB and price makes a high, that high is labeled. When RSI enters OS and price makes a low, that low is labeled. Each swing point is classified as HH (Higher High), HL (Higher Low), LH (Lower High), or LL (Lower Low). When the classification sequence breaks — for example, a HH followed by a LL — the indicator labels it as CHoCH (Change of Character). When the sequence continues — HH followed by another HH — it labels BOS (Break of Structure). Swing connecting lines visually link the pivots. RSI value appears on each label.
Structure Modules
03 EMA Inversion — Three EMAs (21, 55, 200) with ribbon fill. The indicator tracks Fair Value Gaps that form during trend moves. When an FVG is subsequently filled from the opposite direction (inverse FVG flip), a signal fires. Built-in SL/TP management uses the most recent swing high/low for stop placement and projects a 1:1 target. A cooldown timer prevents re-entry immediately after a stop-out. The trade state label shows whether the indicator considers the current position LONG, SHORT, or FLAT.
08 SwingRegress — Anchors linear regression channels to swing pivot confirmations. When a CHoCH occurs (price breaks the previous swing extreme), a new channel begins from the most recent opposite pivot. The channel slope and deviation are calculated from all bars within the segment. Band 1 and Band 2 at configurable standard deviations define the channel width. A linefill between the bands makes the channel body visible. Psychological price levels within the channel are drawn as dotted gold lines. A Bollinger/Keltner squeeze detector highlights when volatility compresses inside the channel — often a precursor to the next directional move.
10 S/R Zones — Builds support and resistance zones from volume-weighted pivot clustering. Nearby pivots are merged into zones. Each zone receives a strength score based on the number of touches, volume at touch, and recency. When price breaks through a zone, it is flagged. When price returns to a broken zone from the other side, it is flagged as a retest. Ghost zones keep broken levels visible with faded opacity. Star ratings provide a quick strength summary. An age-based decay ensures old, untested zones gradually disappear.
12 FVG Wave — Tracks Fair Value Gaps across the chart with session-colored rendering. Asia FVGs are rose, London FVGs are teal, NY FVGs are sky blue. Each FVG has a POC (midpoint) dotted line. When price touches the POC, a detection event fires. Age-based opacity fading dims old FVGs. Mitigation tracking removes FVGs that have been completely filled. Ghost mode optionally keeps mitigated FVGs visible in muted colors for reference.
17 OB Zone Study — Detects order blocks at displacement candles that follow swing pivots. Each OB is scored with a breakdown showing trend alignment, location quality, session, DXY confluence, and psychological level proximity. Mitigation tracking monitors whether price returns to the OB. Once mitigated, the OB is removed. Age-based opacity fading gradually dims unmitigated OBs that have been on the chart for a long time.
19 Vector SMC — Smart Money Concepts with a volume gate. FVGs and order blocks are only detected when the candle's volume exceeds the average by a configurable multiplier. This filters out structural patterns formed on low participation. OBs extend forward and are automatically invalidated when price closes through them. Sweep labels mark liquidity grabs at swing highs and lows where volume confirms institutional activity.
Session Modules
13 Session Range — Tracks the OHLC of Asia, London, and NY sessions in real time. A candle panel visualizes each session's range as a mini candlestick. 25% retracement lines for the London range identify the level where NY price action tends to react. H/M/L/O reference lines project key session levels forward. Regime classification analyzes the session structure pattern (e.g., London Partial Up, London Full Range). Asia sweep detection identifies whether the Asia high or low was taken during London. A stats table shows historical percentages for session behavior patterns.
15 Session Killzones — Draws boxes for Asia, London, NY AM, and NY PM killzone periods. When a killzone closes, its high and low are recorded as levels. These levels extend forward as dashed lines until price sweeps through them. Anticipation bars project the levels further for planning. When a sweep occurs, a detection label marks the bar. Session name labels identify each killzone box.
20 AlgoPath — Plots previous day high and low as horizontal lines. The equilibrium level (midpoint of PDH and PDL) is drawn as a dashed line. London session open and NY session open are drawn when each session begins. New day background shading marks the daily boundary. Whale candle detection flags abnormally large candles — those with body size exceeding a configurable ATR multiple — with session-colored labels showing the session name and exact time.
Volume and Correlation Modules
07 Minicharts — Displays Silver (XAG/USD), Dollar Index (DXY), and Gold Futures (GC1!) in a correlation panel. Each symbol shows EMA position (above/below). SMT (Smart Money Technique) divergence detection flags when Gold moves in the opposite direction to a correlated asset — a potential early warning of reversal.
14 Institutional Volume — Identifies accumulation and distribution phases using volume clustering analysis. When multiple high-volume candles with consistent directional bias appear within a lookback window, the indicator flags the zone. Climax volume detection identifies bars where volume × range reaches the highest level in the lookback period. Zone boxes mark the accumulation or distribution area on the chart.
21 Swing TPO — Builds Time Price Opportunity distributions anchored to swing points. The price range between swing pivots is divided into bins, and each TPO period assigns a letter to every visited bin. Gradient-colored boxes range from cool (low activity) to warm (high activity). The POC (Point of Control) line marks the highest-activity price. Psychological level detection flags when the POC lands near a $50/$100 round number.
22 VWAP — Dual-anchor Volume Weighted Average Price. The primary anchor resets on Session, Week, or Month boundaries. An optional second anchor provides a longer-term VWAP for confluence. Standard deviation bands at 1σ and 2σ show statistical extremes. Previous period VWAP, VAH (Value Area High), and VAL (Value Area Low) levels persist as reference lines with price labels. Band touch signals flag when price reaches the 2σ extreme. Slope direction indicates whether the VWAP is rising, falling, or flat.
How to Use
1. Open indicator settings. Under "Module Select," enable 1–2 modules.
2. Configure "Gold Settings" for session filtering, DXY, and psychological levels.
3. Apply to XAUUSD on your preferred intraday timeframe (5m–4h recommended).
4. Use the Style tab to show/hide individual signal shapes.
5. The module panel (top right) shows all 22 modules with the active one highlighted in gold.
Shared Infrastructure
Session Detection — Automatically identifies Asia (19:00–03:00 ET), London (03:00–09:00 ET), and New York (09:00–17:00 ET). Each module reads the current session for parameter adjustment and signal filtering.
DXY Feed — Pulls TVC:DXY daily open and close. Determines whether the Dollar is strengthening or weakening on the day. All modules use this for macro alignment.
ATR Normalization — All distance calculations (band widths, displacement thresholds, target projections) are normalized to the 14-period ATR. This ensures consistent behavior across timeframes and volatility regimes.
Psychological Level Engine — Configurable interval ($25, $50, or $100). Detects proximity to round numbers and flags signals near these levels with ★ markers. Multiple modules use this for confluence scoring.
Signal Bus — When any active module generates a Buy or Sell signal, it writes to a shared signal bus. The unified output shapes fire from this bus, providing a consistent visual regardless of which module produced the signal.
Module Panel — The top-right panel lists all 22 modules. The active module is highlighted in gold. Inactive modules are dimmed. Session, DXY, and daily range are displayed in the header and footer.
Input Reference
Module Select — 22 boolean toggles, one per module. Default: Module 01 ON, all others OFF.
Gold Settings — Session Filter (ON), Asia Signals (OFF), London Signals (ON), NY Signals (ON), Show DXY (ON), Psych $50/$100 (ON), Psych Interval (50), Show Panel (ON).
Each module has its own parameter group accessible when that module is enabled.
---
🇯🇵 日本語
22のゴールド専用分析モジュールを1つのインジケーターに統合したモジュラー型ツール。各モジュールは設定パネルから個別にON/OFF可能 — 1〜2個ずつ有効にして使用。共通インフラがセッション認識、ドルインデックス相関、心理的価格帯検出を全モジュールに提供。XAUUSD日中足専用設計。
コンセプト
モジュラーアーキテクチャ -- 多くのインジケーターは単一目的。複数ツールを使うゴールドトレーダーは5〜10個のインジを個別にロードする必要がある。モジュラーアーキテクチャはすべてのツールを単一スクリプトに収容し、共通インフラ層を共有することで解決。各モジュールは独自ロジックを実行しつつ、同一のセッション検出、DXYフィード、心理的価格帯エンジンを継承。
セッション依存型動作 -- ゴールドは時間帯によって異なる動きをする。アジア(19:00–03:00 ET)はタイトレンジとストップラン。ロンドン(03:00–09:00 ET)は欧州機関投資家フローによる方向性ブレイクアウト。ニューヨーク(09:00–17:00 ET)は最大ボリュームでロンドンの継続か急反転。全セッションに同じパラメータを適用するインジケーターは文脈の60%を無視している。本ツールキットの全モジュールは現在のセッションを読み取り、シグナル閾値を調整。
ドル逆相関 -- ゴールドはUSドル建て。ドル高→ゴールド下落、ドル安→ゴールド上昇の逆相関が支配的。TVC:DXY日足データを毎バー読み取り、Bullシグナルはドル安文脈、Bearシグナルはドル高文脈を要求。このフィルターだけでマクロトレンドに逆行する偽シグナルの大部分を排除。
心理的価格帯 -- ゴールドは$50/$100刻みのラウンドナンバーで一貫して反応。機関投資家の注文が$4,500、$4,550、$4,600等に集中。価格がこれらのレベルに接近すると感度を引き締め、★マーカーでシグナルを強調。
モジュール一覧
トレンド系 — 01 ML Supertrend:セッション学習エンジン搭載、勝率追跡・自動調整。04 Parabolic SAR:経過時間フェード、モメンタムスコア、MTFアライメント。05 ACN Trend:適応型コーラルノイズフィルター、ノイズスコア、コンビクションメーター。09 Anchored Channels:マクロ+マイクロ二層チャネル、BRK/PB/CONT分類、MTFスクリーナー。18 Asymmetric Trend:非対称閾値フィルター、グラデーション塗り、リバーサルダイヤ。
リバーサル系 — 02 Stop Run Reversal:流動性奪取検出、0–100スコアリング、ゾーンボックス。06 Arc Momentum:非線形アーク型RSI、ダイバージェンス検出、ゾーン背景表示。11 Harmonic Patterns:5種パターン(Bull+Bear)、フィボナッチ投影。16 RSI Swing Structure:HH/HL/LH/LL分類、CHoCH/BOS検出。
ストラクチャー系 — 03 EMA Inversion:3本EMAリボン+FVG追跡+iFVGフリップ。08 SwingRegress:ピボット固定LRC、CHoCH/BOS、スクイーズ検出。10 S/R Zones:出来高加重クラスタリング、強度スコア、リテスト追跡。12 FVG Wave:セッション色分けFVG、POC、ミティゲーション追跡。17 OB Zone Study:OB検出+スコア内訳+経過フェード。19 Vector SMC:出来高ゲート付きSMC。
セッション系 — 13 Session Range:Asia/London/NY OHLC、キャンドルパネル、25%ライン、レジーム分類。15 Session Killzones:キルゾーンボックス+未スイープレベル追跡。20 AlgoPath:前日高安、イクイリブリアム、ホエールキャンドル。
ボリューム・相関系 — 07 Minicharts:Silver/DXY/GC相関パネル、SMT検出。14 Institutional Volume:蓄積/分配検出、クライマックス出来高。21 Swing TPO:グラデーションTPO分布、POC。22 VWAP:デュアルアンカー、σバンド、前期間レベル。
使い方
1. 設定の「Module Select」で1〜2個を有効化。
2. 「Gold Settings」でセッションフィルター、DXY、心理的価格帯を設定。
3. XAUUSD日中足(5分〜4時間推奨)に適用。
4. 右上のモジュールパネルで全22モジュールの状態を確認。有効モジュールはゴールドで表示。
共通インフラ — セッション検出(Asia/London/NY自動識別)、DXYフィード($の強弱判定)、ATR正規化、心理的価格帯エンジン($25/$50/$100)、シグナルバス(統一Buy/Sell出力)、モジュールパネル(全22モジュール一覧表示)。 Indicator

Signal Forge [LuxAlgo]The Signal Forge indicator is a modular technical analysis engine that allows users to blend 11 distinct technical filters into a unified signal and backtest the results in real-time. This tool aims to simplify strategy development by providing a visual framework for testing indicator confluence and risk management settings without writing code.
🔶 USAGE
The script provides a flexible logic system for generating signals based on the alignment of multiple technical components. Users can toggle specific indicators on or off and choose between "strict" mode (requiring ALL active indicators to agree) or "any" mode (where ANY active indicator can trigger a signal).
Signals are displayed on the chart as glowing orbs connected to the price action. Each signal includes a real-time historical win rate label at the moment of entry, allowing for a visual audit of the strategy's performance over time.
🔹 Indicator Selection
The tool includes 11 harmonized indicators:
SMA Crossover
RSI Filter (Levels)
MACD Crossover
Supertrend
Stochastic (Trend-based)
Bollinger Bands (Basis Filter)
EMA Crossover
Awesome Oscillator
Parabolic SAR
CCI Filter
ADX/DI Filter
🔹 Risk Management
Users can enable ATR-based Take Profit, Stop Loss, and Trailing Stop levels. When active, these levels are plotted on the chart. The Trailing Stop feature includes a specialized gradient fill that highlights the "breathing room" between the price and the exit level.
🔶 DETAILS
🔹 Dashboards
The script features two distinct dashboards to provide a comprehensive overview of the strategy:
Indicator Dashboard: Shows the real-time bullish/bearish status of all 11 indicators, their individual "standalone" win rates visualized with histograms, and their current toggle status.
Performance Dashboard: Provides a high-level summary of the combined strategy performance, including Net Profit %, Win Rate, Profit Factor, and Total Trades.
🔹 Logic Harmonization
To ensure different indicator types work together effectively, mean-reversion tools like the Stochastic and Bollinger Bands have been reconfigured to act as trend-confirmation filters. For example, the Stochastic signal is bullish when the %K is in the upper half of its range (> 50) rather than looking for oversold extremes, ensuring it aligns with trend-following components like Moving Averages.
🔶 SETTINGS
🔹 Signal Logic
Require All Enabled Indicators to Align: When enabled, every checked indicator must have the same directional bias to generate a signal.
🔹 Risk Management (ATR)
ATR Length: The period used for volatility-based exit calculations.
Take Profit/Stop Loss/Trailing Stop: Toggles and multipliers for managing trade exits.
🔹 Visuals
Orb Distance (ATR): Controls the vertical offset of signal orbs from the price candle.
Orb Base Size: Adjusts the thickness and glow intensity of the signal markers.
🔹 Dashboards
Dashboards: Enable or disable the table overlays.
Position/Size: Options to move and scale the Indicator and Performance tables to fit different screen layouts.
Indicator

W.D. Gann Toolkit [UAlgo]W.D. Gann Toolkit is a multi tool market structure overlay built to project several classic Gann concepts directly from confirmed pivot points. Instead of focusing on only one angle or one timing idea, the script combines Gann Fan, Gann Box, Square of 9 levels, Master Time Factor markers, Gann retracements, and a live swing charting layer inside a single framework.
The indicator begins with confirmed pivot highs and pivot lows. Once a new pivot is detected, it becomes a structural anchor from which the selected Gann tools are drawn. This makes the toolkit adaptive to changing market structure rather than forcing the user to manually place every anchor point. The user can also decide how many historical pivots should remain active, which helps balance chart detail and readability.
One of the most important parts of any Gann based study is scale. A 1x1 angle only has meaning if the price per bar relationship is defined in a sensible way. For that reason, this script includes several scale methods. It can estimate scale from the broader chart range, from the most recent swing, from ATR, or from a fully manual input. This makes the toolkit flexible enough for different markets and chart styles while still keeping the geometry grounded in visible price behavior.
The Gann Fan module projects the classic angle family such as 1x8, 1x4, 1x3, 1x2, 1x1, 2x1, 3x1, 4x1, and 8x1. The Gann Box creates a ninety bar by scaled price box from the pivot. The Square of 9 module projects rotational price levels from the pivot using square root based calculations. The Master Time Factor module adds important future bar intervals from the pivot. The retracement module draws classic Gann proportional levels between two pivots. A simple Gann style swing chart is also included to visualize directional swing progression on the live chart.
In practical use, W.D. Gann Toolkit is useful for traders who want one structured environment for price, angle, time, and proportion analysis without manually recreating each Gann tool from scratch.
🔹 Features
🔸 Automatic Pivot Anchoring
All tools are drawn from confirmed pivot highs and pivot lows. This lets the toolkit respond to live market structure and keeps the drawings tied to meaningful turning points.
🔸 Multiple Scaling Methods
The script supports Auto Chart Range, Auto Swing, Auto ATR, and Manual scale modes. This is especially important for Gann work because angle interpretation depends on a stable price per bar relationship.
🔸 Gann Fan Projection
The indicator draws the classic Gann angle family from each selected pivot, including the key 1x1 line and the faster and slower angle groups around it.
🔸 Gann Box
A ninety bar box is projected from the pivot using the active scale. This gives the chart a combined time and price measurement zone.
🔸 Square of 9 Price Levels
The script projects Square of 9 levels such as 180°, 360°, 540°, and 720° from the pivot price using the square root transformation method.
🔸 Master Time Factor Markers
Vertical time markers are projected from each pivot at important intervals such as 30, 45, 90, and 180 bars.
🔸 Gann Retracements
When two pivots are available, the script draws classic Gann retracement levels such as 12.5%, 25%, 33.3%, 50%, 66.7%, 75%, and 87.5%.
🔸 Gann Swing Charting
A live swing line tracks directional shifts based on higher highs with higher lows or lower highs with lower lows, creating a simple structural swing map.
🔸 Historical Pivot Control
The user can choose how many recent pivots remain active for tool projection. This keeps the chart cleaner when needed.
🔸 Modern Color Theming
Different tool families use their own color groups, which makes it much easier to separate angles, price levels, time levels, retracements, and swing structure visually.
🔹 Calculations
1) Detecting Confirmed Pivot Highs and Lows
float ph = ta.pivothigh(high, i_piv_len, i_piv_len)
float pl = ta.pivotlow(low, i_piv_len, i_piv_len)
bool is_new_pivot = false
Pivot new_pivot = na
if not na(ph)
new_pivot := Pivot.new(time , bar_index , ph, true)
is_new_pivot := true
else if not na(pl)
new_pivot := Pivot.new(time , bar_index , pl, false)
is_new_pivot := true
This is the structural entry point of the whole toolkit.
The script waits for a confirmed pivot high or pivot low using the chosen pivot length on both sides. Once a pivot is confirmed, it stores the pivot time, bar index, price, and whether it is a high or low.
That pivot then becomes the anchor for all Gann tools. So the entire toolkit is driven by real confirmed turning points rather than by arbitrary chart positions.
2) Storing Recent Active Pivots
if is_new_pivot
active_pivots.unshift(new_pivot)
if active_pivots.size() > i_history + 1
active_pivots.pop()
Whenever a new pivot appears, it is pushed to the front of the active pivot list.
The script keeps only the most recent pivots needed for the selected historical depth. This prevents excessive clutter and ensures that the drawings stay focused on the most relevant recent anchors.
So the toolkit is always working from a controlled pivot memory rather than an unlimited list of old pivots.
3) ATR Based Scaling
float tr_atr = ta.atr(i_atr_len)
float scale_atr = nz(tr_atr, ta.tr) * i_atr_mult
This block creates the ATR based price per bar scale.
The script first calculates ATR over the selected length. That ATR value is then multiplied by the chosen multiplier to produce the scale.
This approach adapts the Gann geometry to current volatility. When ATR expands, the scale expands as well. When ATR contracts, the scale becomes tighter.
So ATR scaling is useful for traders who want the toolkit to stay responsive to the current volatility regime.
4) Chart Range Based Scaling
float price_range = ta.highest(high, i_range_len) - ta.lowest(low, i_range_len)
float scale_chart = price_range / i_range_len
This is the chart range scaling method.
The script measures the total price range across the selected number of bars, then divides that range by the same bar count. The result is an average price per bar scale.
This is often the safest automatic scaling choice because it ties the Gann geometry to the visible chart environment and helps avoid extreme or unrealistic slopes.
So chart range scaling is a balanced default when the user wants a stable visual relationship between price and time.
5) Swing Based Scaling
float scale_swing = na
if active_pivots.size() >= 2
Pivot p_curr = active_pivots.get(0)
Pivot p_prev = active_pivots.get(1)
int bars_diff = math.abs(p_curr.bar_index - p_prev.bar_index)
if bars_diff > 0
scale_swing := math.abs(p_curr.price - p_prev.price) / bars_diff
This method derives scale from the most recent completed pivot to pivot move.
The script measures the price distance between the two latest pivots and divides that by the bar distance between them. The result is a recent swing price per bar ratio.
This makes the Gann angles more sensitive to the latest market structure than the broader chart range method.
So swing scaling is useful when the user wants the geometry to follow the most recent active move more closely.
6) Choosing the Final Active Scale
float current_scale = switch i_scale_method
"Auto (Chart Range)" => scale_chart
"Auto (Swing)" => nz(scale_swing, scale_chart)
"Auto (ATR)" => scale_atr
"Manual" => i_manual_scale
=> i_manual_scale
This is the scale selection engine.
Depending on the user setting, the script picks:
chart range scale,
swing scale,
ATR scale,
or manual scale.
If swing scale is selected but there are not yet enough pivots to calculate it, the script falls back to chart range scale.
This is one of the most important parts of the indicator because all fan angles, box projections, and price projections depend on this final scale value.
7) Gann Fan Slope Logic
array names = array.from("1x8", "1x4", "1x3", "1x2", "1x1", "2x1", "3x1", "4x1", "8x1")
array dy_arr = array.from(1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 3.0, 4.0, 8.0)
array dx_arr = array.from(8.0, 4.0, 3.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0)
float slope = dir * scale * (dy_arr.get(i) / dx_arr.get(i))
This is the mathematical foundation of the Gann Fan.
Each fan line is defined by a price over time ratio. For example:
1x1 means one unit of price per one unit of time,
2x1 means two units of price per one unit of time,
1x2 means one unit of price per two units of time.
The script multiplies the selected scale by the angle ratio to produce the actual slope of each line. Direction is positive for low based pivots and negative for high based pivots.
So the fan is not drawn with arbitrary visual angles. It is drawn from a real price per bar relationship.
8) Limiting Fan Projection Distance Safely
float max_y_dist = recent_range <= 0 ? p.price * 0.05 : recent_range * 1.0
float target_y_delta = slope * 100
int safe_bars = 100
if math.abs(target_y_delta) > max_y_dist
safe_bars := int(math.max(1, math.round(max_y_dist / math.abs(slope))))
This safety logic prevents the fan lines from projecting to unrealistic extremes.
The script estimates a maximum reasonable vertical travel based on the recent chart range. If a projected line would travel too far over a standard forward distance, the script shortens the number of bars used for the initial anchor segment.
This helps keep fast angles readable and prevents extreme slopes from distorting the chart.
So the fan remains visually controlled even when scale is large or price is volatile.
9) Drawing the Fan Lines
float future_price = p.price + (slope * safe_bars)
int future_bar = p.bar_index + safe_bars
line ln = line.new(p.bar_index, p.price, future_bar, future_price, color=line_col, style=line.style_solid, extend=extend.right)
Once the slope is known, the script calculates the projected price after a safe number of bars and draws the line from the pivot to that future point. The line is then extended to the right.
This means every fan ray begins from the pivot and continues forward as an active angular support or resistance guide.
10) Gann Box Calculation
float dir = p.is_high ? -1.0 : 1.0
int span = 90
float target_price = p.price + (dir * scale * span)
int target_bar = p.bar_index + span
box bx = box.new(p.bar_index, p.price, target_bar, target_price, border_color=c_box, bgcolor=color.new(c_box, 90), border_style=line.style_dashed)
The Gann Box uses a fixed time width of ninety bars.
The price height of the box is determined by:
scale × ninety
If the anchor is a high pivot, the box projects downward.
If the anchor is a low pivot, the box projects upward.
So the box combines price and time into a balanced projection area using the active scale.
11) Square of 9 Price Projection
float sqrt_p = math.sqrt(p.price)
array offsets = array.from(0.5, 1.0, 1.5, 2.0)
array names = array.from("Sq9 180°", "Sq9 360°", "Sq9 540°", "Sq9 720°")
float new_price = math.pow(sqrt_p + (dir * offsets.get(i)), 2)
This is the core Square of 9 calculation.
The script takes the square root of the pivot price, adds or subtracts a rotational offset, then squares the result again to get the projected price level.
The offsets correspond to:
180°,
360°,
540°,
and 720° style steps.
If the pivot is a high, the offsets project downward.
If the pivot is a low, they project upward.
So the Square of 9 module transforms the pivot price through the classic square root rotation concept associated with Gann price geometry.
12) Drawing Master Time Factor Levels
array intervals = array.from(30, 45, 90, 180)
for i = 0 to intervals.size() - 1
int b_idx = p.bar_index + intervals.get(i)
if b_idx <= bar_index + 100
line ln = line.new(b_idx, p.price, b_idx, p.price * (p.is_high ? 0.95 : 1.05), color=c_mtf, style=line.style_solid, extend=extend.both)
The Master Time Factor module projects important future time counts from the pivot.
The selected intervals are:
30 bars,
45 bars,
90 bars,
and 180 bars.
Each one is drawn as a vertical time marker. These are not price targets by themselves. They are timing references that may align with future reversals, reactions, or acceleration points.
So this module adds the time side of Gann analysis to the toolkit.
13) Gann Retracement Levels
float high_p = math.max(p1.price, p2.price)
float low_p = math.min(p1.price, p2.price)
float rng = high_p - low_p
array percents = array.from(0.125, 0.25, 0.333, 0.50, 0.667, 0.75, 0.875)
array p_names = array.from("12.5%", "25%", "33.3%", "50% (Key)", "66.7%", "75%", "87.5%")
float lvl_price = low_p + (rng * percents.get(i))
This is the retracement engine.
Given two pivots, the script measures the price range between them and then calculates key Gann proportional retracement levels inside that range.
The plotted levels are:
12.5%,
25%,
33.3%,
50%,
66.7%,
75%,
and 87.5%.
The 50% level is emphasized more strongly because it is one of the most widely watched Gann reference levels.
So this module gives the toolkit a proportional price structure layer between two pivot anchors.
14) Gann Swing Chart Logic
bool up_swing = high > high and low > low
bool dn_swing = high < high and low < low
This is the directional trigger for the swing chart.
A bullish swing condition requires both the high and the low of the current bar to be above the previous bar.
A bearish swing condition requires both the high and the low of the current bar to be below the previous bar.
So the swing chart changes direction only when the bar structure shows a clear full shift in both extremes.
15) Starting a New Swing Segment
if up_swing and swing_dir != 1
swing_dir := 1
int start_x = na(last_swing_line) ? bar_index : line.get_x2(last_swing_line)
float start_y = na(last_swing_line) ? low : line.get_y2(last_swing_line)
last_swing_line := line.new(start_x, start_y, bar_index, high, color=c_swg, width=2)
else if dn_swing and swing_dir != -1
swing_dir := -1
int start_x = na(last_swing_line) ? bar_index : line.get_x2(last_swing_line)
float start_y = na(last_swing_line) ? high : line.get_y2(last_swing_line)
last_swing_line := line.new(start_x, start_y, bar_index, low, color=c_swg, width=2)
When the swing direction changes, the script starts a new swing segment.
If the direction turns bullish, it starts a line toward the current high.
If the direction turns bearish, it starts a line toward the current low.
The starting point is either the previous bar’s extreme or the end of the last swing line if one already exists.
So the swing chart forms a connected directional structure rather than isolated markers.
16) Extending the Active Swing Segment
else
if swing_dir == 1 and not na(last_swing_line) and high > line.get_y2(last_swing_line)
line.set_xy2(last_swing_line, bar_index, high)
else if swing_dir == -1 and not na(last_swing_line) and low < line.get_y2(last_swing_line)
line.set_xy2(last_swing_line, bar_index, low)
If the current swing direction stays the same, the script extends the active swing line when a new extreme is made.
For bullish swings, it updates the end of the line to a new higher high.
For bearish swings, it updates the end of the line to a new lower low.
So the swing chart behaves like a live directional staircase that keeps extending until a new opposite swing begins.
17) Using Historical Pivots to Draw Multiple Tool Sets
for i = 0 to math.min(active_pivots.size() - 1, i_history - 1)
Pivot p = active_pivots.get(i)
GannElement f_el = fan_elements.get(i)
GannElement b_el = box_elements.get(i)
GannElement s_el = sq9_elements.get(i)
GannElement m_el = mtf_elements.get(i)
f_el.drawFan(p, current_scale, global_recent_range)
b_el.drawBox(p, current_scale)
s_el.drawSq9(p, current_scale)
m_el.drawMTF(p)
This loop is what makes the toolkit multi layer.
For each recent pivot within the selected history depth, the script redraws the fan, box, Square of 9 levels, and Master Time Factor markers.
So the chart can display tools from several recent pivots at once instead of only the latest anchor.
18) Drawing Retracements From Consecutive Pivots
if active_pivots.size() > i + 1
GannElement r_el = ret_elements.get(i)
Pivot p2 = active_pivots.get(i + 1)
r_el.drawRetracements(p, p2)
Retracements need two pivots, not one.
This block takes each pivot and the next older pivot, then draws the Gann retracement levels between them. That means retracement structure is always built from a real completed price range between two confirmed turning points.
So the retracement module is linked directly to pivot progression rather than floating independently on the chart. Indicator

Support & Resistance Pro Toolkit [LuxAlgo]The Support & Resistance Pro Toolkit indicator is the ultimate professional structural analysis engine for PulseWire, meticulously engineered to provide the definitive solution for modern structural analysis by integrating four sophisticated detection algorithms—Pivots, Donchian Alternating, CSID, and ZigZag—marked by directional triangle signals to identify high-conviction swing points.
This powerhouse tool allows traders to seamlessly toggle between precise level plotting and dynamic ATR-based zones, both featuring a revolutionary security breakout buffer and 25-bar future projections, alongside advanced filtering based on traded volume, liquidity sweeps (marked by prominent dot signals), re-test frequency, and survival duration.
🔶 USAGE
The toolkit identifies significant price structures using one of four sophisticated detection methods. Once a level is identified, it can be displayed as a precise line or a dynamic zone with depth determined by the Average True Range (ATR).
Traders can use this toolkit to filter out market noise by setting minimum requirements for volume, re-tests, or liquidity sweeps. This ensures that only the most significant institutional structures are displayed on the chart.
🔹 Advanced Detection Engines
The foundation of any structural analysis is detection. This toolkit offers four unique methodologies to suit any trading style:
Pivots : The industry-standard approach using left/right strength lookbacks to find peak highs and valley lows.
Donchian (Alternating) : A high-performance state-machine detector. It identifies alternating swings without fixed lag, confirming a previous extreme precisely when price shifts to a new directional state (e.g., a new Higher High confirms the previous Lower Low).
CSID : A momentum-based detector that identifies structural extremes based on a consecutive sequence of N bullish or bearish candles, highlighting areas of strong trend initiation.
ZigZag : A volatility-adjusted method that identifies swings based on a percentage deviation from price, filtering out minor fluctuations and focusing on significant market moves.
🔹 Zone Sizing & The Security Buffer
Structural areas are rarely single prices. This toolkit treats S&R as dynamic regions of interest:
Zone Depth (ATR Mult) : Zones are calculated using the Average True Range (ATR) to ensure they adapt to current market volatility. This sets the thickness from the swing point inwards towards price.
Breakout Buffer (ATR Mult) : A revolutionary "Security Buffer" that extends the zone outwards on the breakout side. This requires price to clear an additional layer of volatility before a breakout is confirmed, significantly reducing "fakeouts" and noise-triggered mitigations.
🔹 Overlap & Structural Hygiene
Keep your charts actionable and clean with institutional-grade overlap management:
Merge Overlapping : When two zones interact, the older zone expands its boundaries to encompass the newer one, creating a "Super Zone" that respects the combined historical context.
Hide Oldest First : Prioritizes the most recent market context by hiding older levels that are overlapped by newer ones.
Hide Youngest First : Respects established, historical structures by ignoring newer, smaller levels that form within the range of existing unmitigated zones.
🔹 Institutional Filtering
Eliminate minor "noise" levels by showing only structures that meet high-conviction criteria:
Price Entries (E) : Shows zones only after they have been re-tested a specific number of times.
Strength (S) : Tracks the number of additional swing points that occur within the zone range during its lifetime.
Sweeps (SW) : Filters for zones that have successfully trapped liquidity through wick-only violations.
Traded Volume (V) : Sums every tick of volume that occurs while price is within the zone, identifying areas of massive institutional participation.
Duration (D) : Requires a level to survive for a minimum number of bars before it is considered a valid structure.
🔶 DETAILS
🔹 Symbols & Analytic Feedback
▲/▼ Triangles : Pinpoint markers at the exact bar of every detected swing high and low.
● Large Dots : Marked at the exact location of "Sweeps"—where price wicks past a boundary but closes back inside, signaling a potential reversal or liquidity grab.
Future Projections : Active, unmitigated levels extend 25 bars beyond the current price action for immediate visual guidance.
Dynamic Shorthand Labels : Positioned at the end of the extension and centered on the zone average, providing a real-time data readout:
E:Entries | S:Strength | SW:Sweeps | V:Volume | D:Duration
🔹 The Performance Dashboard
A 4-column command center providing a side-by-side comparison of structural performance across Support, Resistance, and Totals:
Active / Total : Real-time count of currently valid versus historically detected structures.
Mitigation % : The structural "break rate" of your current settings.
Avg Duration : The average number of bars a level survives before being violated—critical for timing trades.
Avg Volume : The typical "weight" of institutional activity accumulated within zones before they break.
Total Sweeps : A macro-view of liquidity hunting activity on both sides of the market.
🔶 SETTINGS
🔹 Detection Settings
Detection Method : Choose between Pivots, Donchian, CSID, or ZigZag logic.
Swing Sensitivity : Adjusts the lookback or deviation required to confirm a new swing point.
🔹 Zone & Level Sizing
Display Style : Toggles between horizontal levels and ATR-based zones.
ATR Period : Period used for the volatility calculations.
Zone Depth (ATR Mult) : Sets the vertical thickness of the S&R zones.
Breakout Buffer (ATR Mult) : Adds a buffer to the breakout side to filter out false breaks.
🔹 Filtering & Visibility
Overlap Handling : Manages how overlapping zones are displayed (Merge, Hide Oldest, or Hide Youngest).
Max Active (Unmitigated) : Limits the number of unmitigated levels shown on the chart.
Show Broken S&R : Toggles the visibility of levels that have already been mitigated.
Extend Active S&R : Extends active levels into the future for better visibility.
🔹 Minimum Requirements
Min Price Entries : Minimum re-tests required for a level to be visible.
Min Overall Strength : Minimum strength score required based on internal swing points.
Min Sweeps : Minimum liquidity sweeps required.
Min Traded Volume : Minimum accumulated volume required within the zone.
Min Duration (Bars) : Minimum age of the level in bars before display.
Indicator

ICT Concepts [UAlgo]ICT Concepts is a broad market structure toolkit that combines several core ICT style elements inside a single script. Instead of focusing on only one concept, the indicator brings together order blocks, market structure shifts, SMT divergence, fair value gaps, balanced price ranges, consequent encroachment, liquidity sweeps, Fibonacci levels, and killzones in one integrated overlay.
The script is designed for traders who want a consolidated structure map rather than a collection of separate indicators. It tracks swing highs and lows, labels structural breaks as BOS or MSS, detects order blocks from a strict candle pattern, identifies imbalances through fair value gap logic, monitors liquidity sweeps around recent pivot levels, and draws structure anchored Fibonacci levels from the latest confirmed break. It can also compare the active chart against a second symbol for SMT divergence and even render a small comparison panel directly on the chart.
One of the strongest qualities of this script is that each module is state aware. Order blocks extend until mitigation. Fair value gaps extend until price trades through them. Structure anchors update after new breaks. Killzones persist historically for a defined number of sessions. SMT events are stored, labeled, and optionally projected inside a mini comparison panel. This makes the script much more than a simple set of static drawings. It behaves like a live structural framework that evolves with price.
From a workflow point of view, the indicator is especially useful for traders who want to read context in layers. Structure tells whether price is breaking with trend or shifting against it. Order blocks and imbalances show where inefficiency or sponsorship may remain. Liquidity sweeps show where recent resting liquidity has likely been taken. Fibonacci levels frame premium, discount, equilibrium, and OTE areas relative to the latest structural move. Killzones add time based session context. Together, these components create a broad market map for discretionary analysis.
🔹 Features
🔸 Single Candle Order Block Detection
The script detects bullish and bearish order blocks using a strict three candle displacement pattern. When a valid setup appears, the order block is stored, extended forward, and removed only after mitigation. Optional mean threshold lines can also be shown inside each block.
🔸 Multi Timeframe Order Blocks
Order block detection can run on a selected timeframe through request.security . This allows higher timeframe order blocks to be projected onto the current execution chart.
🔸 Market Structure Mapping
The indicator tracks pivot highs and lows and labels confirmed structural breaks as BOS or MSS. A continuation break is labeled BOS, while a directional reversal break is labeled MSS. This gives the chart a clear structure narrative.
🔸 SMT Divergence Detection
The script can compare the active chart against a second symbol and detect SMT divergence using pivot highs and lows from both instruments. Divergences are labeled directly on the main chart and can also be reflected inside a mini comparison panel.
🔸 Fair Value Gaps
Bullish and bearish fair value gaps are detected through a classic three candle gap condition. These imbalances are stored, extended, and removed once mitigated.
🔸 Balanced Price Range Support
When a new fair value gap overlaps with an opposite side historical fair value gap, the overlapping section becomes a balanced price range. This gives the script the ability to detect conflict zones formed by opposing inefficiencies.
🔸 Consequent Encroachment Mode
The imbalance module can also be displayed in consequent encroachment mode, where the midpoint of the gap is shown along with the premium or discount half of the imbalance.
🔸 Liquidity Sweep Detection
The indicator monitors recent pivot highs and lows and marks when price trades beyond one of those levels but closes back through it. This makes it easy to spot local buy side and sell side sweeps.
🔸 Structure Anchored Fibonacci Levels
After a confirmed structural break, the script anchors Fibonacci levels between the break extreme and the opposing structural point. Equilibrium, OTE, and optional extra levels are then projected forward.
🔸 Killzone Rendering
The script can mark Asian, London, New York AM, and New York PM session windows using session boxes and optional session range lines. Historical session boxes are kept for a user defined number of prior occurrences.
🔸 Active Object Management
Each subsystem uses its own storage and cleanup logic. Order blocks, imbalances, SMT markers, liquidity sweep boxes, Fibonacci objects, and killzones are all managed so the chart remains usable over time.
🔸 Alerts
Alert conditions are included for bullish and bearish order block detection.
🔹 Calculations
1) Order Block Pattern Logic
detectLogic() =>
bool isBull = open > close and close > open and close > open and low < low and close > high
bool isBear = open < close and close < open and close < open and high > high and close < low
[isBull, high , low , time , isBear, high , low , time ]
This is the core order block detector.
A bullish order block requires:
a bearish candle at 2 ,
a bullish candle at 1 ,
a bullish current candle,
a sweep below the low of candle 2 by candle 1 ,
and a close above the high of candle 1 .
A bearish order block uses the exact inverse.
The returned zone bounds come from candle 1 , which becomes the order block candle. That is why the function returns high , low , and time .
So the script is not marking every displacement candle. It is looking for a very specific three candle formation.
2) Multi Timeframe Order Block Projection
= request.security(syminfo.tickerid, i_tf, detectLogic())
This line runs the order block detection logic on the selected timeframe.
If the user chooses a higher timeframe, the resulting order block values are projected onto the current chart. This is extremely useful for mapping higher timeframe sponsorship zones onto a lower timeframe execution environment.
So the detection can stay structurally higher while the display remains on the user’s active chart.
3) Preventing Overlapping Order Blocks
method hasOverlap(array OBs, float top, float bottom) =>
bool overlap = false
if OBs.size() > 0
for i = 0 to OBs.size() - 1
OB item = OBs.get(i)
if (top < item.top and top > item.bottom) or (bottom > item.bottom and bottom < item.top)
overlap := true
break
overlap
Before a new order block is added, the script checks whether it overlaps an existing stored block of the same side.
If the proposed top or bottom falls inside an existing block, the new one is ignored. This reduces clutter and helps avoid stacking multiple highly similar zones in the same area.
So the order block engine is selective not only in detection, but also in object creation.
4) Order Block Mitigation and Active Limit Handling
method isMitigated(OB this, float currentClose) => this.isBull ? (currentClose < this.bottom) : (currentClose > this.top)
if drawCount < OB_ACTIVE_LIMIT
if na(item.id)
item.draw(i_bullColor, "Bull OB", i_showMidLine)
item.extend()
drawCount += 1
else
item.remove()
An order block remains valid until price closes beyond its invalidation boundary.
For bullish order blocks, mitigation happens when close moves below the block bottom.
For bearish order blocks, mitigation happens when close moves above the block top.
The script also limits how many active blocks are actually drawn. Older stored blocks may remain in memory, but only the most recent valid ones stay visible. This keeps the chart clean while preserving logic continuity.
5) Market Structure Pivot Tracking
float ph = ta.pivothigh(i_structLen, i_structLen)
float pl = ta.pivotlow(i_structLen, i_structLen)
if not na(ph)
prevHigh := lastHigh
prevHighIndex := lastHighIndex
lastHigh := ph
lastHighIndex := bar_index
if not na(pl)
prevLow := lastLow
prevLowIndex := lastLowIndex
lastLow := pl
lastLowIndex := bar_index
This is the base structure engine.
The script identifies confirmed pivot highs and lows using the selected pivot length. When a new pivot is confirmed, the prior stored high or low becomes prevHigh or prevLow , and the newest one becomes lastHigh or lastLow .
This means the indicator always keeps a rolling memory of the latest structural extremes, which later become the reference levels for BOS, MSS, liquidity sweeps, and Fibonacci anchoring.
6) BOS and MSS Logic
bool brokenHigh = ta.crossover(close, lastHigh)
bool brokenLow = ta.crossunder(close, lastLow)
if brokenHigh and not na(lastHigh) and not lastHighBroken
if not trendInitialized or trendIsBullish
drawStructure(lastHighIndex, lastHigh, bar_index, lastHigh, "BOS", i_structBull, "solid")
else
drawStructure(lastHighIndex, lastHigh, bar_index, lastHigh, "MSS", i_structBull, "dashed")
if brokenLow and not na(lastLow) and not lastLowBroken
if not trendInitialized or not trendIsBullish
drawStructure(lastLowIndex, lastLow, bar_index, lastLow, "BOS", i_structBear, "solid")
else
drawStructure(lastLowIndex, lastLow, bar_index, lastLow, "MSS", i_structBear, "dashed")
This is how the script classifies structure.
If close breaks above the last confirmed high, price has broken bullish structure.
If close breaks below the last confirmed low, price has broken bearish structure.
The label depends on prior trend state.
If the break happens in the same directional regime, it is labeled BOS.
If the break happens against the prior regime, it is labeled MSS.
So BOS means continuation of prevailing structure, while MSS means a shift in directional character.
7) SMT Divergence Detection
float smtPhA = i_smtOn ? ta.pivothigh(high, i_smtLen, i_smtLen) : na
float smtPlA = i_smtOn ? ta.pivotlow(low, i_smtLen, i_smtLen) : na
float smtPhB = i_smtOn ? request.security(i_smtSymbol, timeframe.period, ta.pivothigh(high, i_smtLen, i_smtLen)) : na
float smtPlB = i_smtOn ? request.security(i_smtSymbol, timeframe.period, ta.pivotlow(low, i_smtLen, i_smtLen)) : na
This block builds pivot data for both the main symbol and the comparison symbol.
The idea of SMT is relative disagreement. If one market makes a stronger high while the other fails to confirm it, or one market makes a lower low while the other refuses to follow, divergence may be present.
The script therefore tracks pivot highs and lows separately for both instruments.
8) Bearish and Bullish SMT Conditions
bool bearishSmt = not na(smtAHighPrev) and not na(smtBHighPrev) and (smtAHighLast > smtAHighPrev) and (smtBHighLast <= smtBHighPrev)
bool bullishSmt = not na(smtALowPrev) and not na(smtBLowPrev) and (smtALowLast < smtALowPrev) and (smtBLowLast >= smtBLowPrev)
These are the actual divergence tests.
Bearish SMT occurs when the active chart makes a higher high while the comparison symbol fails to do so.
Bullish SMT occurs when the active chart makes a lower low while the comparison symbol fails to confirm that weakness.
So the script is looking for asymmetry between related instruments, which is one of the classic uses of SMT analysis.
9) Mini Panel Rendering for SMT
= request.security(i_smtSymbol, timeframe.period, )
drawMiniCandle(startX + (lookback - 1 - i), o, h, l, c, smtMin, smtRange, baseY, targetHeight, i_smtBull, i_smtBear, isBear, isBull)
The mini panel is built by requesting OHLC data for the comparison symbol, then compressing it into a custom candle panel drawn on the right side of the chart.
Each mini candle is scaled into panel coordinates using the comparison symbol’s own high and low range. SMT event bars are then marked inside that mini chart.
So the panel is not decorative only. It provides a quick structural view of the comparison symbol directly beside the main chart.
10) Fair Value Gap Detection
bool fvgBullDetected = low > high
bool fvgBearDetected = high < low
These are the fair value gap rules.
A bullish fair value gap exists when the current low is above the high from two bars ago.
A bearish fair value gap exists when the current high is below the low from two bars ago.
This is the classic three candle inefficiency model. The gap zone is then stored as an FVG object and extended forward until mitigation.
11) Balanced Price Range Logic
bool hasOverlap = fTop > existing.bottom and fBot < existing.top
if hasOverlap
float bprTop = math.min(fTop, existing.top)
float bprBot = math.max(fBot, existing.bottom)
When a newly detected fair value gap overlaps an opposite side historical fair value gap, the overlapping area becomes a balanced price range.
This is important because BPR is not detected as an isolated standalone pattern. It is formed from the intersection of opposing inefficiencies. The script extracts only the common overlapping region and stores it as a new BPR object.
So BPR here is derived from actual imbalance conflict.
12) Consequent Encroachment Logic
float ceLevel = (this.top + this.bottom) / 2
float boxTop = this.isBull ? ceLevel : this.top
float boxBot = this.isBull ? this.bottom : ceLevel
Consequent encroachment is the midpoint of the fair value gap.
The script calculates the midpoint and, when CE mode is enabled, draws both a dashed midpoint line and a half gap box. For bullish gaps it emphasizes the lower half up to midpoint. For bearish gaps it emphasizes the upper half down to midpoint.
So CE mode gives the user a more precise internal level inside the wider imbalance.
13) Fair Value Gap Mitigation
method isMitigated(FVG this, float currentHigh, float currentLow) => this.isBull ? (currentLow < this.bottom) : (currentHigh > this.top)
A bullish fair value gap is mitigated when price trades below its bottom.
A bearish fair value gap is mitigated when price trades above its top.
Once mitigation happens, the object is removed. This keeps the imbalance display focused on still relevant inefficiencies.
14) Liquidity Sweep Detection
float liqPh = ta.pivothigh(LIQ_PIVOT_LEN, 1)
float liqPl = ta.pivotlow(LIQ_PIVOT_LEN, 1)
bool sweepBull = i_showLiq and not na(liqLastLow) and not liqLastLowSwept and low < liqLastLow and close > liqLastLow
bool sweepBear = i_showLiq and not na(liqLastHigh) and not liqLastHighSwept and high > liqLastHigh and close < liqLastHigh
This module watches recent pivot highs and lows for sweep behavior.
A bullish liquidity sweep occurs when price trades below the most recent sell side liquidity level but closes back above it.
A bearish liquidity sweep occurs when price trades above the most recent buy side liquidity level but closes back below it.
This is a clean wick through and reclaim style sweep model.
15) Liquidity Sweep Box Construction
if sweepBull
line bullSweepLine = line.new(liqLastLowIndex, liqLastLow, bar_index, liqLastLow, color = i_liqSellsideCol, style = line.style_solid)
box bullSweepBox = liqNewSweepBox(liqLastLow, low, i_liqSellsideCol)
if sweepBear
line bearSweepLine = line.new(liqLastHighIndex, liqLastHigh, bar_index, liqLastHigh, color = i_liqBuysideCol, style = line.style_solid)
box bearSweepBox = liqNewSweepBox(high, liqLastHigh, i_liqBuysideCol)
When a sweep occurs, the script draws two things:
a line showing the swept liquidity level,
and a box covering the swept excursion beyond that level.
This makes the sweep visually clear by showing both the reference price and the actual penetration area.
16) Fibonacci Anchoring From Latest Structure Break
bool fibCanDraw = i_showFib and lastStructBreakDir != 0 and not na(lastStructBreakIndex) and not na(lastStructBreakExtreme) and not na(lastStructOppPrice) and not na(lastStructOppIndex) and lastStructOppIndex != 0
The Fibonacci engine only draws when a valid structural break context exists.
The anchor requires:
a known break direction,
the latest break index,
the break extreme,
the opposing structural price,
and the opposing structural index.
So Fibonacci is not anchored arbitrarily. It is tied directly to the latest confirmed structural move.
17) Fibonacci Level Calculation
float a0 = lastStructBreakExtreme
float a1 = lastStructOppPrice
float r = a1 - a0
float p0 = a0 + r * 0.0
float p1 = a0 + r * 1.0
float pEq = a0 + r * i_fibEqLevel
float pOteLow = a0 + r * i_fibOteLow
float pOteMid = a0 + r * i_fibOteMid
float pOteHigh = a0 + r * i_fibOteHigh
This is the actual Fibonacci math.
The script defines the range between the break extreme and the opposing structural point, then calculates all Fibonacci levels as proportions of that range.
That includes:
the zero level,
the one level,
equilibrium,
the OTE low,
the OTE midpoint,
and the OTE high.
Optional extra levels can also be added in the same way.
So the Fibonacci framework always adapts to the latest structural swing rather than staying fixed to older price action.
18) Killzone Session Detection
string kzTz = "UTC-5"
kzInSession(string sess) =>
not na(time(timeframe.period, sess, kzTz))
bool inAsian = kzInSession("2000-0000")
bool inLondon = kzInSession("0200-0500")
bool inNY = kzInSession("0830-1100")
bool inLondonC = kzInSession("1330-1600")
Killzones are detected through session time windows defined in UTC 5.
Each session is converted into a boolean state that says whether the current bar falls inside that time window. This becomes the input for the killzone renderer.
So session marking is time based rather than manually positioned.
19) Killzone Box and Range Update Logic
if isActive
if not wasActive or na(sBox)
sBox := box.new(left = time, top = high, right = time, bottom = low, xloc = xloc.bar_time, bgcolor = baseCol, border_color = color(na), border_width = 0, text = boxTxt, text_color = tC, text_size = size.tiny, text_halign = text.align_left, text_valign = text.align_top)
float prevTop = box.get_top(sBox)
float prevBot = box.get_bottom(sBox)
float newTop = math.max(prevTop, high)
float newBot = math.min(prevBot, low)
box.set_top(sBox, newTop)
box.set_bottom(sBox, newBot)
box.set_right(sBox, time)
When a killzone begins, the script creates a new box using the current bar’s range. As the session continues, it keeps updating the top and bottom to reflect the highest high and lowest low made during that session.
So each killzone box becomes both a time marker and a session range marker. Indicator

TICK Arbitrage Toolkit [LuxAlgo]The TICK Arbitrage Toolkit is a specialized institutional internal analysis tool designed to track market breadth and identify high probability reversal zones through TICK and TICKQ index monitoring. It provides real time visualization of market sentiment and internal extremes to assist traders in index scalping and mean reversion strategies.
🔶 USAGE
The indicator identifies three distinct extension levels to signal when market internals are reaching extreme overbought or oversold conditions. Traders use these extensions to anticipate potential price exhausts or trend reversals in major indices like the S&P 500 or Nasdaq 100.
The toolkit maps the NYSE TICK or NASDAQ TICKQ values directly onto the price chart by colorizing bars and providing visual markers. A gradient system transitions bar colors based on the intensity of the TICK value, allowing for a clear interpretation of internal momentum without needing a separate pane.
🔹 Extension Levels
The script utilizes three configurable extension levels (defaulting to 800, 1000, and 1200) to categorize the strength of the internal move.
Extension 1: Displays a single marker and begins tracking for new session highs or lows.
Extension 2: Displays two vertical markers to indicate increasing internal pressure.
Extension 3: Displays three vertical markers and reaches maximum color opacity, signaling an extreme arbitrage opportunity.
🔹 Session Tracking
The toolkit automatically tracks the session high and low for the selected TICK source. When the market reaches a New High of Day (NHOD) or New Low of Day (NLOD) in the internals, a professional label is printed to highlight the breakout.
🔶 DETAILS
The toolkit includes a Refresh Frequency setting that allows the script to process data at a higher resolution than the chart timeframe. By selecting a sub minute frequency such as 1S or 5S, the indicator can react to internal spikes that occur within a single chart bar.
The Include High/Low Extremes feature ensures that brief intrabar spikes are captured. Rather than only looking at the close of the TICK bar, the script evaluates the high and low to find the maximum magnitude, providing a more accurate representation of true market stress.
🔶 SETTINGS
🔹 Settings
TICK Source: Select between NYSE TICK for S&P 500 analysis or NASDAQ TICKQ for Nasdaq 100 analysis.
Refresh Frequency: Determines how often the internal data is sampled. Lower values provide more granular intrabar detail.
Include High/Low Extremes: When enabled, the script uses the absolute highest or lowest value within the sampling period to capture spikes.
Extension 1, 2, 3: Numeric thresholds for the three levels of arbitrage intensity.
🔹 Style
Positive TICK Color: The color used for positive internal readings (typically associated with overbought/reversal zones).
Negative TICK Color: The color used for negative internal readings (typically associated with oversold/reversal zones).
Marker Style: Choose between Circles, Triangles, or None for the extension level markers.
🔹 Dashboard
Dashboard: Toggles the visibility of the on screen data table.
Position: Moves the dashboard to different corners of the chart.
Size: Adjusts the scale of the dashboard text and cells.
Indicator

Indicator

Indicator

Indicator

eBacktesting: MultieBacktesting: Multi is an all-in-one chart toolkit built for structured day-trading study: multi-timeframe levels, “clean” movement zones, session context, bias, candle normalization, gaps, and a powerful alert system — all from one indicator.
What it can show on your chart
1) Multi-timeframe Support/Resistance (S/R) markup
- Detects and plots S/R levels from up to 8 configurable timeframes (mix HTF + LTF).
- Optional labeling styles: Simple, Type (S/R), or Directional.
- Optional price labels next to levels.
- Levels cleanup (decongestion): hides clustered levels to keep the chart readable
- Grouping: can group timeframes that share the same level into a single line.
- Level invalidation: levels can disappear after X passthroughs (with a “getting weaker” dashed style when close to invalidation).
2) Psychological levels (round numbers)
- Automatically draws round-number lines at a practical interval (with optional manual interval control).
- Has smart defaults for common markets (e.g., indices, BTC, metals).
3) Levels heatmap
- Shows level density as shaded “pressure areas”: areas where an agglomeration of S/R levels are present
- Can be simple or persisted (so you can study where price repeatedly reacts)
4) Repeated levels highlight
- Highlights “same area again” levels using a tolerance setting.
- Can require same direction (support with support / resistance with resistance) or allow any direction.
5) LTAs (Low Traffic Areas)
- Marks “air pockets” between levels where price can travel fast.
- Can be built from:
- S/R spacing (between detected levels), or
- Candle sequences (clean directional runs).
- Optional filters:
- By how “untouched” the boundary levels are (passthrough filter)
- By number of candles
- By size (points)
6) Clean zones (candle-based)
- Detects strong same-direction runs and boxes them as “clean zones” for study and backtesting practice.
7) Session Bias
- Computes a bias score from selected timeframes and shows it as a %.
- Can be weighted, inverted weight, or not weighted across timeframes (e.g. HTF candles having more weight towards bias calculation).
- Optional color coded “bias candles” overlay + option to dim weak candles so the signal is clearer.
- Alert when bias flips bullish/bearish/neutral.
8) Candles tools
- Smooth candles: removes candle gaps by drawing candles with open = previous close (useful for price action analysis).
- Ghost current candle: de-emphasizes the still-forming candle until it’s near completion (useful for not going in FOMO).
- Highlight no-wick candles: helps spot strong displacement / clean opens/closes.
- Snap candles: rounds candles to a chosen interval (ATR % or fixed), for cleaner structure reading.
- Optional candle stats: ATR & Average candle size
- Candle score: rates the last candle’s strength (body/wicks/size + context), useful for quick quality checks.
- Gaps: highlights unfilled gaps and optionally removes them once filled.
9) Sessions
- Up to 4 customizable sessions, each with its own color and optional background highlight.
- Option to hide candles outside session hours (great for focused session study).
10) Notifications
- Before session start alerts (X minutes early).
- Before session end alerts (X minutes early).
- Closing beyond detected S/R levels
- Closing beyond custom prices: type your prices (one per line)
- Proximity allowance + “advance notice” option for getting notified 30s/1m/5m before the candle closes based on your preferences
- Timer alerts (“check chart every X minutes”) with a custom message template.
eBacktesting integration (the important part)
This indicator fully integrates with the eBacktesting extension to automatically detect “important moments” during backtesting, so it can auto-pause, tag, and allow you to practice them step-by-step.
- When bias changed
- When a candle closed beyond an automatically detected S/R level
- When a candle closed beyond your custom price
- When new LTAs & clean zones are detected or invalidated
These indicator is built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice. Indicator

BE-Indicator Aggregator toolkit█ Overview:
BE-Indicator Aggregator toolkit is a toolkit which is built for those we rely on taking multi-confirmation from different indicators available with the traders. This Toolkit aid's traders in understanding their custom logic for their trade setups and provides the summarized results on how it performed over the past.
█ How It Works:
Load the external indicator plots in the indicator input setting
Provide your custom logic for the trade setup
Set your expected SL & TP values
█ Legends, Definitions & Logic Building Rules:
Building the logic for your trade setup plays a pivotal role in the toolkit, it shall be broken into parts and toolkit aims to understand each of the logical parts of your setup and interpret the outcome as trade accuracy.
Toolkit broadly aims to understand 4 types of inputs in "Condition Builder"
Comments : Line which starts with single quotation ( ' ) shall be ignored by toolkit while understanding the logic.
Note: Blank line space or less than 3 characters are treated equally to comments.
Long Condition: Line which starts with " L- " shall be considered for identifying Long setups.
Short Condition: Line which starts with " S- " shall be considered for identifying Short setups.
Variables: Line which starts with " VAR- " shall be considered as variables. Variables can be one such criteria for Long or short condition.
Building Rules: Define all variables first then specify the condition. The usual declare and assign concept of programming. :p)
Criteria Rules: Criteria are individual logic for your one parent condition. multiple criteria can be present in one condition. Each parameter should be delimited with ' | ' key and each criteria should be delimited with ' , ' (Comma with a space - IMPORTANT!!!)
█ Sample Codes for Conditional Builder:
For Trading Long when Open = Low
For Trading Short when Open = High with a Red candle
'Long Setup <---- Comment
L-O|E|L
' E <- in the above line refers to Equals ' = '
'Short Setup
S-AND:O|E|H, O|G|C
' 2 Criteria for used building one condition. Since, both have to satisfied used "AND:" logic.
Understanding of Operator Legends:
"E" => Refers to Equals
"NE" => Refers to Not Equals
"NEOR" => Logical value is Either Comparing value 1 or Comparing value 2
"NEAND" => Logical value is Comparing value 1 And Comparing value 2
"G" => Logical value Greater than Comparing value 1
"GE" => Logical value Greater than and equal to Comparing value 1
"L" => Logical value Lesser than Comparing value 1
"LE" => Logical value Lesser than and equal to Comparing value 1
"B" => Logical value is Between Comparing value 1 & Comparing value 2
"BE" => Logical value is Between or Equal to Comparing value 1 & Comparing value 2
"OSE" => Logical value is Outside of Comparing value 1 & Comparing value 2
"OSI" => Logical value is Outside or Equal to Comparing value 1 & Comparing value 2
"ERR" => Logical value is 'na'
"NERR" => Logical value is not 'na'
"CO" => Logical value Crossed Over Comparing value 1
"CU" => Logical value Crossed Under Comparing value 1
Understanding of Condition Legends:
AND: -> All criteria's to be satisfied for the condition to be True.
NAND: -> Output of AND condition shall be Inversed for the condition to be True.
OR: -> One of criteria to be satisfied for the condition to be True.
NOR: -> Output of OR condition shall be Inversed for the condition to be True.
ATLEAST:X: -> At-least X no of criteria to be satisfied for the condition to be True.
Note: "X" can be any number
NATLEAST:X: -> Output of ATLEAST condition shall be Inversed for the condition to be True
WASTRUE:X: -> Single criteria WAS TRUE within X bar in past for the condition to be True.
Note: "X" can be any number.
ISTRUE:X: -> Single criteria is TRUE since X bar in past for the condition to be True.
Note: "X" can be any number.
Understanding of Variable Legends:
While Condition Supports 8 Types, Variable supports only 6 Types listed below
AND: -> All criteria's to be satisfied for the Variable to be True.
NAND: -> Output of AND condition shall be Inversed for the Variable to be True.
OR: -> One of criteria to be satisfied for the Variable to be True.
NOR: -> Output of OR condition shall be Inversed for the Variable to be True.
ATLEAST:X: -> At-least X no of criteria to be satisfied for the Variable to be True.
Note: "X" can be any number
NATLEAST:X: -> Output of ATLEAST condition shall be Inversed for the Variable to be True
█ Sample Outputs with Logics:
1. RSI Indicator + Technical Indicator: StopLoss: 2.25 against Reward ratio of 1.75 (3.94 value)
Plots Used in Indicator Settings:
Source 1:- RSI
Source 2:- RSI Based MA
Source 3:- Strong Buy
Source 4:- Strong Sell
Logic Used:
For Long Setup : RSI Should be above RSI Based MA, RSI has been Rising when compared to 3 candles ago, Technical Indicator signaled for a Strong Buy on the current candle, however in last 6 candles Technical indicator signaled for Strong Sell.
Similarly Inverse for Short Setup.
L-AND:ES1|GE|ES2, ES1|G|ES1
L-ES3|E|1
L-OR:ES4 |E|1, ES4 |E|1, ES4 |E|1, ES4 |E|1, ES4 |E|1, ES4 |E|1
S-AND:ES1|LE|ES2, ES1|L|ES1
S-ES4|E|1
S-OR:ES3 |E|1, ES3 |E|1, ES3 |E|1, ES3 |E|1, ES3 |E|1, ES3 |E|1
'Note: Last OR condition can also be written by using WASTRUE definition like below
'L-WASTRUE:6:ES4|E|1
'S-WASTRUE:6:ES3|E|1
Output:
2. Volumatic Support / Resistance Levels :
Plots Used in Indicator Settings:
Source 1:- Resistance
Source 2:- Support
Logic Used:
For Long Setup : Long Trade on Liquidity Support.
For Short Setup : Short Trade on Liquidity Resistance.
'Variable Named "ChkLowTradingAbvSupport" is declared to check if last 3 candles is trading above support line of liquidity.
VAR-ChkLowTradingAbvSupport:AND:L|G|ES2, L |G|ES2, L |G|ES2
'Variable Named "ChkCurBarClsdAbv4thBarHigh" is declared to check if current bar closed above the high of previous candle where the Liquidity support is taken (4th Bar).
VAR-ChkCurBarClsdAbv4thBarHigh:OR:C|GE|H , L|G|H
'Combining Condition and Variable to Initiate Long Trade Logic
L-L |LE|ES2
L-AND:ChkLowTradingAbvSupport, ChkCurBarClsdAbv4thBarHigh
VAR-ChkHghTradingBlwRes:AND:H|L|ES1, H |L|ES1, H |L|ES1
VAR-ChkCurBarClsdBlw4thBarLow:OR:C|LE|L , H|L|L
S-H |GE|ES1
S-AND:ChkHghTradingBlwRes, ChkCurBarClsdBlw4thBarLow
Output 1: Day Trading Version
Output 2: Scalper Version
Output 3: Position Version
Indicator

Trending Market Toolkit [LuxAlgo]The Trending Market Toolkit focuses exclusively on trending market structures and high-confluence, high-risk-to-reward entry models. It is designed to complement discretionary trading by offering different entry strategies based on market structure.
🔶 USAGE
In the chart above we can see how the tool detects several reversals, draws the broken trendlines, the reversal areas from which the tool starts looking for a trigger, and when it finally happens, a potential trade with risk and reward areas and the risk/reward ratio.
🔹 Detection Mode
Traders can choose between three different modes: trend only, reversal only, or both.
If both are active, reversals have priority over trends, so the tool will not detect a trend if a reversal is active.
In the chart above we can see all three modes.
🔹 Detection on Higher Timeframes
Traders can choose to identify structures on the chart timeframe or on a higher timeframe.
In the chart above, we have the SP500 futures on the 5m timeframe with different settings: chart timeframe, 30m, and 1H.
🔹 Risk And Targets
Depending on whether the high-risk/reward parameter is enabled, traders can choose between three different targets and two different stops.
The chart above shows how different choices affect the risk/reward ratio for the same potential trade on the Gold Futures 2m chart.
🔶 SETTINGS
Show: Traders can choose between Trends, Reversals or Both.
🔹 Structures
Swing Length: Number of candles to confirm a swing high or swing low. A higher number detects larger swings.
Custom Timeframe: Traders can make use of the current chart timeframe, or choose a custom timeframe.
Reversal Area Threshold: A higher number increases the reversal area.
🔹 Trades
Trade Trigger Length: Number of candles to confirm an internal high or internal low. A lower number detects smaller swings. It must be the same size or smaller than the swing length.
Target: Traders can choose between the default target (0) or two extended targets (0.27 or 0.618).
Risk to Reward Threshold: Set the minimum risk-to-reward ratio to detect trades. Use the 0 value to detect all trades.
High Risk to Reward: Enable/Disable the high risk to reward mode.
Indicator

lib_kernelLibrary "lib_kernel"
Library "lib_kernel"
This is a tool / library for developers, that contains several common and adapted kernel functions as well as a kernel regression function and enum to easily select and embed a list into the settings dialog.
How to Choose and Modify Kernels in Practice
Compact Support Kernels (e.g., Epanechnikov, Triangular): Use for localized smoothing and emphasizing nearby data.
Oscillatory Kernels (e.g., Wave, Cosine): Ideal for detecting periodic patterns or mean-reverting behavior.
Smooth Tapering Kernels (e.g., Gaussian, Logistic): Use for smoothing long-term trends or identifying global price behavior.
kernel_Epanechnikov(u)
Parameters:
u (float)
kernel_Epanechnikov_alt(u, sensitivity)
Parameters:
u (float)
sensitivity (float)
kernel_Triangular(u)
Parameters:
u (float)
kernel_Triangular_alt(u, sensitivity)
Parameters:
u (float)
sensitivity (float)
kernel_Rectangular(u)
Parameters:
u (float)
kernel_Uniform(u)
Parameters:
u (float)
kernel_Uniform_alt(u, sensitivity)
Parameters:
u (float)
sensitivity (float)
kernel_Logistic(u)
Parameters:
u (float)
kernel_Logistic_alt(u)
Parameters:
u (float)
kernel_Logistic_alt2(u, sigmoid_steepness)
Parameters:
u (float)
sigmoid_steepness (float)
kernel_Gaussian(u)
Parameters:
u (float)
kernel_Gaussian_alt(u, sensitivity)
Parameters:
u (float)
sensitivity (float)
kernel_Silverman(u)
Parameters:
u (float)
kernel_Quartic(u)
Parameters:
u (float)
kernel_Quartic_alt(u, sensitivity)
Parameters:
u (float)
sensitivity (float)
kernel_Biweight(u)
Parameters:
u (float)
kernel_Triweight(u)
Parameters:
u (float)
kernel_Sinc(u)
Parameters:
u (float)
kernel_Wave(u)
Parameters:
u (float)
kernel_Wave_alt(u)
Parameters:
u (float)
kernel_Cosine(u)
Parameters:
u (float)
kernel_Cosine_alt(u, sensitivity)
Parameters:
u (float)
sensitivity (float)
kernel(u, select, alt_modificator)
wrapper for all standard kernel functions, see enum Kernel comments and function descriptions for usage szenarios and parameters
Parameters:
u (float)
select (series Kernel)
alt_modificator (float)
kernel_regression(src, bandwidth, kernel, exponential_distance, alt_modificator)
wrapper for kernel regression with all standard kernel functions, see enum Kernel comments for usage szenarios. performance optimized version using fixed bandwidth and target
Parameters:
src (float) : input data series
bandwidth (simple int) : sample window of nearest neighbours for the kernel to process
kernel (simple Kernel) : type of Kernel to use for processing, see Kernel enum or respective functions for more details
exponential_distance (simple bool) : if true this puts more emphasis on local / more recent values
alt_modificator (float) : see kernel functions for parameter descriptions. Mostly used to pronounce emphasis on local values or introduce a decay/dampening to the kernel output Library

lib_smcLibrary "lib_smc"
This is an adaptation of LuxAlgo's Smart Money Concepts indicator with numerous changes. Main changes include integration of object based plotting, plenty of performance improvements, live tracking of Order Blocks, integration of volume profiles to refine Order Blocks, and many more.
This is a library for developers, if you want this converted into a working strategy, let me know.
buffer(item, len, force_rotate)
Parameters:
item (float)
len (int)
force_rotate (bool)
buffer(item, len, force_rotate)
Parameters:
item (int)
len (int)
force_rotate (bool)
buffer(item, len, force_rotate)
Parameters:
item (Profile type from robbatt/lib_profile/32)
len (int)
force_rotate (bool)
swings(len)
INTERNAL: detect swing points (HH and LL) in given range
Parameters:
len (simple int) : range to check for new swing points
Returns: values are the price level where and if a new HH or LL was detected, else na
method init(this)
Namespace types: OrderBlockConfig
Parameters:
this (OrderBlockConfig)
method delete(this)
Namespace types: OrderBlock
Parameters:
this (OrderBlock)
method clear_broken(this, broken_buffer)
INTERNAL: delete internal order blocks box coordinates if top/bottom is broken
Namespace types: map
Parameters:
this (map)
broken_buffer (map)
Returns: any_bull_ob_broken, any_bear_ob_broken, broken signals are true if an according order block was broken/mitigated, broken contains the broken block(s)
create_ob(id, mode, start_t, start_i, top, end_t, end_i, bottom, break_price, early_confirmation_price, config, init_plot, force_overlay)
INTERNAL: set internal order block coordinates
Parameters:
id (int)
mode (int) : 1: bullish, -1 bearish block
start_t (int)
start_i (int)
top (float)
end_t (int)
end_i (int)
bottom (float)
break_price (float)
early_confirmation_price (float)
config (OrderBlockConfig)
init_plot (bool)
force_overlay (bool)
Returns: signals are true if an according order block was broken/mitigated
method align_to_profile(block, align_edge, align_break_price)
Namespace types: OrderBlock
Parameters:
block (OrderBlock)
align_edge (bool)
align_break_price (bool)
method create_profile(block, opens, tops, bottoms, closes, values, resolution, vah_pc, val_pc, args, init_calculated, init_plot, force_overlay)
Namespace types: OrderBlock
Parameters:
block (OrderBlock)
opens (array)
tops (array)
bottoms (array)
closes (array)
values (array)
resolution (int)
vah_pc (float)
val_pc (float)
args (ProfileArgs type from robbatt/lib_profile/32)
init_calculated (bool)
init_plot (bool)
force_overlay (bool)
method create_profile(block, resolution, vah_pc, val_pc, args, init_calculated, init_plot, force_overlay)
Namespace types: OrderBlock
Parameters:
block (OrderBlock)
resolution (int)
vah_pc (float)
val_pc (float)
args (ProfileArgs type from robbatt/lib_profile/32)
init_calculated (bool)
init_plot (bool)
force_overlay (bool)
track_obs(swing_len, hh, ll, top, btm, bull_bos_alert, bull_choch_alert, bear_bos_alert, bear_choch_alert, min_block_size, max_block_size, config_bull, config_bear, init_plot, force_overlay, enabled, extend_blocks, clear_broken_buffer_before, align_edge_to_value_area, align_break_price_to_poc, profile_args_bull, profile_args_bear, use_soft_confirm, soft_confirm_offset, use_retracements_with_FVG_out)
Parameters:
swing_len (int)
hh (float)
ll (float)
top (float)
btm (float)
bull_bos_alert (bool)
bull_choch_alert (bool)
bear_bos_alert (bool)
bear_choch_alert (bool)
min_block_size (float)
max_block_size (float)
config_bull (OrderBlockConfig)
config_bear (OrderBlockConfig)
init_plot (bool)
force_overlay (bool)
enabled (bool)
extend_blocks (simple bool)
clear_broken_buffer_before (simple bool)
align_edge_to_value_area (simple bool)
align_break_price_to_poc (simple bool)
profile_args_bull (ProfileArgs type from robbatt/lib_profile/32)
profile_args_bear (ProfileArgs type from robbatt/lib_profile/32)
use_soft_confirm (simple bool)
soft_confirm_offset (float)
use_retracements_with_FVG_out (simple bool)
method draw(this, config, extend_only)
Namespace types: OrderBlock
Parameters:
this (OrderBlock)
config (OrderBlockConfig)
extend_only (bool)
method draw(blocks, config)
INTERNAL: plot order blocks
Namespace types: array
Parameters:
blocks (array)
config (OrderBlockConfig)
method draw(blocks, config)
INTERNAL: plot order blocks
Namespace types: map
Parameters:
blocks (map)
config (OrderBlockConfig)
method cleanup(this, ob_bull, ob_bear)
removes all Profiles that are older than the latest OrderBlock from this profile buffer
Namespace types: array
Parameters:
this (array type from robbatt/lib_profile/32)
ob_bull (OrderBlock)
ob_bear (OrderBlock)
_plot_swing_points(mode, x, y, show_swing_points, linecolor_swings, keep_history, show_latest_swings_levels, trail_x, trail_y, trend)
INTERNAL: plot swing points
Parameters:
mode (int) : 1: bullish, -1 bearish block
x (int) : x-coordingate of swing point to plot (bar_index)
y (float) : y-coordingate of swing point to plot (price)
show_swing_points (bool) : switch to enable/disable plotting of swing point labels
linecolor_swings (color) : color for swing point labels and lates level lines
keep_history (bool) : weater to remove older swing point labels and only keep the most recent
show_latest_swings_levels (bool)
trail_x (int) : x-coordinate for latest swing point (bar_index)
trail_y (float) : y-coordinate for latest swing point (price)
trend (int) : the current trend 1: bullish, -1: bearish, to determine Strong/Weak Low/Highs
_pivot_lvl(mode, trend, hhll_x, hhll, super_hhll, filter_insignificant_internal_breaks)
INTERNAL: detect whether a structural level has been broken and if it was in trend direction (BoS) or against trend direction (ChoCh), also track the latest high and low swing points
Parameters:
mode (simple int) : detect 1: bullish, -1 bearish pivot points
trend (int) : current trend direction
hhll_x (int) : x-coordinate of newly detected hh/ll (bar_index)
hhll (float) : y-coordinate of newly detected hh/ll (price)
super_hhll (float) : level/y-coordinate of superior hhll (if this is an internal structure pivot level)
filter_insignificant_internal_breaks (bool) : if true pivot points / internal structure will be ignored where the wick in trend direction is longer than the opposite (likely to push further in direction of main trend)
Returns: coordinates of internal structure that has been broken (x,y): start of structure, (trail_x, trail_y): tracking hh/ll after structure break, (bos_alert, choch_alert): signal whether a structural level has been broken
_plot_structure(x, y, is_bos, is_choch, line_color, line_style, label_style, label_size, keep_history)
INTERNAL: plot structural breaks (BoS/ChoCh)
Parameters:
x (int) : x-coordinate of newly broken structure (bar_index)
y (float) : y-coordinate of newly broken structure (price)
is_bos (bool) : whether this structural break was in trend direction
is_choch (bool) : whether this structural break was against trend direction
line_color (color) : color for the line connecting the structural level and the breaking candle
line_style (string) : style (line.style_dashed/solid) for the line connecting the structural level and the breaking candle
label_style (string) : style (label.style_label_down/up) for the label above/below the line connecting the structural level and the breaking candle
label_size (string) : size (size.small/tiny) for the label above/below the line connecting the structural level and the breaking candle
keep_history (bool) : weater to remove older swing point labels and only keep the most recent
structure_values(length, super_hh, super_ll, filter_insignificant_internal_breaks)
detect (and plot) structural breaks and the resulting new trend
Parameters:
length (simple int) : lookback period for swing point detection
super_hh (float) : level/y-coordinate of superior hh (for internal structure detection)
super_ll (float) : level/y-coordinate of superior ll (for internal structure detection)
filter_insignificant_internal_breaks (bool) : if true pivot points / internal structure will be ignored where the wick in trend direction is longer than the opposite (likely to push further in direction of main trend)
Returns: trend: direction 1:bullish -1:bearish, (bull_bos_alert, bull_choch_alert, top_x, top_y, trail_up_x, trail_up): whether and which level broke in a bullish direction, trailing high, (bbear_bos_alert, bear_choch_alert, tm_x, btm_y, trail_dn_x, trail_dn): same in bearish direction
structure_plot(trend, bull_bos_alert, bull_choch_alert, top_x, top_y, trail_up_x, trail_up, hh, bear_bos_alert, bear_choch_alert, btm_x, btm_y, trail_dn_x, trail_dn, ll, color_bull, color_bear, show_swing_points, show_latest_swings_levels, show_bos, show_choch, line_style, label_size, keep_history)
detect (and plot) structural breaks and the resulting new trend
Parameters:
trend (int) : crrent trend 1: bullish, -1: bearish
bull_bos_alert (bool) : if there was a bullish bos alert -> plot it
bull_choch_alert (bool) : if there was a bullish choch alert -> plot it
top_x (int) : latest shwing high x
top_y (float) : latest swing high y
trail_up_x (int) : trailing high x
trail_up (float) : trailing high y
hh (float) : if there was a higher high
bear_bos_alert (bool) : if there was a bearish bos alert -> plot it
bear_choch_alert (bool) : if there was a bearish chock alert -> plot it
btm_x (int) : latest swing low x
btm_y (float) : latest swing low y
trail_dn_x (int) : trailing low x
trail_dn (float) : trailing low y
ll (float) : if there was a lower low
color_bull (color) : color for bullish BoS/ChoCh levels
color_bear (color) : color for bearish BoS/ChoCh levels
show_swing_points (bool) : whether to plot swing point labels
show_latest_swings_levels (bool) : whether to track and plot latest swing point levels with lines
show_bos (bool) : whether to plot BoS levels
show_choch (bool) : whether to plot ChoCh levels
line_style (string) : whether to plot BoS levels
label_size (string) : label size of plotted BoS/ChoCh levels
keep_history (bool) : weater to remove older swing point labels and only keep the most recent
structure(length, color_bull, color_bear, super_hh, super_ll, filter_insignificant_internal_breaks, show_swing_points, show_latest_swings_levels, show_bos, show_choch, line_style, label_size, keep_history, enabled)
detect (and plot) structural breaks and the resulting new trend
Parameters:
length (simple int) : lookback period for swing point detection
color_bull (color) : color for bullish BoS/ChoCh levels
color_bear (color) : color for bearish BoS/ChoCh levels
super_hh (float) : level/y-coordinate of superior hh (for internal structure detection)
super_ll (float) : level/y-coordinate of superior ll (for internal structure detection)
filter_insignificant_internal_breaks (bool) : if true pivot points / internal structure will be ignored where the wick in trend direction is longer than the opposite (likely to push further in direction of main trend)
show_swing_points (bool) : whether to plot swing point labels
show_latest_swings_levels (bool) : whether to track and plot latest swing point levels with lines
show_bos (bool) : whether to plot BoS levels
show_choch (bool) : whether to plot ChoCh levels
line_style (string) : whether to plot BoS levels
label_size (string) : label size of plotted BoS/ChoCh levels
keep_history (bool) : weater to remove older swing point labels and only keep the most recent
enabled (bool)
_check_equal_level(mode, len, eq_threshold, enabled)
INTERNAL: detect equal levels (double top/bottom)
Parameters:
mode (int) : detect 1: bullish/high, -1 bearish/low pivot points
len (int) : lookback period for equal level (swing point) detection
eq_threshold (float) : maximum price offset for a level to be considered equal
enabled (bool)
Returns: eq_alert whether an equal level was detected and coordinates of the first and the second level/swing point
_plot_equal_level(show_eq, x1, y1, x2, y2, label_txt, label_style, label_size, line_color, line_style, keep_history)
INTERNAL: plot equal levels (double top/bottom)
Parameters:
show_eq (bool) : whether to plot the level or not
x1 (int) : x-coordinate of the first level / swing point
y1 (float) : y-coordinate of the first level / swing point
x2 (int) : x-coordinate of the second level / swing point
y2 (float) : y-coordinate of the second level / swing point
label_txt (string) : text for the label above/below the line connecting the equal levels
label_style (string) : style (label.style_label_down/up) for the label above/below the line connecting the equal levels
label_size (string) : size (size.tiny) for the label above/below the line connecting the equal levels
line_color (color) : color for the line connecting the equal levels (and it's label)
line_style (string) : style (line.style_dotted) for the line connecting the equal levels
keep_history (bool) : weater to remove older swing point labels and only keep the most recent
equal_levels_values(len, threshold, enabled)
detect (and plot) equal levels (double top/bottom), returns coordinates
Parameters:
len (int) : lookback period for equal level (swing point) detection
threshold (float) : maximum price offset for a level to be considered equal
enabled (bool) : whether detection is enabled
Returns: (eqh_alert, eqh_x1, eqh_y1, eqh_x2, eqh_y2) whether an equal high was detected and coordinates of the first and the second level/swing point, (eql_alert, eql_x1, eql_y1, eql_x2, eql_y2) same for equal lows
equal_levels_plot(eqh_x1, eqh_y1, eqh_x2, eqh_y2, eql_x1, eql_y1, eql_x2, eql_y2, color_eqh, color_eql, show, keep_history)
detect (and plot) equal levels (double top/bottom), returns coordinates
Parameters:
eqh_x1 (int) : coordinates of first point of equal high
eqh_y1 (float) : coordinates of first point of equal high
eqh_x2 (int) : coordinates of second point of equal high
eqh_y2 (float) : coordinates of second point of equal high
eql_x1 (int) : coordinates of first point of equal low
eql_y1 (float) : coordinates of first point of equal low
eql_x2 (int) : coordinates of second point of equal low
eql_y2 (float) : coordinates of second point of equal low
color_eqh (color) : color for the line connecting the equal highs (and it's label)
color_eql (color) : color for the line connecting the equal lows (and it's label)
show (bool) : whether plotting is enabled
keep_history (bool) : weater to remove older swing point labels and only keep the most recent
Returns: (eqh_alert, eqh_x1, eqh_y1, eqh_x2, eqh_y2) whether an equal high was detected and coordinates of the first and the second level/swing point, (eql_alert, eql_x1, eql_y1, eql_x2, eql_y2) same for equal lows
equal_levels(len, threshold, color_eqh, color_eql, enabled, show, keep_history)
detect (and plot) equal levels (double top/bottom)
Parameters:
len (int) : lookback period for equal level (swing point) detection
threshold (float) : maximum price offset for a level to be considered equal
color_eqh (color) : color for the line connecting the equal highs (and it's label)
color_eql (color) : color for the line connecting the equal lows (and it's label)
enabled (bool) : whether detection is enabled
show (bool) : whether plotting is enabled
keep_history (bool) : weater to remove older swing point labels and only keep the most recent
Returns: (eqh_alert) whether an equal high was detected, (eql_alert) same for equal lows
_detect_fvg(mode, enabled, o, h, l, c, filter_insignificant_fvgs, change_tf)
INTERNAL: detect FVG (fair value gap)
Parameters:
mode (int) : detect 1: bullish, -1 bearish gaps
enabled (bool) : whether detection is enabled
o (float) : reference source open
h (float) : reference source high
l (float) : reference source low
c (float) : reference source close
filter_insignificant_fvgs (bool) : whether to calculate and filter small/insignificant gaps
change_tf (bool) : signal when the previous reference timeframe closed, triggers new calculation
Returns: whether a new FVG was detected and its top/mid/bottom levels
_clear_broken_fvg(mode, upper_boxes, lower_boxes)
INTERNAL: clear mitigated FVGs (fair value gaps)
Parameters:
mode (int) : detect 1: bullish, -1 bearish gaps
upper_boxes (array) : array that stores the upper parts of the FVG boxes
lower_boxes (array) : array that stores the lower parts of the FVG boxes
_plot_fvg(mode, show, top, mid, btm, border_color, extend_box)
INTERNAL: plot (and clear broken) FVG (fair value gap)
Parameters:
mode (int) : plot 1: bullish, -1 bearish gap
show (bool) : whether plotting is enabled
top (float) : top level of fvg
mid (float) : center level of fvg
btm (float) : bottom level of fvg
border_color (color) : color for the FVG box
extend_box (int) : how many bars into the future the FVG box should be extended after detection
fvgs_values(o, h, l, c, filter_insignificant_fvgs, change_tf, enabled)
detect (and plot / clear broken) FVGs (fair value gaps), and return alerts and level values
Parameters:
o (float) : reference source open
h (float) : reference source high
l (float) : reference source low
c (float) : reference source close
filter_insignificant_fvgs (bool) : whether to calculate and filter small/insignificant gaps
change_tf (bool) : signal when the previous reference timeframe closed, triggers new calculation
enabled (bool) : whether detection is enabled
Returns: (bullish_fvg_alert, bull_top, bull_mid, bull_btm): whether a new bullish FVG was detected and its top/mid/bottom levels, (bearish_fvg_alert, bear_top, bear_mid, bear_btm): same for bearish FVGs
fvgs_plot(bullish_fvg_alert, bull_top, bull_mid, bull_btm, bearish_fvg_alert, bear_top, bear_mid, bear_btm, color_bull, color_bear, extend_box, show)
Parameters:
bullish_fvg_alert (bool)
bull_top (float)
bull_mid (float)
bull_btm (float)
bearish_fvg_alert (bool)
bear_top (float)
bear_mid (float)
bear_btm (float)
color_bull (color) : color for bullish FVG boxes
color_bear (color) : color for bearish FVG boxes
extend_box (int) : how many bars into the future the FVG box should be extended after detection
show (bool) : whether plotting is enabled
Returns: (bullish_fvg_alert, bull_top, bull_mid, bull_btm): whether a new bullish FVG was detected and its top/mid/bottom levels, (bearish_fvg_alert, bear_top, bear_mid, bear_btm): same for bearish FVGs
fvgs(o, h, l, c, filter_insignificant_fvgs, change_tf, color_bull, color_bear, extend_box, enabled, show)
detect (and plot / clear broken) FVGs (fair value gaps)
Parameters:
o (float) : reference source open
h (float) : reference source high
l (float) : reference source low
c (float) : reference source close
filter_insignificant_fvgs (bool) : whether to calculate and filter small/insignificant gaps
change_tf (bool) : signal when the previous reference timeframe closed, triggers new calculation
color_bull (color) : color for bullish FVG boxes
color_bear (color) : color for bearish FVG boxes
extend_box (int) : how many bars into the future the FVG box should be extended after detection
enabled (bool) : whether detection is enabled
show (bool) : whether plotting is enabled
Returns: (bullish_fvg_alert): whether a new bullish FVG was detected, (bearish_fvg_alert): same for bearish FVGs
OrderBlock
Fields:
id (series int)
dir (series int)
left_top (chart.point)
right_bottom (chart.point)
break_price (series float)
early_confirmation_price (series float)
ltf_high (array)
ltf_low (array)
ltf_volume (array)
plot (Box type from robbatt/lib_plot_objects/49)
profile (Profile type from robbatt/lib_profile/32)
trailing (series bool)
extending (series bool)
awaiting_confirmation (series bool)
touched_break_price_before_confirmation (series bool)
soft_confirmed (series bool)
has_fvg_out (series bool)
hidden (series bool)
broken (series bool)
OrderBlockConfig
Fields:
show (series bool)
show_last (series int)
show_id (series bool)
show_profile (series bool)
args (BoxArgs type from robbatt/lib_plot_objects/49)
txt (series string)
txt_args (BoxTextArgs type from robbatt/lib_plot_objects/49)
delete_when_broken (series bool)
broken_args (BoxArgs type from robbatt/lib_plot_objects/49)
broken_txt (series string)
broken_txt_args (BoxTextArgs type from robbatt/lib_plot_objects/49)
broken_profile_args (ProfileArgs type from robbatt/lib_profile/32)
use_profile (series bool)
profile_args (ProfileArgs type from robbatt/lib_profile/32) Library

TrendLine Toolkit w/ Breaks (Real-Time)The TrendLine Toolkit script introduces an innovating capability by extending the conventional use of trendlines beyond price action to include oscillators and other technical indicators. This tool allows traders to automatically detect and display trendlines on any PulseWire built-in oscillator or community-built script, offering a versatile approach to trend analysis. With breakout detection and real-time alerts, this script enhances the way traders interpret trends in various indicators.
🔲 Methodology
Trendlines are a fundamental tool in technical analysis used to identify and visualize the direction and strength of a price trend. They are drawn by connecting two or more significant points on a price chart, typically the highs or lows of consecutive price movements (pivots).
Drawing Trendlines:
Uptrend Line - Connects a series of higher lows. It signals an upward price trend.
Downtrend Line - Connects a series of lower highs. It indicates a downward price trend.
Support and Resistance:
Support Line - A trendline drawn under rising prices, indicating a level where buying interest is historically strong.
Resistance Line - A trendline drawn above falling prices, showing a level where selling interest historically prevails.
Identification of Trends:
Uptrend - Prices making higher highs and higher lows.
Downtrend - Prices making lower highs and lower lows.
Sideways (or Range-bound) - Prices moving within a horizontal range.
A trendline helps confirm the existence and direction of a trend, providing guidance in aligning with the prevailing market sentiment. Additionally, they are usually paired with breakout analysis, a breakout occurs when the price breaches a trendline. This signals a potential change in trend direction or an acceleration of the existing trend.
The script adapts this methodology to oscillators and other indicators. Instead of relying on price pivots, which can only be detected in retrospect, the script utilizes a trailing stop on the oscillator to identify potential swings in real-time, you may find more info about it here (SuperTrend toolkit) . We detect swings or pivots simply by testing for crosses between the indicator and its trailing stop.
type oscillator
float o = Oscillator Value
float s = Trailing Stop Value
oscillator osc = oscillator.new()
bool l = ta.crossunder(osc.o, osc.s) => Utilized as a formed high
bool h = ta.crossover (osc.o, osc.s) => Utilized as a formed low
This approach enables the algorithm to detect trendlines between consecutive pivot highs or lows on the oscillator itself, providing a dynamic and immediate representation of trend dynamics.
🔲 Breakout Detection
The script goes beyond trendline creation by incorporating breakout detection directly within the oscillator. After identifying a trendline, the algorithm continuously monitors the oscillator for potential breakouts, signaling shifts in market sentiment.
🔲 Setup Guide
A simple example on one of my public scripts, Z-Score Heikin-Ashi Transformed
🔲 Settings
Source - Choose an oscillator source of which to base the Toolkit on.
Zeroing - The Mid-Line value of the oscillator, for example RSI & MFI use 50.
Sensitivity - Calibrates the Sensitivity of which TrendLines are detected, higher values result in more detections.
🔲 Alerts
Bearish TrendLine
Bullish TrendLine
Bearish Breakout
Bullish Breakout
As well as the option to trigger 'any alert' call.
By integrating trendline analysis into oscillators, this Toolkit enhances the capabilities of technical analysis, bringing a dynamic and comprehensive approach to identifying trends, support/resistance levels, and breakout signals across various indicators. Indicator

ICT Killzones Toolkit [LuxAlgo]The ICT Killzones Toolkit is a comprehensive set of tools designed to assist traders in identifying key trading zones and patterns within the market.
The ICT Killzones Toolkit includes the following Price Action components:
ICT Killzones with Pivot Highs/Lows
Order Blocks
Breaker Blocks
Fair Value Gaps
Market Structure Shifts
By combining these components, the ICT Killzones Toolkit provides traders with a comprehensive framework for analyzing the market and identifying setups of interest. Leveraging these tools effectively can enhance traders' decision-making process and improve killzones interpretability.
🔶 USAGE
In forex/futures trading, timing is crucial. ICT Killzone are specific periods when there's a higher chance of finding setups of interest. Mastering these time intervals can offer significant advantages to traders who know how to use them effectively.
The image above highlights a potential setup of interest when using the ICT Killzones Toolkit.
As another example for utilizing the ICT Killzones Toolkit, we can see in the image above when price retests setups generated from killzones such as Order Blocks or Fair Value Gaps, a potential strategy could be to look for entries on those & take profits as the next killzone appears.
🔹 Order Blocks
Order Blocks are sections on a price chart where notable buying or selling activity has occured, often signaling interest zones for institutional traders. This toolkit's Order Blocks component pinpoints these areas within the Killzone, which may act as potential support or resistance levels.
🔹 Breaker Blocks
Breaker Blocks are zones built from mitigated order blocks, and highlight zones on the chart where price has previously stalled or reversed. These areas may act as significant barriers to price movement in the future, and the Breaker Blocks component helps traders identify them for potential trading opportunities.
🔹 Fair Value Gaps
Fair value gaps are especially favored by price action traders and arise from market inefficiencies or imbalances, typically when buying and selling are unequal. These gaps often attract price movement before resuming in the same direction. the Fair Value Gaps component of the toolkit helps traders identify and analyze them.
🔹 Market Structure Shifts
Market Structure Shifts refer to significant changes in the overall structure of the market, such as shifts in trend direction, volatility, or trading activity. These shifts can provide valuable insights into market sentiment and potential trading opportunities, and the Market Structure Shifts component helps traders identify and interpret them.
Overall, the ICT Killzone Toolkit combines these components to provide traders with a comprehensive framework for analyzing the markets and identifying high-probability trading setups.
🔶 SETTINGS
🔹 ICT Killzones
Asian, London Open, New York, and London Close: toggles the visibility of specific Killzones, allowing users to customize time periods and Killzone colors.
Killzone Lines : Top/Bottom, Mean and Extend Top/Bottom: toggles the visibility of the Killzone's pivot high and low lines, mean (average) line, and allows users to extend the pivot lines.
Killzone Labels: Toggles the visibility of the Killzone labels.
Display Killzones within Timeframes Up To: Toggles the visibility of the Killzones up to selected Timeframes.
Open Price, Separator, Label, and Color: toggles the visibility of the open price of the Killzones or for the day, week, or month. If the day, week, or month is selected, a separator will be displayed to highlight the beginning of each respective period. Additionally, users can customize the color and toggle the label as needed.
🔹 Order Blocks & Breaker Blocks
Order Blocks | Breaker Blocks: toggles the visibility of the order blocks & breaker blocks.
Swing Detection Length: lookback period used for the detection of the swing points used to create order blocks & breaker blocks.
Mitigation Price: allows users to select between closing price or wick of the candle.
Use Candle Body in Detection: allows users to use candle bodies as order block areas instead of the full candle range.
Remove Mitigated Order Blocks & Breaker Blocks: toggles the visibility of the mitigated order blocks & breaker blocks.
Extend Order Blocks & Breaker Blocks: enables processing of the order blocks & breaker blocks beyond the boundaries of the killzones.
Display Order Blocks & Breaker Blocks: enables the display of the first, last, or all occurrences of the order blocks & breaker blocks.
Order Blocks : Bullish, Bearish Color: color customization option for order blocks.
Breaker Blocks : Bullish, Bearish Color: color customization option for breaker blocks.
Show Order Blocks & Breaker Blocks Text: toggles the visibility of the order blocks & breaker blocks labels.
🔹 Market Structure Shifts
Market Structure Shifts: toggles the visibility of the market structure shifts.
Detection Length: market structure shift detection length.
Display Market Structure Shifts: enables the display of the first, last, or all occurrences of the market structure shifts.
Market Structure Shifts : Bullish, Bearish Color: color custumization option for market structure shifts.
Show Market Structure Shifts Text: toggles the visibility of the market structure shifts labels.
🔹 Fair Value Gaps
Fair Value Gaps: toggles the visibility of the fair value gaps.
Fair Value Gap Width Filter: filtering threshold wile detecting fair value gaps.
Remove Mitigated Fair Value Gaps: removes mitigated fair value gaps.
Extend Fair Value Gaps: enables processing of the fair value gaps beyond the boundaries of the killzones.
Display Fair Value Gaps: enables the display of the first, last, or all occurrences of the fair value gaps.
Bullish Imbalance Color: color customization option.
Bearish Imbalance Color: color customization option.
Show Fair Value Gaps Text: toggles the visibility of the fair value gaps labels.
🔶 RELATED SCRIPTS
Smart-Money-Concepts
Order-Blocks-Breaker-Blocks
Thanks to our community for recommending this script. For more conceptual scripts and related content, we welcome you to explore by visiting >>> LuxAlgo-Scripts . Indicator

lib_fvgLibrary "lib_fvg"
further expansion of my object oriented library toolkit. This lib detects Fair Value Gaps and returns them as objects.
Drawing them is a separate step so the lib can be used with securities. It also allows for usage of current/close price to detect fill/invalidation of a gap and to adjust the fill level dynamically. FVGs can be detected while forming and extended indefinitely while they're unfilled.
method draw(this)
Namespace types: FVG
Parameters:
this (FVG)
method draw(fvgs)
Namespace types: FVG
Parameters:
fvgs (FVG )
is_fvg(mode, precondition, filter_insignificant, filter_insignificant_atr_factor, live)
Parameters:
mode (int) : switch for detection 1 for bullish FVGs, -1 for bearish FVGs
precondition (bool) : allows for other confluences to block/enable detection
filter_insignificant (bool) : allows to ignore small gaps
filter_insignificant_atr_factor (float) : allows to adjust how small (compared to a 50 period ATR)
live (bool) : allows to detect FVGs while the third bar is forming -> will cause repainting
Returns: a tuple of (bar_index of gap bar, gap top, gap bottom)
create_fvg(mode, idx, top, btm, filled_at_pc, config)
Parameters:
mode (int) : switch for detection 1 for bullish FVGs, -1 for bearish FVGs
idx (int) : the bar_index of the FVG gap bar
top (float) : the top level of the FVG
btm (float) : the bottom level of the FVG
filled_at_pc (float) : the ratio (0-1) that the fill source needs to retrace into the gap to consider it filled/invalidated/ready for removal
config (FVGConfig) : the plot configuration/styles for the FVG
Returns: a new FVG object if there was a new FVG, else na
detect_fvg(mode, filled_at_pc, precondition, filter_insignificant, filter_insignificant_atr_factor, live, config)
Parameters:
mode (int) : switch for detection 1 for bullish FVGs, -1 for bearish FVGs
filled_at_pc (float)
precondition (bool) : allows for other confluences to block/enable detection
filter_insignificant (bool) : allows to ignore small gaps
filter_insignificant_atr_factor (float) : allows to adjust how small (compared to a 50 period ATR)
live (bool) : allows to detect FVGs while the third bar is forming -> will cause repainting
config (FVGConfig)
Returns: a new FVG object if there was a new FVG, else na
method update(this, fill_src)
Namespace types: FVG
Parameters:
this (FVG)
fill_src (float) : allows for usage of different fill source series, e.g. high for bearish FVGs, low vor bullish FVGs or close for both
method update(all, fill_src)
Namespace types: FVG
Parameters:
all (FVG )
fill_src (float)
method remove_filled(unfilled_fvgs)
Namespace types: FVG
Parameters:
unfilled_fvgs (FVG )
method delete(this)
Namespace types: FVG
Parameters:
this (FVG)
method delete_filled_fvgs_buffered(filled_fvgs, max_keep)
Namespace types: FVG
Parameters:
filled_fvgs (FVG )
max_keep (int) : the number of filled, latest FVGs to retain on the chart.
FVGConfig
Fields:
box_args (|robbatt/lib_plot_objects/36;BoxArgs|#OBJ)
line_args (|robbatt/lib_plot_objects/36;LineArgs|#OBJ)
box_show (series__bool)
line_show (series__bool)
keep_filled (series__bool)
extend (series__bool)
FVG
Fields:
config (|FVGConfig|#OBJ)
startbar (series__integer)
mode (series__integer)
top (series__float)
btm (series__float)
center (series__float)
size (series__float)
fill_size (series__float)
fill_lvl_target (series__float)
fill_lvl_current (series__float)
fillbar (series__integer)
filled (series__bool)
_fvg_box (|robbatt/lib_plot_objects/36;Box|#OBJ)
_fill_line (|robbatt/lib_plot_objects/36;Line|#OBJ) Library

lib_retracement_patternsLibrary "lib_retracement_patterns"
types and functions for XABCD pattern detection and plotting
method set_tolerances(this, tolerance_Bmin, tolerance_Bmax, tolerance_Cmin, tolerance_Cmax, tolerance_Dmin, tolerance_Dmax)
sets tolerances for B, C and D retracements. This creates another Pattern instance that is set as tolerances field on the original and will be used for detection instead of the original ratios.
Namespace types: Pattern
create_config(pattern_line_args, pattern_point_args, name_label_args, retracement_line_args, retracement_label_args, line_args_Dtarget, line_args_completion, line_args_tp1, line_args_tp2, line_args_sl, label_args_completion, label_args_tp1, label_args_tp2, label_args_sl, label_terminal, label_terminal_up_char, label_terminal_down_char, color_bull, color_bear, color_muted, fill_opacity, draw_point_labels, draw_retracements, draw_target_range, draw_levels, hide_shorter_if_shared_legs_greater_than_max, hide_engulfed_pattern, hide_engulfed_pattern_of_same_type, hide_longer_pattern_with_same_X, mute_previous_pattern_when_next_overlaps, keep_failed_patterns)
method direction(this)
Namespace types: Match
method length(this)
return the length of this pattern, determined by the distance between X and D point
Namespace types: Match
method height(this)
return the height of this pattern, determined by the distance between the biggest distance between A/C and X/D
Namespace types: Match
method is_forming(this)
returns true if not complete, not expired and not invalidated
Namespace types: Match
method tostring(this)
return a string representation of all Matches in this map
Namespace types: Match
method tostring(this)
Namespace types: map
remove_complete_and_expired(this)
method add(this, item)
Namespace types: map
method is_engulfed_by(this, other)
checks if this Match is engulfed by the other
Namespace types: Match
method update(tracking_matches, zigzag, patterns, max_age_idx, detect_dir, pattern_minlen, pattern_maxlen, max_sub_waves, max_shared_legs, max_XB_BD_ratio, debug_log)
checks this map of tracking Matches if any of them was completed or invalidated in
Namespace types: map
method mute(this, mute_color, mute_fill_color)
mute this pattern by making it all one color (lines and labels, for pattern fill there's another)
Namespace types: Match
method mute(this, mute_color, mute_fill_color)
mute all patterns in this map by making it all one color (lines and labels, for pattern fill there's another)
Namespace types: map
method hide(this)
hide this pattern by muting it with a transparent color
Namespace types: Match
method reset_styles(this)
reset the style of a muted or hidden match back to the preset configuration
Namespace types: Match
method delete(this)
remove the plot of this Match from the chart
Namespace types: Match
method delete(this)
remove all the plots of the Matches in this map from the chart
Namespace types: map
method draw(this)
draw this Match on the chart
Namespace types: Match
method draw(this, config, all_patterns, debug_log)
draw all Matches in this map, considering all other patterns for engulfing and overlapping
Namespace types: map
method check_hide_or_mute(this, all, config, debug_log)
checks if this pattern needs to be hidden or muted based on other plotted patterns and given configuration
Namespace types: Match
method add_if(id, item, condition)
convenience function to add a search pattern to a list, only if given condition (input.bool) is true
Namespace types: Pattern
Pattern
type to hold retracement ratios and tolerances for this pattern, as well as targets for trades
Config
allows control of pattern plotting shape and colors, as well as settings for hiding overlapped patterns etc.
Match
holds all information on a Pattern and a successful match in the chart. Includes XABCD pivot points as well as all Line and Label objects to draw it
Library

lib_plot_composite_objectsLibrary "lib_plot_composite_objects"
library building on top of lib_plot_objects for composite objects such as Triangles and Polygons. heavily using chart.points
method tostring(this, date_format)
Namespace types: Triangle
Parameters:
this (Triangle)
date_format (simple string)
method tostring(this, date_format)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
date_format (simple string)
method tostring(this, date_format)
Namespace types: Polygon
Parameters:
this (Polygon)
date_format (simple string)
method tostring(this, date_format)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
date_format (simple string)
method tostring(this, date_format)
Namespace types: Triangle
Parameters:
this (Triangle )
date_format (simple string)
method tostring(this, date_format)
Namespace types: Polygon
Parameters:
this (Polygon )
date_format (simple string)
method tostring(this, date_format)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
date_format (simple string)
method tostring(this, date_format)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
date_format (simple string)
method create_triangle(this, b, c, args)
Namespace types: chart.point
Parameters:
this (chart.point)
b (chart.point)
c (chart.point)
args (LineArgs type from robbatt/lib_plot_objects/32)
method create_triangle(this, c)
Namespace types: D.Line
Parameters:
this (Line type from robbatt/lib_plot_objects/32)
c (chart.point)
method create_polygon(points, args)
Namespace types: chart.point
Parameters:
points (chart.point )
args (LineArgs type from robbatt/lib_plot_objects/32)
method create_polygon(start, others, args)
Namespace types: chart.point
Parameters:
start (chart.point)
others (chart.point )
args (LineArgs type from robbatt/lib_plot_objects/32)
method create_fill(this, fill_color)
Namespace types: Triangle
Parameters:
this (Triangle)
fill_color (color)
method create_fill(this, fill_color)
Namespace types: Polygon
Parameters:
this (Polygon)
fill_color (color)
method create_center_label(this, txt, args, tooltip)
Namespace types: Triangle
Parameters:
this (Triangle)
txt (string)
args (LabelArgs type from robbatt/lib_plot_objects/32)
tooltip (string)
method create_label(this, txt, args, tooltip)
Namespace types: Polygon
Parameters:
this (Polygon)
txt (string)
args (LabelArgs type from robbatt/lib_plot_objects/32)
tooltip (string)
method nz(this, default)
Namespace types: Triangle
Parameters:
this (Triangle)
default (Triangle)
method nz(this, default)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
default (TriangleFill)
method nz(this, default)
Namespace types: Polygon
Parameters:
this (Polygon)
default (Polygon)
method nz(this, default)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
default (PolygonFill)
method enqueue(id, item, max)
Namespace types: Triangle
Parameters:
id (Triangle )
item (Triangle)
max (int)
method enqueue(id, item, max)
Namespace types: Polygon
Parameters:
id (Polygon )
item (Polygon)
max (int)
method enqueue(id, item, max)
Namespace types: TriangleFill
Parameters:
id (TriangleFill )
item (TriangleFill)
max (int)
method enqueue(id, item, max)
Namespace types: PolygonFill
Parameters:
id (PolygonFill )
item (PolygonFill)
max (int)
method update(this, a, b, c)
Namespace types: Triangle
Parameters:
this (Triangle)
a (chart.point)
b (chart.point)
c (chart.point)
method update(this, points)
Namespace types: Polygon
Parameters:
this (Polygon)
points (chart.point )
method delete(this)
Namespace types: Triangle
Parameters:
this (Triangle)
method delete(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
method delete(this)
Namespace types: Polygon
Parameters:
this (Polygon)
method delete(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
method delete(this)
Namespace types: Triangle
Parameters:
this (Triangle )
method delete(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
method delete(this)
Namespace types: Polygon
Parameters:
this (Polygon )
method delete(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
method draw(this, ab_args_override, ac_args_override, bc_args_override)
Namespace types: Triangle
Parameters:
this (Triangle)
ab_args_override (LineArgs type from robbatt/lib_plot_objects/32)
ac_args_override (LineArgs type from robbatt/lib_plot_objects/32)
bc_args_override (LineArgs type from robbatt/lib_plot_objects/32)
method draw(this)
Namespace types: Polygon
Parameters:
this (Polygon)
method draw(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill)
method draw(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill)
method draw(this)
Namespace types: Triangle
Parameters:
this (Triangle )
method draw(this)
Namespace types: TriangleFill
Parameters:
this (TriangleFill )
method draw(this)
Namespace types: Polygon
Parameters:
this (Polygon )
method draw(this)
Namespace types: PolygonFill
Parameters:
this (PolygonFill )
method apply_style(this, args)
Namespace types: Triangle
Parameters:
this (Triangle)
args (LineArgs type from robbatt/lib_plot_objects/32)
method apply_style(this, args)
Namespace types: Polygon
Parameters:
this (Polygon)
args (LineArgs type from robbatt/lib_plot_objects/32)
method apply_style(this, args)
Namespace types: Triangle
Parameters:
this (Triangle )
args (LineArgs type from robbatt/lib_plot_objects/32)
method apply_style(this, args)
Namespace types: Polygon
Parameters:
this (Polygon )
args (LineArgs type from robbatt/lib_plot_objects/32)
Triangle
Fields:
a (chart.point) : first Corner
b (chart.point) : second Corner
c (chart.point) : third Corner
args (LineArgs type from robbatt/lib_plot_objects/32) : Wrapper for reusable arguments for line.new()
ab (Line type from robbatt/lib_plot_objects/32)
ac (Line type from robbatt/lib_plot_objects/32)
bc (Line type from robbatt/lib_plot_objects/32)
TriangleFill
Fields:
triangle (Triangle) : The Triangle object
plot (LineFill type from robbatt/lib_plot_objects/32) : The linefill object to be added and plotted via draw()
Polygon
Fields:
points (chart.point ) : array of points that make up the Polygon
center (chart.point) : Center point of the Polygon, can be used for a label and will be center for PolygonFill
args (LineArgs type from robbatt/lib_plot_objects/32) : Wrapper for reusable arguments for line.new()
plot (Line type from robbatt/lib_plot_objects/32) : An array of Lines that form Polygon Border
PolygonFill
Fields:
poly (Polygon) : the Polygon
fill_color (series color) : The color used to fill the space between the lines.
plot (TriangleFill ) Library

lib_profileLibrary "lib_profile"
a library with functions to calculate a volume profile for either a set of candles within the current chart, or a single candle from its lower timeframe security data. All you need is to feed the
method delete(this)
deletes this bucket's plot from the chart
Namespace types: Bucket
Parameters:
this (Bucket)
method delete(this)
Namespace types: Profile
Parameters:
this (Profile)
method delete(this)
Namespace types: Bucket
Parameters:
this (Bucket )
method delete(this)
Namespace types: Profile
Parameters:
this (Profile )
method update(this, top, bottom, value, fraction)
updates this bucket's data
Namespace types: Bucket
Parameters:
this (Bucket)
top (float)
bottom (float)
value (float)
fraction (float)
method update(this, tops, bottoms, values)
update this Profile's data (recalculates the whole profile and applies the result to this object) TODO optimisation to calculate this incremental to improve performance in realtime on high resolution
Namespace types: Profile
Parameters:
this (Profile)
tops (float ) : array of range top/high values (either from ltf or chart candles using history() function
bottoms (float ) : array of range bottom/low values (either from ltf or chart candles using history() function
values (float ) : array of range volume/1 values (either from ltf or chart candles using history() function (1s can be used for analysing candles in bucket/price range over time)
method tostring(this)
allows debug print of a bucket
Namespace types: Bucket
Parameters:
this (Bucket)
method draw(this, start_t, start_i, end_t, end_i, args, line_color)
allows drawing a line in a Profile, representing this bucket and it's value + it's value's fraction of the Profile total value
Namespace types: Bucket
Parameters:
this (Bucket)
start_t (int) : the time x coordinate of the line's left end (depends on the Profile box)
start_i (int) : the bar_index x coordinate of the line's left end (depends on the Profile box)
end_t (int) : the time x coordinate of the line's right end (depends on the Profile box)
end_i (int) : the bar_index x coordinate of the line's right end (depends on the Profile box)
args (LineArgs type from robbatt/lib_plot_objects/24) : the default arguments for the line style
line_color (color) : the color override for POC/VAH/VAL lines
method draw(this, forced_width)
draw all components of this Profile (Box, Background, Bucket lines, POC/VAH/VAL overlay levels and labels)
Namespace types: Profile
Parameters:
this (Profile)
forced_width (int) : allows to force width of the Profile Box, overrides the ProfileArgs.default_size and ProfileArgs.extend arguments (default: na)
method init(this)
Namespace types: ProfileArgs
Parameters:
this (ProfileArgs)
method init(this)
Namespace types: Profile
Parameters:
this (Profile)
profile(tops, bottoms, values, resolution, vah_pc, val_pc, bucket_buffer)
split a chart/parent bar into 'resolution' sections, figure out in which section the most volume/time was spent, by analysing a given set of (intra)bars' top/bottom/volume values. Then return price center of the bin with the highest volume, essentially marking the point of control / highest volume (poc) in the chart/parent bar.
Parameters:
tops (float ) : array of range top/high values (either from ltf or chart candles using history() function
bottoms (float ) : array of range bottom/low values (either from ltf or chart candles using history() function
values (float ) : array of range volume/1 values (either from ltf or chart candles using history() function (1s can be used for analysing candles in bucket/price range over time)
resolution (int) : amount of buckets/price ranges to sort the candle data into (analyse how much volume / time was spent in a certain bucket/price range) (default: 25)
vah_pc (float) : a threshold percentage (of values' total) for the top end of the value area (default: 80)
val_pc (float) : a threshold percentage (of values' total) for the bottom end of the value area (default: 20)
bucket_buffer (Bucket ) : optional buffer of empty Buckets to fill, if omitted a new one is created and returned. The buffer length must match the resolution
Returns: poc (price level), vah (price level), val (price level), poc_index (idx in buckets), vah_index (idx in buckets), val_index (idx in buckets), buckets (filled buffer or new)
create_profile(start_idx, tops, bottoms, values, resolution, vah_pc, val_pc, args)
split a chart/parent bar into 'resolution' sections, figure out in which section the most volume/time was spent, by analysing a given set of (intra)bars' top/bottom/volume values. Then return price center of the bin with the highest volume, essentially marking the point of control / highest volume (poc) in the chart/parent bar.
Parameters:
start_idx (int) : the bar_index at which the Profile should start drawing
tops (float ) : array of range top/high values (either from ltf or chart candles using history() function
bottoms (float ) : array of range bottom/low values (either from ltf or chart candles using history() function
values (float ) : array of range volume/1 values (either from ltf or chart candles using history() function (1s can be used for analysing candles in bucket/price range over time)
resolution (int) : amount of buckets/price ranges to sort the candle data into (analyse how much volume / time was spent in a certain bucket/price range) (default: 25)
vah_pc (float) : a threshold percentage (of values' total) for the top end of the value area (default: 80)
val_pc (float) : a threshold percentage (of values' total) for the bottom end of the value area (default: 20)
args (ProfileArgs)
Returns: poc (price level), vah (price level), val (price level), poc_index (idx in buckets), vah_index (idx in buckets), val_index (idx in buckets), buckets (filled buffer or new)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (int)
len (int)
offset (int)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (float)
len (int)
offset (int)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (bool)
len (int)
offset (int)
history(src, len, offset)
allows fetching an array of values from the history series with offset from current candle
Parameters:
src (string)
len (int)
offset (int)
Bucket
Fields:
idx (series int) : the index of this Bucket within the Profile starting with 0 for the lowest Bucket at the bottom of the Profile
value (series float) : the value of this Bucket, can be volume or time, for using time pass and array of 1s to the update function
top (series float) : the top of this Bucket's price range (for calculation)
btm (series float) : the bottom of this Bucket's price range (for calculation)
center (series float) : the center of this Bucket's price range (for plotting)
fraction (series float) : the fraction this Bucket's value is compared to the total of the Profile
plot_bucket_line (Line type from robbatt/lib_plot_objects/24) : the line that resembles this bucket and it's valeu in the Profile
ProfileArgs
Fields:
show_poc (series bool) : whether to plot a POC line across the Profile Box (default: true)
show_profile (series bool) : whether to plot a line for each Bucket in the Profile Box, indicating the value per Bucket (Price range), e.g. volume that occured in a certain time and price range (default: false)
show_va (series bool) : whether to plot a VAH/VAL line across the Profile Box (default: false)
show_va_fill (series bool) : whether to fill the 'value' area between VAH/VAL line (default: false)
show_background (series bool) : whether to fill the Profile Box with a background color (default: false)
show_labels (series bool) : whether to add labels to the right end of the POC/VAH/VAL line (default: false)
show_price_levels (series bool) : whether add price values to the labels to the right end of the POC/VAH/VAL line (default: false)
extend (series bool) : whether extend the Profile Box to the current candle (default: false)
default_size (series int) : the default min. width of the Profile Box (default: 30)
args_poc_line (LineArgs type from robbatt/lib_plot_objects/24) : arguments for the poc line plot
args_va_line (LineArgs type from robbatt/lib_plot_objects/24) : arguments for the va line plot
args_poc_label (LabelArgs type from robbatt/lib_plot_objects/24) : arguments for the poc label plot
args_va_label (LabelArgs type from robbatt/lib_plot_objects/24) : arguments for the va label plot
args_profile_line (LineArgs type from robbatt/lib_plot_objects/24) : arguments for the Bucket line plots
args_profile_bg (BoxArgs type from robbatt/lib_plot_objects/24)
va_fill_color (series color) : color for the va area fill plot
Profile
Fields:
start (series int) : left x coordinate for the Profile Box
end (series int) : right x coordinate for the Profile Box
resolution (series int) : the amount of buckets/price ranges the Profile will dissect the data into
vah_threshold_pc (series float) : the percentage of the total data value to mark the upper threshold for the main value area
val_threshold_pc (series float) : the percentage of the total data value to mark the lower threshold for the main value area
args (ProfileArgs) : the style arguments for the Profile Box
h (series float) : the highest price of the data
l (series float) : the lowest price of the data
total (series float) : the total data value (e.g. volume of all candles, or just one each to analyse candle distribution over time)
buckets (Bucket ) : the Bucket objects holding the data for each price range bucket
poc_bucket_index (series int) : the Bucket index in buckets, that holds the poc Bucket
vah_bucket_index (series int) : the Bucket index in buckets, that holds the vah Bucket
val_bucket_index (series int) : the Bucket index in buckets, that holds the val Bucket
poc (series float) : the according price level marking the Point Of Control
vah (series float) : the according price level marking the Value Area High
val (series float) : the according price level marking the Value Area Low
plot_poc (Line type from robbatt/lib_plot_objects/24)
plot_vah (Line type from robbatt/lib_plot_objects/24)
plot_val (Line type from robbatt/lib_plot_objects/24)
plot_poc_label (Label type from robbatt/lib_plot_objects/24)
plot_vah_label (Label type from robbatt/lib_plot_objects/24)
plot_val_label (Label type from robbatt/lib_plot_objects/24)
plot_va_fill (LineFill type from robbatt/lib_plot_objects/24)
plot_profile_bg (Box type from robbatt/lib_plot_objects/24) Library

lib_retracement_labelLibrary "lib_retracement_label"
creates a retracement label between the origin and target of a retracement, updating it's position (via update + draw) when the target moves.
create_tooltip(name, min, max, tol_min, tol_max)
Parameters:
name (string)
min (float)
max (float)
tol_min (float)
tol_max (float)
method update(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel)
method create_retracement_label(this, move_endpoint, args, tooltip)
Creates a new RetracementLabel object.
Namespace types: D.Line
Parameters:
this (Line type from robbatt/lib_plot_objects/23)
move_endpoint (Point type from robbatt/lib_plot_objects/23)
args (LabelArgs type from robbatt/lib_plot_objects/23)
tooltip (string)
method create_retracement_label(this, move_end, args, tooltip)
Creates a new RetracementLabel object.
Namespace types: D.Line
Parameters:
this (Line type from robbatt/lib_plot_objects/23)
move_end (Pivot type from robbatt/lib_pivot/43)
args (LabelArgs type from robbatt/lib_plot_objects/23)
tooltip (string)
method enqueue(id, item, max)
Namespace types: RetracementLabel
Parameters:
id (RetracementLabel )
item (RetracementLabel)
max (int)
method draw(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel)
method draw(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel )
method delete(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel)
method delete(this)
Namespace types: RetracementLabel
Parameters:
this (RetracementLabel )
RetracementLabel
Fields:
move_endpoint (|robbatt/lib_plot_objects/23;Point|#OBJ)
center_label (|robbatt/lib_plot_objects/23;CenterLabel|#OBJ) Library

Library

lib_pivotLibrary "lib_pivot"
Object oriented implementation of Pivot methods.
method tostring(this)
Converts HLData to a json string representation
Namespace types: HLData
Parameters:
this (HLData) : HLData
Returns: string representation of Pivot
method tostring(this, date_format)
Namespace types: Pivot
Parameters:
this (Pivot)
date_format (simple string)
method tostring(this, date_format)
Namespace types: Pivot
Parameters:
this (Pivot )
date_format (simple string)
method get_color(this, mode)
Namespace types: PivotColors
Parameters:
this (PivotColors)
mode (int)
method get_label_text(this)
Namespace types: Pivot
Parameters:
this (Pivot)
method direction(this)
Namespace types: Pivot
Parameters:
this (Pivot)
method same_direction_as(this, other)
Namespace types: Pivot
Parameters:
this (Pivot)
other (Pivot)
method exceeds(this, price)
Namespace types: Pivot
Parameters:
this (Pivot)
price (float)
method exceeds(this, other)
Namespace types: Pivot
Parameters:
this (Pivot)
other (Pivot)
method exceeded_by(this, price)
Namespace types: Pivot
Parameters:
this (Pivot)
price (float)
method exceeded_by(this, other)
Namespace types: Pivot
Parameters:
this (Pivot)
other (Pivot)
method retracement_ratio(this, lastPivot, sec_lastPivot)
Namespace types: Pivot
Parameters:
this (Pivot)
lastPivot (Pivot)
sec_lastPivot (Pivot)
ratio_target(sec_lastPivot, lastPivot, target_ratio)
Parameters:
sec_lastPivot (Pivot)
lastPivot (Pivot)
target_ratio (float)
method update(this, ref_highest, ref_lowest)
Namespace types: HLData
Parameters:
this (HLData)
ref_highest (float)
ref_lowest (float)
method update(this, bar_time, bar_idx, price, prev)
Namespace types: Pivot
Parameters:
this (Pivot)
bar_time (int)
bar_idx (int)
price (float)
prev (Pivot)
method create_next(this, bar_time, bar_idx, price)
Namespace types: Pivot
Parameters:
this (Pivot)
bar_time (int)
bar_idx (int)
price (float)
HLData
HLData wraps the data received from ta.highest, ta.highestbars, ta.lowest, ta.lowestbars, as well as the reference sources
Fields:
length (series int) : lookback length for pivot points
highest_offset (series int) : offset to highest value bar
lowest_offset (series int) : offset to lowest value bar
highest (series float) : highest value within lookback bars
lowest (series float) : lowest value within lookback bars
new_highest (series bool) : update() will set this true if the current candle forms a new highest high at the last (current) bar of set period (length)
new_lowest (series bool) : update() will set this true if the current candle forms a new lowest low at the last (current) bar of set period (length)
new_highest_fractal (series bool) : update() will set this true if the current candle forms a new fractal high at the center of set period (length)
new_lowest_fractal (series bool) : update() will set this true if the current candle forms a new fractal low at the center of set period (length)
PivotColors
Pivot colors for different modes
Fields:
hh (series color) : Color for Pivot mode 2 (HH)
lh (series color) : Color for Pivot mode 1 (LH)
hl (series color) : Color for Pivot mode -1 (HL)
ll (series color) : Color for Pivot mode -2 (LL)
Pivot
Pivot additional pivot data around basic Point
Fields:
point (Point type from robbatt/lib_plot_objects/5)
mode (series int) : can be -2/-1/1/2 for LL/HL/LH/HH
price_movement (series float) : The price difference between this and the previous pivot point in the opposite direction
retracement_ratio (series float) : The ratio between this price_movement and the previous
prev (Pivot) Library
