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)
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.