Bcnk——MFB

indicator(title = '', shorttitle = 'Bcnk——MFB', overlay = true)
length = input(title = 'Length', defval = 32)
offset = input(title = 'Offset', defval = 0)
src = input(close, title = 'Source')
// ZLSMA 计算
lsma = ta.linreg(src, length, offset)
lsma2 = ta.linreg(lsma, length, offset)
zlsma = lsma + lsma - lsma2
// 趋势方向(颜色用它控制)
isUp = zlsma >= zlsma[1]
col = isUp ? color.green : color.red
// 主线
plot(zlsma, color = col, linewidth = 3)
// ============================
// 变色(趋势方向变)就画箭头
// ============================
// 红 → 绿
upSignal = isUp and not isUp[1]
// 绿 → 红
downSignal = not isUp and isUp[1]
// 上箭头
plotshape(upSignal, title = 'Up Arrow', style = shape.arrowup, location = location.belowbar, color = color.new(color.green, 0), size = size.small)
// 下箭头
plotshape(downSignal, title = 'Down Arrow', style = shape.arrowdown, location = location.abovebar, color = color.new(color.red, 0), size = size.small)
Skrip hanya-undangan
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact BuchuanneikuYYDS directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
Instruksi penulis
Pernyataan Penyangkalan
Skrip hanya-undangan
Only users approved by the author can access this script. You'll need to request and get permission to use it. This is typically granted after payment. For more details, follow the author's instructions below or contact BuchuanneikuYYDS directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.