RicardoSantos

[RS]Volatility Scalper V0

EXPERIMENTAL:
request for DCC            
adapted from: http://jonathankinlay.com/index.php/2014/05/implementation-of-a-scalping-strategy/
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study(title='[RS]Volatility Scalper V0', overlay=false)
//  ||  Request from:
//  ||      DCC
//  ||  Adapted from:
//  ||      http://jonathankinlay.com/index.php/2014/05/implementation-of-a-scalping-strategy/
//  ||  
upper_volume_threshold = input(title='upper_volume_threshold', type=float, defval=0.01)
lower_volume_threshold = input(title='lower_volume_threshold', type=float, defval=0.001)
SHOW_SIGNALS = input(title='Show Barcolor Signals?', type=bool, defval=true)
upside_volatility = change(close) > 0 ? tr + change(tr, 2)*0.5 : na
downside_volatility = change(close) < 0 ? tr + change(tr, 2)*0.5 : na

plot(title='Upside Volatility', series=upside_volatility, style=histogram, color=green, linewidth=2)
plot(title='Downside Volatility', series=downside_volatility, style=histogram, color=red, linewidth=2)
hline(title='Upper volume threshold', price=upper_volume_threshold, color=black)
hline(title='Lower volume threshold', price=lower_volume_threshold, color=black)

high_volume_buy_trigger = not SHOW_SIGNALS ? na : upside_volatility >= upper_volume_threshold
high_volume_sel_trigger = not SHOW_SIGNALS ? na : downside_volatility >= upper_volume_threshold
low_volume_buy_trigger = not SHOW_SIGNALS ? na : upside_volatility >= lower_volume_threshold
low_volume_sel_trigger = not SHOW_SIGNALS ? na : downside_volatility >= lower_volume_threshold

bar_color = high_volume_buy_trigger ? green : high_volume_sel_trigger ? maroon : low_volume_buy_trigger ? lime : low_volume_sel_trigger ? red : silver
barcolor(bar_color)
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