RicardoSantos

[RS]MTF Volatility Stop V0

1311 views
138
1311 3
request for: jackmk
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study(title='[RS]MTF Volatility Stop V0', shorttitle='mtfVS', overlay=true)
multiplier = input(title='True Range Multiplier', type=float, defval=1.618)
tf = input(title='Timeframe to pool ATR:', type=string, defval='D', confirm=false)
length = input(title='ATR Length', type=integer, defval=20, minval=1)
range = security(tickerid, tf, atr(length))

trend = na(trend[1]) ? +1 : close > vstop[1] ? +1 : close < vstop[1] ? -1 : trend[1]
max_close = change(trend) != 0 ? close : close >= max_close[1] ? close : max_close[1]
min_close = change(trend) != 0 ? close : close <= min_close[1] ? close : min_close[1]
vstop = na(vstop[1]) ? hl2 :
         change(trend) > 0 ? close - (multiplier * range) : 
         trend > 0 ? max(vstop[1], max_close - (multiplier * range)) :
         change(trend) < 0 ? close + (multiplier * range) : 
         trend < 0 ? min(vstop[1], min_close + (multiplier * range)) : 
         vstop[1]

plot(title='mtfVS', series=vstop, style=circles, color=close>=vstop?lime:red, transp=0, linewidth=2)
plot(title='mtfVS', series=vstop, style=line, color=black, transp=0, linewidth=1)
Thank you so much!

Could you please an MTF MACD indicator for me? the one I found here is still repaints the signals, and I can't trade with it.

Thanks in advance.
Reply
Great!
Reply
thank you very much again.
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar Shows How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Help Center Refer a friend Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out