PROTECTED SOURCE SCRIPT
Cập nhật

Volatility Contraction Box (VCB)

80
Volatility Contraction Box (VCB) [Confirmed Breakouts]

Description (Copy & Paste)
This script is a specialized breakout detector designed for scalpers on the Nifty, BankNifty, and NSE 1-minute timeframes.

Inspiration & Concept The core philosophy of this script is based on the concept of Volatility Contraction—the idea that strong market moves are almost always preceded by a period of "quiet compression."

Conceptual Source: This script was inspired by the trading theory discussed in the article "What 90% of Traders Miss Before a Breakout" by betashorts1998, which highlights the importance of identifying low-volatility zones before the expansion phase occurs.

Adaptation: While the original concept often uses ATR to measure contraction, this script adapts that theory into a Price Action Box Model. It detects physical price stagnation (flat Highs and Lows) to draw visual "Kill Zones" on the chart.

The Problem: The "Fakeout" In 1-minute scalping, a simple breakout often results in a wick that traps traders (a "fakeout"). The Solution: This script uses a Next-Candle Confirmation Algorithm. It detects a breakout but hides the signal until the next candle closes in the direction of the trend. If the follow-through fails, the box and signal are discarded, keeping your chart clean and your capital safe.

How the Code Works (Programmer's Logic)
For those interested in the Pine Script logic, here is how the algorithm processes market data:

1. Stagnation Detection (range_changed) The script uses ta.highest(length) and ta.lowest(length) to track the Donchian Channel of the price.

It checks ta.change(h) and ta.change(l).

If both return 0 (meaning the High and Low haven't moved), a counter (count_activity) increments.

Once this counter hits the threshold (default: 5 bars), a "Virtual Box" is created in the code's memory.

2. The "Ghost" State (Pending Logic) Unlike standard indicators that plot immediately, this script enters a "Pending" state when price breaks the box levels:

pendingDir variable is set to 1 (Buy) or -1 (Sell).

breakoutBar records the specific time of the break.

Crucially, nothing is drawn on the chart yet.

3. The Confirmation Loop The script waits for bar_index == breakoutBar + 1 (the very next candle).

It runs a boolean check: isValid.

For Buys: close >= open (The candle must be Green).

For Sells: close <= open (The candle must be Red).

If isValid is true, the script utilizes box.new and label.new to retroactively draw the setup.

If isValid is false, the variables are reset, and the setup is deleted from memory.

How to Use
Wait for the Signal: Do not pre-empt the move. Wait for the colored Box and "BUY/SELL" label to appear.

Entry: The signal appears on the close of the confirmation candle. Enter immediately.

Stop Loss: Place your SL at the opposite end of the Box.

Targets: Aim for a quick 1:1.5 or 1:2 Risk-Reward, or trail your stop using the previous candle's low/high.

Settings
Lookback Length: How far back to check for High/Low (Default: 20).

Min Flat Candles: Minimum duration of the squeeze (Default: 5).

Box Width: Adjusts the visual multiplier of the box.
Phát hành các Ghi chú
Added TArget, stoploss and trend ribbon in bottom....
Phát hành các Ghi chú
Added MTF Filter ........
Phát hành các Ghi chú
Added Reversal setup.......

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.