OPEN-SOURCE SCRIPT

Volumetric Compressed MA

371
VCMA (Volumetric Compressed Moving Average)uses the compressor and weighted standard deviation functions originally translated to pinescript by gorx1 to plot moving averages in order to use for entry confirmation.


🔹Concepts and Idea:
When we do music we always use different kinds of filters (low-pass, high pass, etc) for equalization and filtering itself. That stuff we use in finance as well. What we also always use in music are compressors, there dynamic processors that automatically adjust volume so it will be more consistent. Almost all the cool music you hear is compressed (both individual instruments (especially vocals) and the whole track afterwards), otherwise stuff will be too quite and too weak to flex on it, and also DJing it would be a nightmare.


🔹Model:
I don't wanna explain it all in statistical / DSP way for once.
First of all, I think the population of volumes is log-normally distributed, so let's take logs of volumes, now we have a ~ normally distributed data. We take linearly weighted mean, add and subtract linearly weighted standard deviation from it, these would be our thresholds, the borders between different kinds of volumes explained before.
The upper threshold is for downward compression, that will not let volume pass it higher.
The lower threshold is for upward compression, all the volumes lower than this threshold will be brought up to the threshold's level.
Then we apply multipliers to the thresholds in order to adjust em and find the sweet spots. We do it the same way as in sound engineering when we don't aim for overcompression, we adjust the thresholds until they start to touch the signal and all good.
Afterwards, we delete all the number 1 and number 3 volume, leaving us exclusively with the clear main component, ready to be processed further.
We return the volumes to dem real scale.


For more info on Volume Compression it's highly advised to check gorx1's initial script Volume Compressor

🔹Settings:
MA Type: Moving average type to be used for comparison after calculating the compressed version of volume. This creates the second line after the compression line, so we can consider crossovers for confirmation entries.

Upward threshold: Upward threshold where the compression of volume is calculated. Increasing usually causes smoother lines.

Downward threshold: Downward threshold where the compression of volume is calculated. Decreasing usually causes smoother lines.

Compression Lookback: The Main lookback window of a volume that is used for compression. Increasing this would provide smoother lines but might cause delayed signals. Decreasing means more signals, but might cause whiplash and distorted signals.

Comparative Lookback: This is our lookback to be used with our ma type selection. There is no static better or worse lookback value for this indicator. It should be adjusted based on the pair.


🔹Where to use:

สแนปชอต

This indicator should be used as another confirmation tool for your entry signals in your existing strategy/market following combination. Green dots (crossovers) mean bullish movement is expected, and red dots (crossbounders) mean bearish movement is expected. Automated crossover alerts are available. A reminder is that this kind of indicator should not be used on its own for trading, but rather should be used as a confirmation along with your trend detection and main entry indicators to provide additional confidence.

If you want to know under the hood, read the How it works section below.


🔹How it works:

Pine Script®
//This is our main compression calculation, which is used for the first line. Compressed_out = compressor(volume, len_window, up_thresh, down_thresh) //This is the secondary ratio calculation that we use for the second line. Comp_ma = ma(ma_type, close * compressed_out, len_ml) / ma(ma_type, compressed_out, len_ml) Vwma = ma(ma_type, close, len_window)


We calculate the ratio of the compressed volume and plot it against the base MA. Base MA's length is determined by the Compression Lookback input compared to the Comperative Lookback that is used for the compressed version. This provides us with another possible confirmation indicator that can be used to take advantage of volume ranges.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน