Order Blocks & S/R [GILDEX]GILDEX – Order Block & Support / Resistance Indicator
This indicator is developed by GILDEX, combining Order Blocks with Support & Resistance to identify high-probability trading zones.
Key Features
• Blue Order Blocks: Potential BUY zones
• Red Order Blocks: Potential SELL zones
• Cyan lines: Support levels
• Red lines: Resistance levels
Order Blocks highlight areas where strong institutional buying or selling previously occurred.
Support and Resistance are used to refine entries within the Order Block for improved precision and risk control.
Designed mainly for intraday trading, especially on the 5-minute timeframe, where most Order Blocks range between 30–50 pips.
Layered (scaled) entries are recommended, as price may react at the edge of the Order Block or deeper inside the zone.
This indicator focuses on market structure and price reaction, not prediction.
Candlestick analysis
Lune Institutional Analysis Premium⬛️ Overview
Lune Institutional Analysis is a comprehensive suite of institutional-grade tools designed to visualize market liquidity and volume dynamics. By utilizing volume clustering and delta analysis, this indicator provides traders with a professional perspective on market activity, highlighting areas where significant volume concentrations occur. It is designed to complement strategies such as SMC (Smart Money Concepts) and ICT (Inner Circle Trader) by providing a data-driven layer of institutional context.
Distinguished by its real-time, non-repainting calculations, Lune Institutional Analysis aims to bridge the gap between retail price action and volume-based institutional data, helping traders identify potential "smart money" footprints.
🟦 Features
Lune Institutional Analysis equips traders with an array of sophisticated features:
🔹 Liquidity Bubbles: This feature visualizes significant volume spikes and concentrations based on volume delta and point of control (POC) analysis within each candle. It identifies imbalances where buy or sell volume significantly outweighs the other. It supports two modes: Regular Bubbles and Trapped Liquidity Bubbles. Trapped Liquidity Bubbles are designed to identify potential "liquidity traps" where price moves sharply against a high-volume area. The Adaptive Transparency feature dynamically adjusts bubble visibility based on the relative volume significance.
🔹 Liquidity Waves: Liquidity Waves track market movements through advanced volume spread analysis, showing the ebb and flow of market interest. By analyzing volume delta patterns, this tool helps traders visualize the momentum of liquidity as it enters or exits the market. It includes sensitivity controls and adaptive transparency to highlight the most significant wave patterns.
🔹 Accumulation/Distribution: The Accumulation/Distribution tool automatically detects and highlights professional accumulation and distribution zones. These zones identify where institutional players are likely building or offloading positions, providing crucial context for potential trend reversals or continuations.
🔹 AI Volume Candles: This feature reimagines price action by integrating volume delta directly into candle visualization. It includes Volume Delta Zones and Net Volume Lines to pinpoint where the most significant trading activity is occurring within each bar. By highlighting volume concentrations, AI Volume Candles reveal the internal strength or weakness of price moves that standard candles might hide.
🔹 AI Liquidation Levels: This tool identifies potential liquidation zones by analyzing historical volume clusters and price pivots. These levels represent areas where a high volume of orders was previously executed, often serving as magnets for price (draw on liquidity) or significant areas of interest for ICT-style analysis. The indicator uses a normalization algorithm to represent volume concentration through dynamic width and adaptive transparency.
🔹 AI Heat Map: The AI Heat Map provides a historical volume distribution visualization, color-coding zones based on net volume delta or directional bias. This reveals the "memory" of the market and where historical interest remains, allowing traders to see significant support and resistance levels formed by historical volume concentrations.
🔹 AI Volume Profile: This sophisticated butterfly-style profile displays both total volume and buy/sell delta distribution. It automatically identifies AI Key Levels (significant volume nodes) that serve as institutional support and resistance. The profile offers deep insights into where value is being perceived by major market participants.
These features and tools collectively offer a comprehensive solution for traders to understand and navigate the financial markets. It's important to remember that they are designed to assist in making informed trading decisions and should be used as part of a balanced trading strategy.
🟧 Usage
Lune Institutional Analysis's unique feature set can be leveraged both individually and synergistically. It is important to understand each feature and experiment with different configurations to best suit your unique trading needs.
🔸 Example #1: The following example demonstrates how Trapped Liquidity Bubbles and AI Liquidation Levels can be used together to identify potential reversal points.
Trapped Liquidity Bubbles highlight areas where market participants may be positioned against a sharp move, while AI Liquidation Levels show historical volume clusters where those positions might face pressure. When a bearish Trapped Liquidity Bubble appears near an AI Liquidation level, it can serve as a confluence signal for a potential price reaction.
🔸 Example #2: This example shows how the AI Volume Profile and AI Heat Map can be used to identify areas of significant interest and volume exhaustion.
The AI Volume Profile's key levels represent nodes of high historical volume. When price approaches an AI Heat Map zone that aligns with a high-volume node, it provides a stronger confirmation of a potential support or resistance area. Observing price reaction at these combined levels can help traders gauge whether a trend is likely to continue or exhaust.
🔸 Example #3: This example demonstrates how AI Volume Candles can be used to confirm trend strength or identify potential absorption.
By using Volume Delta Zones within the AI Volume Candles, traders can see if a breakout is supported by strong directional volume. If price breaks a resistance level but the AI Volume Candles show a high concentration of bearish delta (absorption), it may indicate a fakeout. Conversely, strong bullish delta zones during an uptrend confirm institutional participation in the move.
🟥 Conclusion
Lune Institutional Analysis provides a data-centric bridge between retail analysis and institutional-grade volume data. By offering clear visualizations of liquidity, volume delta, and significant volume clusters, it allows traders to look beyond standard price action and understand the underlying volume dynamics. This suite is built for practitioners of SMC and ICT who require an objective, volume-based confirmation for their setups.
🔻 Access
You can see the Author's instructions below to get instant access to this indicator & our Premium Suite.
🔻 Disclaimer
Lune Institutional Analysis is a tool for aiding in market analysis and is not a guarantee of future market performance or individual trading success. We strongly recommend that users combine our tool with their trading strategies and do their due diligence before making any trading decisions.
Remember, past performance is not indicative of future results. Please trade responsibly.
Session OpensThis Indicator Draws Session open labels for Asia Session-New York Session-London Session with Optional Alerts.
Buy and Sell Signals (Heiken Ashi)This indicator displays Buy And Sell Signals With Alerts based on custom conditions derived from Heiken Ashi candles.
Week High/LowThis indicator plots the Previous Week High and Low as two horizontal dashed lines.
It is designed to appear only on the Daily (D) and Weekly (W) timeframes, ensuring a clean higher-timeframe context without lower-timeframe noise.
The levels are calculated from the completed weekly candle and automatically update at the start of each new week.
These levels serve as weekly liquidity references, commonly used to assess premium/discount zones, potential stop-run areas, and higher-timeframe market reactions.
Smart Scalper Pro Template + VWAP + FVG Invite-Only Trading Script
Private Access • Risk-First • Discipline-Driven
🔐 Access Tiers
Lifetime Access — $999
(Limited to 25 total seats)
One-time payment
Full script access
All future updates included
Priority support & early feature access
Locked pricing — never increases
Once lifetime seats are filled, this tier is permanently closed.
Level 2 Access — $199
Advanced Risk & Confirmation Module
Higher-confidence trade filters
Enhanced risk controls & lockout logic
Advanced session and volatility filters
Designed for experienced, disciplined traders
Reduces over-trading and low-quality setups
Level 2 is feature-based, not cosmetic — it adds stricter trade qualification.
Subscription Access — $99 / month
Core strategy framework
Risk-managed trade logic
Ongoing updates while subscribed
Ideal for evaluation or short-term usage
Subscription does not include Level 2 advanced filters.
📌 Author
Garry Evans
Independent system developer focused on:
Risk-first automation
Market structure & liquidity behavior
Discipline, consistency, and capital preservation
“The edge isn’t the market — it’s the man who survives it.”
⚙️ Risk Management & Position Sizing
The script is built around capital protection, not signal frequency.
Risk logic includes:
Fixed or dynamic risk per trade
Market-adaptive position sizing
Session-based trade limits
Daily trade caps and auto-lockout protection
Volatility-aware sizing (futures & crypto)
⚠️ Profit is pursued only after risk is controlled.
📊 Track Record
Backtested across multiple market environments
Forward-tested and actively used by the author
Real-account trades are logged where platform rules allow
Results vary by market, timeframe, and user-defined risk settings.
🌍 Supported Markets
Designed to work across all liquid markets, including:
Stocks
Crypto (spot & futures)
Options (signal-based framework)
Futures (indices, metals, crypto futures)
The system adapts to volatility and structure — it is not market-specific.
⚖️ Leverage
Leverage is not required
If used, leverage is fully user-controlled
Risk logic scales exposure conservatively
No martingale.
No revenge sizing.
No over-exposure logic.
🧪 Backtesting
✔ Yes
Strategy logic has been backtested
Filters reduce chop, noise, and forced trades
Focus on drawdown control over curve-fitting
🛠 Support
✔ Yes
Direct author support
Ongoing improvements and updates
Feature refinement based on real usage and feedback
👥 Community
✔ Yes
Private user access
High-quality feedback environment
No public signal spam or hype-driven chat rooms
⏳ Trial Period
✔ Yes
Limited trial access available
Designed for evaluation only
Trial users do not receive full feature access
🚫 Who This Script Is NOT For
This system is not for:
Traders looking for guaranteed profits
Users expecting copy-paste “signal calls”
Over-leveraged gamblers
Those unwilling to follow risk rules
Anyone seeking overnight results
This is a discipline and automation tool, not a shortcut.
🧠 Final Positioning
This is not a signal service.
This is a risk-controlled execution framework designed to:
Enforce discipline
Reduce emotional trading
Protect capital during bad market conditions
Scale responsibly during favorable ones
NY Open Edge (NQ only)📊 NY Open Edge - Session Direction Predictor
Predict NY session direction using backtested Asia-London pattern analysis
Based on 5 years of data (2021-2025, 1,283 trading days), this indicator analyzes overnight session relationships to predict
which direction the New York session will likely move first.
🎯 What It Does
Tracks Asia (8pm-2am ET) and London (2am-8am ET) session ranges, then at NY open (8am ET) it:
1. Classifies the pattern - How London interacted with Asia range
2. Checks NY open position - Above or below London midpoint
3. Displays probabilities - Statistical edge for high/low sweeps based on historical data
4 Pattern Types
- P1 - London Engulfs Asia: London range contains Asia range
- P2 - Asia Engulfs London: Asia range contains London range
- P3 - Partial Up (Bullish): London breaks above Asia high only
- P4 - Partial Down (Bearish): London breaks below Asia low only
💡 How To Use
Reading the Dashboard
The indicator displays:
- Pattern - Which of the 4 patterns occurred
- NY Open Position - ABOVE or BELOW London midpoint
- First High Sweep % - Probability of taking highs first
- First Low Sweep % - Probability of taking lows first
- Median Penetration - Typical point movement
- Failure Rate - How often both sides get swept (choppy sessions)
- Tier Classification - Reliability (Tier 1 = Best, Tier 3 = Risky)
- Sample Size - Historical occurrences
⚙️ Settings
- Display Options - Toggle session boxes, midlines, and dashboard
- Colors - Customize session colors and transparency
- Dashboard Theme - Dark (for dark charts) or Light (for light charts)
- Max Sessions - Memory management (10-150 sessions)
- Timezone - Default America/New_York (DST-aware)
---
📋 Best Practices
✅ Is designed for NQ only!
✅ Use 5m-15m timeframes for clear session definitions
✅ Combine with your own analysis - this is a probability tool
✅ Focus on Tier 1 setups for highest win rates
✅ Respect the failure rate - high percentages suggest choppy sessions
---
⚠️ RISK DISCLAIMER
THIS INDICATOR IS FOR EDUCATIONAL AND INFORMATIONAL PURPOSES ONLY
- NOT financial advice - Do not trade based solely on this indicator
- Past performance does not guarantee future results - Historical statistics may not reflect future market behavior
- Trading involves substantial risk of loss - Only trade with capital you can afford to lose
- Use proper risk management - Always use stop losses and appropriate position sizing
- Backtest limitations - Results based on historical data that may not repeat
- No guarantees - Probabilities are not certainties; markets can behave unpredictably
You are solely responsible for your trading decisions and outcomes.
Candle wicks body and HL sizeThis indicator calculates the size of each candlestick in pips and displays all key values of the candle in a single vertical label directly on the chart
Each label shows four values, one per line, in this order:
Upper wick → high - max(open, close)
The distance from the top of the candle body to the high.
OC (open-close) → abs(open - close)
The body size of the candle in pips.
HL (high-low) → abs(high - low)
Total candle range in pips.
Bottom wick → min(open, close) - low
The distance from the bottom of the candle body to the low.
All four values are displayed vertically in a single label.
Labels are transparent, showing only the text.
Finlu CONTINUACION PROFinlu CONTINUACIÓN PRO is an oscillator designed to detect trend continuation signals after a pullback.
The logic is based on:
A normalized momentum similar to Finlu Momentum PRO.
A central neutral zone: when momentum pulls back into this zone without fully changing direction, it is treated as a pullback within the trend.
Internal impulse levels (1, 2 and 3) to distinguish mild pullbacks from strong impulses.
A signal line used to confirm crossovers or separation between the main line and the signal.
An optional directional filter (DMI/ADX-style) that checks trend strength before allowing a signal.
Typical usage conditions:
Bullish continuation signals when there is prior upside momentum, the oscillator pulls back into the neutral zone and then turns up again, meeting the crossover/separation condition and the directional filter.
Bearish continuation signals in the opposite scenario.
The colored background shows the dominant side of momentum and helps visualize which sections of the chart favor long or short setups.
This indicator is intended as a support tool for traders already working with market structure and supply/demand zones. It does not guarantee results and does not replace risk management or the trader’s own judgement.
Candle OC and HL size in pipsThis script calculates and displays candle sizes in pips
Shows both the Open-Close and the High-Low size in a single label
Configurable minimal and maximal size
Finlu Momentum PROFinlu Momentum PRO is a momentum oscillator designed to detect exhaustion zones and potential short-term reversals.
The indicator calculates a smoothed momentum from price changes and normalizes it around 0. On top of that momentum, it builds:
Overbought and oversold levels: when the main line enters these zones, it highlights extreme momentum conditions.
Central neutral zone: helps distinguish strong momentum phases from consolidation phases.
Signal line: a moving average of the momentum itself, used to confirm crossovers and exits from extreme zones.
Repetition filters: limit the number of consecutive signals to reduce noise when the market is ranging.
Reversal detection: additional conditions that require momentum to turn from extreme zones before enabling a signal.
Divergences: compares price highs and lows with the momentum line to highlight potential exhaustion of the move.
Basic usage:
Sell signals when momentum comes from overbought, loses strength and crosses below the signal line, while passing the reversal and repetition filters.
Buy signals when the opposite occurs from oversold levels.
Bearish divergences appear when price makes a higher high, but momentum makes a lower high.
Bullish divergences appear when price makes lower lows, but momentum makes higher lows.
This indicator is designed to be combined with your own price-action and market structure analysis. It is not a buy/sell recommendation or a standalone automated system. The user remains fully responsible for risk management, instrument selection and timeframe choice.
WatchmenThe Watchmen Indicator tracks potential market maker breakeven zones using dynamic open/close ranges (no wicks in Fib calc). It expands the range until the 50% level is breached by the full candle range, then resets. Green = long/down setups (buy retrace), Red = short/up setups (sell retrace). Uses only open/close for levels, high/low for breaches. Ideal for mean-reversion in trends.
HoneG_CCIv17HoneG_CCIv17
This is a signal tool capable of both counter-trend and trend-following trading. Apply it to 1-minute charts.
For trend-following, it features a rapid-fire mode. When conditions align, rapid-fire mode activates, and two indicators signaling the rapid-fire timing will turn ON/OFF in sync with price extension moments.
逆張りも順張りも出来るサインツールです。1分足チャートに適用してください。
順張りには連打モードがあり、条件が揃うと連打モードが発動し、連打タイミングを知らせる二か所の表示が、価格が伸びるタイミングに合わせてON/OFFします。
BIAS+KeyLevels - R.AlvaradoBIAS+KeyLevels – R. Alvarado
This indicator identifies the institutional market bias (BIAS) on Monthly, Weekly, and Daily timeframes using confirmed Turtle Soup–style candle closes.
It also automatically plots the Key Levels (high / low) from the Monthly, Weekly, Daily, and 4H timeframes, along with the 50% level of the previous candle for each higher timeframe.
It is designed for traders who operate on lower timeframes and require clear, clean, and structural market context to anticipate potential reaction zones without cluttering the chart.
NASDAQ PREDICTION RANGE ADR projection for the US session based on previous Price Action and session
Blockcircle Heikin-Ashi Multi-TimeframeThe BLOCKCIRCLE HEIKIN-ASHI MULTI-TIMEFRAME indicator displays Heikin-Ashi price data across multiple timeframes simultaneously, giving you a clear picture of trend direction from your current chart all the way up to monthly views.
Instead of flipping between charts to check if higher timeframes agree with your trade idea, everything sits right in front of you on a single unified view.
The core concept is simple: when multiple timeframes show the same trend direction, the probability of a successful trade increases. When they disagree, you might want to wait for better alignment or reduce your position size.
WHAT MAKES THIS INDICATOR ORIGINAL AND DIFFERENT
While Heikin-Ashi candles and multi-timeframe analysis are established concepts, this indicator extends beyond simple HA plotting in several ways that justify its protected source status.
First, the summary scoring algorithm calculates a directional score from 0 to 100 that quantifies trend alignment across all enabled timeframes. This is not simply counting bullish versus bearish readings. The score incorporates the current timeframe alongside higher timeframes, weights each contribution, and produces a single metric that represents overall market structure bias.
Second, the indicator includes an intelligent auto-timeframe system that dynamically selects appropriate higher timeframes based on your current chart. Rather than requiring manual configuration, the algorithm maps each chart timeframe to a logical hierarchy of higher timeframes. A 15-minute chart automatically receives 30-minute, 1-hour, 2-hour, 4-hour, and 8-hour references. A daily chart receives 3-day, weekly, 2-week, monthly, and quarterly references. This mapping logic ensures meaningful timeframe relationships regardless of where you trade.
Third, the alignment quality calculation measures how decisive the current trend reading is, regardless of direction. A score where 80 percent of timeframes agree in either direction produces a high alignment quality rating, while a 50/50 split produces low quality. This helps traders distinguish between strong conviction setups and ambiguous market conditions.
Fourth, the stability factor tracks how many timeframes have recently changed direction. Markets where multiple timeframes are actively flipping carry different risk characteristics than markets where all timeframes have maintained their direction for extended periods. The stability calculation converts recent change counts into a percentage that feeds into the overall assessment.
Fifth, the confidence rating system interprets the raw data and translates it into actionable guidance. High confidence requires near-complete alignment across timeframes. Medium confidence requires majority agreement. Low confidence indicates mixed conditions. This interpretation layer helps traders who prefer clear guidance over raw numbers.
These proprietary elements, particularly the auto-timeframe mapping, the multi-factor scoring system, and the stability tracking, represent original development work that extends meaningfully beyond standard Heikin-Ashi MTF implementations available elsewhere.
KEY FEATURES
Multi-Timeframe Heikin-Ashi Display: View up to five higher timeframes plotted directly on your chart alongside the current timeframe
Each timeframe shows both the open and close values as separate lines, with optional fill between them
Heikin-Ashi smoothing filters out market noise better than standard candlesticks, making trend direction easier to identify
All timeframe data updates in real-time as new bars form
Professional Dashboard Panel
Summary score from 0 to 100 that quantifies overall trend alignment at a glance
Individual timeframe breakdown showing exact open and close prices, trend direction, and whether a change just occurred
Statistics section with trend strength percentage, timeframe alignment count, and recent change tracking
Signal status that interprets the data and suggests whether conditions favour buying, selling, or staying neutral
Confidence rating based on how many timeframes agree with each other
Compact mode option for traders who prefer a smaller footprint on their charts
Visual Customisation Options
Three display modes: lines only for a clean look, lines with fill for easier trend visualisation, or cloud style for a more distinct separation between levels
Full colour control for each timeframe so you can match your existing chart theme
Adjustable line widths and optional midline display showing the average of open and close
Background colour shading that changes based on overall trend alignment
Trend change arrows that appear automatically when a timeframe flips direction
Practical Alert System
Individual alerts for each timeframe when it switches from bullish to bearish or vice versa
Combined alert when all enabled timeframes align in the same direction
Single master alert that fires whenever any timeframe changes, useful for staying informed without setting up multiple notifications
Strong trend detection alert when alignment score crosses above key thresholds
HOW TO USE
Setting Up Your Timeframes
Start by choosing timeframes that match your trading style. If you trade the 15-minute chart, enable the 1-hour, 4-hour, and daily timeframes. If you swing trade on the daily, consider the 3-day, weekly, and monthly timeframes.
Give each timeframe a custom label that makes sense to you. The dashboard will display these labels, so use whatever helps you read the information quickly.
You do not need to enable all five timeframes. Many traders find that three or four provide enough context without cluttering the chart.
How to Read the Dashboard
Check the summary row first. A score above 70 with a clear bullish or bearish bias suggests strong alignment. Scores between 40 and 70 indicate mixed conditions where caution is warranted.
Look at the alignment count to see exactly how many timeframes agree. Four out of five being bullish is more convincing than two out of five.
Pay attention to the change indicator, shown as a yellow dot next to any timeframe that just flipped. Recent changes often signal the start of a new move but can also be false signals that reverse quickly.
The confidence rating helps newer traders interpret the data. High confidence means most or all timeframes agree, while low confidence suggests waiting for better conditions.
Identifying Trade Opportunities
The strongest signals occur when all enabled timeframes show the same direction. If you see all green across the board, bullish setups are more likely to succeed. The opposite applies when everything points to bearishness.
When the current timeframe flips to match the higher timeframes, this often marks a good entry point. The lower timeframe is now in agreement with the bigger picture.
Avoid trading against multiple higher timeframes. If the 4-hour, daily, and weekly are all bearish, taking long positions on the 15-minute chart is fighting the overall trend.
Use divergences between timeframes as warning signs. If lower timeframes turn bullish but higher timeframes remain bearish, the rally may be a pullback within a larger downtrend rather than a true reversal.
Managing Risk with Timeframe Analysis
Consider position sizing based on alignment. Full positions when alignment is strong, reduced size when conditions are mixed.
Place stops beyond the higher timeframe structure. If the daily Heikin-Ashi open sits at a certain level, that level often acts as support or resistance.
When higher timeframes start changing direction one by one, this often signals a larger trend shift developing. Take profits or tighten stops on existing positions.
The trend strength percentage gives you a quick read on momentum. Above 80 percent suggests strong conviction in one direction. Below 40 percent suggests the opposite direction dominates.
Combining with Other Analysis
This indicator works well alongside volume analysis. Strong trend alignment with increasing volume adds confidence to the signal.
You can see use the trend change arrows as added confluence towards a trend break as you see below
Support and resistance levels from higher timeframes carry more weight. Use the higher timeframe Heikin-Ashi values as dynamic support and resistance zones.
Combine with momentum oscillators for timing. When the indicator shows alignment and an oscillator shows oversold or overbought conditions, the setup becomes more compelling.
Price action patterns that form in the direction of multi-timeframe alignment have better follow-through than those forming against it.
LIMITATIONS
This indicator uses Heikin-Ashi calculations, which by design lag behind standard price action. Signals confirm trends rather than predict them, and early entries require additional confirmation from other methods.
The auto-timeframe feature selects higher timeframes based on predefined mappings. These mappings work well for most trading styles but may not suit every specific use case. Manual override is available for traders who prefer custom timeframe combinations.
During extended consolidation periods, the summary score may oscillate around 50 percent and produce mixed readings. The indicator performs best when markets exhibit clear directional movement.
Multi-timeframe alignment does not guarantee trade success. Markets can and do reverse even when multiple timeframes agree. Proper risk management and position sizing remain essential regardless of alignment score.
This indicator should be used as part of a complete trading approach. It provides trend context and alignment analysis but does not replace fundamental analysis, risk management, or trading discipline.
Hazmeed HTF Candles Aligned)HTF Candles Overlay (v6, Aligned + Accurate Wicks)
This indicator overlays higher timeframe candles on your current chart.
It allows you to visually compare HTF price action directly on your lower timeframe chart without switching timeframes.
⭐ Features
Displays Higher Timeframe (HTF) candles on the current chart
Fully aligned to HTF candle start time
Option to show accurate wicks
Supports configurable:
HTF timeframe (e.g., 1D, 4H, 1W)
Number of HTF candles displayed
Candle width (in bars)
Bull/Bear colors and wick color
BK AK-King Quazi🦁👑 BK AK–KING QUAZI — MEASURED HAND, CLEAN BLADE. 👑🦁
All glory to Gd — the true source of wisdom, restraint, and endurance.
AK is honor — my mentor’s standard: clarity, patience, no shortcuts, no gambling.
Update / Record: A previous version of this publication was hidden by PineCoders moderation due to insufficient description. This republish includes a fully self-contained explanation of what the script does, how it works, and how to use it.
1) What this script does (outputs)
BK AK–King Quazi is a Quasimodo (QM) structure manager that turns the pattern into a permissioned process:
PROTO → BOS proof → RETEST → CONFIRM → resolve or invalidate
On-chart you get:
Stage labels: P↑ / P↓ (PROTO), R↑ / R↓ (RETEST), C↑ / C↓ (CONFIRM), X (INVALIDATED), ✓ (TARGET HIT)
Execution map lines: QM, BOS, INV (invalidation)
Optional projection extension forward (QM/BOS/INV + optional T1/T2)
Optional entry zone around QM (ATR buffer)
MTF “War Room” table: 5 timeframes showing STATE and NOW (recent events)
This is not a “pattern sticker.” It’s a workflow + object lifecycle so outcomes are visible and charts stay clean.
2) Definitions (what each stage means)
PROTO (P): “Sweep + BOS candidate.” Early awareness that a QM setup is forming.
BOS (Break of Structure): requires a body displacement vs ATR (proof filter).
RETEST (R): price returns to the QM level and holds it (permission test).
CONFIRM (C): full QM geometry is complete (structure + proof + timing aligned).
INV: invalidation level. If breached, the pattern is failed and marked X.
Targets: optional T1/T2 mapped from selected target mode.
3) How it works (actual logic in plain English)
A) Swing engine (how structure is built)
The script uses a ZigZag-style swing detector based on lookbacks:
A “to_up” swing trigger occurs when high reaches the highest high over zz_len
A “to_down” swing trigger occurs when low reaches the lowest low over zz_len
Trend flips on those triggers and the script stores the last 3 swing points:
Highs: h2 → h1 → h0
Lows: l2 → l1 → l0
This creates repeatable swing structure without manual drawing.
B) BOS displacement filter (proof of intent)
A BOS is only accepted if the candle body displacement is large enough:
Displacement condition: abs(close - open) ≥ disp_used * ATR(atr_len)
disp_used can be:
Manual, or
Auto (TF Map), or
Auto (ATR%)
This is the “no wick theater” filter.
C) PROTO detection (sweep + BOS)
Bull PROTO fires when:
structure suggests a sweep (higher swing high behavior) and
price sweeps below a prior swing low, then BOS closes above h1 with displacement
Bear PROTO is the mirror:
sweep above a prior swing high, then BOS closes below l1 with displacement
On PROTO, the script defines the key levels:
Bull: QM = l1, BOS = h1, INV = current low
Bear: QM = h1, BOS = l1, INV = current high
D) RETEST + CONFIRM
RETEST checks the return to QM with a hold:
Bull retest: low ≤ QM and close ≥ QM
Bear retest: high ≥ QM and close ≤ QM
CONFIRM triggers only when the full swing sequence meets the “QM complete” rules (the script’s bu_conf / be_conf conditions).
E) Targets / projection math (if enabled)
Targets are optional:
Measured (1.0 / 1.618): uses the distance |BOS − QM| times multipliers
BOS + prior swing: uses BOS + prior swing extreme
Neck→Head (H&S projection): projects neck/head distance from BOS
F) Object lifecycle (keeps chart honest and readable)
If opposite PROTO appears, you can:
do nothing, or
clear projections, or
mark X + clear the prior campaign
On invalidation, the script replaces the existing P/C label with X (no overlapping junk)
On target hit, it can resolve the campaign and optionally remove projections/tags
4) MTF War Room (what the table means)
The table shows 5 user-selectable timeframes (TF1–TF5) with:
STATE: current posture on that TF (P↑, C↑, P↓, C↓, —)
NOW: highlights recent PROTO/CONFIRM events on that TF
Implementation note (what’s original here):
It computes zigzag + displacement inside each TF context
“NOW” flash timing is measured in that TF (not chart TF)
It packs NOW + RECENT + STAGE into one request.security() call per TF (performance-aware)
5) How to use it (clean execution workflow)
Suggested workflow (AK standard):
Use MTF first: don’t fight higher court structure
Treat PROTO as awareness, not permission
Require BOS displacement (proof)
Execute only on RETEST of QM or on your CONFIRM rules
Stop is INV (if INV breaks, mark X and stand down)
Use mapped T1/T2 for planning + resolution (no improvising mid-trade)
Label key:
P = Proto (sweep + BOS)
R = Retest (QM hold)
C = Confirm (full QM)
X = Invalidated (broke INV)
✓ = Target hit (T1/T2 resolution)
6) What’s original (why it’s not “another QM clone”)
Quasimodo is public. The originality here is the system around it:
staged sequencing (PROTO → BOS proof → RETEST → CONFIRM) instead of “shape = signal”
ATR displacement proof filter to cut fake BOS
standardized level mapping (QM/BOS/INV + targets + entry zone)
object lifecycle management (replace labels with X, clear/gray projections, remove on target)
MTF packed engine (one call per TF; “NOW” measured on that TF)
controlled alert routing by event type (PROTO vs CONFIRM)
7) Limitations (important)
This is bar-based structure logic; it can change during an unclosed realtime candle.
ZigZag swings are lookback-based, not a broker “official” swing definition.
It’s a structure/permission tool, not a guarantee engine.
🧑🏫 BK / AK / Faith
BK is the mark I’m building.
AK is honor — discipline, patience, clean execution.
All glory to Gd — the true source of wisdom and endurance.
🗡️ King David Lens (Deep — Discipline Under Fire)
David’s power wasn’t impulse. It was governed force — strength that answers to law.
He learned early that the most dangerous trap is moving before you’re sent.
That’s why his life is full of the same pattern traders ignore:
He was anointed long before he was crowned.
Meaning: truth can be real before it’s allowed to manifest.
He fought Goliath with a weapon people mocked — not because it was flashy, but because it was mastered.
Meaning: edge isn’t what looks impressive — it’s what’s trained and repeatable.
He had Saul in his hands and still refused the shortcut.
Meaning: opportunity is not permission; proximity is not assignment.
He waited through wilderness seasons where nothing “looked like progress.”
Meaning: silence isn’t rejection — sometimes it’s preparation.
That is the trader’s war.
Price will always offer motion.
But motion without permission is bait.
David didn’t survive by chasing what was available.
He survived by waiting until the moment was proved, the ground was chosen, and the strike was clean.
That’s what King Quazi enforces:
PROTO is the rumor.
BOS displacement is the proof.
Retest is the test of legitimacy.
Confirm is permission to strike.
Invalidation is humility — stand down immediately.
A lion doesn’t chase every shadow.
A lion waits until the prey is committed — then ends it.
🦁👑 BK AK–KING QUAZI — execute with proof. 👑🦁
Gd bless. 🙏
Chip Distribution Pro// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// Enhanced Position Cost Distribution - Auto-adaptive with improved visualization
// Works with ETFs, commodities, forex, crypto, stocks - any instrument
// @version=5
indicator('Chip Distribution Pro', overlay = true, max_lines_count = 500, max_bars_back = 500)
//#region Inputs
string GRP_GENERAL = "General Settings"
int LOOKBACK = input.int(1000, 'Lookback Bars', maxval = 20000, minval = 500, step = 250, group = GRP_GENERAL)
int CHART_X_OFFSET = input.int(100, 'Chart Offset', step = 10, group = GRP_GENERAL)
int LABEL_X_OFFSET = CHART_X_OFFSET + 4
int CHART_MAX_WIDTH = input.int(80, 'Max Width', maxval = 500, minval = 10, step = 10, group = GRP_GENERAL)
int NUM_BUCKETS = input.int(400, 'Price Buckets', maxval = 500, minval = 50, step = 50, group = GRP_GENERAL)
string GRP_AUTO = "Auto-Tuning"
bool AUTO_TUNE = input.bool(true, 'Enable Auto-Tuning', group = GRP_AUTO,
tooltip = 'Automatically adjusts turnover rate based on volatility and volume characteristics')
float MANUAL_DECAY = input.float(0.1, 'Manual Turnover Rate', minval = 0.01, maxval = 0.5, step = 0.01, group = GRP_AUTO,
tooltip = 'Only used when Auto-Tuning is disabled')
int VOLATILITY_PERIOD = input.int(20, 'Volatility Period', minval = 5, maxval = 100, group = GRP_AUTO)
string GRP_VISUAL = "Visualization"
string COLOR_SCHEME = input.string("Rainbow", "Color Scheme", options = , group = GRP_VISUAL)
color PROFIT_COLOR_LIGHT = input.color(#26a69a, 'Profit Light', group = GRP_VISUAL)
color PROFIT_COLOR_DARK = input.color(#004d40, 'Profit Dark', group = GRP_VISUAL)
color LOSS_COLOR_LIGHT = input.color(#ef5350, 'Loss Light', group = GRP_VISUAL)
color LOSS_COLOR_DARK = input.color(#b71c1c, 'Loss Dark', group = GRP_VISUAL)
color CURRENT_PRICE_COLOR = input.color(color.yellow, 'Current Price', group = GRP_VISUAL)
color AVG_PRICE_COLOR = input.color(#2196F3, 'Average Cost', group = GRP_VISUAL)
color PEAK_COLOR = input.color(#FF9800, 'Peak Concentration', group = GRP_VISUAL)
color STATS_COLOR = input.color(#434651, 'Stats Background', group = GRP_VISUAL)
string GRP_LEVELS = "Key Levels"
bool SHOW_SUPPORT_RESISTANCE = input.bool(true, 'Show Support/Resistance Zones', group = GRP_LEVELS)
bool SHOW_PEAK = input.bool(true, 'Show Peak Concentration', group = GRP_LEVELS)
float SR_THRESHOLD = input.float(0.7, 'S/R Detection Threshold', minval = 0.3, maxval = 0.95, step = 0.05, group = GRP_LEVELS,
tooltip = 'Minimum concentration (relative to peak) to mark as support/resistance')
string GRP_SIGNALS = "Signals Panel"
bool SHOW_SIGNALS = input.bool(true, 'Show Signal Panel', group = GRP_SIGNALS)
bool SHOW_KEY_LEVELS = input.bool(true, 'Show Key Price Levels', group = GRP_SIGNALS)
bool SHOW_TREND_ARROW = input.bool(true, 'Show Trend Arrow', group = GRP_SIGNALS)
bool SHOW_PRESSURE_BAR = input.bool(true, 'Show Pressure Bar', group = GRP_SIGNALS)
// Colors for key levels
color SUPPORT_COLOR = input.color(#00E676, 'Support Level', group = GRP_LEVELS)
color RESISTANCE_COLOR = input.color(#FF5252, 'Resistance Level', group = GRP_LEVELS)
color BREAKOUT_COLOR = input.color(#FFD600, 'Breakout Level', group = GRP_LEVELS)
//#endregion
//#region Candle Type
type Candle
int idx
float hi
float lo
float vol
float relativeVol
float atrPct
//#endregion
//#region PCD Type
type PCD
array candles
float minPrice
float maxPrice
float priceStep
array lines
label currentPriceLabel
label avgPriceLabel
label peakLabel
label statsLabel
label signalLabel
array srZones
float calculatedTurnover
// New visualization elements
line supportLine
line resistanceLine
line avgCostLine
label trendArrow
box pressureBar
box pressureFill
label pressureLabel
// Create a new price label
newPriceLabel(color bg, color txtColor) =>
label.new(0, 0, '', style = label.style_label_left, color = bg, textcolor = txtColor, size = size.small)
// Create a new PCD instance
newPCD() =>
array lns = array.new(NUM_BUCKETS)
for i = 0 to NUM_BUCKETS - 1
array.set(lns, i, line.new(0, 0, 0, 0))
PCD.new(
candles = array.new(0),
lines = lns,
currentPriceLabel = newPriceLabel(color.new(#00BCD4, 0), color.white),
avgPriceLabel = newPriceLabel(AVG_PRICE_COLOR, color.white),
peakLabel = newPriceLabel(PEAK_COLOR, color.white),
statsLabel = label.new(0, 0, '', style = label.style_label_up, size = size.small,
textalign = text.align_left, color = color.new(STATS_COLOR, 20), textcolor = color.white),
signalLabel = label.new(0, 0, '', style = label.style_label_left, size = size.small,
textalign = text.align_left, color = color.new(#1a1a2e, 20), textcolor = color.white),
srZones = array.new(0),
calculatedTurnover = 0.1,
minPrice = na,
maxPrice = na,
priceStep = na,
supportLine = line.new(0, 0, 0, 0, color = SUPPORT_COLOR, width = 2, style = line.style_dashed),
resistanceLine = line.new(0, 0, 0, 0, color = RESISTANCE_COLOR, width = 2, style = line.style_dashed),
avgCostLine = line.new(0, 0, 0, 0, color = AVG_PRICE_COLOR, width = 2, style = line.style_dotted),
trendArrow = label.new(0, 0, '', style = label.style_label_center, size = size.large, textcolor = color.white),
pressureBar = box.new(0, 0, 0, 0, bgcolor = color.new(#424242, 50), border_color = color.gray),
pressureFill = box.new(0, 0, 0, 0, bgcolor = color.green, border_color = na),
pressureLabel = label.new(0, 0, '', style = label.style_label_right, size = size.tiny, color = color.new(#000000, 100), textcolor = color.white))
// Auto-calculate turnover rate based on instrument characteristics
calcAdaptiveTurnover(float atrPct, float volRatio) =>
float safeAtrPct = na(atrPct) or atrPct <= 0 ? 0.02 : atrPct
float safeVolRatio = na(volRatio) or volRatio <= 0 ? 1.0 : volRatio
float volBasedTurnover = math.max(0.03, math.min(0.3, safeAtrPct * 3))
float volAdjustment = math.max(0.5, math.min(2.0, safeVolRatio))
float turnover = volBasedTurnover * volAdjustment
math.max(0.02, math.min(0.4, turnover))
// Store candle method
method storeCandle(PCD this, int barIdx, float hiPrice, float loPrice, float volVal, float avgVol, float atrPct) =>
if not na(hiPrice) and not na(loPrice) and not na(volVal) and volVal > 0
float safeAvgVol = na(avgVol) or avgVol <= 0 ? volVal : avgVol
float relVol = volVal / safeAvgVol
float safeAtrPct = na(atrPct) ? 0.02 : atrPct
bool modified = false
int candleSize = array.size(this.candles)
if candleSize > 0
Candle c = array.get(this.candles, candleSize - 1)
if c.idx == barIdx
c.hi := hiPrice
c.lo := loPrice
c.vol := volVal
c.relativeVol := relVol
c.atrPct := safeAtrPct
modified := true
if not modified
Candle c = Candle.new(barIdx, hiPrice, loPrice, volVal, relVol, safeAtrPct)
array.push(this.candles, c)
this.minPrice := na(this.minPrice) ? loPrice : math.min(this.minPrice, loPrice)
this.maxPrice := na(this.maxPrice) ? hiPrice : math.max(this.maxPrice, hiPrice)
float priceRange = this.maxPrice - this.minPrice
this.priceStep := priceRange > 0 ? priceRange / NUM_BUCKETS : 0.0001
// Get bucket index for price
method getBucketIndex(PCD this, float price) =>
if na(this.priceStep) or this.priceStep <= 0 or na(this.minPrice)
0
else
int idx = int(math.floor((price - this.minPrice) / this.priceStep))
math.max(0, math.min(idx, NUM_BUCKETS - 1))
// Get price for bucket index
method getBucketedPrice(PCD this, int bucketIdx) =>
int safeIndex = math.max(0, math.min(bucketIdx, NUM_BUCKETS - 1))
float safeStep = na(this.priceStep) or this.priceStep <= 0 ? 0.0001 : this.priceStep
float safeMin = na(this.minPrice) ? 0.0 : this.minPrice
(safeIndex + 0.5) * safeStep + safeMin
// Get rainbow color based on position (0.0 = bottom/red, 1.0 = top/violet)
getRainbowColor(float position, float intensityRatio) =>
float pos = math.max(0.0, math.min(1.0, position))
int transparency = int(math.round((1.0 - intensityRatio) * 50))
// Rainbow spectrum: red -> orange -> yellow -> green -> cyan -> blue -> violet
if pos < 0.166
color.new(color.from_gradient(pos, 0.0, 0.166, #FF0000, #FF7F00), transparency)
else if pos < 0.333
color.new(color.from_gradient(pos, 0.166, 0.333, #FF7F00, #FFFF00), transparency)
else if pos < 0.5
color.new(color.from_gradient(pos, 0.333, 0.5, #FFFF00, #00FF00), transparency)
else if pos < 0.666
color.new(color.from_gradient(pos, 0.5, 0.666, #00FF00, #00FFFF), transparency)
else if pos < 0.833
color.new(color.from_gradient(pos, 0.666, 0.833, #00FFFF, #0000FF), transparency)
else
color.new(color.from_gradient(pos, 0.833, 1.0, #0000FF, #8B00FF), transparency)
// Get color based on scheme and intensity
getColor(bool isProfitable, float intensity, float maxIntensity, int bucketIdx) =>
float safeMax = maxIntensity > 0 ? maxIntensity : 1.0
float ratio = math.max(0.0, math.min(1.0, intensity / safeMax))
float positionRatio = bucketIdx / math.max(1.0, NUM_BUCKETS - 1.0)
if COLOR_SCHEME == "Rainbow"
getRainbowColor(positionRatio, ratio)
else if COLOR_SCHEME == "Gradient"
if isProfitable
color.from_gradient(ratio, 0.0, 1.0, PROFIT_COLOR_DARK, PROFIT_COLOR_LIGHT)
else
color.from_gradient(ratio, 0.0, 1.0, LOSS_COLOR_DARK, LOSS_COLOR_LIGHT)
else if COLOR_SCHEME == "Heatmap"
color.from_gradient(ratio, 0.0, 1.0, #1a237e, #f44336)
else
if isProfitable
color.new(#5d606b, int(math.round((1.0 - ratio) * 70)))
else
color.new(#e91e63, int(math.round((1.0 - ratio) * 70)))
// Update method
method update(PCD this) =>
int candleCount = array.size(this.candles)
if candleCount > 0 and not na(this.priceStep) and this.priceStep > 0
// Create distribution array
array dist = array.new_float(NUM_BUCKETS, 0.0)
// Process each candle
for candleIdx = 0 to candleCount - 1
Candle candle = array.get(this.candles, candleIdx)
bool isFirstCandle = candleIdx == 0
float turnover = AUTO_TUNE ? calcAdaptiveTurnover(candle.atrPct, candle.relativeVol) : MANUAL_DECAY * candle.relativeVol
turnover := math.min(turnover, 0.95)
this.calculatedTurnover := turnover
int startIdx = this.getBucketIndex(candle.lo)
int endIdx = this.getBucketIndex(candle.hi)
int buckets = math.max(1, endIdx - startIdx + 1)
if isFirstCandle
float initialWeight = 1.0 / buckets
for i = startIdx to endIdx
array.set(dist, i, initialWeight)
else
float decayedAmount = 0.0
for i = 0 to NUM_BUCKETS - 1
float oldVal = array.get(dist, i)
float newVal = oldVal * (1.0 - turnover)
array.set(dist, i, newVal)
decayedAmount += oldVal - newVal
float addPerBucket = decayedAmount / buckets
for i = startIdx to endIdx
array.set(dist, i, array.get(dist, i) + addPerBucket)
// Normalize distribution
float totalWeight = 0.0
for i = 0 to NUM_BUCKETS - 1
totalWeight += array.get(dist, i)
if totalWeight > 0
for i = 0 to NUM_BUCKETS - 1
array.set(dist, i, array.get(dist, i) / totalWeight)
// Find peak
float maxWeight = array.max(dist)
if na(maxWeight) or maxWeight <= 0
maxWeight := 0.001
int peakIndex = array.indexof(dist, maxWeight)
if peakIndex < 0
peakIndex := 0
float peakPrice = this.getBucketedPrice(peakIndex)
// Find support/resistance zones
array srIndices = array.new(0)
if SHOW_SUPPORT_RESISTANCE
bool inZone = false
int zoneStart = 0
for i = 0 to NUM_BUCKETS - 1
bool isHighConcentration = array.get(dist, i) >= maxWeight * SR_THRESHOLD
if isHighConcentration and not inZone
inZone := true
zoneStart := i
else if not isHighConcentration and inZone
inZone := false
array.push(srIndices, int(math.floor((zoneStart + i) / 2)))
if inZone
array.push(srIndices, int(math.floor((zoneStart + NUM_BUCKETS - 1) / 2)))
// Clear old SR zones
int srZoneSize = array.size(this.srZones)
if srZoneSize > 0
for i = 0 to srZoneSize - 1
box b = array.get(this.srZones, i)
box.set_lefttop(b, 0, 0)
box.set_rightbottom(b, 0, 0)
// Draw the distribution
float lowestDisplayedPrice = na
float highestDisplayedPrice = na
for i = 0 to NUM_BUCKETS - 1
float weight = array.get(dist, i)
float price = (i + 0.5) * this.priceStep + this.minPrice
int width = int(math.round(weight / maxWeight * CHART_MAX_WIDTH))
line ln = array.get(this.lines, i)
if width > 0
if na(lowestDisplayedPrice)
lowestDisplayedPrice := price
highestDisplayedPrice := price
int x1 = bar_index + CHART_X_OFFSET
int x2 = x1 - width
bool isProfitable = price < close
color c = getColor(isProfitable, weight, maxWeight, i)
line.set_xy1(ln, x1, price)
line.set_xy2(ln, x2, price)
line.set_color(ln, c)
else
line.set_xy1(ln, 0, 0)
line.set_xy2(ln, 0, 0)
// Draw S/R zones
if SHOW_SUPPORT_RESISTANCE
int srCount = array.size(srIndices)
int leftBar = math.max(0, bar_index - LOOKBACK)
if srCount > 0
for i = 0 to srCount - 1
int idx = array.get(srIndices, i)
float zonePrice = this.getBucketedPrice(idx)
float zoneHalfHeight = this.priceStep * 3
box b = na
if i < array.size(this.srZones)
b := array.get(this.srZones, i)
box.set_lefttop(b, leftBar, zonePrice + zoneHalfHeight)
box.set_rightbottom(b, bar_index, zonePrice - zoneHalfHeight)
else
b := box.new(leftBar, zonePrice + zoneHalfHeight, bar_index, zonePrice - zoneHalfHeight, bgcolor = color.new(PEAK_COLOR, 85), border_color = color.new(PEAK_COLOR, 60))
array.push(this.srZones, b)
// Calculate cumulative distribution
array cumdist = array.copy(dist)
for i = 1 to NUM_BUCKETS - 1
array.set(cumdist, i, array.get(cumdist, i - 1) + array.get(cumdist, i))
// Highlight current price
int closeIndex = this.getBucketIndex(close)
if closeIndex >= 0 and closeIndex < NUM_BUCKETS
line.set_color(array.get(this.lines, closeIndex), CURRENT_PRICE_COLOR)
// Calculate stats
float totalShares = array.get(cumdist, NUM_BUCKETS - 1)
int profitIndex = math.min(closeIndex + 1, NUM_BUCKETS - 1)
float profitRatio = totalShares > 0 ? array.get(cumdist, profitIndex) / totalShares : 0.0
// Calculate average price
float avg = 0.0
for i = 0 to NUM_BUCKETS - 1
float weight = array.get(dist, i)
float price = this.getBucketedPrice(i)
avg += price * weight
int avgIndex = this.getBucketIndex(avg)
if avgIndex >= 0 and avgIndex < NUM_BUCKETS
line.set_color(array.get(this.lines, avgIndex), AVG_PRICE_COLOR)
// Peak concentration - highlight line
if SHOW_PEAK and peakIndex >= 0 and peakIndex < NUM_BUCKETS
line.set_color(array.get(this.lines, peakIndex), PEAK_COLOR)
// Smart label positioning - avoid overlaps
float priceRange = na(highestDisplayedPrice) or na(lowestDisplayedPrice) ? close * 0.01 : (highestDisplayedPrice - lowestDisplayedPrice)
float minLabelSpacing = priceRange * 0.025
// Sort prices and assign staggered X offsets
float currentY = close
float avgY = avg
float peakY = peakPrice
// Adjust avg label if too close to current
if math.abs(avgY - currentY) < minLabelSpacing
avgY := currentY > avgY ? avgY - minLabelSpacing : avgY + minLabelSpacing
// Adjust peak label if too close to current or avg
if SHOW_PEAK
if math.abs(peakY - currentY) < minLabelSpacing
peakY := currentY > peakY ? peakY - minLabelSpacing : peakY + minLabelSpacing
if math.abs(peakY - avgY) < minLabelSpacing
peakY := avgY > peakY ? peakY - minLabelSpacing : peakY + minLabelSpacing
// Position price labels - compact format, right side of distribution
label.set_text(this.currentPriceLabel, str.format('{0,number,#.##}', close))
label.set_xy(this.currentPriceLabel, bar_index + LABEL_X_OFFSET + 2, close)
label.set_style(this.currentPriceLabel, label.style_label_left)
label.set_size(this.currentPriceLabel, size.tiny)
label.set_text(this.avgPriceLabel, str.format('{0,number,#.##} AVG', avg))
label.set_xy(this.avgPriceLabel, bar_index + LABEL_X_OFFSET + 2, avgY)
label.set_style(this.avgPriceLabel, label.style_label_left)
label.set_size(this.avgPriceLabel, size.tiny)
if SHOW_PEAK
label.set_text(this.peakLabel, str.format('{0,number,#.##} PEAK', peakPrice))
label.set_xy(this.peakLabel, bar_index + LABEL_X_OFFSET + 2, peakY)
label.set_style(this.peakLabel, label.style_label_left)
label.set_size(this.peakLabel, size.tiny)
// Calculate ranges safely
float safeTotalShares = totalShares > 0 ? totalShares : 1.0
int idx05 = array.binary_search_leftmost(cumdist, safeTotalShares * 0.05)
int idx95 = array.binary_search_leftmost(cumdist, safeTotalShares * 0.95)
int idx15 = array.binary_search_leftmost(cumdist, safeTotalShares * 0.15)
int idx85 = array.binary_search_leftmost(cumdist, safeTotalShares * 0.85)
float ninetyPctLow = this.getBucketedPrice(idx05)
float ninetyPctHigh = this.getBucketedPrice(idx95)
float seventyPctLow = this.getBucketedPrice(idx15)
float seventyPctHigh = this.getBucketedPrice(idx85)
float rangeDenom = ninetyPctHigh - ninetyPctLow
float rangeOverlap = rangeDenom != 0 ? (seventyPctHigh - seventyPctLow) / rangeDenom : 0.0
// Calculate chip concentration
float concentration = rangeOverlap * 100
string concentrationDesc = concentration < 50 ? "High" : concentration < 70 ? "Medium" : "Dispersed"
// Pressure analysis
float safeAvg = avg > 0 ? avg : close
float priceVsAvg = ((close - safeAvg) / safeAvg) * 100
string pressure = priceVsAvg > 5 ? "Strong Bullish" : priceVsAvg > 1 ? "Bullish" :
priceVsAvg < -5 ? "Strong Bearish" : priceVsAvg < -1 ? "Bearish" : "Neutral"
// Price vs Peak
float safePeak = peakPrice > 0 ? peakPrice : close
float priceVsPeak = ((close - safePeak) / safePeak) * 100
string peakRelation = close > peakPrice ? "Above Peak" : close < peakPrice ? "Below Peak" : "At Peak"
// Stats panel - positioned at bottom, compact
float displayedRange = na(highestDisplayedPrice) or na(lowestDisplayedPrice) ? close * 0.02 : highestDisplayedPrice - lowestDisplayedPrice
label.set_text(this.statsLabel, str.format(
'90%: {0,number,#.##} - {1,number,#.##} | 70%: {2,number,#.##} - {3,number,#.##}',
ninetyPctLow, ninetyPctHigh, seventyPctLow, seventyPctHigh))
if not na(lowestDisplayedPrice) and displayedRange > 0
label.set_y(this.statsLabel, lowestDisplayedPrice - displayedRange * 0.05)
label.set_style(this.statsLabel, label.style_label_up)
label.set_x(this.statsLabel, bar_index + CHART_X_OFFSET - 30)
label.set_size(this.statsLabel, size.tiny)
// Signal panel - hidden (info moved to trend arrow and pressure bar)
label.set_text(this.signalLabel, "")
label.set_xy(this.signalLabel, bar_index, close)
// === NEW PROFESSIONAL VISUALIZATIONS ===
// 1. Key Level Lines - Support, Resistance, and Average Cost extending across chart
if SHOW_KEY_LEVELS
int chartLeft = math.max(0, bar_index - LOOKBACK)
int chartRight = bar_index + CHART_X_OFFSET - 5
// Average cost line (horizontal dotted blue line)
line.set_xy1(this.avgCostLine, chartLeft, avg)
line.set_xy2(this.avgCostLine, chartRight, avg)
line.set_color(this.avgCostLine, AVG_PRICE_COLOR)
// Find strongest support (highest concentration below current price)
float strongestSupport = na
float strongestSupportWeight = 0.0
float strongestResistance = na
float strongestResistanceWeight = 0.0
for i = 0 to NUM_BUCKETS - 1
float bucketPrice = this.getBucketedPrice(i)
float bucketWeight = array.get(dist, i)
if bucketPrice < close and bucketWeight > strongestSupportWeight
strongestSupport := bucketPrice
strongestSupportWeight := bucketWeight
if bucketPrice > close and bucketWeight > strongestResistanceWeight
strongestResistance := bucketPrice
strongestResistanceWeight := bucketWeight
// Support line (green dashed)
if not na(strongestSupport)
line.set_xy1(this.supportLine, chartLeft, strongestSupport)
line.set_xy2(this.supportLine, chartRight, strongestSupport)
line.set_color(this.supportLine, SUPPORT_COLOR)
else
line.set_xy1(this.supportLine, bar_index, close)
line.set_xy2(this.supportLine, bar_index, close)
line.set_color(this.supportLine, color.new(SUPPORT_COLOR, 100))
// Resistance line (red dashed)
if not na(strongestResistance)
line.set_xy1(this.resistanceLine, chartLeft, strongestResistance)
line.set_xy2(this.resistanceLine, chartRight, strongestResistance)
line.set_color(this.resistanceLine, RESISTANCE_COLOR)
else
line.set_xy1(this.resistanceLine, bar_index, close)
line.set_xy2(this.resistanceLine, bar_index, close)
line.set_color(this.resistanceLine, color.new(RESISTANCE_COLOR, 100))
// 2. Trend Direction Arrow
if SHOW_TREND_ARROW
string trendSymbol = priceVsAvg > 5 ? "▲▲" : priceVsAvg > 1 ? "▲" :
priceVsAvg < -5 ? "▼▼" : priceVsAvg < -1 ? "▼" : "◆"
color trendColor = priceVsAvg > 5 ? color.new(#00E676, 0) : priceVsAvg > 1 ? color.new(#4CAF50, 0) :
priceVsAvg < -5 ? color.new(#FF1744, 0) : priceVsAvg < -1 ? color.new(#EF5350, 0) : color.new(#9E9E9E, 0)
string trendText = trendSymbol + " " + pressure
label.set_text(this.trendArrow, trendText)
float arrowY = na(highestDisplayedPrice) ? close : highestDisplayedPrice + displayedRange * 0.12
label.set_xy(this.trendArrow, bar_index + CHART_X_OFFSET - 40, arrowY)
label.set_color(this.trendArrow, color.new(trendColor, 70))
label.set_textcolor(this.trendArrow, trendColor)
label.set_size(this.trendArrow, size.large)
// 3. Pressure Bar (Profit/Loss ratio visualization)
if SHOW_PRESSURE_BAR
float barWidth = 8.0
float barHeight = displayedRange * 0.25
float barX = bar_index + CHART_X_OFFSET + 5
float barTop = na(highestDisplayedPrice) ? close + barHeight/2 : highestDisplayedPrice - displayedRange * 0.02
float barBottom = barTop - barHeight
// Background bar
box.set_lefttop(this.pressureBar, int(barX), barTop)
box.set_rightbottom(this.pressureBar, int(barX + barWidth), barBottom)
box.set_bgcolor(this.pressureBar, color.new(#424242, 60))
// Fill based on profit ratio (green from bottom)
float fillHeight = barHeight * profitRatio
float fillTop = barBottom + fillHeight
color fillColor = profitRatio > 0.7 ? color.new(#00E676, 30) :
profitRatio > 0.5 ? color.new(#4CAF50, 30) :
profitRatio > 0.3 ? color.new(#FFC107, 30) : color.new(#FF5252, 30)
box.set_lefttop(this.pressureFill, int(barX), fillTop)
box.set_rightbottom(this.pressureFill, int(barX + barWidth), barBottom)
box.set_bgcolor(this.pressureFill, fillColor)
// Pressure label
string pressureText = str.format('{0,number,#}%', profitRatio * 100)
label.set_text(this.pressureLabel, pressureText)
label.set_xy(this.pressureLabel, int(barX - 1), barTop + displayedRange * 0.01)
label.set_textcolor(this.pressureLabel, fillColor)
//#endregion
//#region Main
= request.security(syminfo.tickerid, 'D', , lookahead = barmerge.lookahead_off)
float atrPercent = dailyClose > 0 ? dailyATR / dailyClose : 0.02
if timeframe.in_seconds(timeframe.period) <= timeframe.in_seconds('D')
var PCD pcd = newPCD()
if last_bar_index - bar_index < LOOKBACK
pcd.storeCandle(dailyBarIdx, dailyHigh, dailyLow, dailyVolume, avgVolume, atrPercent)
if barstate.islast
pcd.update()
//#endregion






















