anja
study("IP Power Trends (TheLark: Choppiness Index)", overlay=true) length = input(4, title="Length") doavg = input(true,title="Do Average?") avg = input(4, title="Average Length") l1 = input(60, title="Extreme Chop") l2 = input(50.0, title="Midline") l3 = input(20, 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)) a = chop<60 b = ema(close,3)>ema(close,7) and ema(close,7)>ema(close,50) c = open>close d = atr(3)[1]>=atr(3) plotshape (a and b and c and d)