OPEN-SOURCE SCRIPT

VB-MainLite

97
VB-MainLite – v1.0 Initial Release

Overview
VB-MainLite is a consolidated market-structure and execution framework designed to streamline decision-making into a single chart-level view. The script combines multi-timeframe trend, volatility, volume, and liquidity signals into one cohesive visual layer, reducing indicator clutter while preserving depth of information for active traders.

Core Architecture

Trend Backbone – EMA 200

Dedicated EMA 200 acts as the primary trend filter and higher-timeframe bias reference.

Serves as the “spine” of the system for contextualizing all secondary signals (swings, reversals, volume events, etc.).

Custom MA Suite (Envelope Ready)

Four configurable moving averages with flexible source, length, and smoothing.

Default configuration (preset idea: “8/89 Envelope”):

MA #1: EMA 8 on high

MA #2: EMA 8 on low

MA #3: EMA 89 on high

MA #4: EMA 89 on low

All four are disabled by default to keep the chart minimal. Users can toggle them on from the Custom MAs group for envelope or cloud-style configurations.

Nadaraya–Watson Smoother (Swing Framework)

Gaussian-kernel Nadaraya–Watson regression applied to price (hl2) to build a smooth synthetic curve.

Two layers of functionality:

Swing labels (▲ / ▼) at inflection points in the smoothed curve.

Optional curve line that visually tracks the turning structure over the last ~500 bars.

Designed to surface early swing potential before standard MAs react.

Hull Moving Average (Trend Overlay)

Optional Hull MA (HMA) for faster trend visualization.

Color-coded by slope (buy/sell bias).

Default: off to prevent overloading the chart; can be enabled under Hull MA settings.

Momentum, Exhaustion & Pattern Engine

CCI-Based Bar Coloring

CCI applied to close with configurable thresholds.

Overbought / oversold CCI zones map directly into candle coloring to visually highlight short-term momentum extremes.

RSI Top / Bottom Exhaustion Finder

RSI logic applied separately to high-driven (tops) and low-driven (bottoms) sequences.

Plots:

Top arrows where high-side RSI stretches into high-risk territory.

Bottom arrows where low-side RSI indicates exhaustion on the downside.

Useful as confluence around the Nadaraya swing turns and EMA 200 regime.

Engulfing + MA Trend Engine (“Fat Bull / Fat Bear”)

Detects bullish and bearish engulfing patterns, then combines them with MA trend cross logic.

Only when both pattern and MA regime align does the engine flag:

Fat Bull (Engulf + MA aligned long)

Fat Bear (Engulf + MA aligned short)

Candles are marked via conditional barcolor to highlight strong, structured shifts in control.

Fat Finger Detection (Wick Spikes / Stop Runs)

Identifies abnormal wick extensions relative to the prior bar’s body range with configurable tolerance.

Supports detection of potential liquidity grabs, stop runs, or “excess” that may precede reversals or mean-reversion behavior.

Volume & Liquidity Intelligence

Bull Snort (Aggressive Buy Spikes)

Flags events where:

Volume is significantly above the 50-period average, and

Price closes in the upper portion of the bar and above prior close.

Plots a labeled marker below the bar to indicate aggressive upside initiative by buyers.

Pocket Pivots (Accumulation Flags)

Compares current volume vs prior 10 sessions with a filter on prior “up” days.

Highlights pocket pivot days where current green candle volume outclasses recent down-day volumes, suggesting stealth accumulation.

Delta Volume Core (Directional Volume by Price)

Internal volume-by-price style engine over a user-defined lookback.

Splits volume into up-close and down-close buckets across dynamic price bins.

Feeds into S&R and ICT zone logic to quantify where buying vs selling pressure built up.

Structural Context: S&R and ICT Zones

S&R Power Channel

Computes local high/low band over a configurable lookback window.

Renders:

Upper and lower S&R channel lines.

Shaded support / resistance zones using boxes.

Adds Buy Power / Sell Power metrics based on the ratio of up vs down bars inside the window, displayed directly in the zone overlays.

Drops ◈ markers where price interacts dynamically with the top or bottom band, highlighting reaction points.

ICT-Style Premium / Discount & Macro Zones

Two tiered structures:

Local Premium / Discount zones over a shorter SR window.

Macro Premium / Discount zones over a longer macro window.

Each zone:

Uses underlying directional volume to annotate accumulation vs distribution bias.

Provides Delta Volume Bias shading in the mid-band region, visually encoding whether local power flows are net-buying or net-selling.

Enables traders to quickly see whether current trade location is in a local/macro discount or premium context while still respecting volume profile.

Positioning Intelligence: PCD (Stocks)

Position Cost Distribution (PCD) – Stocks Only

Available for stock symbols on intraday up to daily timeframe (≤ 1D).

Uses:

TOTAL_SHARES_OUTSTANDING fundamentals,

Daily OHLCV snapshot, and

A bucketed distribution engine
to approximate cost basis distribution across price.

Outputs:

Horizontal “PCD bars” to the right of current price, density-scaled by estimated share concentration.

Color-coding by profitability relative to current price (profitable vs unprofitable positions).

Labels for:

Current price

Average cost

Profit ratio (share % below current price)

90% cost range

70% cost range

Range overlap as a measure of clustering / concentration.

Multi-Timeframe Trend: Two-Pole Gaussian Dashboard

Two-Pole Gaussian Filter (Line + Cloud)

Smooths a user-selected source (default: close) using a two-pole Gaussian filter with tunable alpha.

Plots:

A thin Gaussian trend line, and

A thick Gaussian “cloud” line with transparency, colored by slope vs past (offsetG).

Functions as a responsive trend backbone that is more sensitive than EMA 200 but less noisy than raw price.

Multi-Timeframe Gaussian Dashboard

Evaluates Gaussian trend direction across up to six timeframes (e.g., 1H / 2H / 4H / Daily / Weekly).

Renders a compact bottom-right table:

Header: symbol + overall bias arrow (up / down) based on average trend alignment.

Row of colored cells per timeframe (green for uptrend, magenta for downtrend) with human-readable TF labels (e.g., “60M”, “4H”, “1D”).

Gives an immediate read on whether intraday, swing, and higher-timeframe flows are aligned or fragmented.

Default Configuration & Usage Guidance

Default state after adding the script:

Enabled by default:

EMA 200 trend backbone

Nadaraya–Watson swing labels and curve

CCI bar coloring

RSI top/bottom arrows

Fat Bull / Fat Bear engine

Bull Snort & Pocket Pivots

S&R Power Channel

ICT Local + Macro zones

Two-pole Gaussian line + cloud + dashboard

PCD engine for stocks (auto-active where data is available)

Disabled by default (opt-in):

Custom MA suite (4x MAs, preset as EMA 8/8/89/89)

Hull MA overlay

How traders can use VB-MainLite in practice:

Use EMA 200 + Gaussian dashboard to define top-down directional bias and avoid trading directly against multi-TF trend.

Use Nadaraya swing labels, RSI exhaustion arrows, and CCI bar colors to time entries within that higher-timeframe bias.

Use Fat Bull / Fat Bear events as structured confirmation that both pattern and MA regime have flipped in the same direction.

Use Bull Snort, Pocket Pivots, and S&R / ICT zones to align execution with liquidity, volume, and location (premium vs discount).

On stocks, use PCD as a positioning map to understand trapped supply, support zones near crowded cost basis, and where profit-taking is likely.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.