OPEN-SOURCE SCRIPT
Cập nhật

Hazel nut BB Strategy, volume base- lite version

2 220
Hazel nut BB Strategy, volume base — lite version

Having knowledge and information in financial markets is only useful when a trader operates with a well-defined trading strategy. Trading strategies assist in capital management, profit-taking, and reducing potential losses.

This strategy is built upon the core principle of supply and demand dynamics. Alongside this foundation, one of the widely used technical tools — the Bollinger Bands — is employed to structure a framework for profit management and risk control.

In this strategy, the interaction of these tools is explained in detail. A key point to note is that for calculating buy and sell volumes, a lower timeframe function is used. When applied with a tick-level resolution, this provides the most precise measurement of buyer/seller flows. However, this comes with a limitation of reduced historical depth. Users should be aware of this trade-off: if precise tick-level data is required, shorter timeframes should be considered to extend historical coverage.

The strategy offers multiple configuration options. Nevertheless, it should be treated strictly as a supportive tool rather than a standalone trading system. Decisions must integrate personal analysis and other instruments. For example, in highly volatile assets with narrow ranges, it is recommended to adjust profit-taking and stop-loss percentages to smaller values.

◉ Volume Settings
• Buyer and seller volume (up/down volume) are requested from a lower timeframe, with an option to override the automatic resolution.
• A global lookback period is applied to calculate moving averages and cumulative sums of buy/sell/delta volumes.
• Ratios of buyers/sellers to total volume are derived both on the current bar and across the lookback window.

ảnh chụp nhanh

◉ Bollinger Band
• Bands are computed using configurable moving averages (SMA, EMA, RMA, WMA, VWMA).
• Inputs allow control of length, standard deviation multiplier, and offset.
• The basis, upper, and lower bands are plotted, with a shaded background between them.

ảnh chụp nhanh

◉ Progress & Proximity
• Relative position of the price to the Bollinger basis is expressed as percentages (qPlus/qMinus).
• “Near band” conditions are triggered when price progress toward the upper or lower band exceeds a user-defined threshold (%).
• A signed score (sScore) represents how far the close has moved above or below the basis relative to band width.

◉ Info Table
• Optional compact table summarizing:
• - Upper/lower band margins
• - Buyer/seller volumes with moving averages
• - Delta and cumulative delta
• - Buyer/seller ratios per bar and across the window
• - Money flow values (buy/sell/delta × price) for bar-level and summed periods
• The table is neutral-colored and resizable for different chart layouts.

ảnh chụp nhanh

◉ Zone Event Gate
• Tracks entry into and exit from “near band” zones.
• Arming logic: a side is armed when price enters a band proximity zone.
• Trigger logic: on exit, a trade event is generated if cumulative buyer or seller volume dominates over a configurable window.

◉ Trading Logic
• Orders are placed only on zone-exit events, conditional on volume dominance.
• Position sizing is defined as a fixed percentage of strategy equity.
• Long entries occur when leaving the lower zone with buyer dominance; short entries occur when leaving the upper zone with seller dominance.

◉ Exit Rules
• Open positions are managed by a strict priority sequence:
• 1. Stop-loss (% of entry price)
• 2. Take-profit (% of entry price)
• 3. Opposite-side event (zone exit with dominance in the other direction)
• Stop-loss and take-profit levels are configurable

ảnh chụp nhanh

◉ Notes
• This lite version is intended to demonstrate the interaction of Bollinger Bands and volume-based dominance logic.
• It provides a framework to observe how price reacts at band boundaries under varying buy/sell pressure, and how zone exits can be systematically converted into entry/exit signals.

When configuring this strategy, it is essential to carefully review the settings within the Strategy Tester. Ensure that the chosen parameters and historical data options are correctly aligned with the intended use. Accurate back testing depends on applying proper configurations for historical reference. The figure below illustrates sample result and configuration type.


ảnh chụp nhanh


















Phát hành các Ghi chú
Release Notes:
Now shows exact LTF data coverage in HUD and chart, plus enforces a 50% band filter for cleaner, more reliable entries.

1. Lower-Timeframe Volume & Data Coverage
This update improves transparency around how much lower-timeframe (LTF) data is actually available for buy/sell volume calculations. While 1 Tick (1T) remains the most precise option—classifying every trade individually as buy or sell—the historical coverage depends on both TradingView’s bar limits (≈25k–40k tick bars depending on plan) and the trading activity of the symbol. That means some symbols may offer several days of 1T history, while high-volume instruments may only cover hours. To make this clear in back tests, the HUD now shows the number of bars of valid LTF data, and a chart label marks exactly where coverage begins. This ensures traders know the precise trade-off between accuracy and historical depth.

Important Note :
The amount of historical intraday data available in TradingView depends on your subscription plan. By default, charts provide 5,000 bars of history. This limit is extended to 10,000 bars for Essential and Plus accounts, and up to 20,000 bars for Premium accounts. In addition, a few extra bars are always included, reaching back to the beginning of the current week, month, or year depending on the selected chart timeframe.
Professional plans unlock significantly larger histories: Expert plans support up to 25,000 bars, while Ultimate plans provide the maximum of 40,000 bars of intraday history. Forty thousand bars is already a substantial amount of data; and if you need even deeper back testing, TradingView’s Strategy Tester includes a special mode that allows you to run calculations across all historical data available for the selected symbol, not just the portion currently loaded on the chart.


