مؤشر Pine Script®
دعم ومقاومة
SmartDCA by TradeAkademiSmartDCA is a single-direction (Long or Short) step-based DCA strategy with adaptive take-profit and structured risk management.
All core parameters are fully user-configurable. The strategy logic does not enforce a fixed trading style; behavior depends entirely on user-selected settings.
General Structure
The strategy operates in one direction at a time (Long or Short).
All position management logic is applied relative to the selected direction.
The following components are fully controlled by the user:
Trade direction (Long / Short)
Entry model
Entry filters
Take-profit percentage
DCA distance percentage
TP/DCA increment scaling mode
Order size model
Maximum DCA steps
Risk management options
Exit model selection
The strategy plan is visualized either across the entire chart history or within a user-defined custom backtest date range.
Entry Configuration
Users can select the entry model:
Structural breakout
RSI reversal
Trend flip
None (manual disable)
Optional entry filters refine signal selection based on:
Reward space
Entry quality
RSI extremity
Fair value (VWMA)
Trend alignment
DCA & Position Scaling
After initial entry:
Additional DCA orders are triggered when price deviates from the average position price by the defined DCA percentage.
DCA distance and take-profit levels expand step-by-step according to the selected scaling mode.
Order size progression depends on the selected order size model.
Maximum DCA steps define the upper exposure limit.
This ensures the full theoretical risk is bounded and visible.
Exit Models
Users can choose the exit behavior:
Fixed take-profit
Structure-based exit
Adaptive Fast
Adaptive Slow
Protect Profit
Trend Ended
None
All exits are executed using market orders.
Additional Risk Controls
Optional risk features include:
DCA Compression (partial size reduction after recovery)
Defensive Profit Exit
Trend Soft Stop (breakeven protection after trend reversal)
These mechanisms are configurable and do not override the predefined maximum DCA limit.
Visualization & Reporting
The strategy provides:
Active position tracking
DCA step monitoring
Position notional transparency
Trend strength visualization
Historical DCA performance summary
Users may restrict execution to a custom backtest range or allow the strategy to operate across the full visible chart history.
Risk Disclosure
The maximum DCA step defines the full predefined risk envelope.
Strong and sustained one-directional trends may lead to full DCA utilization.
The strategy does not attempt unlimited recovery.
Users are responsible for configuring position sizing and DCA parameters relative to their capital.
This script is for educational and analytical purposes only and does not constitute investment advice.
استراتيجية Pine Script®
GC High-Prob 3-Touch + RVOLWhen publishing your script to TradingView, the description is your "sales pitch" to the community. TradingView’s moderators and users look for three things: What it does, Why it’s useful, and How to interpret it.
Here is a structured, professional description you can copy and paste into the publishing field.
Title Suggestion: GC High-Prob Liquidity Zones: 3-Touch + RVOL Surge
Description:
Overview
This indicator is designed specifically for Gold (GC) and other highly liquid futures, focusing on identifying high-probability support and resistance zones. Rather than plotting every minor pivot, this script filters market noise by requiring a "clustering" of price action and institutional volume confirmation.
It identifies levels where the price has been rejected at least three times within a narrow range and validates the strength of these zones using Relative Volume (RVOL).
Key Features
3-Touch Requirement: The script only plots a zone once it detects 3 separate rejections at a specific price level. This identifies "battlegrounds" where supply and demand are truly established.
RVOL Surge Filter: To prevent "lazy" or low-liquidity fake-outs, the zone is only highlighted if the most recent touch occurred with a volume spike (Relative Volume > 1.5x average).
Dynamic Price Anchoring: Built using Pine Script v6 force_overlay, these zones are physically anchored to the price candles. They scale and move perfectly with the chart as you zoom or scroll, avoiding the "floating" issues common in standard drawing scripts.
Smart Proximity: Includes a proximity filter (default $0.50 for Gold) that groups nearby wicks into a single unified zone of interest.
How to Use
Identify the Zone: When a Red (Resistance) or Green (Support) box appears with a thick yellow border, it indicates a high-probability institutional level.
Wait for the Sweep: Look for price to "hunt" the liquidity inside the box.
The Rejection: A successful trade setup often occurs when a candle wicks into the zone but closes back outside of it on high volume.
Risk Management: The edges of these boxes provide clear, objective levels for stop-loss placement.
Settings
Pivot Strength: Adjusts how "significant" a peak must be to be recorded. (10 is recommended for 1m/5m charts).
RVOL Threshold: Sets the multiplier for volume spikes. 1.5 means 150% of the recent average volume.
Touch Proximity: Defines how close rejections must be to each other to be considered part of the same "cluster."
مؤشر Pine Script®
Holy Grail by Linda Bradford Raschke Holy Grail - Linda Raschke (v6)
Trend-following pullback strategy inspired by Linda Bradford Raschke & Larry Connors' classic "Holy Grail" setup from Street Smarts: High Probability Short-Term Trading Strategies.
Captures high-probability continuations in strong trends by entering on low-risk pullbacks to the 20-period EMA after ADX confirms trend strength.
Overview:
This open-source Pine v6 strategy implements the famous "Holy Grail" setup — ironically named for its elegant simplicity. It uses only two core indicators (14-period ADX + 20-period EMA/SMA) to identify strong trends and enter on the resumption after a pullback. Designed for swing and intraday trading on trending instruments like indices (DAX, Dow, NQ, ES), forex majors, or stocks.
The strategy:
Filters for strong, rising trends (ADX > 30 and increasing)
Waits for price to touch the 20 MA during a retracement
Places simulated stop-entry orders (buy above high / sell below low of the touch bar)
Applies tight initial stops + ATR-based trailing to let winners run
Includes an additional exit when trend momentum fades (ADX < user-defined weak level)
Best suited for 15-min to daily timeframes in volatile, directional markets.
Concepts & Core Rules (from Street Smarts):
Trend Strength Filter : 14-period ADX must be > threshold (default 30) and rising (ADX > ADX ) to confirm a strong trend — avoids choppy/range-bound conditions.
Pullback Identification : In uptrends (close > MA), price retraces to touch the 20 MA (low ≤ MA). In downtrends (close < MA), price rallies to touch (high ≥ MA).
Entry : Buy-stop above the high of the pullback bar (longs) or sell-stop below the low (shorts) — simulates breakout confirmation of trend resumption.
Risk Management : Initial stop at the pullback bar's extreme (low for longs, high for shorts). Trailing stop activates using ATR multiplier.
Exits : No fixed targets — trail profits + close position if ADX falls below a "weak" level (default 25), indicating potential trend exhaustion.
This implementation adds modern touches: optional EMA vs SMA, ATR trailing, background trend coloring, and setup labels for easy visual confirmation.
How to Use :
Add to chart (works on any symbol/timeframe; best on trending ones like indices or forex).
Look for green background + "HG L" label (long setup) or red background + "HG S" label (short setup).
The strategy places orders on the next bar after a valid pullback — review backtest results in the Strategy Tester tab.
Adjust inputs for your market/timeframe (e.g., lower ADX threshold on lower timeframes if needed).
Important: This is not financial advice. Always backtest thoroughly, forward-test on demo, and use proper risk management (1-2% per trade max).
Inputs :
ADX Length (default 14)
ADX Threshold (default 30) — must exceed and rise
ADX Exit Weak (default 25) — closes when trend fades
EMA Length (default 20)
Use EMA instead of SMA (toggle)
Trailing ATR Multiplier (default 2.5)
ATR Length for trailing (default 14)
Plots & Visuals :
Orange 20 MA line
"HG L" / "HG S" labels on setup bars
Green/red background tint during strong trend conditions
Notes & Limitations :
Simulation Note: Pine Script cannot place persistent broker-style stop orders across bars; entries use limit ≈ stop-entry on the next bar (close approximation — many traders place manual stops in live trading).
Prefers first pullback after ADX rise (highest probability); later pullbacks may work but are not filtered here.
Performs best in trending, volatile conditions — avoid ranging/choppy markets (ADX filter helps).
No pyramiding (one position at a time); no fixed R:R targets (focus on trailing winners).
Backtest results vary by symbol/timeframe — optimize cautiously and avoid curve-fitting.
Inspired by public domain rules from Street Smarts (1996) — this is an independent adaptation with Pine v6 improvements for clarity and flexibility.
If you find this useful, consider liking/favoriting. Feedback welcome — happy to add alerts, fixed targets, or "first pullback only" logic in future updates!
Original open-source release — feel free to study/modify.
استراتيجية Pine Script®
FeraTrading Rolling Price MagnetFeraTrading Rolling Price Magnet
This indicator highlights the price zones where the market has spent the most time over a recent window of bars. Instead of using moving averages or fixed levels, it scans past price action and identifies the levels that price has interacted with most frequently, helping reveal natural areas of interest, support, or resistance.
Overview
The script looks back a user-defined number of bars and breaks the price range into small zones (bins). It then counts how often price traveled through each zone and ranks them by frequency. The most-visited levels are plotted directly on the chart as horizontal lines.
This creates a dynamic view of where the market has been spending time, rather than relying on static indicators or lagging averages.
How It Works
The indicator looks back over the last X bars.
Each candle contributes price “hits” based on the selected mode:
Full Range: Counts all price levels between the candle’s low and high.
Positive Close: Only counts upward movement for candles that closed higher than the previous close.
Negative Close: Only counts downward movement for candles that closed lower than the previous close.
Price is grouped into small zones using a configurable bin size.
The script counts how often price passes through each zone.
The top most-visited levels are plotted as horizontal lines.
Visual Behavior
Green line: Most-visited price level.
Yellow line: Second most-visited level.
Orange line: Third most-visited level.
Optional labels display how many times each level was hit.
Lines update continuously as the rolling lookback window moves forward.
Inputs
Lookback Bars: Number of past bars used to calculate levels.
Top Levels: How many price levels to display.
Hit Mode:
Full Range
Positive Close
Negative Close
Bin Size: Controls the width of each price zone (in ticks or points).
Spacing Filter: Option to only count bars that are a minimum number of bars apart.
Line Width / Label Toggle: Visual customization options.
Use Case Summary
This indicator is useful for:
Finding natural support and resistance zones.
Identifying price “acceptance” areas.
Spotting magnets where price tends to return.
It works well across intraday and swing timeframes, especially on liquid instruments where price interacts frequently with key levels.
مؤشر Pine Script®
Volume Profile S/R Zones (Peaks)Volume Profile S/R Zones (Peaks) is a volume-profile based support/resistance tool that converts significant volume nodes into tradable zones, then ranks them by how consistently price respected them over the selected lookback.
The script builds a rolling Volume Profile over a user-defined window (default 81 days) using a fixed number of price bins (default 33 rows). For each price bin it accumulates:
Total volume traded inside that price region
Bullish volume (lower-timeframe bars that close above open)
Bearish volume (implied as total − bullish)
The profile is plotted on the left side of the chart. All profile elements and zones are intentionally forced to a single clean style: white at 20% opacity (labels keep the chart’s default text color styling).
What it detects
1) High Volume Nodes (Peaks)
The script scans the profile rows and detects local maxima (HVNs). To prevent noisy “micro peaks,” a peak must pass two quality filters:
Relative-to-Max filter: peak volume must be at least a % of the largest node’s volume
Prominence filter: peak volume must exceed the average of nearby nodes by a minimum ratio
These filters remove weak nodes and keep only meaningful price areas where the market traded heavily.
2) Optional Low Volume Nodes (Troughs / LVNs)
When enabled, the script also detects local minima (LVNs). LVNs can behave like “barrier” areas where price rejects or moves quickly through.
Zones instead of lines
Each detected node becomes a zone, not a single price line.
Zone center = middle of the profile row
Zone thickness is adaptive:
Zone Half-Width = max(price bin size, ATR × fraction)
This makes zones robust to volatility and reduces “false breaks” caused by small wicks.
Zone merging (reduces clutter)
Nodes close to each other are merged into a single zone if their centers are within:
Merge Distance = ATR × fraction
The merged zone center becomes volume-weighted, so stronger nodes dominate.
Reliability scoring (the core feature)
Every zone is scored by replaying price interaction over the lookback window:
Events
Touch: candle range intersects the zone
Valid rejection: touch + close exits the zone in the expected direction
Confirmed break: close outside the zone, confirmed by:
distance beyond the zone (ATR-based), or
a minimum number of consecutive closes outside
Scoring
Touch adds points
Rejection adds more points
Confirmed break subtracts points
A decay factor is applied each bar so older interactions matter less than recent ones
This produces a practical ranking: zones that get repeatedly respected score high; zones that fail score low.
What you see on the chart
Left-side Volume Profile (white 20% opacity)
Top N strongest zones (ranked by score), drawn as horizontal bands across the chart
Right-side price labels showing each zone’s center price
Label tooltip includes:
zone center price
reliability score
current “role” (support-side vs resistance-side)
polarity bias (bull/bear/neutral based on volume delta)
Inputs and how to tune
Volume Profile
Profile Lookback (Days): defines market memory (short = tactical, long = structural)
Rows: resolution of price bins (higher = more detailed, lower = smoother)
Profile Width: visual width of the profile histogram
POC mode: optional regular or developing POC line
Zones
Top N Zones: limits clutter by plotting only the strongest zones
ATR Length / Zone Half-Width: controls how wide zones are
Prominence / Relative-to-Max: controls strictness of peak detection
Merge Distance: merges nearby zones into one
Scoring
Touch / Rejection / Break points
Decay factor (higher = longer memory)
Break confirmation settings (ATR distance + consecutive closes)
How to use (practical framework)
This indicator is designed to treat volume nodes as acceptance/rejection areas, not perfect lines:
Focus on high-score zones (they have the most recent evidence of being respected)
Use zones as:
potential accumulation/defense areas (support-side)
potential supply/ceiling areas (resistance-side)
Break confirmation is ATR-based to reduce false breakdowns/breakouts
For investing, many users run two instances:
long lookback (e.g., 252 days) for macro zones
shorter lookback (e.g., 81 days) for tactical entries
Notes / Limitations
The script is a historical structure tool, not a predictor.
Zones can shift gradually as the rolling lookback window updates.
Different assets (high volatility vs low volatility) may require different row counts and filter strictness.
License / Credits
Based on LuxAlgo’s Volume Profile foundation and heavily modified to add zone construction, merging, and reliability scoring.
Licensed under CC BY-NC-SA 4.0 (Attribution–NonCommercial–ShareAlike).
مؤشر Pine Script®
Daily Key Levels (4AM-8PM)Dynamically updating Daily Key Levels for:
Opening Range Breakout
Pre-market High/Low
Yesterday High/Low
Current All Time High
*Pre-market levels don't take wicks into account
مؤشر Pine Script®
NQ Hourly Connected Flat BlocksThis indicator is designed for NQ (Nasdaq-100) and high-volatility futures traders who need a clean, distraction-free view of Hourly Market Structure. Unlike standard scripts that "staircase" every time a new high is hit, this script utilizes dynamic line-object management to keep hourly levels perfectly flat and connected.
Key Features
Static In-Period Ranges: The High and Low lines for the current hour remain perfectly horizontal. If a new high is hit, the entire line for that hour shifts up, maintaining a "Block" visual rather than a jagged staircase.
Vertical Connectivity: Hours are bridged by vertical connectors at the period transitions, allowing you to visualize "Liquidity Steps" as the market expands or contracts.
Midpoint (Equilibrium) Line: Includes a dashed 50% retracement level for every hour, essential for determining if price is in a "Premium" or "Discount" zone relative to the current hour's range.
Zero Offset: Levels are pinned directly to the candles that created them, providing real-time feedback on range expansion.
How to Trade It
Liquidity Sweeps: Watch for price to wick above the Green High line and immediately reclaim the previous level. This often signals a "Stop Run" before a reversal.
The "Ladder" Trend: In strong trending environments, you will see the "Blocks" create a staircase pattern. Use the Midpoint as a trailing support/resistance level.
Volatility Contraction: When the distance between the Green and Red lines is narrow compared to previous hours, anticipate an explosive breakout.
مؤشر Pine Script®
Market Open Line - 9:30 AM ETI've created a PineScript indicator that draws a horizontal line at the exact opening price from 9:30 AM Eastern Time.
Key Features:
Detects when the market opens at 9:30 AM ET
Captures the opening price at that exact time
Draws a horizontal line that extends from 9:30 AM through the rest of the trading session
Resets daily for a fresh line each trading day
Includes an optional label showing the price level
I tried to find other scripts that performed this same function on all chart types (i.e. Renko) but no other scripts worked for all use cases.
Cheers!
مؤشر Pine Script®
ZenAlgo - ABCThis indicator identifies a three-point price structure (X, A, B) and projects proportional price levels forward from point B. It uses either automatically detected swing points or manually selected anchors and then builds a forward projection framework based on the relative movement between X and A.
1. Anchor Point Selection (X, A, B)
The script first determines three key price points that define the reference movement.
Automatic mode
When manual anchors are disabled, the indicator scans historical bars to detect local highs and lows using a fixed number of bars on the left and right side. A pivot high is confirmed only after enough future bars exist, and the same applies to pivot lows. This avoids using information that is not yet available in real time.
Detected pivots are stored in sequence:
The previous confirmed pivot becomes X
The next confirmed pivot becomes A
The most recent confirmed pivot becomes B
To avoid repeatedly using the same type of pivot, the script alternates between highs and lows. This ensures that X, A, and B always represent a swing structure instead of a flat sequence.
Manual mode
When manual anchors are enabled, the user defines three timestamps. The script captures the price and bar index at those times. After all three points are collected, the script adjusts them to represent true extremes inside their bars. Depending on direction, it replaces closes with highs or lows so that X and A form a valid swing, and B represents a corrective endpoint.
If manual anchors are incomplete, the script falls back to the automatic pivots.
2. Validation and Direction Detection
After anchors are collected, the script checks whether all three points are available. If any of them is missing, no projection is drawn.
When X, A, and B exist, the script determines the directional context:
If A is above X, the structure is treated as bullish
If A is below X, the structure is treated as bearish
The vertical distance between X and A defines the reference movement. This distance is treated as the base unit for all further projections.
This approach assumes that the impulse move from X to A represents the dominant directional leg, and that B represents a retracement or pause within that structure.
3. Projection Calculation
All projected levels are derived from the difference between X and A and are applied starting from point B.
For each predefined ratio:
In bullish structures, the distance from X to A is added upward from B
In bearish structures, the distance is subtracted downward from B
This produces a set of horizontal price levels that are proportional to the initial impulse.
No fixed price values are used. All levels scale automatically with market volatility and with the size of the X–A movement.
4. Configurable Levels and Naming
The indicator defines a list of projection ratios that represent retracement, extension, and continuation zones. Each level can be enabled or disabled and has an adjustable color and transparency.
Each level may be displayed in two ways:
As a descriptive name combined with the ratio
As a numeric ratio combined with the projected price
The naming system maps specific ratios to semantic labels such as base, entry, intermediate targets, main target, and extended continuation levels. These names are fixed in the script and reflect their relative position in the projection structure.
5. Visual Construction
On the most recent bar, the script clears all previously drawn elements and rebuilds the full structure.
It then draws:
A dashed line from X to A and from A to B to visualize the underlying swing
Labels at X, A, and B with direction-aware placement
Horizontal lines from B into the future for each enabled level
Text labels at the end of each level line
All level lines extend a configurable number of bars to the right of the current bar, creating a forward projection area.
Transparency values are fixed to maintain visual consistency and to avoid obscuring price action.
6. Zone Construction
In addition to individual lines, the script can draw shaded zones between selected pairs of levels.
These zones include:
A retracement zone between two closely spaced mid-range ratios
A target zone between the main extension levels
An extended continuation zone above or below the main target
Zones are drawn as semi-transparent rectangles from point B to the right extension limit. Their vertical boundaries are defined by the corresponding projected levels.
These zones highlight areas where price interaction with multiple proportional levels is expected.
7. Display and Update Logic
The drawing process runs only on the most recent bar. This prevents excessive historical objects and ensures that projections always reflect the latest confirmed X, A, and B.
All graphical objects are stored internally and deleted before redrawing. This avoids overlap and keeps the chart synchronized with the current structure.
8. Interpretation of Levels
The projected levels represent proportional price distances derived from the prior impulse.
They should be interpreted as:
Reference zones for potential reactions
Areas of interest for continuation or exhaustion
Context for managing existing positions
Lower ratios correspond to shallow projections near B. Higher ratios correspond to extended moves away from B.
No level represents a guaranteed support or resistance. All values are conditional on the validity of the underlying X–A–B structure.
9. Practical Usage
Typical usage follows this workflow:
Wait for the script to confirm X, A, and B
Observe whether the structure is bullish or bearish
Use projected levels as reference for planning entries, exits, and risk placement
Re-evaluate when a new pivot replaces X, A, or B
Manual anchors can be used when the user wants to enforce a specific structure that differs from the automatic pivot logic.
The indicator is designed for contextual analysis rather than standalone signal generation.
10. Limitations and Disclaimers
This indicator depends on confirmed pivots. In fast or highly volatile markets, pivot confirmation can lag, which delays projections.
Structures may be invalidated when:
Price forms new extremes before a pivot is confirmed
Market conditions change abruptly
Range-bound markets produce frequent small pivots
In such conditions, projected levels may shift frequently or lose relevance.
The method assumes that past impulse size is a meaningful reference for future movement. This assumption does not hold in all market regimes.
The indicator does not incorporate volume, order flow, trend filters, or volatility regimes. It should therefore be combined with additional analysis.
11. Relationship to Manual Fibonacci and ABC Tools
Unlike standard manual Fibonacci retracement or projection tools, this indicator does not rely on subjective anchor placement. In automatic mode, swing points are selected using a fixed pivot detection process, which enforces consistent structural rules.
Anchor points are derived from confirmed price pivots instead of manual selection
The X–A–B structure is maintained automatically as new swings form
All projection levels and zones are recalculated and redrawn dynamically
This removes the need for repeated manual adjustments when market structure changes.
Compared to typical ABC projection tools, the script formalizes the entire workflow. The selection of reference points, the construction of proportional levels, and the management of graphical objects are handled programmatically. This prevents inconsistent anchor choices, reduces user interpretation bias, and ensures that projections always reflect the most recent validated structure.
The integrated zone construction further extends standard projection methods by grouping related levels into continuous price regions, rather than displaying only isolated horizontal lines.
Summary
This script identifies swing-based X–A–B structures using confirmed pivots or manual anchors, measures the impulse between X and A, and projects proportional levels from B. All displayed lines and zones are derived from this single reference movement and update dynamically as new pivots appear. The indicator provides a structured projection framework based on historical price geometry rather than predictive signals.
مؤشر Pine Script®
Liquidation Heatmap by RumiancevLiquidation Heatmap by Rumiancev
Overview
Liquidation Heatmap is an open-source visual map of estimated liquidation zones built from activity spikes .
When the script detects an unusually large spike, it projects liquidation levels for multiple leverage tiers and aggregates them into horizontal price “bins”. Each bin accumulates weight over time and is displayed as a color gradient:
• Brighter / hotter = higher accumulated weight
• Darker / colder = lower accumulated weight
Important: This is not an exchange liquidation feed and it does not display “real liquidation prices”. It is a proxy model designed to visualize where liquidation pressure could be clustering based on abnormal market activity.
Why BTCUSDT.P is recommended
For the most consistent and “liquidation-relevant” behavior, use a perpetual futures symbol such as BTCUSDT.P .
Perpetual markets provide Open Interest , so the script can use OI Delta (change in OI) as the spike stream. OI delta typically reflects leveraged positioning changes (build-up / flushes) more directly than spot volume.
• On perpetuals → OI data is available → spikes are usually cleaner for this model
• On spot → OI is not available → the script may fall back to volume, which can be noisier
If needed, set OI Symbol Override manually (examples are shown in the input tooltip).
How it works (logic)
1) Select a spike stream
• AUTO : uses OI Delta if available, otherwise Volume
• OI : forces OI Delta
• VOL : forces Volume only
2) Detect spike events
The script measures abnormal activity using a Z-score style approach on the absolute stream:
• Spike Lookback defines the baseline window
• Sensitivity maps to a threshold (lower = more events, higher = fewer events)
• Min bars between events optionally reduces clustering on lower timeframes
3) Project liquidation prices
For each spike event, liquidation estimates are calculated for up to three leverage tiers:
• Long liquidations are projected below the reference price
• Short liquidations are projected above the reference price
4) Bin, accumulate, and colorize
Projected levels are snapped into bins using Bin Scale (ticks) .
Bin weight is accumulated and displayed as a gradient between Low density and High density .
5) Freeze on touch
When price touches a bin (wick or close, depending on settings), the bin is frozen :
• it stops updating
• it becomes dotted / high transparency
This keeps a lightweight history of zones that have been interacted with.
How to read the map
• Bins below price often represent potential long-liquidation pressure zones
• Bins above price often represent potential short-liquidation pressure zones
• Brighter bins = more accumulated spike weight → potentially more crowded zone
• Frozen dotted bins = price already touched that zone (historical interaction)
Timeframes (recommendations)
This indicator runs on any timeframe, but density/noise changes significantly.
Best balance (recommended):
• 15m / 1H / 4H — good signal-to-noise and clean structure
Higher timeframes (cleaner, fewer zones):
• 12H / 1D — fewer events, more “macro” zones
Lower timeframes (noisier by nature):
• 1m / 3m / 5m — more spikes and more bins
To reduce clutter on low TF, consider:
• increasing Sensitivity (e.g., 14–18)
• enabling Min bars between events (e.g., 10–30)
• increasing Bin Scale (ticks) (thicker bins → fewer levels)
• enabling Keep only local range bins
Inputs (what each setting does)
Source
• Source Mode : AUTO / VOL / OI
• OI Symbol Override : manual OI source if AUTO is not suitable
Event (Spike) Filter
• Spike Lookback : baseline window for mean/stdev
• Sensitivity : lower = more events, higher = fewer events
• Use high/low for touch test : wick-based touches
• Min bars between events : reduces spike clustering
Liquidation Levels (bins)
• Reference Price : base price for projections (close/hl2/etc.)
• Leverage 1/2/3 : leverage tiers (set to 0 to disable any tier)
• Bin Scale (ticks) : bin thickness (bigger = fewer bins)
• Extend (bars) : how long active bins extend
• Max active bins per side : cap for active bins
• Dispersion (%) : splits part of the weight to the opposite side
• Keep only local range bins + Local range lookback : trims bins far from recent range
Visual
• Gradient colors, frozen transparency, legend, and debug marker
Limitations / Disclaimer
This script is provided for research and educational purposes only . It is not financial advice .
The plotted zones are estimates derived from a simplified model (spike detection + leverage projections). Results depend on symbol, exchange data availability (OI), and timeframe.
مؤشر Pine Script®
Aka Daily CPR LevelsAka Daily CPR Levels
This indicator plots clean and non-repainting Daily Central Pivot Range (CPR) levels along with R1/R2/R3 and S1/S2/S3, all calculated from the previous trading session.
Designed for intraday traders and options traders who need reliable support and resistance levels without clutter or lag.
Key Features:
• Daily CPR (TC / Pivot / BC)
• R1, R2, R3 resistance levels
• S1, S2, S3 support levels
• Non-repainting logic
• Lightweight and fast
Best used on intraday timeframes such as 5m, 15m, and 30m
مؤشر Pine Script®
Session Range BoxGeneric Session Box
Generic Session Box is a lightweight and customizable tool designed to visualize price ranges within user-defined trading sessions.
This indicator automatically draws a dynamic box that tracks the High and Low formed during a selected session period. The box updates in real time while the session is active and preserves historical session ranges for visual reference and analysis.
🔹 Features
Fully customizable session time range
Timezone selection support
Real-time session High/Low tracking
Automatic historical session storage
Adjustable maximum number of displayed boxes
Customizable box colors and borders
Efficient performance and memory management
⚙️ How It Works
The indicator monitors price activity during the selected session and dynamically builds a range box from the session High and Low. Once the session ends, the box is preserved as part of the historical session dataset.
🎯 Typical Use Cases
Identifying session volatility zones
Monitoring breakout levels
Comparing session ranges across days
Supporting intraday trading strategies
This tool is intended for visual and analytical purposes only and does not provide trading signals.
━━━━━━━━━━━━━━━━━━━━
🌎 Descripción (Español)
Generic Session Box es una herramienta configurable que permite visualizar el rango de precios generado dentro de sesiones de trading definidas por el usuario.
El indicador dibuja automáticamente una caja que representa el máximo y mínimo alcanzado durante la sesión seleccionada, actualizándose en tiempo real mientras la sesión está activa y conservando el historial de sesiones anteriores.
مؤشر Pine Script®
Clouds and Diamonds════════════════════════════════════════════════════════════════════════════════
CLOUDS AND DIAMONDS INDICATOR
════════════════════════════════════════════════════════════════════════════════
OVERVIEW
--------
A visual trend analysis tool displaying four moving average "clouds" on your
chart, each representing a different time horizon. Helps identify trend
direction and current trend state at a glance.
THE CLOUDS
----------
Each cloud is formed by the space between an EMA and SMA of the same period.
Color-coded by "metal" for quick timeframe identification:
Cloud | Default | Color | Purpose
------------|---------|--------|----------------------
Period 1 | 21 | Pink | Short-term trends
Period 2 | 50 | Bronze | Medium-term trends
Period 3 | 100 | Silver | Longer-term trends
Period 4 | 200 | Gold | Major long-term trends
Cloud border colors indicate trend direction:
- Green border = Bullish (EMA above SMA)
- Red border = Bearish (EMA below SMA)
THE SIGNALS
-----------
At the end of the chart, each cloud displays its current trend state:
Signal | Shape | Meaning
----------|-------|----------------------------------------
Diamond | * | Currently bullish (EMA above SMA)
X-Cross | X | Currently bearish (EMA below SMA)
Note: Markers appear only on the last bar, providing a clean summary of current
trend conditions across all timeframes. Signal sizes increase with period
length — larger signals represent longer-term trends.
HOW TO USE IT
-------------
1. Identify the trend — Look at cloud border colors. Multiple green = strong
uptrend; multiple red = downtrend.
2. Check the end-of-chart signals — Diamonds = bullish, X = bearish. Multiple
diamonds across timeframes = strong bullish alignment.
3. Weigh by timeframe — A diamond on Gold (200) carries more weight than
Pink (21). Look for multi-timeframe confirmation.
4. Gauge trend strength — Price above all clouds = strong trend. Clouds
converging or price entering them = momentum slowing.
QUICK REFERENCE
---------------
Green cloud borders Bullish trend for that timeframe
Red cloud borders Bearish trend for that timeframe
Diamond (at end) Currently bullish
X-Cross (at end) Currently bearish
Larger marker Longer-term timeframe
All diamonds Strong bullish alignment
All X-crosses Strong bearish alignment
Mixed signals Consolidation or transition
════════════════════════════════════════════════════════════════════════════════
مؤشر Pine Script®
MST Medio v1.0MST Medio — 3-Phase Price Action Confirmation
MST Medio is a structured price action indicator that detects high-probability reversal entries using a 3-phase confirmation process: Break → Confirm → Retest. It waits for a confirmed Higher High / Lower Low, validates the impulse wave, then triggers only when price retests the key level.
No repainting. No lagging indicators. Pure price action logic built on swing structure.
────────────────
How It Works
Phase 1 — Break
Price forms a Higher High (HH) above the previous Swing High, or a Lower Low (LL) below the previous Swing Low. The break must pass two filters:
Break Strength — The break distance must exceed a minimum percentage of the previous swing range (configurable, default 0.25×).
Impulse Body Filter — The first candle closing beyond the old high/low must have a body ≥ 1.5× the 20-bar average body. This ensures the break is driven by momentum, not a weak drift.
The indicator then identifies the W1 impulse wave — the highest high (BUY) or lowest low (SELL) from the break candle until the first opposing candle.
Phase 2 — Confirm
After the impulse wave, price must pull back and then close beyond the W1 peak (for BUY) or below the W1 trough (for SELL). This confirms that momentum has resumed after the correction.
Invalidation rules:
Price returns to the entry level (old SH/SL) before confirmation → structure broken, cancel.
Price hits the Stop Loss level → cancel.
Phase 3 — Retest Entry
Once confirmed, the indicator waits for price to retest the original Swing High (BUY) or Swing Low (SELL). This is your entry point — buying at the old resistance turned support, or selling at the old support turned resistance.
Invalidation rules:
Price hits Stop Loss → cancel.
Price breaks below the W1 trough (BUY) or above the W1 peak (SELL) → cancel.
────────────────
Visual Elements
Entry / SL / TP lines (dashed) — Drawn at signal confirmation with labels showing levels and R:R ratio.
Risk/Reward zones — Colored boxes: red zone (Entry → SL) and green zone (Entry → TP) for instant visual assessment.
Confirm Break label — "▲ Confirm Break" / "▼ Confirm Break" at the wave confirmation candle.
Pending state — Dotted lines and phase labels ("Phase 1 BUY", "Phase 2 SELL") showing the indicator is tracking a potential setup before it triggers.
Swing markers (optional) — Small triangles at detected pivot highs and lows.
────────────────
Take Profit Logic
TP is placed at the high of the Confirm Break candle (BUY) or the low of the Confirm Break candle (SELL). This represents the point where momentum was confirmed — a natural target that aligns with the structure of the move.
────────────────
Inputs
Pivot Lookback (default: 5) — Bars left/right to confirm a swing point. Higher values = fewer but stronger pivots.
Break Strength (default: 0.25) — Break distance must be ≥ this multiple of the previous swing range. Set 0 to disable.
Impulse Body Filter (default: 1.5) — The break candle body must be ≥ this multiple of the 20-bar average body. Set 0 to disable.
Show Entry / SL / TP Lines — Toggle dashed level lines and labels.
Show Risk/Reward Zones — Toggle colored risk/reward boxes.
Show Pending State — Toggle the dotted lines and phase labels for setups being tracked.
Show Confirm Break Label — Toggle the confirmation label.
Show Swing Points — Toggle swing high/low markers on the chart.
Full color customization for all visual elements.
────────────────
Alerts
BUY Signal — Fires when Phase 3 retest is triggered on a bullish setup.
SELL Signal — Fires when Phase 3 retest is triggered on a bearish setup.
Any Signal — Fires on either direction.
────────────────
Notes
Works on all timeframes and all instruments.
Non-repainting — All signals use confirmed (closed) pivots. No lookahead.
This is a detection tool , not a strategy. Use it alongside your own risk management and confluence analysis.
Best suited for trending markets where HH/LL structures form clean impulse waves.
The 3-phase confirmation significantly reduces false signals compared to raw breakout detection.
مؤشر Pine Script®
Game Theory Strategic Indicator - Archery & Horse Riding Model# Game Theory Strategic Indicator - Archery & Horse Riding Model
## Overview
This indicator applies rigorous game theory mathematics to market analysis, modeling price action as a strategic two-player game between buyers and sellers. The methodology draws from economic game theory, evolutionary dynamics, and zero-sum game optimization.
## Theoretical Foundation
The indicator implements five core game theory concepts:
**1. Expected Utility (Mixed Strategies)**
Calculates E = p×U₁ + (1-p)×U₂ where:
- p = probability distribution based on volume dynamics
- U₁, U₂ = utility payoffs for aggressive vs defensive strategies
- Uses RSI momentum and ATR volatility to quantify payoffs
**2. Nash Equilibrium Detection**
Identifies market states where ui(σᵢ*, σ₋ᵢ*) ≥ ui(σᵢ, σ₋ᵢ*):
- Measures when no participant can improve by changing strategy
- Highlighted with yellow background zones
- Signals reduced edge environments (avoid trading)
**3. Replicator Dynamics**
Models evolutionary strategy adaptation: dx/dt = x(f(x) - φ(x))
- Tracks frequency changes in bullish vs bearish strategies
- Shows which approach is gaining evolutionary fitness
- Purple line indicates strategy evolution trend
**4. Minimax Algorithm**
Implements zero-sum game optimal strategy L(x,y):
- Calculates win/loss ratio over lookback period
- Values > 1.0 suggest favorable risk/reward
- Orange line shows deviation from neutral state
**5. Best Response Function**
Determines optimal action maximizing ui(aᵢ, a₋ᵢ):
- Compares buyer vs seller expected utilities
- Generates primary long/short signals
- Confidence weighted by utility differential
## Visual Elements
**Chart Plots:**
- **Blue Line (Utility Differential)**: Buyer utility minus seller utility. Positive favors longs, negative favors shorts
- **Purple Line (Replicator Dynamics)**: Rate of strategy evolution. Rising = bullish strategies gaining fitness
- **Orange Line (Minimax Deviation)**: Zero-sum game value. Above zero = favorable conditions
- **Pink Area (Mixed Strategy Bias)**: Probability-weighted strategy preference
- **Yellow Background**: Nash equilibrium zones where no player has edge
**Signals:**
- **Green Triangle Up**: Long signal - buyer utility dominates outside equilibrium
- **Red Triangle Down**: Short signal - seller utility dominates outside equilibrium
- **Yellow Diamond**: Equilibrium warning - reduced edge state
**Info Table (Top Right):**
- EU Buyer/Seller: Current expected utilities
- Nash Score: Equilibrium strength (>0.65 = equilibrium)
- Mix Prob: Volume-based probability distribution
- Minimax: Win/loss ratio indicator
## Strategy Metaphors
**Archery (Buyer Strategy)**: Represents precision attacks - targeted entries at optimal risk/reward points, high accuracy required
**Horse Riding (Seller Strategy)**: Represents mobile defense - flexible positioning, quick exits, adaptive to changing terrain
## Parameters
- **Strategy Period (14)**: Lookback for RSI and ATR calculations
- **Mixed Strategy Length (21)**: Period for minimax win/loss analysis
- **Nash Equilibrium Threshold (0.65)**: Minimum score to identify equilibrium (0.5-0.9)
- **Show Trade Signals**: Toggle buy/sell arrows
- **Show Equilibrium Zones**: Toggle background highlighting
## How to Use
1. **Trend Trading**: Take long signals when utility differential (blue) is rising and no equilibrium zone present
2. **Counter-Trend**: Take signals when replicator dynamics (purple) diverges from price
3. **Risk Management**: Avoid trading during yellow equilibrium zones - market has no clear edge
4. **Confirmation**: Best signals occur when minimax > 1.0 and best response aligns with utility differential
5. **Monitoring**: Watch info table for real-time utility balance and equilibrium status
## Alerts
Three alert conditions available:
- **GT Long Signal**: Buyer utility dominates, composite score > 0.5
- **GT Short Signal**: Seller utility dominates, composite score < -0.5
- **Nash Equilibrium**: Market reaches balanced state, avoid new entries
## Mathematical Rigor
All calculations use proper game theory formulations:
- Payoff functions normalized by volatility
- Probability distributions bounded
- Zero-division protection implemented
- Utilities properly weighted in composite score
## Originality Statement
This indicator is original work implementing classical game theory mathematics in a novel market analysis framework. The code, calculations, and interpretation methodology are entirely my own creation. No external scripts were copied or modified.
## Disclaimer
This indicator is for educational purposes. Game theory provides a framework for analyzing strategic interaction but does not guarantee profitable trading. Always use proper risk management, test thoroughly, and understand that past performance does not indicate future results.
---
**Educational Resource**: For deeper understanding of game theory in economics, see Nash (1950) "Equilibrium Points in N-Person Games" and Maynard Smith (1982) "Evolution and the Theory of Games"
```
---
مؤشر Pine Script®
[ARTIO] Ultimate Initial Balance (EU & US) - Real-Time & Clean🚀 Professional Initial Balance for DAX & Nasdaq Scalping
This is the ultimate Initial Balance (IB) tool designed for serious day traders. It solves the biggest issues of standard indicators: the "Blind Hour" (when the box appears only after the close) and "Chart Clutter" (too many old lines).
Key Features:
⚡ Real-Time Drawing: No blind spots. The IB Box, High/Low lines, and Targets appear from the very first minute of the session and update dynamically with every tick.
🧹 Clean Chart Technology: A unique "Garbage Collector" feature. You can keep historical colored boxes for structure analysis, but the script automatically deletes old lines (High/Low/Targets) from previous days. Your chart stays clean.
🌍 Dual Session Support: Monitor Europe (DAX, 09:00 Berlin) and USA (Nasdaq, 09:30 NY) simultaneously on one chart. Hardcoded exchange timezones ensure accuracy regardless of your local time.
🎯 Pro Levels & Targets:
- Midline (50%): The "Fair Value" of the opening range.
- Extensions (1.5x & 2.0x): Automatic take-profit levels based on range expansion.
- Range Info: Displays the IB width in points (essential for volatility filtering).
Settings:
Toggle "Today's Lines" and "History Lines" independently.
Adjust History Depth (how many days of lines to keep).
Fully customizable colors and session times.
Developed by for precision trading.
__________________________________________________
🚀 Профессиональный Initial Balance для скальпинга DAX и Nasdaq
Это самый продвинутый индикатор Initial Balance (IB) для дейтрейдеров. Он решает главную проблему стандартных скриптов: "Слепой Час" (когда коробка рисуется только после закрытия) и "Мусор на графике" (когда старые линии мешают обзору).
Главные фишки:
⚡ Real-Time Отрисовка: Вы видите коробку с первой минуты торгов. Линии High/Low и Цели двигаются за ценой в реальном времени. Никаких задержек.
🧹 Clean Chart (Умная очистка): Уникальная функция. Вы можете оставить цветные боксы истории за месяц, но линии уровней (High/Low/Targets) будут автоматически удаляться за прошлые дни. Ваш график всегда чист.
🌍 Dual Session: Одновременная работа с Европой (DAX, 09:00 Berlin) и США (Nasdaq, 09:30 NY). Жесткая привязка к часовым поясам бирж — работает корректно из любой страны.
🎯 Профессиональные уровни:
- Midline (50%): Справедливая цена дня. Работает как магнит.
- Targets (1.5x и 2.0x): Автоматические цели для фиксации прибыли при пробое.
- Info Label: Показывает ширину диапазона в пунктах (для фильтрации волатильности).
Настройки:
Вкл/Выкл линий Сегодня и Истории отдельно.
Настройка глубины истории (сколько дней хранить линии).
Полная кастомизация цветов и времени сессий.
Разработано для профессиональной торговли.
مؤشر Pine Script®
PD Location Screener (NY Session)PD Location Screener (NY Session) – Premium / Discount / Equilibrium Bias
This open-source overlay indicator is a lightweight visual screener that shows where current price is located relative to the **previous day's range** (PD high/low/midpoint), helping traders quickly identify:
- Discount zones (below 25% of PD range → potential buy bias)
- Premium zones (above 75% of PD range → potential sell bias)
- Equilibrium / neutral (near midpoint → balanced / choppy)
Core Concept
Many intraday traders use the previous day's range as a reference framework:
- Price below the midpoint (especially in the lower 25%) is considered **discount** → undervalued relative to yesterday → higher probability of mean-reversion buys or continuation if momentum builds
- Price above the midpoint (especially in the upper 25%) is considered **premium** → overvalued → higher probability of mean-reversion sells or fading
- Near the midpoint → equilibrium → often choppy or awaiting directional catalyst
This script adds a **NY session filter** (default 08:30–16:00 NY time) so the PD range calculation only includes bars during active New York hours — useful for avoiding thin Asian-range noise and focusing on high-liquidity period behavior.
Why this is useful
- Provides instant visual context for bias without cluttering the chart
- Helps filter trades: e.g., look for longs in discount + bullish structure, shorts in premium + bearish structure
- Session filter makes it particularly effective for NY/London overlap strategies (forex, indices, gold, futures)
How It Works
1. Tracks daily high/low only during NY session (optional toggle)
- Resets at new day
- Updates only when inSession = true
2. Calculates:
- Midpoint = (PD High + PD Low) / 2
- PD Range = PD High – PD Low
- Discount threshold = PD Low + 25% of range
- Premium threshold = PD Low + 75% of range
3. Bias flags:
- Discount: close < midpoint → green triangle below bar
- Premium: close > midpoint → red triangle above bar
4. Optional last-bar label:
- "DISCOUNT ZONE" (green)
- "PREMIUM ZONE" (red)
- "EQUILIBRIUM" (gray)
Visual Output
- Green triangle below bar → price in discount (buy bias area)
- Red triangle above bar → price in premium (sell bias area)
- Last-bar label (toggleable) showing current location
How to Use
- Best on **5m–1h timeframes** for intraday trading (forex majors, indices, gold, futures)
- Recommended pairs: EURUSD, GBPUSD, XAUUSD, NAS100, ES1!, NQ1!
- Typical workflow:
1. Wait for price to reach discount zone + bullish price action / structure → consider longs
2. Wait for premium zone + bearish price action → consider shorts
3. Avoid entries near equilibrium unless strong breakout catalyst
- Combine with:
- Order blocks, FVGs, liquidity sweeps
- Higher-timeframe trend filter
- Session open/high/low
- Toggle "Use NY Session Only" off if you want full 24h range (e.g., crypto or Asian-focused pairs)
Inputs
- Use NY Session Only: true = only NY hours count toward PD range (recommended)
- NY Session: default "0830-1600" (adjust if broker timezone differs)
- Show Location Labels: toggle last-bar text label
Publishing Recommendation
- Publish with a clean chart (e.g., 15m–1h XAUUSD or EURUSD during NY session)
- Show a period where price moves from discount → equilibrium → premium (triangles visible)
- No extra indicators/drawings needed
This is a simple, educational location bias tool — fully open-source. It highlights relative value zones — not trade signals. Trading involves significant risk of loss. Use discretion and proper risk management.
Feedback welcome — especially suggestions for adding PD open or 50% retracement lines!
مؤشر Pine Script®
Gold/Spread AlgoXAUUSD 1-Minute RSI Scalping Strategy – Mean-Reversion with Fixed Exits
This open-source strategy is a high-frequency, counter-trend scalping system designed specifically for **XAUUSD (Gold)** on the 1-minute timeframe.
Core Logic
The strategy uses classic RSI(14) to identify short-term overextension:
- Long entry when RSI drops below oversold (default 30) → expects quick snap-back
- Short entry when RSI rises above overbought (default 70) → expects quick pullback
Entries are taken only when flat (no pyramiding). Exits are fixed in pips and set immediately on entry:
- Take Profit: +10 pips (0.10 in XAUUSD price)
- Stop Loss: –5 pips (0.05 in XAUUSD price)
- Built-in Risk:Reward = 1:2
This fixed structure gives the system positive mathematical expectancy even with moderate win rates (≈55–65% before costs), provided gold continues to exhibit frequent mean-reversion behavior on 1-minute charts.
Why this simple approach?
Gold is one of the most volatile and momentum-driven instruments on very short timeframes. Pure RSI extremes often capture quick exhaustion moves after news spikes, order flow imbalances, or session transitions — especially during London/NY overlap. Fixed pip targets prevent over-optimization and mimic real broker execution more closely than dynamic trailing or percentage-based exits.
Important Realism & Backtesting Notes
To produce non-misleading results, use these settings when publishing/testing:
- Initial Capital: $10,000 – $30,000 (realistic retail size)
- Position sizing: fixed 0.10–0.30 lots or 1–3% equity per trade
- Commission: 5–8 USD round-turn per lot (typical ECN/raw-spread)
- Slippage: 3–8 ticks (≈0.03–0.08 in price) — gold spreads widen during volatility
- Minimum dataset: 12–36 months of 1-minute data (aim for 800–2000+ trades)
- Risk per trade: usually 0.5–1.5% with defaults — never exceeds sustainable levels
Results vary significantly:
- Strongest in ranging or mildly trending sessions
- Weaker during strong directional moves or major news (NFP, FOMC, geopolitics)
- Expect drawdowns during trending regimes — this is NOT a trend-following system
Visual & Dashboard Elements
- RSI line + fill (blue/orange background) + overbought/oversold zones
- BUY/SELL triangles at entry points
- Professional top-right dashboard showing:
- Net Profit & Loss
- Total Trades / Win Rate / Profit Factor
- Winning / Losing Trades
- Current RSI value
- Position status (LONG / SHORT / FLAT)
- TP:SL ratio
Alerts
- 🟢 LONG ENTRY – RSI oversold
- 🔴 SHORT ENTRY – RSI overbought
How to Use
1. Apply to XAUUSD 1-minute chart only
2. Use realistic commission/slippage in Strategy Tester
3. Trade primarily during London & New York sessions for best liquidity
4. Avoid major news events or widen stops manually
5. Forward-test on demo for 2–3 months minimum
6. Always size conservatively — never risk more than 1–2% per trade
Publish Recommendation
- Use a clean chart: only this strategy, no extra indicators/drawings
- Show realistic tester results with commission/slippage applied
- Screenshot during active session with visible entry signals + dashboard
Educational tool — open-source for learning and testing. Not financial advice. Gold 1-minute trading is extremely volatile and carries high risk of loss. Trade responsibly.
استراتيجية Pine Script®
All-in-One SMC ProAll-in-One SMC Pro: CHOCH • BOS • FVG • Order Blocks • Liquidity + Discount/Premium
This open-source overlay indicator combines the five most widely used Smart Money / ICT (Inner Circle Trader) concepts into a single, customizable tool:
- Break of Structure (BOS)
- Change of Character (CHOCH)
- Fair Value Gaps (FVG)
- Order Blocks (mitigation blocks)
- Liquidity grabs (equal highs/lows)
- Discount / Premium zones
Why this combination?
SMC traders rarely use these concepts in isolation. A complete workflow typically involves:
1. Identifying market structure direction (BOS) or reversal (CHOCH)
2. Locating high-probability entry zones (Order Blocks, FVGs)
3. Confirming institutional manipulation (liquidity grabs of equal highs/lows)
4. Understanding price positioning relative to value (discount = buy bias, premium = sell bias)
Putting them all in one script reduces chart clutter, improves confluence visibility, and helps newer SMC users see how the pieces connect — without needing 5–7 separate indicators.
Core Concepts & Detection Logic
1. Break of Structure (BOS)
- Bullish BOS: price closes above previous swing high
- Bearish BOS: price closes below previous swing low
- Swing points detected with user-defined lookback (default 5 bars left/right)
2. Change of Character (CHOCH)
- Bullish CHOCH: price makes lower low but closes above previous swing high (bearish structure broken → bullish reversal signal)
- Bearish CHOCH: price makes higher high but closes below previous swing low (bullish structure broken → bearish reversal signal)
3. Fair Value Gaps (FVG)
- Bullish FVG: gap up after a bearish candle (low > high )
- Bearish FVG: gap down after a bullish candle (high < low )
- Sensitivity controlled via ATR multiplier (default 0.1 × ATR(14))
- Dashed horizontal lines mark the gap boundaries
4. Order Blocks
- Bullish OB: previous swing low after bullish BOS (potential demand zone)
- Bearish OB: previous swing high after bearish BOS (potential supply zone)
- Drawn as semi-transparent boxes extending rightward (lookback period adjustable)
5. Liquidity Grabs
- Detects clusters of equal highs/lows (default 3-bar lookback)
- Labels appear when price reverses after touching equal levels (classic stop-hunt / liquidity raid)
6. Discount / Premium Zones
- Equilibrium proxy = (H + L + C) / 3
- Discount: price below ~0.5% of equilibrium (green tint – buy bias area)
- Premium: price above ~0.5% of equilibrium (red tint – sell bias area)
Visual Customization
- Toggle each element independently (BOS, CHOCH, FVG, OB, Liquidity, Disc/Prem)
- Separate bullish/bearish colors + dedicated FVG/OB/Liquidity colors
- Max lines/labels set high (500) to handle longer histories
Alerts (built-in conditions)
- Bullish / Bearish BOS
- Bullish / Bearish CHOCH
- Bullish / Bearish FVG formation
How to Use
- Best on 5m–4h timeframes for forex, indices, crypto, gold (high-liquidity instruments)
- Typical SMC workflow example:
1. Look for CHOCH → potential trend reversal
2. Wait for BOS in new direction → structure confirmation
3. Seek entry at Order Block or FVG mitigation in discount/premium zone
4. Liquidity grabs near swing extremes often precede strong moves
- Combine with session times, news events, or higher-timeframe bias — never trade signals in isolation
- Adjust swingLen (3–10) for sensitivity: lower = more signals, higher = cleaner structure
Publishing Recommendation
- Publish with a clean chart (recommended: 15m–1h EURUSD, XAUUSD, BTCUSD, or NQ1!)
- Show a recent CHOCH → BOS → OB/FVG confluence sequence
- Remove all other indicators, drawings, and unnecessary gridlines
Always use discretion, proper risk management, and backtest thoroughly.
Feedback welcome — especially on FVG sensitivity or OB refinement ideas!
مؤشر Pine Script®
Apex / ChartFanatics Bubbles + Clusters + SweepsApex / ChartFanatics Bubbles + Clusters + Sweeps
This open-source indicator combines four visual elements — Volume Bubbles, Volume Clusters, Liquidity Sweep Markers, and Dynamic Supply/Demand Zones — into a single overlay tool. The goal is to provide traders with a unified view of volume intensity, aggressive price action, and key institutional reference levels on any timeframe or instrument.
Why this combination?
Many volume and structure tools exist separately, but combining them creates synergy:
- Volume Bubbles highlight relative volume strength instantly (quick glance at participation level).
- Volume Clusters emphasize high-volume bars as potential support/resistance areas.
- Liquidity Sweep markers flag classic "fakeout" or stop-hunt behavior (aggressive wicks that fail to sustain).
- Supply/Demand zones provide context for where price is likely to react after sweeps or clusters form.
Together, these elements help traders spot:
- Areas of high institutional interest (clusters + zones)
- Potential reversals after liquidity grabs (sweeps + zones)
- Confirmation of momentum via volume size and candle direction (bubbles + clusters)
This mashup is not random — it follows a logical Smart-Money / Order-Flow inspired workflow: detect volume → identify aggressive liquidity raids → map reaction zones → visualize everything for fast decision-making.
Core Features & How They Work
1. Volume Bubbles (Quantile-Based)
- Volume is ranked against a rolling lookback (default 200 bars).
- Dynamic quantiles divide the volume range into buckets (default 10 levels).
- Bubble size scales with quantile rank (tiny → huge).
- Color: bright green (bullish close) or bright red (bearish close), with adjustable opacity.
- Only shown when volume exceeds 1.2× the lookback minimum (avoids noise).
- Tooltip shows exact volume, delta (close-open), and quantile position.
2. Volume Clusters
- Draws semi-transparent boxes around bars exceeding a user-defined minimum volume.
- Width adjustable (default 4 bars forward) to highlight clusters visually.
- Same bullish/bearish coloring as bubbles for consistency.
3. Liquidity Sweeps
- Detects classic sweep patterns on the previous bar:
→ Bullish sweep: high > previous high, but close < previous high AND bearish candle
→ Bearish sweep: low < previous low, but close > previous low AND bullish candle
- Marked with a bright yellow star (★) label + tooltip.
- Useful for identifying potential stop hunts or failed breakouts.
4. Supply & Demand Zones
- Uses pivot high/low (default lookback 20 left/right) to detect swing points.
- Supply zone: from pivot high downward by 2× ATR(14).
- Demand zone: from pivot low upward by 2× ATR(14).
- Zones extend rightward dynamically (up to +30 bars) and remain visible until new pivots form.
- Brownish for supply (resistance), greenish for demand (support).
Inputs & Customization
- Bubble Quantiles (3–15): more levels = finer volume grading
- Bubble Opacity: controls transparency
- Volume Lookback: historical window for quantile calculation
- Cluster settings: toggle, min volume, width
- Sweeps & Zones: individual toggles
- Zone Pivot Lookback: sensitivity of swing detection
How to Use
- Best on lower timeframes (1m–15m) for scalping/day trading or higher (1h–4h) for swing setups.
- Look for confluence:
→ Large green bubble + cluster + demand zone + bullish sweep = strong support area
→ Large red bubble + cluster + supply zone + bearish sweep = strong resistance area
- Use sweeps as early warning of potential reversal when price approaches a zone.
- Combine with your own price action or structure analysis — this is a visual aid, not a signal generator.
- Keep chart clean: toggle off unused features if cluttered.
Publishing Notes
- Publish with a clean chart (only this indicator active, no other overlays/drawings).
- Recommended symbols: volatile instruments (forex majors, indices, crypto, gold).
- Max labels/boxes set high (500) to handle long histories — reduce if performance issues occur.
This script is fully open-source for transparency and learning. It is provided for educational purposes — no guarantees of profitability. Trading involves risk.
Feedback welcome — happy charting!
مؤشر Pine Script®
MA & BB Levels [ST]**MA & BB Levels ** is a comprehensive Multi-Timeframe (MTF) technical analysis tool designed to visualize key Weekly and Daily support and resistance levels on lower timeframe charts.
This indicator helps traders identify significant dynamic levels that are often respected by institutional algorithms but are invisible on standard intraday charts.
### 🛠 Key Features
1. **Multi-Timeframe Overlays:**
* Plots **Weekly** EMA 9, EMA 20, and Bollinger Bands (Upper/Lower).
* Plots **Daily** EMA 9, EMA 20, and Bollinger Bands (Upper/Lower).
* All levels are automatically calculated and synchronized, regardless of the chart's current timeframe.
2. **Smart Visuals:**
* Uses extended lines to project levels forward, making it easy to anticipate price reactions.
* Includes clear labels placed precisely on top of the lines (Label Lower Left style) to avoid obscuring the price action.
* Customizable text sizes to fit different screen resolutions (4k/HD).
3. **Standardization :**
* Part of the suite, ensuring optimized code performance and standardized inputs.
* English-native codebase and settings.
### 📚 How to Use
* **Trend Alignment:** Use the Weekly EMA 20 to gauge the macro trend direction while trading on intraday frames like 15m or 5m.
* **Reversion Plays:** The Daily and Weekly Bollinger Bands often act as strong reversion points (Overbought/Oversold zones) when tested for the first time.
* **Confluence:** Look for areas where a Daily EMA overlaps with a Weekly Bollinger Band level. These clusters often provide high-probability reaction zones.
### ⚙️ Settings
* **Toggles:** You can individually turn on/off any Weekly or Daily level via the settings panel to keep your chart clean.
* **Periods:** Standard defaults are EMA 9/20 and BB 20 (StdDev 2.0), but all periods are fully customizable.
---
*Disclaimer: This tool is for educational purposes and technical analysis assistance only. Always manage your risk.*
مؤشر Pine Script®
Volumetric Supply and Demand Zones [BOSWaves]Volumetric Supply and Demand Zones - Impulse-Based Zone Detection with Embedded Volume Profile Analysis
Overview
Volumetric Supply and Demand Zones is an impulse-driven zone identification system that marks significant reversal areas through swing detection and volume accumulation patterns, where zone boundaries dynamically reflect actual trading activity concentration rather than arbitrary price levels.
Instead of relying on traditional horizontal support/resistance lines or fixed pivot structures, zone placement, thickness, and volumetric composition are determined through ATR-normalized impulse detection, volume profile distribution analysis, and delta decomposition within base formation periods.
This creates adaptive supply and demand boundaries that reflect actual volume accumulation patterns rather than simple price extremes - contracting zones around high-volume concentration areas when profile shows tight distribution, expanding zones during dispersed volume activity, and incorporating positive/negative delta breakdowns to reveal whether zones formed under buying or selling pressure dominance.
Price interactions are therefore evaluated relative to volume-weighted zone structures and point-of-control levels rather than conventional naked price zones.
Conceptual Framework
Volumetric Supply and Demand Zones is founded on the principle that meaningful reversal zones emerge where significant volume accumulated during consolidation before impulse moves rather than at simple swing high/low pivot points.
Traditional supply and demand methods identify zones using price structure alone through swing detection or candlestick patterns, which often ignores the underlying volume distribution and buying/selling pressure that validates institutional accumulation or distribution. This framework replaces price-only logic with volume-weighted zone construction informed by actual trading activity concentration and delta composition.
Three core principles guide the design:
Zone boundaries should encompass base formation periods preceding impulse moves, not isolated pivot candles alone.
Volume profile distribution within zones must reveal where actual trading activity concentrated, identifying true points of control.
Delta decomposition exposes whether zones formed under buying pressure (demand accumulation) or selling pressure (supply distribution).
This shifts supply and demand analysis from naked price levels into volume-validated, delta-aware institutional footprint zones.
Theoretical Foundation
The indicator combines swing pivot detection, ATR-based impulse measurement, volume profile construction, and delta decomposition analysis.
A pivot detection system identifies local swing highs and lows using configurable left/right bar parameters. Impulse validation measures the subsequent price move magnitude relative to ATR, confirming whether the swing preceded a significant directional thrust. Zone boundaries encompass a lookback period of candles forming the base, with maximum height capped by ATR multiplier to prevent excessively large zones. Volume profile divides each zone into horizontal rows, distributing volume proportionally based on price overlap and identifying the point of control (highest volume row). Delta profile separates volume into buying versus selling components using close-open relationships, revealing net directional pressure within each profile row.
Five internal systems operate in tandem:
Swing Detection Engine : Identifies pivot highs and lows using symmetrical left/right bar confirmation for potential zone anchor points.
Impulse Validation System : Measures price movement magnitude following pivot formation, requiring ATR-multiple threshold breach to confirm zone significance.
Volume Profile Constructor : Divides zone height into configurable rows, allocates volume proportionally based on bar price range overlap with each row, identifies POC as highest-volume row.
Delta Decomposition Engine : Separates volume into buying (up-close bars) versus selling (down-close bars) components within each profile row, calculates net delta and dominant pressure direction.
Zone Merge Logic : Detects overlapping zones of same type (supply/supply or demand/demand), combines boundaries and recalculates volume/delta statistics with weighted blending.
This design allows supply and demand zones to reflect actual volume accumulation reality rather than reacting mechanically to price pivots alone.
How It Works
Volumetric Supply and Demand Zones evaluates price through a sequence of volume-aware zone construction processes:
Pivot Identification : Swing detection algorithm identifies local highs and lows using configurable left/right bar symmetry, marking potential reversal zone anchors.
Impulse Magnitude Validation : Following pivot formation, price movement measured relative to ATR over lookback period - move must exceed ATR multiplier threshold to confirm zone validity.
Base Period Boundary Definition : Zone encompasses pivot bar plus configurable lookback candles forming the consolidation base preceding impulse move.
Height Normalization : Raw zone height (high to low of base period) capped at maximum ATR multiplier to prevent zones becoming unreasonably large during extended consolidations.
Volume Profile Row Allocation : Zone divided into configurable number of horizontal rows, each bar's volume distributed proportionally based on price range overlap with row boundaries.
Point of Control Identification : Row with highest accumulated volume marked as POC, representing price level with maximum trading activity concentration within zone.
Delta Component Separation : Each bar's volume classified as buying (close > open) or selling (close < open), allocated to respective delta buckets within overlapping profile rows.
Delta Profile Construction : Net delta (buy volume minus sell volume) calculated per row, rendered as horizontal bars extending from zone right edge inward with green (positive) or red (negative) coloring.
Overlap Detection and Merging : New zones checked against existing zones of same type, overlapping zones within merge gap threshold combined with boundary expansion and volume/delta statistics aggregation.
Mitigation Detection : Price interaction monitoring using configurable method (wick or close) determines when zones violated, triggering zone deletion and cleanup of all visual elements.
Together, these elements form a continuously updating supply and demand framework anchored in volume accumulation reality and delta pressure composition.
Interpretation
Volumetric Supply and Demand Zones should be interpreted as volume-validated institutional footprint zones:
Demand Zones (Green) : Form at swing lows preceding upward impulse moves exceeding ATR threshold - represent areas where buyers accumulated positions before markup phase, volume profile shows where bids concentrated.
Supply Zones (Red) : Establish at swing highs preceding downward impulse moves exceeding ATR threshold - identify areas where sellers distributed positions before markdown phase, volume profile shows where offers concentrated.
Volume Profile Bars : Horizontal bars extending from zone left edge show relative volume distribution across price levels - longer bars indicate higher trading activity, revealing true institutional accumulation/distribution levels versus arbitrary zone edges.
Point of Control Line (White) : Horizontal line within zone marks price level with maximum volume concentration - represents the most significant institutional activity level, often acts as magnetic price level during retests.
Delta Profile Bars : Horizontal bars extending from zone right edge inward display net buying/selling pressure per price level - green bars show buy volume dominance (accumulation), red bars show sell volume dominance (distribution).
Zone Info Box : Text panel on right edge displays zone type (SUPPLY/DEMAND), status (Fresh/Tested), total volume, net delta, and touch count - provides quantitative validation of zone significance.
Fresh Status : Newly created zones not yet tested by price - highest probability reversal zones as institutional orders likely remain unfilled.
Tested Status : Zones where price returned and interacted with boundaries - touch count reveals how many times zone provided support/resistance, excessive touches suggest weakening.
Merged Zones : Wider zones with higher volume/delta values formed by combining multiple overlapping base periods - represent extended institutional accumulation/distribution areas with greater significance.
POC Brightness : Brightest (white) volume profile bar marks point of control - visual emphasis highlights the most critical price level within zone structure.
Volume distribution shape, POC placement, delta composition, and touch count outweigh simple zone boundary reactions.
Signal Logic & Visual Cues
Volumetric Supply and Demand Zones presents zone interaction insights rather than discrete directional signals:
Fresh Zone Formation : New supply or demand zone created when swing pivot followed by ATR-threshold impulse - suggests institutional footprint left behind, high-probability reversal area established.
First Retest (Fresh → Tested) : Price returning to previously untouched zone triggers status change and touch increment - historically highest-probability reaction level as unfilled orders likely remain.
POC Magnetic Behavior : Price gravitating toward white POC line during zone interaction - suggests institutional activity concentration level acting as support/resistance within broader zone.
Volume Profile Asymmetry : Profile showing volume concentrated at zone edge versus center reveals base formation character - edge concentration suggests quick accumulation before impulse, center concentration indicates prolonged consolidation.
Delta Divergence Patterns : Demand zones showing negative delta profile (red bars dominant) or supply zones showing positive delta (green bars) reveal weak zone formation - pressure composition conflicted with expected direction.
Delta Confirmation Patterns : Demand zones with strong positive delta (green bars) or supply zones with strong negative delta (red bars) validate institutional conviction - pressure aligned with expected reversal direction.
Excessive Touch Degradation : Touch count exceeding 3-4 interactions suggests zone weakening - repeated tests consume institutional orders, reducing reversal probability.
Mitigation Events : Price closing beyond zone boundaries (or wicking through, based on settings) triggers zone deletion - invalidation confirms institutional levels failed, trend continuation likely.
The primary value lies in volume-validated zone structure and delta composition analysis rather than simple boundary touches.
Strategy Integration
Volumetric Supply and Demand Zones fits within institutional footprint and order flow-aware trading approaches:
Fresh Zone Reversal Entries : Enter counter-trend positions at first retest of fresh zones with strong delta confirmation - unfilled institutional orders provide high-probability reaction levels.
POC-Precise Limit Orders : Place entries at POC line rather than zone edges - point of control represents maximum volume concentration, offering tighter stop placement and better risk/reward.
Delta-Filtered Zone Selection : Prioritize demand zones showing positive net delta and supply zones showing negative net delta-aligned pressure composition validates institutional conviction.
Volume Profile Distribution Analysis : Favor zones with tight volume concentration (profile bars clustered) over dispersed distribution - concentrated profiles suggest decisive institutional accumulation/distribution.
Merge-Enhanced Conviction : Treat merged zones with higher volume/delta totals as stronger reversal candidates - combined statistics represent extended institutional activity periods.
Touch Count Degradation Filtering : Reduce position sizing or avoid zones with 3+ touches - excessive interaction depletes institutional orders, weakening reversal probability.
Trend Continuation via Mitigation : Enter breakout positions when price closes beyond supply zones (uptrend) or demand zones (downtrend) - mitigation confirms trend strength overwhelming institutional levels.
Multi-Timeframe Zone Confluence : Apply higher-timeframe zones for macro structure, use lower-timeframe volume profile to identify precise entry levels within larger zones.
Technical Implementation Details
Core Engine : Pivot detection with symmetrical left/right confirmation, ATR-normalized impulse validation
Zone Construction : Base period lookback with ATR-capped height normalization and time-based extension
Volume Profile System : Proportional volume allocation across configurable rows with overlap percentage calculation
Delta Engine : Close-open relationship classification separating buy/sell volume with net delta calculation per row
POC Identification : Maximum volume row detection with visual emphasis rendering
Merge Logic : Overlap detection with gap threshold, boundary expansion, and weighted statistic aggregation
Visualization : Multi-element rendering (zone boxes, profile bars, delta bars, POC lines, info panels) with proportional sizing
Performance Profile : Custom type system for zone/profile/delta management, efficient array-based storage with configurable zone limits
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Micro-structure supply/demand for scalping with tight ATR multipliers and reduced lookback
15 - 60 min : Intraday institutional footprint zones with balanced profile row count and merge sensitivity
4H - Daily : Swing-level accumulation/distribution areas with extended lookback periods and wider merge gaps
Weekly - Monthly : Macro institutional zones with maximum profile detail and extended zone persistence
Suggested Baseline Configuration:
Swing Length : 8
Impulse Size (ATR) : 1.2
Base Lookback Candles : 3
ATR Length : 14
Maximum Zone Height (ATR) : 4.0
Maximum Zones : 10
Extend Zones (bars) : 60
Merge Overlapping Zones : Enabled
Merge Gap (ATR) : 0.3
Mitigation Type : Wick
Profile Rows : 10
Profile Width (%) : 0.5
Show POC Line : Enabled
Show Delta Profile : Enabled
Delta Profile Width (%) : 0.35
Show Zone Info Box : Enabled
These suggested parameters should be used as a baseline; their effectiveness depends on the asset's volatility profile, volume characteristics, and preferred zone sensitivity, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Too many zones cluttering chart : Increase Swing Length (10 - 12) to demand stronger pivots, or increase Impulse Size multiplier (1.5 - 2.0) to require larger moves for zone validation.
Missing significant reversal levels : Decrease Swing Length (5-6) for earlier pivot detection, or reduce Impulse Size (0.8 - 1.0) to capture smaller but valid base formations.
Zones too large/tall : Reduce Maximum Zone Height ATR multiplier (2.5 - 3.0) to cap vertical size, or decrease Base Lookback Candles (1 - 2) for tighter base periods.
Zones too small to be useful : Increase Base Lookback Candles (4 - 6) to encompass longer consolidation periods, or raise Maximum Zone Height (5.0 - 7.0) for taller zones.
Profile bars too granular : Decrease Profile Rows (6 - 8) for coarser distribution showing major volume clusters only.
Profile lacking detail : Increase Profile Rows (15 - 20) for finer resolution revealing subtle volume distribution nuances.
Zones merging too aggressively : Decrease Merge Gap ATR multiplier (0.1 - 0.2) to require tighter overlap for merge qualification, or disable merging entirely.
Related zones not combining : Increase Merge Gap (0.5 - 0.8) to allow merging of zones with larger separation distances.
Zones invalidating prematurely : Switch Mitigation Type from "Wick" to "Close" to require closing violation rather than intrabar penetration.
Zones persisting too long after breach : Switch Mitigation Type from "Close" to "Wick" for faster invalidation on initial penetration.
Profile bars invisible : Increase Profile Width percentage (0.6 - 0.8) for longer bars, improving visibility on cluttered charts.
Delta profile obscuring volume profile : Reduce Delta Profile Width (0.2 - 0.3) to prevent overlap, or disable delta display temporarily.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Range-bound and mean-reverting markets where institutional zones provide reliable turning points
Instruments with consistent volume characteristics where profile distribution reveals true accumulation/distribution
Swing trading approaches targeting zone-to-zone reactions with defined risk parameters
Reversal strategies seeking volume-validated entry levels rather than blind counter-trend positions
Markets where delta proxy correlates well with actual order flow (trending volume instruments)
Position trading benefiting from macro supply/demand structure with embedded volume context
Reduced Effectiveness:
Extremely low volume environments where profile distribution becomes unreliable and sparse
News-driven or gapped markets where zones form/invalidate without normal volume accumulation patterns
Highly trending markets where zones consistently mitigate without providing reversal opportunities
Instruments with erratic volume patterns making delta decomposition and profile interpretation misleading
Very high-frequency timeframes (seconds) where base formation periods too short for meaningful volume accumulation
Integration Guidelines
Confluence : Combine with BOSWaves structure, market profile, or traditional technical analysis for zone validation within broader context
Volume Profile Respect : Trust POC levels and high-volume profile bars over arbitrary zone edges for entry/exit precision
Delta Confirmation Priority : Favor zones where delta composition aligns with expected direction - positive delta in demand, negative delta in supply
Fresh Zone Preference : Prioritize first retests of untouched zones over repeatedly tested areas with high touch counts
Merge Recognition : Treat merged zones with elevated volume/delta statistics as higher-conviction institutional footprint areas
Touch Count Filtering : Reduce position sizing or avoid zones after 3+ touches as institutional order depletion reduces effectiveness
Mitigation Discipline : Exit zone-based positions decisively when price closes beyond boundaries, respecting invalidation signals
Multi-Timeframe Structure : Apply higher-timeframe zones for swing structure, use lower-timeframe profiles for tactical entry refinement
Disclaimer
Volumetric Supply and Demand Zones is a professional-grade supply/demand zone and volume profile analysis tool. It uses volume-based delta proxy to estimate directional pressure but does not access true order book data or institutional trade information. Results depend on market conditions, volume reliability, ATR characteristics, parameter selection, and disciplined execution. Volume profile and delta calculations represent approximations based on close-open relationships and price overlap formulas, not actual bid/ask transactions. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates price structure, order flow context, and comprehensive risk management.
مؤشر Pine Script®






















