5emaSell/buy
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © chinnasch

//@version=5
indicator("5emaSell/buy", overlay=true)

EMA5 = ta.ema(close, 5)
bgcolor(low > EMA5 ? color.new(color.yellow, 90) : na)
bgcolor(EMA5 > high ? color.new(color.green,90) : na)

insidebuybar = close>open and high<=high[1] and low>=low[1]
insidesellbar =close<open and high<=high[1] and low>=low[1]
outsidebuybar = close>open and high>high[1] and low<low[1]
outsidesellbar= close<open and high>high[1] and low<low[1]

plotshape(insidebuybar, title="I", style=shape.arrowup, location=location.belowbar, size=size.tiny, text="I", color=color.green, transp=0, offset=0)
plotshape(insidesellbar,title="I", style=shape.arrowdown, location=location.abovebar, size=size.tiny, text="I", color=color.red, transp=0, offset=0)
plotshape(outsidebuybar, title="O", style=shape.arrowup, location=location.belowbar, size=size.tiny, text="O", color=color.green, transp=0, offset=0)
plotshape(outsidesellbar,title="O", style=shape.arrowdown, location=location.abovebar, size=size.tiny, text="O", color=color.red, transp=0, offset=0)
