OPEN-SOURCE SCRIPT

Bond Yield Spread

업데이트됨
The Bond Yield Spread Script is developed for forex traders, offering an automated tool to calculate the bond yield spread between two countries associated with the forex pair displayed on the chart.

Functionality:

The script starts by identifying the base and quote currencies of the current forex pair and aligns them with their corresponding national bond symbols based on user-selected maturity, with options ranging from 01Y to 30Y. It calculates the yield spread by subtracting the bond yield associated with the quote country from that of the base country, following the formula:

Yield Spread = Yield(Base Country) − Yield(Quote Country)

which is then displayed as a plot line on the chart.

This script relies solely on TradingView's internal yield symbols, with the following calculation:
"currency" => "first two letters" + maturity

And maturity, in this case, is the value that is configured in the indicator settings, for example:
"EUR" => "EU" + "02Y" will result in EU02Y -> which will be used in the formula, depending on the quote or base currency.

Application in Trading:

This indicator is invaluable for traders employing carry trading strategies or assessing currency strength based on traded interest rates as an indicator. A higher yield spread typically indicates a stronger currency, because the return obtained for holding the currency is higher.

Originality and Practicality:

This script is self-developed, aiming to fill the gap in automatic bond yield comparisons within the TradingView environment. It is particularly beneficial for traders focusing on macroeconomic factors affecting forex markets. Unlike other scripts, it integrates various bond maturities into one tool, enhancing its utility and application range.

Conclusion:

Designed for traders incorporating macroeconomics in their strategy, this script will be useful to calculate the bond yield differences automatically without having to enter a new formula for every new currency pair.

Compliance and Limitations:

The script complies with TradingView scripting standards, ensuring no lookahead bias and maintaining real-time data integrity. However, its utility depends on the comprehensive availability of bond yield data within TradingView. As not all countries issue bonds for each listed maturity, this may limit the script’s application for certain currency pairs or specific maturities.
릴리즈 노트
Changed color to red
bondsbondyieldsbondyieldspreadMacroeconomic Analysis And Trading IdeascurrencystrengthFundamental Analysisinterestratesentimentyieldspread

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항