CooperHoang

FingerTrap Indicator

40
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
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
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)