OPEN-SOURCE SCRIPT
TMC Strategy - Simplified Buy/Sell Signals

//version=5
indicator("TMC Strategy - Simplified Buy/Sell Signals", overlay=true)
// Input parameters
emaLength = input.int(20, title="EMA Length")
rsiLength = input.int(10, title="RSI Length")
macdFast = input.int(12, title="MACD Fast Length")
macdSlow = input.int(26, title="MACD Slow Length")
macdSignal = input.int(9, title="MACD Signal Length")
// Calculate indicators
ema = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)
[macdLine, signalLine, _] = ta.macd(close, macdFast, macdSlow, macdSignal)
// Trend condition
uptrend = close > ema
downtrend = close < ema
// Momentum condition
rsiBullish = rsi > 50
rsiBearish = rsi < 50
// MACD condition
macdBullish = ta.crossover(macdLine, signalLine)
macdBearish = ta.crossunder(macdLine, signalLine)
// Buy and Sell Signals
buySignal = uptrend and rsiBullish and macdBullish
sellSignal = downtrend and rsiBearish and macdBearish
// Plot Buy and Sell Signals
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", size=size.small)
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", size=size.small)
// Optional: Plot EMA for visual reference
plot(ema, title="EMA", color=color.blue, linewidth=2)
indicator("TMC Strategy - Simplified Buy/Sell Signals", overlay=true)
// Input parameters
emaLength = input.int(20, title="EMA Length")
rsiLength = input.int(10, title="RSI Length")
macdFast = input.int(12, title="MACD Fast Length")
macdSlow = input.int(26, title="MACD Slow Length")
macdSignal = input.int(9, title="MACD Signal Length")
// Calculate indicators
ema = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)
[macdLine, signalLine, _] = ta.macd(close, macdFast, macdSlow, macdSignal)
// Trend condition
uptrend = close > ema
downtrend = close < ema
// Momentum condition
rsiBullish = rsi > 50
rsiBearish = rsi < 50
// MACD condition
macdBullish = ta.crossover(macdLine, signalLine)
macdBearish = ta.crossunder(macdLine, signalLine)
// Buy and Sell Signals
buySignal = uptrend and rsiBullish and macdBullish
sellSignal = downtrend and rsiBearish and macdBearish
// Plot Buy and Sell Signals
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", size=size.small)
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL", size=size.small)
// Optional: Plot EMA for visual reference
plot(ema, title="EMA", color=color.blue, linewidth=2)
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。