LazyBear

DEnvelope [Better Bollinger Bands]

*** ***

Bollinger Bands (BB) usually expand quickly after a volatility increase but contract more slowly as volatility declines. This extended time it takes for BB to contract after a volatility drop can make trading some instruments using BB alone difficult or less profitable.

In the October 1998 issue of "Futures" there is an article written by Dennis McNicholl called "Better Bollinger Bands", in which the author recommends improving BB by modifying:
- the center line formula &
- different equations for calculating the bands.

These bands, called "DEnvelope", follow price more closely and respond faster to changes in volatility with these modifications.

Fore more indicators, check out my "Master Index of indicators" (Also check my published charts page for new ones I haven't added to that list):

More scripts related to DEnvelope:
------------------------------------------------
- DEnvelope Bandwidth: pastebin.com/jz6QL45G
- DEnvelope %B : pastebin.com/r4XfrDvd

Sample chart with above indicators: www.tradingview.com/v/dK1uhbN8/

List of my free indicators: bit.ly/1LQaPK8
List of my indicators at Appstore: blog.tradingview.com/?p=970
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
//
// @author LazyBear 
// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
//
study("DEnvelope [LazyBear]", shorttitle="DENV_LB", overlay=true)
lb=input(20, title="DEnvelope lookback length")
de=input(2, title="DEnvelope band deviation")
alp=2/(lb+1)
src=hlc3
mt=alp*src+(1-alp)*nz(mt[1])
ut=alp*mt+(1-alp)*nz(ut[1])
dt=((2-alp)*mt-ut)/(1-alp)
mt2=alp*abs(src-dt)+(1-alp)*nz(mt2[1])
ut2=alp*mt2+(1-alp)*nz(ut2[1])
dt2=((2-alp)*mt2-ut2)/(1-alp)
but=dt+de*dt2
blt=dt-de*dt2
plot(but, color=red, linewidth=2)
plot(dt, color=gray)
plot(blt, color=green, linewidth=2)