This commit is contained in:
wvr committed 2026-11-18 00:50:16 -06:00
1 parent fafd443cac
commit bc2bb6ddcd
1 file changed
+13 -12
+13 -12
View File
@@ -154,6 +154,7 @@ if barstate.isconfirmed and nqDir != 0 and nqShow == 0
sideText(d) => d == 1 ? "LONG" : d == -1 ? "SHORT" : "waiting" sideText(d) => d == 1 ? "LONG" : d == -1 ? "SHORT" : "waiting"
sideColor(d) => d == 1 ? color.lime : d == -1 ? color.new(#ff5252, 0) : color.silver sideColor(d) => d == 1 ? color.lime : d == -1 ? color.new(#ff5252, 0) : color.silver
num(x) => na(x) ? "-" : str.tostring(x, "#.##") num(x) => na(x) ? "-" : str.tostring(x, "#.##")
pts(x) => na(x) ? "-" : str.tostring(x, "#.####") // prices/points: enough decimals for NG (0.001 tick)
usd(x) => na(x) ? "-" : "$" + str.tostring(x, "#,##0.00") usd(x) => na(x) ? "-" : "$" + str.tostring(x, "#,##0.00")
var table t = table.new(position.top_right, 10, 6, bgcolor = color.new(color.black, 15), border_width = 1) var table t = table.new(position.top_right, 10, 6, bgcolor = color.new(color.black, 15), border_width = 1)
@@ -166,45 +167,45 @@ if barstate.islast
table.cell(t, 1, 1, "8:21", text_color = color.white) table.cell(t, 1, 1, "8:21", text_color = color.white)
table.cell(t, 2, 1, sideText(goldDir), text_color = sideColor(goldDir)) table.cell(t, 2, 1, sideText(goldDir), text_color = sideColor(goldDir))
table.cell(t, 3, 1, "gap " + num(goldGap) + "% vs " + num(thr) + "%" + (liveMed ? " (live median)" : " (input)") + " | now " + num(gap) + "%", text_color = color.white) table.cell(t, 3, 1, "gap " + num(goldGap) + "% vs " + num(thr) + "%" + (liveMed ? " (live median)" : " (input)") + " | now " + num(gap) + "%", text_color = color.white)
table.cell(t, 4, 1, num(gcAtr), text_color = color.white) table.cell(t, 4, 1, pts(gcAtr), text_color = color.white)
table.cell(t, 5, 1, num(gcN), text_color = color.white) table.cell(t, 5, 1, num(gcN), text_color = color.white)
table.cell(t, 6, 1, usd(gcRiskUsd), text_color = color.red) table.cell(t, 6, 1, usd(gcRiskUsd), text_color = color.red)
table.cell(t, 7, 1, usd(gcRewUsd), text_color = color.lime) table.cell(t, 7, 1, usd(gcRewUsd), text_color = color.lime)
table.cell(t, 8, 1, num(gcSp), text_color = color.new(color.red, 40)) table.cell(t, 8, 1, pts(gcSp), text_color = color.new(color.red, 40))
table.cell(t, 9, 1, num(gcTp), text_color = color.new(color.lime, 40)) table.cell(t, 9, 1, pts(gcTp), text_color = color.new(color.lime, 40))
table.cell(t, 0, 2, "Crude", text_color = color.white) table.cell(t, 0, 2, "Crude", text_color = color.white)
table.cell(t, 1, 2, "9:01", text_color = color.white) table.cell(t, 1, 2, "9:01", text_color = color.white)
table.cell(t, 2, 2, sideText(clDir), text_color = sideColor(clDir)) table.cell(t, 2, 2, sideText(clDir), text_color = sideColor(clDir))
table.cell(t, 3, 2, "yesterday: settle " + num(clSettle) + " vs 9:00 close " + num(clOpen), text_color = color.white) table.cell(t, 3, 2, "yesterday: settle " + num(clSettle) + " vs 9:00 close " + num(clOpen), text_color = color.white)
table.cell(t, 4, 2, num(clAtr), text_color = color.white) table.cell(t, 4, 2, pts(clAtr), text_color = color.white)
table.cell(t, 5, 2, num(clN), text_color = color.white) table.cell(t, 5, 2, num(clN), text_color = color.white)
table.cell(t, 6, 2, usd(clRiskUsd), text_color = color.red) table.cell(t, 6, 2, usd(clRiskUsd), text_color = color.red)
table.cell(t, 7, 2, usd(clRewUsd), text_color = color.lime) table.cell(t, 7, 2, usd(clRewUsd), text_color = color.lime)
table.cell(t, 8, 2, num(clSp), text_color = color.new(color.red, 40)) table.cell(t, 8, 2, pts(clSp), text_color = color.new(color.red, 40))
table.cell(t, 9, 2, num(clTp), text_color = color.new(color.lime, 40)) table.cell(t, 9, 2, pts(clTp), text_color = color.new(color.lime, 40))
table.cell(t, 0, 3, "Nat gas", text_color = color.white) table.cell(t, 0, 3, "Nat gas", text_color = color.white)
table.cell(t, 1, 3, "6:01 pm (prev. eve)", text_color = color.white) table.cell(t, 1, 3, "6:01 pm (prev. eve)", text_color = color.white)
table.cell(t, 2, 3, sideText(clDir), text_color = sideColor(clDir)) table.cell(t, 2, 3, sideText(clDir), text_color = sideColor(clDir))
table.cell(t, 3, 3, "crude's side for the trading day that opens at 6 pm (no hedging)", text_color = color.white) table.cell(t, 3, 3, "crude's side for the trading day that opens at 6 pm (no hedging)", text_color = color.white)
table.cell(t, 4, 3, num(ngAtr), text_color = color.white) table.cell(t, 4, 3, pts(ngAtr), text_color = color.white)
table.cell(t, 5, 3, num(ngN), text_color = color.white) table.cell(t, 5, 3, num(ngN), text_color = color.white)
table.cell(t, 6, 3, usd(ngRiskUsd), text_color = color.red) table.cell(t, 6, 3, usd(ngRiskUsd), text_color = color.red)
table.cell(t, 7, 3, usd(ngRewUsd), text_color = color.lime) table.cell(t, 7, 3, usd(ngRewUsd), text_color = color.lime)
table.cell(t, 8, 3, num(ngSp), text_color = color.new(color.red, 40)) table.cell(t, 8, 3, pts(ngSp), text_color = color.new(color.red, 40))
table.cell(t, 9, 3, num(ngTp), text_color = color.new(color.lime, 40)) table.cell(t, 9, 3, pts(ngTp), text_color = color.new(color.lime, 40))
table.cell(t, 0, 4, "NQ", text_color = color.white) table.cell(t, 0, 4, "NQ", text_color = color.white)
table.cell(t, 1, 4, "9:31", text_color = color.white) table.cell(t, 1, 4, "9:31", text_color = color.white)
table.cell(t, 2, 4, sideText(nqShow), text_color = sideColor(nqShow)) table.cell(t, 2, 4, sideText(nqShow), text_color = sideColor(nqShow))
table.cell(t, 3, 4, "9:30 close " + num(nqShowPx) + " vs prior 4:00 close " + num(nqShowRef), text_color = color.white) table.cell(t, 3, 4, "9:30 close " + num(nqShowPx) + " vs prior 4:00 close " + num(nqShowRef), text_color = color.white)
table.cell(t, 4, 4, num(nqAtr), text_color = color.white) table.cell(t, 4, 4, pts(nqAtr), text_color = color.white)
table.cell(t, 5, 4, num(nqN), text_color = color.white) table.cell(t, 5, 4, num(nqN), text_color = color.white)
table.cell(t, 6, 4, usd(nqRiskUsd), text_color = color.red) table.cell(t, 6, 4, usd(nqRiskUsd), text_color = color.red)
table.cell(t, 7, 4, usd(nqRewUsd), text_color = color.lime) table.cell(t, 7, 4, usd(nqRewUsd), text_color = color.lime)
table.cell(t, 8, 4, num(nqSp), text_color = color.new(color.red, 40)) table.cell(t, 8, 4, pts(nqSp), text_color = color.new(color.red, 40))
table.cell(t, 9, 4, num(nqTp), text_color = color.new(color.lime, 40)) table.cell(t, 9, 4, pts(nqTp), text_color = color.new(color.lime, 40))
note = timeframe.period != "1" ? "Switch the chart to 1 minute." : "USD amounts include costs (stop: slippage + commission; target: commission): type as shown. Per-account sizes: tracker. Skip holidays and early closes." note = timeframe.period != "1" ? "Switch the chart to 1 minute." : "USD amounts include costs (stop: slippage + commission; target: commission): type as shown. Per-account sizes: tracker. Skip holidays and early closes."
table.cell(t, 0, 5, note, text_color = timeframe.period != "1" ? color.orange : color.new(color.white, 30), text_size = size.small) table.cell(t, 0, 5, note, text_color = timeframe.period != "1" ? color.orange : color.new(color.white, 30), text_size = size.small)