OPEN-SOURCE SCRIPT
Profile volume deviation

This indicator calculates the width of the 70% Value Area of a moving volume profile over a defined number of candles.
It begins by identifying the highest and lowest points of the period under review, then divides this price range into several segments. For each candle, the volume is added to the segment corresponding to the closing price, which allows a volume profile to be constructed.
Once the total volume is known, the indicator identifies the most traded segment, called the Point of Control. From this central point, it gradually widens the area upwards and downwards by adding the most voluminous adjacent segments until it covers 70% of the total volume: this is the Value Area.
The lower and upper limits of this area are then converted into prices, and their difference gives the width of the Value Area. This width can be displayed directly as a price value or as a percentage of the current price.
The indicator is mainly used to assess the state of the market: a narrow Value Area suggests a phase of compression or range, while a wide Value Area indicates a period of expansion and strong activity.
It begins by identifying the highest and lowest points of the period under review, then divides this price range into several segments. For each candle, the volume is added to the segment corresponding to the closing price, which allows a volume profile to be constructed.
Once the total volume is known, the indicator identifies the most traded segment, called the Point of Control. From this central point, it gradually widens the area upwards and downwards by adding the most voluminous adjacent segments until it covers 70% of the total volume: this is the Value Area.
The lower and upper limits of this area are then converted into prices, and their difference gives the width of the Value Area. This width can be displayed directly as a price value or as a percentage of the current price.
The indicator is mainly used to assess the state of the market: a narrow Value Area suggests a phase of compression or range, while a wide Value Area indicates a period of expansion and strong activity.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.