OPEN-SOURCE SCRIPT
My script

//version=6
strategy("Elite Option Signal Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === INPUTS ===
fastLength = input.int(9, title="Fast MA Length")
slowLength = input.int(21, title="Slow MA Length")
trendLength = input.int(50, title="Trend MA Length")
rsiLength = input.int(14, title="RSI Length")
rsiOversold = input.int(30, title="RSI Oversold Level")
rsiOverbought = input.int(70, title="RSI Overbought Level")
useStopLoss = input.bool(true, title="Use Stop Loss?")
stopLossPercent = input.float(2.0, title="Stop Loss %", minval=0.1, maxval=10.0)
// === INDICATORS ===
fastMA = ta.sma(close, fastLength)
slowMA = ta.sma(close, slowLength)
trendMA = ta.sma(close, trendLength)
rsi = ta.rsi(close, rsiLength)
// === CONDITIONS ===
bullishTrend = close > trendMA
bearishTrend = close < trendMA
longCondition = ta.crossover(fastMA, slowMA) and bullishTrend and rsi < rsiOverbought
shortCondition = ta.crossunder(fastMA, slowMA) and bearishTrend and rsi > rsiOversold
// === EXECUTION ===
if longCondition
strategy.entry("Long", strategy.long)
if useStopLoss
strategy.exit("Exit Long", "Long", stop=close * (1 - stopLossPercent / 100))
if shortCondition
strategy.entry("Short", strategy.short)
if useStopLoss
strategy.exit("Exit Short", "Short", stop=close * (1 + stopLossPercent / 100))
// === PLOTS ===
plot(fastMA, color=color.green, title="Fast MA")
plot(slowMA, color=color.red, title="Slow MA")
plot(trendMA, color=color.blue, title="Trend MA")
plotshape(longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup)
plotshape(shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown)
strategy("Elite Option Signal Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === INPUTS ===
fastLength = input.int(9, title="Fast MA Length")
slowLength = input.int(21, title="Slow MA Length")
trendLength = input.int(50, title="Trend MA Length")
rsiLength = input.int(14, title="RSI Length")
rsiOversold = input.int(30, title="RSI Oversold Level")
rsiOverbought = input.int(70, title="RSI Overbought Level")
useStopLoss = input.bool(true, title="Use Stop Loss?")
stopLossPercent = input.float(2.0, title="Stop Loss %", minval=0.1, maxval=10.0)
// === INDICATORS ===
fastMA = ta.sma(close, fastLength)
slowMA = ta.sma(close, slowLength)
trendMA = ta.sma(close, trendLength)
rsi = ta.rsi(close, rsiLength)
// === CONDITIONS ===
bullishTrend = close > trendMA
bearishTrend = close < trendMA
longCondition = ta.crossover(fastMA, slowMA) and bullishTrend and rsi < rsiOverbought
shortCondition = ta.crossunder(fastMA, slowMA) and bearishTrend and rsi > rsiOversold
// === EXECUTION ===
if longCondition
strategy.entry("Long", strategy.long)
if useStopLoss
strategy.exit("Exit Long", "Long", stop=close * (1 - stopLossPercent / 100))
if shortCondition
strategy.entry("Short", strategy.short)
if useStopLoss
strategy.exit("Exit Short", "Short", stop=close * (1 + stopLossPercent / 100))
// === PLOTS ===
plot(fastMA, color=color.green, title="Fast MA")
plot(slowMA, color=color.red, title="Slow MA")
plot(trendMA, color=color.blue, title="Trend MA")
plotshape(longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup)
plotshape(shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown)
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。