//version=5
indicator("Multi-Indicator Strategy", overlay=true)
// Parameter RSI
rsiPeriod = input(14, title="RSI Period")
overboughtLevel = input(70, title="Overbought Level")
oversoldLevel = input(30, title="Oversold Level")
rsiValue = ta.rsi(close, rsiPeriod)
// Parameter Moving Average
maLength = input(50, title="Moving Average Length")
ma = ta.sma(close, maLength)
// Parameter MACD
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// Sinyal beli dan jual berdasarkan gabungan indikator
buySignal = ta.crossover(rsiValue, oversoldLevel) and close > ma and macdLine > signalLine
sellSignal = ta.crossunder(rsiValue, overboughtLevel) and close < ma and macdLine < signalLine
// Plot tanda beli dan jual pada chart
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Eksekusi buy dan sell
if (buySignal)
strategy.entry("Buy", strategy.long)
if (sellSignal)
strategy.close("Buy")
indicator("Multi-Indicator Strategy", overlay=true)
// Parameter RSI
rsiPeriod = input(14, title="RSI Period")
overboughtLevel = input(70, title="Overbought Level")
oversoldLevel = input(30, title="Oversold Level")
rsiValue = ta.rsi(close, rsiPeriod)
// Parameter Moving Average
maLength = input(50, title="Moving Average Length")
ma = ta.sma(close, maLength)
// Parameter MACD
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// Sinyal beli dan jual berdasarkan gabungan indikator
buySignal = ta.crossover(rsiValue, oversoldLevel) and close > ma and macdLine > signalLine
sellSignal = ta.crossunder(rsiValue, overboughtLevel) and close < ma and macdLine < signalLine
// Plot tanda beli dan jual pada chart
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Eksekusi buy dan sell
if (buySignal)
strategy.entry("Buy", strategy.long)
if (sellSignal)
strategy.close("Buy")
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。