OPEN-SOURCE SCRIPT
更新済

VB-MainLite

1 006
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.
リリースノート
v1.4.0 — Regime System Overhaul

Enhancements

Added full toggle control for the Regime Quad Box (Show Regime Quad Box).
Allows users to enable or disable the regime heatmap overlay without modifying source code.

Restored original Beluga-style 11×11 heatmap while improving compatibility with Pine v6.
All quadrant gradients, center node, and directional color logic are preserved.

Rebuilt the Quad Box rendering engine
Eliminated multiline conditional outputs and replaced them with explicit state logic for improved stability on TradingView’s renderer.

Improved grid safety and clamping logic
Trend and volume scores are now constrained to the valid 0–10 index range to prevent off-grid placement errors.

Ensured table persistence only when active
When toggled off, the quad box fully clears its UI footprint so no stale visual elements remain on chart.

Stability / Performance

Reduced redraw footprint to a single barstate.islast execution block.

Avoids unnecessary table object creation; table reused once instantiated.

Integrated clean fallback handling when user disables visualization.

UX Improvements

Quad Box now aligns consistently with other VB-MainLite modules (Gaussian, PCD dashboard, S&R channels).

Maintains stylistic coherence with the rest of the UI elements.

Uses TradingView-safe Unicode symbols with proper axis labeling.
リリースノート
v1.5.0 — Regime Engine Modernization & UI Upgrade
New Features

Configurable Regime Quad Box Module
A fully reworked visualization layer for market regime detection:

Toggle On/Off (Show Regime Quad Box)

Grid Size Selector
• Compact (6×6) — minimal footprint
• Full (11×11) — original, high-resolution view

Marker Selector (Dropdown)
Choose between "●", "⚪", "◆", "◎", "■" for the active regime point

Marker Color Control
Full user control of symbol color for improved chart theme compatibility

Heatmap Improvements

Consistent Heatmap Coloring Across Grid Sizes
The 6×6 mode now uses a virtual 11-step gradient engine, preserving the smooth color transitions of the original 11×11 version.

Quadrant Logic Preserved
Uptrend, downtrend, high-volume, low-volume color semantics remain unchanged from the Beluga heritage model.

Central Regime Highlight retained using the original #2d3e76 node.

UI & Labeling Enhancements

Restored the classic quadrant labels:

Top Axis: "➖ TREND ➕"

Left Axis: "➕ VOLUME ➖"

Improved grid rendering efficiency with deterministic barstate.islast updating.

Ensured proper cleanup when the regime display is toggled off to avoid stale visual elements.

Performance & Stability

All scaling math dynamically adapts to grid size without rewriting logic.

Safe clamping on all index values prevents out-of-bounds table rendering.

Significantly reduced layout distortion in Compact mode.
リリースノート
v1.5.2 — Compact Grid Correction + Heatmap Normalization
Structural Fixes

Corrected 6×6 Quadrant Division
Compact mode now uses a clean 3×3 top/bottom and 3×3 left/right split
(0–2 vs 3–5), eliminating the misaligned midpoint inherited from the 11×11 design.
This restores consistent quadrant logic for:

Trend Up / Trend Down

Volume Up / Volume Down

Mixed zones

Removed false center in even grids
6×6 mode correctly has no single center cell, preventing incorrect color assignments.

Heatmap Consistency Upgrade

Unified Color Model Across Grid Sizes
Both 6×6 and 11×11 grids now use a virtual 11-step gradient scale, maintaining visual smoothness and preventing “blocky” color jumps in compact mode.

Quadrant Color Mapping Stabilized
All four regime quadrants now align precisely with Beluga-style logic in both modes:

Weak Trend x Weak Volume

Strong Trend x Strong Volume

Strong Trend x Weak Volume

Weak Trend x Strong Volume

Marker Logic Improvements

Active marker color now uses the same virtual gradient, ensuring the dot remains consistent with the background heatmap.

Full boundary clamping ensures the marker never lands off-grid.

UI/Label Refinements

Restored original axis labels:

"➖ TREND ➕" (top)

"➕ VOLUME ➖" (left)

Grid display, marker size, and layout now scale properly with selected mode.

Existing Enhancements Retained

Grid Size toggle (Compact 6×6 / Full 11×11)

Marker symbol dropdown (●, ⚪, ◆, ◎, ■)

Custom marker color

Clean table clearing when disabled

Fully optimized barstate.islast execution
リリースノート
Added Fib Level Projections

免責事項

この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。