OPEN-SOURCE SCRIPT
已更新

TA Trading Signal Bot

89
//version=5
indicator(title="TA Trading Signal Bot", overlay=true)

// Input settings
lengthEMA = input(20, title="EMA Length")
lengthRSI = input(14, title="RSI Length")
overbought = input(70, title="RSI Overbought Level")
oversold = input(30, title="RSI Oversold Level")

// Indicators
ema = ta.ema(close, lengthEMA)
rsi = ta.rsi(close, lengthRSI)
macdline = ta.ema(close, 12) - ta.ema(close, 26)
signalline = ta.ema(macdline, 9)

// Buy/Sell Conditions
crossoverRSI = ta.crossover(rsi, oversold)
crossoverMACD = ta.crossover(macdline, signalline)
buySignal = crossoverRSI and close > ema and crossoverMACD

// Plot Buy Signal
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY Signal")
發行說明
//version=5
indicator(title="TA Trading Signal Bot", overlay=true)

// Input settings
lengthEMA = input(20, title="EMA Length")
lengthRSI = input(14, title="RSI Length")
overbought = input(70, title="RSI Overbought Level")
oversold = input(30, title="RSI Oversold Level")

// Indicators
ema = ta.ema(close, lengthEMA)
rsi = ta.rsi(close, lengthRSI)
macdline = ta.ema(close, 12) - ta.ema(close, 26)
signalline = ta.ema(macdline, 9)

// Buy/Sell Conditions
buySignal = ta.crossover(rsi, oversold) and close > ema and ta.crossover(macdline, signalline)
sellSignal = ta.crossunder(rsi, overbought) and close < ema

// Plot Buy & Sell Signals
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY Signal")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL Signal")

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。