OPEN-SOURCE SCRIPT

VWAP Price Channel

527
VWAP Price Channel cuts the crust off of a traditional price channel (Donchian Channel) by anchoring VWAPs at the highs and lows. By doing this, the flat levels, characteristic of traditional Donchian Channels, are no more!

Author's Note: This indicator is formed with no inherent use, and serves solely as a thought experiment.

> Concept

I would be hesitant to call this a "predictive" indicator, however the behavior of it would suggest it could be considered at least partially predictive

syot kilat

Essentially, the Anchored VWAPs creates something from otherwise nothing.

While the DC upper or lower values are staying flat, the VWAPs improvise based on price and volume to project a level that may be a better representation of where future highs or lows may settle.

Visually, this looks like we have cut off the corners of the Donchian Channel.

Note: Notice how we are calculating values before the corners are realized.

> Implementation

While this is only a concept indicator, The specific application I've gone with for this, is a sort of supertrend-ish display (A Trend Flipping Trailing Stop Loss).

syot kilat

The script uses basic logic to create a trend direction, and then displays the Anchored VWAPs as a form of trailing stop loss.

While "In Trend", the script fills in the area between the VWAP and Price in the direction of trend.

When new highs or lows are made while in trend, the opposite VWAP will start to generate at the new highs or lows. These happen on every new high or low, so they are not indicating the trend shift, but could be interpreted as breakout levels for the current trend direction in order for continuation.

Note: All values are drawn live, but when using higher timeframes, there is a natural calculation discrepancy when using live data vs. historical.

> Technicals

In this script, I'm simply detecting new highs or lows from the DC and using those as the anchor frequency on the built-in VWAP function.

So each time a new high or low is made based on DC, the VWAP function re-anchors to the high or low of the candle.

Past that, I have implemented some logic in order to account for a common occurrence I faced during development.
Frequently, the price would outpace the anchored VWAP, so we would end up with the VWAP being further from price than the actual DC upper or lower.

Due to this, what I have ended up with was a third value which, rather than switching between raw VWAP values and DC values, it adjusts the value based on the change in the VWAP value.
This can be simply thought of as a "Start + Change" type of setup.
By doing this, I can use the change values from the actual anchored VWAP, and under normal conditions, this will also be the true VWAP value.
However, situationally, I am able to update the start value which we're applying the VWAP change to.

In other words, when these situations happen, the VWAP change is added to the new (closer to price) DC value.

The specific trend logic being used is nothing fancy at all, we are simply checking if a new high or low is created and setting the trend in that direction.
This is in line with some traditional DC Strategies.

To those who made it here,
Just remember:
The chart may be ugly, but it's the fastest analysis of the data you can get.
Nicer displays often come at the hidden cost of latency.
You have to shoot your shot to make it.

Choose 2: Fast, Clean, Useful

Enjoy!

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.