TradeAutomation

S&P 500 Quandl Data & Ratios

TradingView has a little-known integration that allows you to pull in 3rd party data-sets from Nasdaq Data Link, also known as Quandl. Today, I am open-sourcing for the community an indicator that uses the Quandl integration to pull in historical data and ratios on the S&P500. I originally coded this to study macro P/E ratios during peaks and troughs of boom/bust cycles.

The indicator pulls in each of the following datasets, as defined and provided by Quandl. The user can select which datasets to pull in using the indicator settings:

  • Dividend Yield: S&P 500 dividend yield (12 month dividend per share)/price. Yields following June 2022 (including the current yield) are estimated based on 12 month dividends through June 2022, as reported by S&P. Sources: Standard & Poor's for current S&P 500 Dividend Yield. Robert Shiller and his book Irrational Exuberance for historic S&P 500 Dividend Yields.

  • Price Earning Ratio: Price to earnings ratio, based on trailing twelve month as reported earnings. Current PE is estimated from latest reported earnings and current market price. Source: Robert Shiller and his book Irrational Exuberance for historic S&P 500 PE Ratio.

  • CAPE/Shiller PE Ratio: Shiller PE ratio for the S&P 500. Price earnings ratio is based on average inflation-adjusted earnings from the previous 10 years, known as the Cyclically Adjusted PE Ratio (CAPE Ratio), Shiller PE Ratio, or PE 10 FAQ. Data courtesy of Robert Shiller from his book, Irrational Exuberance.

  • Earnings Yield: S&P 500 Earnings Yield. Earnings Yield = trailing 12 month earnings divided by index price (or inverse PE) Yields following March, 2022 (including current yield) are estimated based on 12 month earnings through March, 2022 the latest reported by S&P. Source: Standard & Poor's

  • Price Book Ratio: S&P 500 price to book value ratio. Current price to book ratio is estimated based on current market price and S&P 500 book value as of March, 2022 the latest reported by S&P. Source: Standard & Poor's

  • Price Sales Ratio: S&P 500 Price to Sales Ratio (P/S or Price to Revenue). Current price to sales ratio is estimated based on current market price and 12 month sales ending March, 2022 the latest reported by S&P. Source: Standard & Poor's

  • Inflation Adjusted SP500: Inflation adjusted SP500. Other than the current price, all prices are monthly average closing prices. Sources: Standard & Poor's Robert Shiller and his book Irrational Exuberance for historic S&P 500 prices, and historic CPIs.

  • Revenue Per Share: Trailing twelve month S&P 500 Sales Per Share (S&P 500 Revenue Per Share) non-inflation adjusted current dollars. Source: Standard & Poor's

  • Earnings Per Share: S&P 500 Earnings Per Share. 12-month real earnings per share inflation adjusted, constant August, 2022 dollars. Sources: Standard & Poor's for current S&P 500 Earnings. Robert Shiller and his book Irrational Exuberance for historic S&P 500 Earnings.


Disclaimer: This is not financial advice. Open-source scripts I publish in the community are largely meant to spark ideas that can be used as building blocks for part of a more robust trade management strategy. If you would like to implement a version of any script, I would recommend making significant additions/modifications to the strategy & risk management functions. If you don’t know how to program in Pine, then hire a Pine-coder. We can help!

Want to build custom alerts and custom strategies? Interested in automated trading?

Hire me to code or automate your trading strategy, or schedule a free consultation at:
www.TradeAutomation.net
オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?