Begin of green = entry Long
Begin of red = entry Short
Yellow = retracement of downtrend or begin of uptrend
Bright Yellow = strong indication trending is move up
Orange = retracement of uptrend or begin of downtrend
Bright Orange = strong indication trending is move down
Begin of red = entry Short
Yellow = retracement of downtrend or begin of uptrend
Bright Yellow = strong indication trending is move up
Orange = retracement of uptrend or begin of downtrend
Bright Orange = strong indication trending is move down
study(title="Moving Average Exponential", shorttitle="FingerTrap", overlay=true) len = input(8, minval=1, title="Length") src = input(close, title="Source") out = ema(src, len) len1 = input(96, minval=1, title="Length1") out1 = ema(src, len1) len2 = input(408, minval=1, title="Length2") out2 = ema(src, len2) data = close > out data1 = close < out data2 = close > out1 data3 = close < out1 data4 = close > out2 data5 = close < out2 data6 = out > out1 and out1 > out2 data7 = (out < out1 and out1 < out2) bgUp = (data and data2 and data4 and data6) ? green : na bgmiddle = (out < out1 and out2 < out and out2 < out1) ? orange : na bgmiddle1 = (out > out1 and out2 > out and out2 > out1) ? yellow : na bgmiddle2 = (out < out1 and out < out2 and out1 > out2) ? orange : na bgmiddle3 = (out > out1 and out > out2 and out1 < out2) ? yellow : na bgDown = (data1 and data3 and data5 and data7) ? red : na // === /LOGIC === // === PLOTTING === bgcolor(bgUp, transp=20) bgcolor (bgmiddle, transp=20) bgcolor (bgmiddle1, transp=20) bgcolor (bgmiddle2, transp=0) bgcolor (bgmiddle3, transp=0) bgcolor(bgDown, transp=20)