CooperHoang

Finger trap indicator

51
Begin of Green = entry long
Begin of Red = entry short
No plot = not an entry
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="EMA", 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
bgDown  = (data1 and data3 and data5 and data7) ? red : na
// === /LOGIC ===

// === PLOTTING ===
bgcolor(bgUp, transp=50)
bgcolor(bgDown, transp=50)