RicardoSantos

[RS]Average Expansion Dynamic V0

EXPERIMENTAL: calculation of extremes and price range for averaging movement.
while price is above market is rising, when bellow market is falling. also can discern strength from the gap of the averages.
Remove from Favorite Scripts Add to Favorite Scripts
study(title='[RS]Average Expansion Dynamic V0', overlay=true)
window = input(title='Interval Window:', type=integer, minval=1, defval=5)
multiplier = input(title='Average Multiplier:', type=float, minval=0.01, maxval=0.99, defval=0.5)

h = valuewhen(high >= highest(window), high, 0)
l = valuewhen(low <= lowest(window), low, 0)

rising_falloff = l + ((highest(window)-l)*multiplier)
falling_falloff = h - ((h-lowest(window))*multiplier)

plot(title='High Extreme', series=h, color=h!=h[1]?na:black)
plot(title='Low Extreme', series=l, color=l!=l[1]?na:black)

p_dp = plot(title='+ Decay', series=rising_falloff, color=rising(rising_falloff, window)?green:silver)
p_dn = plot(title='- Decay', series=falling_falloff, color=falling(falling_falloff, window)?maroon:silver)

fill(p_dp, p_dn, color=blue, transp=75)
//buy = max(close, falling_falloff)-falling_falloff
//sel = min(close, rising_falloff) - rising_falloff

//plot(title='+ Decay', series=buy, style=line, color=green, linewidth=1)
//plot(title='- Decay', series=sel, style=line, color=maroon, linewidth=1)
//plot(title='+ Decay', series=buy, style=histogram, color=green, linewidth=2)
//plot(title='- Decay', series=sel, style=histogram, color=maroon, linewidth=2)
English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体中文
繁體中文
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out