OPEN-SOURCE SCRIPT
USD GAP RATIO (USD/KRW vs DXY)

This custom indicator measures the relative value of the USD/KRW exchange rate against the global US Dollar Index (DXY) to identify premium and discount zones.
By dividing DXY by USD/KRW, it captures structural anomalies where the Korean Won becomes temporarily overvalued despite strong global dollar sentiment. It utilizes a 240-day Simple Moving Average (SMA) as a baseline to signal mean-reversion trading opportunities.
Long Entry (Buy Signal):"When the blue Gap Ratio line spikes significantly above the gray dashed line (240 SMA), it indicates that USD/KRW is deeply undervalued relative to the global dollar. This signals a high-probability quarterly bottom for a long position."
Exit / Avoid Long:"When the blue line drops well below the 240 SMA, the currency pair is overvalued (premium zone). Avoid entering new long positions."
- Formula: Gap Ratio = (DXY / USD_KRW) * 100,000
- Baseline: 240-period Simple Moving Average (SMA) of the Gap Ratio
- Category: Macro Spread / Trend & Mean-Reversion Indicator
- Recommended Timeframe: Daily (D) or 4-Hour (4H) for swing trading
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.