OPEN-SOURCE SCRIPT
SP500 Ratios

The "SP500 Ratios" indicator is a powerful tool developed for the TradingView platform, allowing users to access a variety of financial ratios and inflation-adjusted data related to the S&P 500 index. This indicator integrates with Nasdaq Data Link (formerly known as Quandl) to retrieve historical data, providing a comprehensive overview of key financial metrics associated with the S&P 500.
Key Features
User Configuration
The indicator offers flexibility through user-configurable options. You can choose to display or hide each metric according to your analysis needs. Users can also adjust the line width for better visibility on the chart.
Visualization
The selected data is plotted on the chart with distinct colors for each metric, facilitating visual analysis. A dynamic legend table is also generated in the top-right corner of the chart, listing the currently displayed metrics with their associated colors.
This indicator is ideal for traders and analysts seeking detailed insights into the financial performance and valuations of the S&P 500, while benefiting from the customization flexibility offered by TradingView.
Key Features
- Price to Sales Ratio: Quarterly ratio of price to sales (revenue) for the S&P 500.
- Dividend Yield: Monthly dividend yield based on 12-month dividend per share.
- Price Earnings Ratio (PE Ratio): Monthly price-to-earnings ratio based on trailing twelve-month reported earnings.
- CAPE Ratio (Shiller PE Ratio): Monthly cyclically adjusted PE ratio, based on average inflation-adjusted earnings over the past ten years.
- Earnings Yield: Monthly earnings yield, the inverse of the PE ratio.
- Price to Book Ratio: Quarterly ratio of price to book value.
- Inflation Adjusted S&P 500: Monthly S&P 500 level adjusted for inflation.
- Revenue Per Share: Quarterly trailing twelve-month sales per share, not adjusted for inflation.
- Earnings Per Share: Monthly real earnings per share, adjusted for inflation.
User Configuration
The indicator offers flexibility through user-configurable options. You can choose to display or hide each metric according to your analysis needs. Users can also adjust the line width for better visibility on the chart.
Visualization
The selected data is plotted on the chart with distinct colors for each metric, facilitating visual analysis. A dynamic legend table is also generated in the top-right corner of the chart, listing the currently displayed metrics with their associated colors.
This indicator is ideal for traders and analysts seeking detailed insights into the financial performance and valuations of the S&P 500, while benefiting from the customization flexibility offered by TradingView.
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 trend is your friend, until it's not...
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.
For quick access on a chart, add this script to your favorites — learn more here.
The trend is your friend, until it's not...
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.