The "PLN Index" is a custom indicator developed for TradingView using Pine Script (version 6). It tracks the relative strength of the Polish Zloty (PLN) against a basket of four major currencies: the U.S. Dollar (USD), Swiss Franc (CHF), Euro (EUR), and British Pound (GBP), with each currency contributing an equal weight of 25%. Modeled after the Polish Zloty Index (PLN_I) concept, this indicator offers traders a tool to monitor PLN’s performance across various forex market conditions.
How It Works
The indicator fetches closing prices for the currency pairs USDPLN, CHFPLN, EURPLN, and GBPPLN from TradingView’s data provider (FX_IDC). These pairs represent the amount of PLN needed to purchase one unit of each respective foreign currency. To measure PLN’s strength, the script inverts these rates (e.g., PLNUSD = 1/USDPLN) and calculates the geometric mean of the resulting values using the formula geom_mean = (PLNUSD * PLNCHF * PLNEUR * PLNGBP)^(0.25). The result is then normalized to a base value of 100 at the first bar with complete data, allowing users to observe relative changes in PLN’s value over time. A rising index indicates PLN appreciation, while a falling index suggests depreciation against the basket.
Key Features
Data Inputs: Retrieves closing prices for USDPLN, CHFPLN, EURPLN, and GBPPLN on the selected timeframe. Calculation: Computes the geometric mean of the inverted exchange rates and normalizes it to 100 based on the first valid bar. Visualization: Plots the index as a blue line with a linewidth of 2 on a separate chart pane (non-overlay). Robust Normalization: Normalizes the index using the first bar where all data is available, improving reliability across different timeframes. Usage
The PLN Index is useful for:
Evaluating the Polish Zloty’s strength or weakness relative to a balanced currency basket. Identifying long-term trends or short-term shifts in PLN’s value for forex trading or economic analysis. Supporting technical analysis when paired with additional indicators, such as moving averages or oscillators. Limitations
Data Dependency: The indicator relies on the availability of historical data for all four currency pairs. Missing data (e.g., on higher timeframes like D1 or W1) may prevent accurate plotting. Relative Normalization: Unlike the official PLN_I, which uses a fixed historical base date (e.g., January 2, 1984), this indicator normalizes to 100 at the first valid bar, making it a relative rather than absolute measure. Potential Data Gaps: On higher timeframes, inconsistencies or limited historical data from the FX_IDC provider may result in incomplete index values. Notes
This version of the PLN Index includes an improved normalization method that sets the base value (100) at the first bar with valid data, enhancing its adaptability compared to earlier iterations. It performs best on timeframes up to H4, where data availability is generally consistent. For higher timeframes, users should verify data completeness to ensure reliable results.
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.
For quick access on a chart, add this script to your favorites — learn more here.
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.
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.
For quick access on a chart, add this script to your favorites — learn more here.
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.