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)
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
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