Current Trend [KPM] - Buy / Sell
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © kpm

//@version=5
indicator(title="Current Trend [KPM] - Buy / Sell", shorttitle="CT-KPM",timeframe="180", timeframe_gaps=false)
linewidth = input.int(title="EMA Width", defval=3, maxval=10, minval=2)
rsi = ta.rsi(close,14)
ema = ta.ema(high,1)
emacol = rsi > 55 ? color.lime : rsi < 45 ? color.red : color.black
plot(ema, title="Histogram",style=plot.style_histogram, color = emacol, linewidth=linewidth, offset=0)
plot(ema, title="Top EMA", color = emacol, linewidth=linewidth, offset=0)