Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- study("TheLark: Choppiness Index", overlay=false)
- //•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//
- // //
- // CHOPPINESS INDEX BY THELARK //
- // ~ 4-23-14 ~ //
- // //
- // •/• //
- // //
- // https://www.tradingview.com/u/TheLark //
- // //
- //•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•/•//
- length = input(14, title="Length")
- doavg = input(true,title="Do Average?")
- avg = input(4, title="Average Length")
- l1 = input(61.8, title="Extreme Chop")
- l2 = input(50.0, title="Midline")
- l3 = input(38.2, title="Trending")
- str = sum(tr,length)
- ltl = lowest(low <= close[1] ? low : close[1],length)
- hth = highest(high >= close[1] ? high : close[1],length)
- height = hth - ltl
- chop = 100 * (log10(str / height) / log10(length))
- plot(chop, color=#42B0FF, linewidth=2)
- plot(doavg ? sma(chop,avg) : na, color=white)
- hli1 = plot(l1, color=gray)
- hli2 = plot(l2, color=gray)
- hli3 = plot(l3, color=gray)
- fill(hli1,hli2,black,80)
- fill(hli2,hli3,#C8D974,80)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement