RicardoSantos

[RS]MTF CATR Stop Hunt Levels V0

EXPERIMENTAL:
Adaptation from stop hunt levels:
[RS]Stop Hunt Levels V0

Uses timeframe and atr to set ranges.
Remove from Favorite Scripts Add to Favorite Scripts
study(title='[RS]MTF CATR Stop Hunt Levels V0', overlay=true)
tf = input(title='Timeframe:', defval='D', type=string)
src = input(title='Source', type=source, defval=close)
multiplier = input(title='Range Multiplier:', type=float, defval=1, step=0.01)

catr(_m) => (cum(tr)/(n+1))*_m

d_open = security(tickerid, tf, round(src/catr(1))*catr(1))
d_high = security(tickerid, tf, round(1+src/catr(1))*catr(1))
d_low = security(tickerid, tf, round(src/catr(1)-1)*catr(1))

d_open_buy = d_open+catr(multiplier)
d_open_sel = d_open-catr(multiplier)
d_high_buy = d_high+catr(multiplier)
d_high_sel = d_high-catr(multiplier)
d_low_buy = d_low+catr(multiplier)
d_low_sel = d_low-catr(multiplier)

dob = plot(title='mh', series=d_open_buy, style=circles, color=lime)
dos = plot(title='ml', series=d_open_sel, style=circles, color=red)
dhb = plot(title='hh', series=d_high_buy, style=circles, color=lime)
dhs = plot(title='hl', series=d_high_sel, style=circles, color=red)
dlb = plot(title='lh', series=d_low_buy, style=circles, color=lime)
dls = plot(title='ll', series=d_low_sel, style=circles, color=red)

fill(title='mf', plot1=dob, plot2=dos, color=blue, transp=75)
fill(title='hf', plot1=dhb, plot2=dhs, color=blue, transp=75)
fill(title='lf', plot1=dlb, plot2=dls, color=blue, transp=75)

plot(title='m', series=d_open, style=circles, color=black)
plot(title='h', series=d_high, style=circles, color=black)
plot(title='l', series=d_low, style=circles, color=black)
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out