OPEN-SOURCE SCRIPT

SP500 Earnings Yield Spread: SP500 vs 3 Month & 10 Year Treasury

By goodmonke
Add the SP500 ttm Earnings Yield Spreads vs the 3 Month and 10 Year Treasury Rates.
Short Spread = SP500 E/P ttm - 3 Month Treasury Rate
Long Spread = SP500 E/P ttm - 10 Year Treasury Rate

Symbol "SP500_EARNINGS_YIELD_MONTH" as the SP500 Earnings Yield
Symbol "US03MY" as the 3 Month Treasury Rate
Symbol "US10Y" as the 10 Year Treasury Rate

Based on research suggesting Earnings Yield and Interest Rates may have predictive power of future returns:
- Market-Timing Strategies That Worked? - Pu Shen [2002]
- Valuation Ratios and the Long-Run Stock Market Outlook - Campbell and Shiller [1998]

Inputs:
Short Term Spread - Line for Short Term Spread
Long Term Spread - Line for Long Term Spread
Zero Line - Horizontal line at 0
Color Lines Based on Spread - Color the spreads green/red if spread is positive/negative
Short 10th PCT - Line for Short Term Spread 10th percentile of historical values
Long 10th PCT - Line for Long Term Spread 10th percentile of historical values
Shade Below 10 PCT: Spread Must be Negative - Requirement the spread is negative to shade background
Shade Background Below Short 10th Percentile - Shade the background if the Short Term Spread is below its 10th percentile. (and spread is negative if input above chosen)
Shade Background Below Long 10th Percentile - Shade the background if the Long Term Spread is below its 10th percentile. (and spread is negative if input above chosen)
Portfolio managementpushenshilleryieldspread

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الرمز في المنشور يخضع لقواعد‎‎قوانين الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟

إخلاء المسؤولية