2. Strategy Entry Filter — 50% Band Rule
The original zone-exit plus volume-dominance logic remains intact, but an additional filter has been introduced: long entries are only permitted in the lower half of the Bollinger Band (below the midpoint between basis and lower band), and short entries only in the upper half (above the midpoint between basis and upper band). This prevents long trades from triggering in the upper band region and short trades in the lower band region, aligning entries more closely with directional bias and improving the robustness of back test results.


Phát hành các Ghi chú
BB Volume Apex Strategy [BB & Volume Flow]

Description:

"A strategy is only as successful as the trader's understanding of the tools they wield."

The BB Volume Apex Strategy is a sophisticated measurement tool designed for traders who wish to analyze Market Structure (via Bollinger Bands) alongside Volume Flow (via Cumulative Volume Delta & Pressure).

This script moves beyond simple crossovers. It acts as an analytical engine that quantifies the battle between buyers and sellers, helping you distinguish between a genuine Breakout and a Fakeout (Trap).

THE DUAL-ENGINE LOGIC

This strategy operates on two distinct logical "engines," adaptively switching based on market conditions:

1. VCS (Volume Confirmed Squeeze) - The Breakout Engine
This engine activates when volatility compresses (Bollinger Squeeze). It does not blindly trade breakouts; it waits for specific confirmation:
- The Setup: Price breaks out of the bands after a period of low volatility .
- The Confirmation: Requires a Volume Spike combined with significant CVD Pressure (Cumulative Volume Delta) in the direction of the break .
- Goal: To catch high-momentum expansions.

2. ADb (Absorption/Distribution at Bands) - The Reversal Engine
This engine utilizes VSA (Volume Spread Analysis) concepts to identify exhaustion points at the edges of the bands:
- Distribution (Sell): When price is high (Upper Band), Volume is High, but the result (price progress) is weak, or Delta is negative. This signals "Effort without Result" [cite: 229-232].
- Absorption (Buy): When price is low (Lower Band), Volume is High, but Delta is positive (limit buyers absorbing market sellers).
- Goal: To catch mean-reversion moves when the trend runs out of fuel.

THE DASHBOARD: VOLUME PRESSURE MATRIX (USER MANUAL)

The on-screen dashboard is the heart of this tool. It combines Structural State (S) with Dynamic Pressure (D) to give you a bias reading.

How to Read the Matrix:

- S-States (Rows - Price Location):
S1 (Above Upper): Price is extended above volatility bands.
S2 (Near Upper): Price is testing resistance.
S3 (Mid Zone): Price is in equilibrium or starting a trend.
S4 (Near Lower): Price is testing support.
S5 (Below Lower): Price is extended below volatility bands.

- D-States (Columns - CVD Pressure):
D1 (Extreme Buy): Massive buying pressure (>1.5).
D2 (Moderate Buy): Healthy buying interest (>0.5).
D3 (Neutral): Low conviction/Choppy volume.
D4 (Moderate Sell): Healthy selling interest (<-0.5).
D5 (Extreme Sell): Massive selling pressure (<-1.5).

Key Matrix Interpretations:
1. Breakout Signals:
State S1 + D1 = VOLUME BREAKOUT (UP). Buyers dominating above resistance.
State S5 + D5 = VOLUME BREAKDOWN (DN). Sellers dominating below support.

2. Reversal/VSA Signals:
State S1 + D4/D5 = DISTRIBUTION. High price but Sellers are taking over.
State S5 + D1/D2 = ABSORPTION. Low price but Buyers are stepping in.

3. Trend Initiation:
State S3 (Mid) + D1/D5 = TREND START. Strong volume emerging from the center.

HYBRID RISK MANAGEMENT

Unlike rigid strategies with fixed targets, this system adapts its exit plan based on the type of trade:

- For VCS (Breakout) Trades: Uses a Dynamic Trailing Stop (ATR Based). Since breakouts can run indefinitely, the system trails the price to maximize trends .
- For ADb (Reversal) Trades: Uses a Dynamic Take Profit. Since these are reversions to the mean, the system targets the Basis Line (Middle Band) or the Opposite Band automatically .

IMPORTANT DISCLAIMERS & OPERATIONAL NOTES

Please Note:

1. Not a Trading Strategy: This script is an analytical assistant, not a standalone "Black Box" trading system. It does not generate buy or sell signals that should be followed blindly.
2. No Financial Advice: The data provided by this tool is for informational purposes only. It is not a recommendation to buy or sell any asset.
3. Risk Warning: Trading involves significant risk. Always use your own judgment, perform your own technical analysis, and use proper risk management. Do not use this tool as the sole basis for your trading decisions.
4. Data Precision & Platform Limits: The "Intrabar (Precise)" calculation mode relies on high-resolution historical data (Lower Timeframe) to provide exact volume delta results. Access to this specific data depth depends entirely on your TradingView plan's capabilities .
Tip: If your plan does not support this level of historical intrabar data, the Precise mode may have limited coverage or show N/A. In that case, you should switch the "Volume Calculation Method" setting to "Geometric (Approx)" mode for a fully populated view .

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.