Drop this into TradingView. It creates a real-time matrix on your chart comparing your A-list pairs. It highlights when the London session is active, converts ATR directly to pips for quick risk calculation, and flags high RVOL (over 1.5x) in aqua so you can immediately spot where the volume is flowing.
Code: Select all
//@version=5
indicator("London Scalp Matrix", overlay=true)
// --- Inputs ---
grp1 = "Session Settings"
sessionTime = input.session("0800-1200", title="London Core Session (UTC)", group=grp1)
tz = input.string("UTC", title="Timezone", group=grp1)
volLength = input.int(20, title="RVOL SMA Length", group=grp1)
atrLength = input.int(14, title="ATR Length", group=grp1)
grp2 = "Pairs to Track"
sym1 = input.symbol("OANDA:EURUSD", title="Primary 1", group=grp2)
sym2 = input.symbol("OANDA:GBPUSD", title="Primary 2", group=grp2)
sym3 = input.symbol("OANDA:GBPJPY", title="Cross 1", group=grp2)
sym4 = input.symbol("OANDA:USDJPY", title="Primary 3", group=grp2)
// --- Core Logic ---
// Determine if we are currently in the defined session
inSession = not na(time(timeframe.period, sessionTime, tz))
// Function to pull raw data for each pair
getMetrics() =>
rawAtr = ta.atr(atrLength)
vSma = ta.sma(volume, volLength)
rvol = vSma > 0 ? volume / vSma : 0.0
[rvol, rawAtr]
// Fetch data from other symbols
[rvol1, atr1] = request.security(sym1, timeframe.period, getMetrics())
[rvol2, atr2] = request.security(sym2, timeframe.period, getMetrics())
[rvol3, atr3] = request.security(sym3, timeframe.period, getMetrics())
[rvol4, atr4] = request.security(sym4, timeframe.period, getMetrics())
// Pip Conversion Helper
toPips(sym, rawAtr) =>
multiplier = str.contains(sym, "JPY") ? 100 : 10000
rawAtr * multiplier
// --- Dashboard Drawing ---
var table matrix = table.new(position.top_right, 4, 5, bgcolor=color.new(color.black, 20), border_width=1, border_color=color.new(color.gray, 80))
if barstate.islast
// Headers
table.cell(matrix, 0, 0, "Pair", text_color=color.gray, text_size=size.small, bgcolor=color.new(color.black, 0))
table.cell(matrix, 1, 0, "Status", text_color=color.gray, text_size=size.small, bgcolor=color.new(color.black, 0))
table.cell(matrix, 2, 0, "RVOL", text_color=color.gray, text_size=size.small, bgcolor=color.new(color.black, 0))
table.cell(matrix, 3, 0, "ATR (Pips)", text_color=color.gray, text_size=size.small, bgcolor=color.new(color.black, 0))
// Row function
fillRow(tbl, row, sym, rvol, atrRaw) =>
pipAtr = toPips(sym, atrRaw)
isActive = inSession
table.cell(tbl, 0, row, sym, text_color=color.white, text_halign=text.align_left)
table.cell(tbl, 1, row, isActive ? "Active" : "Wait", text_color=isActive ? color.green : color.gray)
table.cell(tbl, 2, row, str.tostring(rvol, "#.##"), text_color=rvol >= 1.5 ? color.aqua : (rvol >= 1.0 ? color.green : color.white))
table.cell(tbl, 3, row, str.tostring(pipAtr, "#.1"), text_color=color.white)
fillRow(matrix, 1, sym1, rvol1, atr1)
fillRow(matrix, 2, sym2, rvol2, atr2)
fillRow(matrix, 3, sym3, rvol3, atr3)
fillRow(matrix, 4, sym4, rvol4, atr4)