PROTECTED SOURCE SCRIPT
已更新 Forex Currency Strength

What this indicator does
It compares the relative strength of the 8 major currencies (USD, EUR, GBP, JPY, AUD, CAD, NZD, CHF) by looking at all 28 currency pairs. Each currency is smoothed (averaged) with a moving average to reduce noise.
From this it shows:
• Currency strength lines → how each major currency is performing over time (optional view).
• Pair divergence histogram → the difference in strength between the two currencies of the chart pair (e.g. EUR vs USD on an EURUSD chart). Green means the base currency is stronger, red means the quote currency is stronger.
• Ranking table → shows the strongest to weakest currency at the current moment. The strongest is highlighted green, the weakest red.
• Session highlighting → shows your chosen trading session on the chart (background shading, optional vertical line at the session start).
• Alerts → you can set TradingView alerts when:
• the pair divergence crosses above or below zero
• the divergence strength gets big enough (above your threshold)
• the difference between the strongest and weakest currency becomes large
⸻
👉 In plain words:
This indicator helps you quickly see which currencies are strong, which are weak, and whether the pair you are trading has a clear directional bias. It also highlights trading sessions and can notify you when strong moves or imbalances appear.
// ─────────────────────────────────────────────────────────────
// Forex Currency Strength (8 Majors, %R) + Divergence + Ranking
// ─────────────────────────────────────────────────────────────
//
// === Inputs ===
//
// exchPrefix → Broker/feed prefix (e.g. "OANDA:", "FX:", or "" for ICMarkets)
// tf → Data timeframe (empty = chart timeframe)
// smoothLen → Smoothing length (MA) for currency strength (default = 14)
// smoothMethod → MA method (SMA, EMA, WMA, DEMA)
// viewMode → Display mode: "Strength Lines", "Pair Divergence", "Both"
// (Tip: set to "Pair Divergence" to hide lines by default)
// barsLimit → Number of bars to display
//
// sessionStr → Trading session time (e.g. "0800-1700"); session is highlighted on chart
//
// alertDivAbs → Threshold for alerts on |divergence|
// alertGapTF → Threshold for alerts on Top–Flop ranking gap
//
// scaleK → Scaling factor (here ×1000)
//
// rankPos → Position of the ranking table (top/bottom left/right)
// rankTextSize → Font size for the ranking table (tiny, small, normal, large, huge)
//
// === Outputs ===
//
// • 8 currency strength lines (optionally visible)
// • Divergence (current pair) as histogram
// • Ranking table (top & flop highlighted)
// • Session highlighting (background color + optional vertical line)
// • Alerts on divergence crosses, |divergence| thresholds & top–flop gaps
//
// === Alert Conditions ===
//
// longDivCross → Divergence (current pair) crosses above 0
// shortDivCross → Divergence (current pair) crosses below 0
// divAbsUp → |Divergence| exceeds alertDivAbs threshold
// gapUp → Top–Flop ranking gap exceeds alertGapTF threshold
//
// ─────────────────────────────────────────────────────────────
It compares the relative strength of the 8 major currencies (USD, EUR, GBP, JPY, AUD, CAD, NZD, CHF) by looking at all 28 currency pairs. Each currency is smoothed (averaged) with a moving average to reduce noise.
From this it shows:
• Currency strength lines → how each major currency is performing over time (optional view).
• Pair divergence histogram → the difference in strength between the two currencies of the chart pair (e.g. EUR vs USD on an EURUSD chart). Green means the base currency is stronger, red means the quote currency is stronger.
• Ranking table → shows the strongest to weakest currency at the current moment. The strongest is highlighted green, the weakest red.
• Session highlighting → shows your chosen trading session on the chart (background shading, optional vertical line at the session start).
• Alerts → you can set TradingView alerts when:
• the pair divergence crosses above or below zero
• the divergence strength gets big enough (above your threshold)
• the difference between the strongest and weakest currency becomes large
⸻
👉 In plain words:
This indicator helps you quickly see which currencies are strong, which are weak, and whether the pair you are trading has a clear directional bias. It also highlights trading sessions and can notify you when strong moves or imbalances appear.
// ─────────────────────────────────────────────────────────────
// Forex Currency Strength (8 Majors, %R) + Divergence + Ranking
// ─────────────────────────────────────────────────────────────
//
// === Inputs ===
//
// exchPrefix → Broker/feed prefix (e.g. "OANDA:", "FX:", or "" for ICMarkets)
// tf → Data timeframe (empty = chart timeframe)
// smoothLen → Smoothing length (MA) for currency strength (default = 14)
// smoothMethod → MA method (SMA, EMA, WMA, DEMA)
// viewMode → Display mode: "Strength Lines", "Pair Divergence", "Both"
// (Tip: set to "Pair Divergence" to hide lines by default)
// barsLimit → Number of bars to display
//
// sessionStr → Trading session time (e.g. "0800-1700"); session is highlighted on chart
//
// alertDivAbs → Threshold for alerts on |divergence|
// alertGapTF → Threshold for alerts on Top–Flop ranking gap
//
// scaleK → Scaling factor (here ×1000)
//
// rankPos → Position of the ranking table (top/bottom left/right)
// rankTextSize → Font size for the ranking table (tiny, small, normal, large, huge)
//
// === Outputs ===
//
// • 8 currency strength lines (optionally visible)
// • Divergence (current pair) as histogram
// • Ranking table (top & flop highlighted)
// • Session highlighting (background color + optional vertical line)
// • Alerts on divergence crosses, |divergence| thresholds & top–flop gaps
//
// === Alert Conditions ===
//
// longDivCross → Divergence (current pair) crosses above 0
// shortDivCross → Divergence (current pair) crosses below 0
// divAbsUp → |Divergence| exceeds alertDivAbs threshold
// gapUp → Top–Flop ranking gap exceeds alertGapTF threshold
//
// ─────────────────────────────────────────────────────────────
版本注释
improvment of table受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用它,没有任何限制 — 在此处了解更多信息。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。