OPEN-SOURCE SCRIPT

AM_SNR Level Auto Signals

85
//version=5
indicator("AM_SNR Level Auto Signals", overlay=true)

// ==========================
// INPUTS
// ==========================
MaFast_period = input.int(7, "MA Fast Period", minval=1, maxval=100)
MaSlow_period = input.int(25, "MA Slow Period", minval=1, maxval=100)
Signal_period = input.int(5, "Signal Period", minval=1, maxval=100)

// Source selection (Fix for Issue #1)
MaValue = input.source(close, "MA Source")

// ==========================
// COLORS & VISIBILITY
// ==========================
colorBuy = input.color(color.white, "Buy Signal Color")
visibleBuy = input.bool(true, "Show Buy Signal")

colorSell = input.color(color.red, "Sell Signal Color")
visibleSell = input.bool(true, "Show Sell Signal")

// ==========================
// MOVING AVERAGES
// ==========================
smaFast = ta.ema(MaValue, MaFast_period)
smaSlow = ta.ema(MaValue, MaSlow_period)
buffer1 = smaFast - smaSlow
buffer2 = ta.wma(buffer1, Signal_period)

// ==========================
// SIGNAL CONDITIONS
// ==========================
buyCondition = buffer1 > buffer2 and buffer1[1] < buffer2[1]
sellCondition = buffer1 < buffer2 and buffer1[1] > buffer2[1]

// ==========================
// PLOT SIGNALS
// ==========================
plotshape(buyCondition and visibleBuy, title="Buy Signal", location=location.belowbar, color=colorBuy, style=shape.triangleup, size=size.large)
plotshape(sellCondition and visibleSell, title="Sell Signal", location=location.abovebar, color=colorSell, style=shape.triangledown, size=size.large)

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.