OPEN-SOURCE SCRIPT
USD Session 8FX - LDN & NY (TF-invariant, Live + Table)

What it is
A USD strength/weakness meter for the London (08:00–08:45) or New York (15:30–16:00/16:15) session. It blends the movement of 8 markets—EURUSD, GBPUSD, AUDUSD, NZDUSD, USDCHF, USDCAD, USDJPY, XAUUSD—into one Score that is timeframe-invariant (it uses a 1-minute “boundary TF” under the hood so changing chart TF doesn’t change the math).
Core logic (simple)
During the chosen session window, it records each symbol’s start and live end prices, computes returns, optionally normalizes by ATR (volatility), applies your weights, and averages anti-USD (EUR/GBP/AUD/NZD/XAU) vs USD-base (CHF/CAD/JPY) groups.
The final Score is the normalized sum of weighted contributions:
Score > 0 → “USD Strong”
Score < 0 → “USD Weak”
At the session close it freezes (“Locked”) the results so you can review them later.
What you see
Main plot: the USD Score line (with a 0 baseline).
Optional lines: Anti-USD average vs USD-base average (post-normalization, pre-weights).
Session background shading (London silver, New York aqua).
Live table with:
Each symbol’s % change, its weight, and its contribution to the Score.
TOP badges for the two biggest drivers (by absolute contribution).
A Side column (only for the two TOPs) showing BUY/SELL aligned with the USD verdict (e.g., if USD Strong → SELL anti-USD pairs like EURUSD, BUY USD-base like USDCHF).
Verdict row with USD Strong/Weak, the Score value, the window text, and whether you’re LIVE / CLOSED / FROZEN.
Trade Gate panel:
Shows Verdict (USD Strong/Weak), Bias OK/weak (|Score| vs your threshold), Top-1/Top-2 VWAP checks, an overall GATE: OK/NO, and an Entry hint string (e.g., “SELL EURUSD, BUY USDCHF”) when conditions align.
VWAP “Trade Gate”
It confirms alignment between the USD bias and price vs VWAP for the top movers:
If USD Strong: anti-USD symbols should be below VWAP (short bias), USD-base symbols above VWAP (long bias).
If USD Weak: the opposite.
Gate = OK only if |Score| ≥ minAbsScore and at least one of the two TOP symbols is on the correct side of VWAP.
Tip: set vwapTF to an intraday value (“1”, “5”, “15”) for reliable VWAP on higher-TF charts.
Alerts
At session close: “USD Strong/Weak – session close”.
Live threshold: alerts when |Score| crosses your intraday threshold up/down.
Entry hint (Gate OK): triggers when the Gate flips from NO → OK inside the window.
If you create an alert of type “Any alert() function call”, you also get a dynamic message like:
ENTRY HINT • Hint: SELL EURUSD, BUY USDCHF
Key inputs you can tweak
Session: London vs New York; NY end time 16:00 or 16:15.
Timezone: default Europe/Tirane.
Boundary TF: default “1” (keeps the indicator TF-invariant).
minAbsScore: sensitivity threshold for “Bias OK”.
ATR normalization (len): stabilizes comparisons across different volatility regimes.
VWAP settings: toggle panel and set vwapTF.
How to use (playbook)
Choose the session (e.g., New York 15:30–16:15), keep Boundary TF = 1.
If you’re on a higher-TF chart, set vwapTF = "1" or "5".
Watch Score and Verdict; when |Score| ≥ minAbsScore, bias is meaningful.
Check Top-1/Top-2 and the Trade Gate:
If Gate = OK, use the Entry hint (e.g., “SELL EURUSD, BUY USDCHF”) as the aligned idea.
Use your own execution rules (e.g., structure, risk, stops) on the suggested symbols.
After close, review the Frozen table to validate behavior and refine thresholds/weights.
Notes & edge cases
If some markets are illiquid/holiday, a few returns may be na; the script handles that gracefully.
If ta.vwap is na on high TFs, the Gate will simply not confirm—set vwapTF intraday.
You can customize weights (e.g., reduce XAUUSD to -0.3 or similar) to suit your basket philosophy.
If you want, I can add toggles to show Side for all 8 symbols, or print a one-line summary (e.g., “USD Strong • Score 0.23 • Gate OK • SELL EURUSD, BUY USDCHF”) in the top-left of the pane.
A USD strength/weakness meter for the London (08:00–08:45) or New York (15:30–16:00/16:15) session. It blends the movement of 8 markets—EURUSD, GBPUSD, AUDUSD, NZDUSD, USDCHF, USDCAD, USDJPY, XAUUSD—into one Score that is timeframe-invariant (it uses a 1-minute “boundary TF” under the hood so changing chart TF doesn’t change the math).
Core logic (simple)
During the chosen session window, it records each symbol’s start and live end prices, computes returns, optionally normalizes by ATR (volatility), applies your weights, and averages anti-USD (EUR/GBP/AUD/NZD/XAU) vs USD-base (CHF/CAD/JPY) groups.
The final Score is the normalized sum of weighted contributions:
Score > 0 → “USD Strong”
Score < 0 → “USD Weak”
At the session close it freezes (“Locked”) the results so you can review them later.
What you see
Main plot: the USD Score line (with a 0 baseline).
Optional lines: Anti-USD average vs USD-base average (post-normalization, pre-weights).
Session background shading (London silver, New York aqua).
Live table with:
Each symbol’s % change, its weight, and its contribution to the Score.
TOP badges for the two biggest drivers (by absolute contribution).
A Side column (only for the two TOPs) showing BUY/SELL aligned with the USD verdict (e.g., if USD Strong → SELL anti-USD pairs like EURUSD, BUY USD-base like USDCHF).
Verdict row with USD Strong/Weak, the Score value, the window text, and whether you’re LIVE / CLOSED / FROZEN.
Trade Gate panel:
Shows Verdict (USD Strong/Weak), Bias OK/weak (|Score| vs your threshold), Top-1/Top-2 VWAP checks, an overall GATE: OK/NO, and an Entry hint string (e.g., “SELL EURUSD, BUY USDCHF”) when conditions align.
VWAP “Trade Gate”
It confirms alignment between the USD bias and price vs VWAP for the top movers:
If USD Strong: anti-USD symbols should be below VWAP (short bias), USD-base symbols above VWAP (long bias).
If USD Weak: the opposite.
Gate = OK only if |Score| ≥ minAbsScore and at least one of the two TOP symbols is on the correct side of VWAP.
Tip: set vwapTF to an intraday value (“1”, “5”, “15”) for reliable VWAP on higher-TF charts.
Alerts
At session close: “USD Strong/Weak – session close”.
Live threshold: alerts when |Score| crosses your intraday threshold up/down.
Entry hint (Gate OK): triggers when the Gate flips from NO → OK inside the window.
If you create an alert of type “Any alert() function call”, you also get a dynamic message like:
ENTRY HINT • Hint: SELL EURUSD, BUY USDCHF
Key inputs you can tweak
Session: London vs New York; NY end time 16:00 or 16:15.
Timezone: default Europe/Tirane.
Boundary TF: default “1” (keeps the indicator TF-invariant).
minAbsScore: sensitivity threshold for “Bias OK”.
ATR normalization (len): stabilizes comparisons across different volatility regimes.
VWAP settings: toggle panel and set vwapTF.
How to use (playbook)
Choose the session (e.g., New York 15:30–16:15), keep Boundary TF = 1.
If you’re on a higher-TF chart, set vwapTF = "1" or "5".
Watch Score and Verdict; when |Score| ≥ minAbsScore, bias is meaningful.
Check Top-1/Top-2 and the Trade Gate:
If Gate = OK, use the Entry hint (e.g., “SELL EURUSD, BUY USDCHF”) as the aligned idea.
Use your own execution rules (e.g., structure, risk, stops) on the suggested symbols.
After close, review the Frozen table to validate behavior and refine thresholds/weights.
Notes & edge cases
If some markets are illiquid/holiday, a few returns may be na; the script handles that gracefully.
If ta.vwap is na on high TFs, the Gate will simply not confirm—set vwapTF intraday.
You can customize weights (e.g., reduce XAUUSD to -0.3 or similar) to suit your basket philosophy.
If you want, I can add toggles to show Side for all 8 symbols, or print a one-line summary (e.g., “USD Strong • Score 0.23 • Gate OK • SELL EURUSD, BUY USDCHF”) in the top-left of the pane.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。