PROTECTED SOURCE SCRIPT
Price Difference Between Two Correlated Symbols

//version=5
indicator("Price Difference Between Two Symbols", overlay=true)
// === User Inputs ===
symbol1 = input.symbol("Pepperstone:US500", "Symbol 1")
symbol2 = input.symbol("CME_MINI:ES1!", "Symbol 2")
tf = input.timeframe("", "Resolution (leave blank to use chart TF)")
// === Price Feeds ===
price1 = request.security(symbol1, tf == "" ? timeframe.period : tf, close)
price2 = request.security(symbol2, tf == "" ? timeframe.period : tf, close)
// === Difference Calculation ===
difference = price1 - price2
// === Plotting ===
plot(difference, title="Price Difference", color=color.new(color.teal, 0), linewidth=2)
hline(0, "Zero Line", color=color.gray, linestyle=hline.style_dotted)
// === Debug Info (Optional) ===
// label.new(bar_index, na, text="Price1: " + str.tostring(price1) + "\nPrice2: " + str.tostring(price2), style=label.style_label_left, yloc=yloc.abovebar)
indicator("Price Difference Between Two Symbols", overlay=true)
// === User Inputs ===
symbol1 = input.symbol("Pepperstone:US500", "Symbol 1")
symbol2 = input.symbol("CME_MINI:ES1!", "Symbol 2")
tf = input.timeframe("", "Resolution (leave blank to use chart TF)")
// === Price Feeds ===
price1 = request.security(symbol1, tf == "" ? timeframe.period : tf, close)
price2 = request.security(symbol2, tf == "" ? timeframe.period : tf, close)
// === Difference Calculation ===
difference = price1 - price2
// === Plotting ===
plot(difference, title="Price Difference", color=color.new(color.teal, 0), linewidth=2)
hline(0, "Zero Line", color=color.gray, linestyle=hline.style_dotted)
// === Debug Info (Optional) ===
// label.new(bar_index, na, text="Price1: " + str.tostring(price1) + "\nPrice2: " + str.tostring(price2), style=label.style_label_left, yloc=yloc.abovebar)
สคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน