//@version=5 indicator('Ehlers SuperSmoother', overlay=true, timeframe = '',…
- User
//@version=5 indicator('Ehlers SuperSmoother', overlay=true, timeframe = '', timeframe_gaps = true)
length = input.int ( 10, 'Length') src = input.source(close, 'Source')
clr_mono = input.color(color.blue, 'Colors ', inline='colors') clr_up = input.color(color.green, '', inline='colors') clr_dn = input.color(color.red, '', inline='colors')
smart_clr_ON = input.bool ( true, 'Colorize')
//■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
Super_Smoother(float price = close, int len = 10) => var PI = math.pi var SQRT2 = math.sqrt(2) PIxSQRT2_length = PI * SQRT2 / len
a1 = math.exp(-PIxSQRT2_length) c3 = -a1 * a1 c2 = 2 * a1 * math.cos(PIxSQRT2_length) c1 = 1 - c2 - c3 filt = 0.0 filt := c1 * (price + nz(price[1])) / 2 + c2 * nz(filt[1]) + c3 * nz(filt[2]) filt//
//🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰🀰
MA_Smart_Color(float ma, bool smart_clr_ON, color color_up, color color_dn, color clr) =>
color clr_ma = na clr_ma := switch not smart_clr_ON => clr // Mono color ma > ma[1] => color_up // Up ma < ma[1] => color_dn // Down => clr_ma[1] // The same // clr_ma//
//■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
ma = Super_Smoother(src, length)
clr_ma = MA_Smart_Color(ma, smart_clr_ON, clr_up, clr_dn, clr_mono)
plot(ma, 'SuperSmoother', clr_ma[1], 2)
//■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 帮我注释好每一句代码.
- Assistant