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 อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน