MartinShkreIi

Recession Indicator

MartinShkreIi 已更新   
This script attempts to predict recessions four quarters ahead.

According to the New York Fed, "The yield curve—specifically, the spread between the interest rates on the ten-year Treasury
note and the three-month Treasury bill—is a valuable forecasting tool. It is simple to use
and significantly outperforms other financial and macroeconomic indicators in predicting
recessions two to six quarters ahead."

The paper offers Estimated Recession Probabilities Using the Yield Curve Spread:
Four Quarters Ahead

Recession Probability Value of Spread
(Percent) (Percentage Points)
5 1.21
10 0.76
15 0.46
20 0.22
25 0.02
30 -0.17
40 -0.50
50 -0.82
60 -1.13
70 -1.46
80 -1.85
90 -2.40

"Note: The yield curve spread is defined as the spread between the
interest rates on the ten-year Treasury note and the three-month
Treasury bill."

You can choose at which Recession Probability (percent) you want to display the signal (default value is 25%), as well as choose if you want to only display the signal at inversion (default) or at all times when the yield curve is inverted.

To use, just select your current timeframe from the menu.

Includes an option for repainting -- default value is true, meaning the script will repaint the current bar.

False = Not Repainting = Value for the current bar is not repainted, but all past values are offset by 1 bar.

True = Repainting = Value for the current bar is repainted, but all past values are correct and not offset by 1 bar.

In both cases, all of the historical values are correct, it is just a matter of whether you prefer the current bar to be realistically painted and the historical bars offset by 1, or the current bar to be repainted and the historical data to match their respective price bars.

As explained by TradingView,`f_security()` is for coders who want to offer their users a repainting/no-repainting version of the HTF data.
版本注释:
Removed the timeframe input to simplify the script.
版本注释:
Changed the size of the dots to small and added a zero line.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?