DonovanWall

Squeeze Box [DW]

This is an experimental study designed using data from Bollinger Bands to determine price squeeze ranges and active levels of support and resistance .
First, a set of Bollinger Bands using a Coefficient of Variation weighted moving average as the basis is calculated.
Then, the relative percentage of current bandwidth to maximum bandwidth over the specified sampling period determines the relative squeeze.
The box is outlined by drawing the current highest and lowest source value over the sampling period whenever a squeeze is active.
I've included the COVWMA in the visualization for additional confirmation of price activity.

Custom Bar color scheme is included.
Sürüm Notları: Updates:
Added alternate moving average types. The available moving averages now in this script are:
-Exponential Moving Average
-Simple Moving Average
-Smoothed Moving Average
-Weighted Moving Average
-Volume Weighted Moving Average
-Least Squares Moving Average
-Arnaud Legoux Moving Average
-Hull Moving Average
-Coefficient of Variation Weighted Moving Average
-Fractal Adaptive Moving Average
-Kaufman's Adaptive Moving Average

Refined the color scheme for both bar colors and the moving averages.

Please note: Each moving average type generates different box values, so play around with them and find the one that works best for you.
Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu komut dosyasının yazarı açık kaynak olarak yayınladı, böylece yatırımcılar bunu anlayabilir ve doğrulayabilir. Yazara tebrikler! Ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları tarafından belirlenmektedir. Bir grafikte kullanmak için favorilerinize ekleyebilirsiniz.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?
For my full list of premium tools, check the blog:
https://wallanalytics.com/

Reach out on Telegram:
https://t.me/DonovanWall

Yorumlar

//@version=4
study(title="Squeeze Box ", overlay=true, linktoseries=true)
//by Donovan Wall

//This is an experimental study designed using data from Bollinger Bands to determine price squeeze ranges and active levels of support and resistance.
//First, a set of Bollinger Bands using a Coefficient of Variation weighted moving average as the basis is calculated.
//Then, the relative percentage of current bandwidth to maximum bandwidth over the specified sampling period determines the relative squeeze.
//The box is outlined by drawing the current highest and lowest source value over the sampling period whenever a squeeze is active.
//I've included the COVWMA in the visualization for additional confirmation of price activity.

//Custom Bar color scheme is included.

//---------------------------------------------------------------------------------------------------------------------------------------------------------------
//Updates:
//Added alternate moving average types. The available moving averages now in this script are:
// -Exponential Moving Average
// -Simple Moving Average
// -Smoothed Moving Average
// -Weighted Moving Average
// -Volume Weighted Moving Average
// -Least Squares Moving Average
// -Arnaud Legoux Moving Average
// -Hull Moving Average
// -Coefficient of Variation Weighted Moving Average
// -Fractal Adaptive Moving Average
// -Kaufman's Adaptive Moving Average

//Refined the color scheme for both bar colors and the moving averages.

//Please note: Each moving average type generates different box values, so play around with them and find the one that works best for you.

//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
//Inputs
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------

//Source
src = input(defval=hlc3, title="Source")

//Periods
per = input(defval=21, minval=1, title="Sampling Period")

//MA Type
matype = input(defval="COVWMA", title="MA Type (Available Inputs: 'EMA', 'SMA', 'SMMA', 'WMA', 'VWMA', 'LSMA', 'ALMA', 'HULLMA', 'COVWMA', 'FRAMA', 'KAMA')")

//Standard Deviations
ndev = input(defval=2, minval=1, title="Number of Deviations for Squeeze Calculation")

//Relative Squeeze Threshold
sr = input(defval=50, minval=0, maxval=100, step=0.01, title="Relative Squeeze % Threshold")

//LSMA Offset
loff = input(defval=0, minval=0, title="Offset (if LSMA)")

//ALMA Offset and Sigma
aoff = input(defval=0.85, step=0.01, minval=0, title="Offset (if ALMA)")
sigma = input(defval=6, minval=0, title="Sigma (if ALMA)")

//FRAMA Coefficient
w = input(defval=-4.6, title="Coefficient (if FRAMA)")

//KAMA Smoothing Constant
fast = input(defval=0.666, step=0.001, title="Smoothing Constant Fast End (if KAMA)")
slow = input(defval=0.0645, step=0.0001, title="Smoothing Constant S
+7 Cevap Gönder
richhubb richhubb
@richhubb, https://pastebin.com/W0K1sebW

Couldn't paste entire script here
+7 Cevap Gönder
DonovanWall richhubb
@richhubb, Thanks for taking the time to update this to v4! I'm going to look it over and publish it with some other updates and new tools I have in the works.
+1 Cevap Gönder
TransitMan DonovanWall
@DonovanWall, This is one of my favorite studies on TradingView Thanks Donovan! A nice addition to this study(or possibly a new study) would be % price change above/below last support/resistance level breakthrough to warn/alert of possible consolidation areas or areas of potential price reversal Thanks again for an incredibly insightful study Or maybe you have a study that replicates something similar Perhaps your Z Score indicator?
Cevap Gönder
Hey @DonovanWall, I'm a big fan of boxes and this is a really cool way to integrate the squeeze. I used it on hl2 with a length of 10 on 1D for USD/CAD and it did a good job of detecting trends and consolidation. Thank you very much for sharing this, your effort is much appreciated :)
+7 Cevap Gönder
great work!
+4 Cevap Gönder
WORK OF ART
+3 Cevap Gönder
you are a genius..thanks for all your work!
+1 Cevap Gönder
Updated to Pinescript version 4, was a nightmare - Valuewhen() was out / not functioning the same (It only looks at actual values, not bars) - so fixed that and figured I'd post the updated script here :-)

Using modified version for my bot,

Cheers!
+1 Cevap Gönder
it seems nice work, have to use it? would like to write some manual. Thanks.
+1 Cevap Gönder