Yield Curve (1-10yr)Yield curve of the 1-10 year US Treasury Bonds, with over 60 years of history.
The Yield Curve is the interest rate on the 10 year bond minus the 1 year bond.
When it inverts (crosses under 0) a recession usually follows 6-12 months later.
It's a great leading indicator to identify risk in the macroeconomic environment.
Yield curves can be constructed on varying durations. Using a 1-year as the short-term bond provides a slightly faster response than the 2-year bond; and the 1-year has more historical data on TradingView.
Fundamental Analysis
[ENT] IndicatorsИндикатор показывает:
Открытие и закрытие торговых сессий (KillZones) - Азия, Лондон, Нью-Йорк
Открытие дня
Хай и Лой предыдущего дня
Разделение дней недели и их отображение.
Используйте на здоровье)
Sessions Lines & BackgroundDisplay Asia, London & New York sessions as background colors or lines (for a cleaner chart).
SPX Fair Value Bands V2An updated version of the SPX Fair Value Bands script from dharmatech and based on the net liquidity concept by MaxJAnderson .
Now with full customization of parameters through the settings (Dialog Box) and allowing the options to the use of
1) Standard Bands based on Offsets of the Fair Value
2) Bollinger Bands
3) Keltner Channels
to better capture buy/sell areas rather than relying on noisy unreliably (and unevenly) updated data from the Treasury/Fed.
==================================
Net Liquidity's importance in the new post-COVID QE to QT regime as described MaxJAnderson
----------------
" In past cycles, size of Fed's balance sheet changed a lot, while TGA and RRP changed relatively little. So size of balance sheet roughly equated Net Liquidity.
(The Treasury General Account) TGA and (Reverse Repo) RRP didn't matter. They were rounding errors by comparison.
But starting in 2020, relative changes in TGA and RRP have been THREE TIMES LARGER than the change in size of the Fed's balance sheet. As result, changes in TGA and RRP have taken over as the primary drivers Net Liquidity.
This is new, and changes the game significantly. Again - the size of the Fed's balance sheet doesn't matter.
What matters is the portion of it that's available to circulate in the economy (Net Liquidity).
And ever since 2020, the Treasury and Reverse Repo have become what controls that. Not the size of Fed's balance sheet.
----------------
The idea that follows is simple,short when $SPX reaches extreme levels of overvaluation, and close out when SPX returns to being undervalued. Here's the formulas I currently use to determine fair value:
Fair Value = (Fed Bal Sheet - TGA - RRP)/1.1 - 1625
And here's the trading rules I currently follow:
Short when diff of $SPX - Fair Value > 350
Close when diff of $SPX - Fair Value < 150
When one of these rules is triggered upon market close on a given day, trades are entered at open of the following day "
Fed Net Liquidity Indicator (24-Oct-2022 update)This indicator is an implementation of the USD Liquidity Index originally proposed by Arthur Hayes based on the initial implementation of jlb05013, kudos to him!
I have incorporated subsequent additions (Standing Repo Facility and Central Bank Liquidity Swaps lines) and dealt with some recent changes in reporting units from TradingView.
This is a macro indicator that aims at tracking how much USD liquidity is available to chase financial assets:
- When the FED is expanding liquidity, financial asset prices tend to increase
- When the FED is contracting liquidity, financial asset prices tend to decrease
Here is the current calculation:
Net Liquidity =
(+) The Fed’s Balance Sheet (FRED:WALCL)
(-) NY Fed Total Amount of Accepted Reverse Repo Bids (FRED:RRPONTTLD)
(-) US Treasury General Account Balance Held at NY Fed (FRED:WTREGEN)
(+) NY Fed - Standing Repo Facility (FRED:RPONTSYD)
(+) NY Fed - Central Bank Liquidity Swaps (FRED:SWPT)
Yield Curve (2-10yr)Yield curve of the 2-10 year US Treasury Bonds, with over 50 years of history.
The Yield Curve is the interest rate on the 10 year bond minus the 2 year bond.
When it inverts (crosses under 0) a recession usually follows 6-12 months later.
It's a great leading indicator to identify risk in the macroeconomic environment.
Rolling CAGR (Compound Annual Growth Rate)Simple and powerful Rolling CAGR (Compound Annual Growth Rate) script.
Works with daily, weekly, and monthly data. Do not work with data of hours, minutes, seconds, or customized time intervals.
You can change the rolling period, from the default (3 years) to any other period of years. Just change one value in the script.
Capital Asset Pricing Model (CAPM) [Loxx]Capital Asset Pricing Model (CAPM) demonstrates how to calculate the Cost of Equity for an underlying asset using Pine Script. This script will only work on the monthly timeframe. While you can change the default inputs, you should study what CAPM is and how this works before doing so. This indicator pulls various types of data from SPY from various timeframes to calculate risk-free rates, market premiums, and log returns. Alpha and Beta are computed using the regression between underlying asset and SPY. This indicator only calculates on the most recent data. If you wish to change this, you'll have to save the script and make adjustments. A few examples where CAPM is used:
Used as the mu factor Geometric Brownian Motion models for options pricing and forecasting price ranges and decay
Calculating the Weighted Average Cost of Capital
Asset pricing
Efficient frontier
Risk and diversification
Security market line
Discounted Cashflow Analysis
Investment bankers use CAPM to value deals
Account firms use CAPM to verify asset prices and assumptions
Real estate firms use variations of CAPM to value properties
... and more
Details of the calculations used here
Rm is calculated using yearly simple returns data from SPY, typically this is just hard coded as 10%.
Rf is pulled from US 10 year bond yields
Beta and Alpha are pulled form monthly returns data of the asset and SPY
In the past, typically this data is purchased from investments banks whose research arms produce values for beta, alpha, risk free rate, and risk premiums. In 2022 ,you can find free estimates for each parameter but these values might not reflect the most current data or research.
History
The CAPM was introduced by Jack Treynor (1961, 1962), William F. Sharpe (1964), John Lintner (1965) and Jan Mossin (1966) independently, building on the earlier work of Harry Markowitz on diversification and modern portfolio theory. Sharpe, Markowitz and Merton Miller jointly received the 1990 Nobel Memorial Prize in Economics for this contribution to the field of financial economics. Fischer Black (1972) developed another version of CAPM, called Black CAPM or zero-beta CAPM, that does not assume the existence of a riskless asset. This version was more robust against empirical testing and was influential in the widespread adoption of the CAPM.
Usage
The CAPM is used to calculate the amount of return that investors need to realize to compensate for a particular level of risk. It subtracts the risk-free rate from the expected rate and weighs it with a factor – beta – to get the risk premium. It then adds the risk premium to the risk-free rate of return to get the rate of return an investor expects as compensation for the risk. The CAPM formula is expressed as follows:
r = Rf + beta (Rm – Rf) + Alpha
Therefore,
Alpha = R – Rf – beta (Rm-Rf)
Where:
R represents the portfolio return
Rf represents the risk-free rate of return
Beta represents the systematic risk of a portfolio
Rm represents the market return, per a benchmark
For example, assuming that the actual return of the fund is 30, the risk-free rate is 8%, beta is 1.1, and the benchmark index return is 20%, alpha is calculated as:
Alpha = (0.30-0.08) – 1.1 (0.20-0.08) = 0.088 or 8.8%
The result shows that the investment in this example outperformed the benchmark index by 8.8%.
The alpha of a portfolio is the excess return it produces compared to a benchmark index. Investors in mutual funds or ETFs often look for a fund with a high alpha in hopes of getting a superior return on investment (ROI).
The alpha ratio is often used along with the beta coefficient, which is a measure of the volatility of an investment. The two ratios are both used in the Capital Assets Pricing Model (CAPM) to analyze a portfolio of investments and assess its theoretical performance.
To see CAPM in action in terms of calculate WACC, see here for an example: finbox.com
Further reading
en.wikipedia.org
Economic Calendar Events: FOMC, CPI, and moreThis script plots major events from the Economic Calendar that often correspond to major pivot points in various markets. It also includes built-in logic to retroactively adjust larger time intervals (i.e. greater than 1 hour) to be correctly aligned with the interval during which the event occurred.
Events are taken from the Economic Calendar and will be updated periodically at the following library:
The above library can be used to conveniently access date-related data for major Meetings, Releases, and Announcements as integer arrays, which can be used in other indicators. Currently, it has support for the following events:
FOMC Meetings
The FOMC meets eight times a year to determine the course of monetary policy. The FOMC's decisions are based on a review of economic and financial developments and its assessment of the likely effects of these developments on the economic outlook.
FOMC Minutes
The FOMC minutes are released three weeks after each FOMC meeting. The minutes provide a detailed account of the FOMC's discussion of economic and financial developments and its assessment of the likely effects of these developments on the economic outlook.
Producer Price Index (PPI) Releases
The Producer Price Index (PPI) measures changes in the price level of goods and services sold by domestic producers. The PPI is a weighted average of prices of a basket of goods and services, such as transportation, food, and medical care. PPI is a leading indicator of CPI.
Consumer Price Index (CPI) Releases
The Consumer Price Index (CPI) measures changes in the price level of goods and services purchased by households. The CPI is a weighted average of prices of a basket of consumer goods and services, such as transportation, food, and medical care. CPI is one of the most widely used measures of inflation.
Consumer Sentiment Index (CSI) Releases
The University of Michigan's Consumer Sentiment Index (CSI) is a measure of consumer attitudes about the economy. The CSI is based on a monthly survey of U.S. households and reflects the consumers' assessment of present and future economic conditions. The CSI is a leading indicator of consumer spending, which accounts for about two-thirds of U.S. economic activity.
Consumer Confidence Index (CCI) Releases
The Consumer Confidence Index is a survey that measures how optimistic or pessimistic consumers are regarding their expected financial situation.
Non-Farm Payroll (NFP) Releases
The Non-Farm Payroll (NFP) is a measure of the change in the number of employed persons, excluding farm workers and government employees. The NFP is a leading indicator of consumer spending, which accounts for about two-thirds of U.S. economic activity.
Financial MetricsGives a sneak peak into some of the important financial ratios described below:
1. P/E : price to earnings ratio (Green when P/E<15)
2. PEG: Price to earnings growth ratio (Green when PEG<1)
3. P/S: Price to sales ratio (Green when P/S<2)
4. EV/FCF: Enterprise Value to Free Cashflow ratio
5. OPM: Operating Profit Margin % (Green when OPM>15%)
6. D/E: Debt to equity ratio (Green when D/E<1)
7. ROE: Return on equity % (Green when ROE>15%)
8. Div_Yield: Dividend yield
Disclaimer: All the limits defined are based on the widely accepted general values, but are subjective to particular sector or group of stocks. For example IT stocks command higher valuation than cyclical stocks like metal. So Compare with other stocks of the same sector to reach any conclusion.
Recession And Bull Run WarningThis script uses 2 moving averages of Unemployment and projects a possible recession period or bull run period.
A Red Dot means a recession could've started or is coming soon - markets could possibly fall for the next few months.
A Green Dot means a bull run could begin following a recessionary period - markets could possibly rally for the next few months.
Using Unemployment to define recessionary periods has been highly accurate and has very often predicted many downturns and bull runs way before they occurred, as history suggests of course.
Have fun with this indicator!
HOTW/LOTW frequencyThis indicator plots a table of the frequency of which day the week the high-of-the-week and the-low-of-the week are formed.
You will need to manually update the symbol open days in the settings (FX = 5, crypto = 7)
Make sure you are on the Daily timeframe to get the correct results
Invest-Long : Script for quick checks before investingA simple script to verify RSI, SMAs, VWMA, and Pivots on Daily, Weekly, and Monthly time frames.
In case if you are not interested in SMA's or want to add different cheks -- simply copy the script to local and edit.
Happy investing.
Add the script to any chart and table values remain the same irrespective of current chart resolution, as it checks on Daily, Weekly, and Monthly time frames.
The table has multiple columns.
1st column checks on RSI value on all 3 timeframes. Ideally, look for all green and D>W>M
2nd Column: Check current Close is above 20 SMA and 50 SMA on Daily / Weekly / Monthly time frames
3rd Column: Check SMA 13> SMA 34, SMA 34 > SMA 55 and SMA 20 > SMA 50 on Daily / Weekly time frames
4th Column: Check Current close is above Weekly Pivot and Monthly Pivot. And also verify Close is above 4 Week High.
5th Column: Verify Close is above Daily VWMA. Also Daily VWMA is > Weekly VWMA and Weekly > Monthly.
// Similarly you can add more checks based on different time frames
Feel free to trouble me incase if need help.
Crypto Map Dashboard v1.0🔰Overview
Charts are an essential part of working with data, as they are a way to condense large amounts of data into an easy to understand format. Visualizations of data can bring out insights to someone looking at the data for the first time, as well as convey findings to others who won’t see the raw data. There are countless chart types out there, each with different use cases. Often, the most difficult part of creating a data visualization is figuring out which chart type is best for the task at hand.
What are the types of metrics, features, or other variables that you plan on plotting? Although it depended on some multiple factors!
But my choices of the chart type for this Crypto datas was Pie chart or Donut char for crypto dominances ,and Colum (Bar) chart for Total MarketCaps .
The audiences that I plan on presenting this for them could be all tradingviewrs , especially crypto lovers ,or those who just aim to have an initial exploration for themselves ,like me!
so this indicator mostly could be an educational indicator script for pine coders !
We can use the " Crypto Map Dashboard " indicator to Get an quick overview of the crypto market and monitor where the smart money Flow changing by comparing the dominances and totals Caps .
In general, it consists of 4 parts:
✅1 =>> Table1 : If you like to see and compare and monitor the changes of dominances of (Bitcoin, Ethereum, Usdt , Usdc , etc.) and their market cap in different times you can see the table on The upper-right corner.
✅2 =>> Table2: Also, in the table lower-right corner, you can see the changes of the totals(Total, Total2 , Total3 and TotalDefi) in the same time periods.
✅3 =>> pie chart or donut chart: By viewing this , you understand better about Table1 Datas, that it depicts exactly how Dominance is distributed and specialized.
✅4 =>> column chart (bar chart) : And in the last you can clearly compare the total marketcaps and see how far they are from their ATHs.
You also can even notice the entry and exit of liquidity from the crypto market!
I must also mention that I am definitely still a beginner compared to more experienced pine coders, and there may be some bugs in my codes and calculations, but I am an open person and I welcome your comments ,Also Let me know if you have any questions.
Lots of Love to all tradingviewers and pineCoder ,Cheers!💚❤️💙
YOY[TV1]Year-to-year comparison is a popular and effective way to evaluate a company's financial performance and investment performance.
Any measurable event that repeats yearly can be compared based on YoY.
As a rule, the indicator YoY (year to year) is the number of percentages indicating an increase or regression in relation to the future or past period.
For example, you can compare WM2NS using the YOY (Year to Year) method.
The Offset argument sets the data comparison period. For daily, weekly and monthly timeframes, if Offset is set to 0, it will be determined automatically.
Сравнение Год к году - популярный и эффективный способ оценки финансовых показателей компании и эффективность инвестиций.
Любое измеримое событие, которое повторяется ежегодно можно сравнить на основе YoY.
Как правило, показателем YoY (year to year) является количество процентов указывающее на прирост или регресс по отношению к будущему или прошлому периоду.
Например, вы можете сравнить WM2NS (эмиссию доллара) с помощью метода YOY (Год к году).
Допустим, в 2021 году вы эмитировали А долларов, а в 2022 вы эмитировали Б долларов
Итак итоговой формулой будет: ((Б - А) / А) * 100
Аргумент Offset устанавливает период сравнения данных. Для дневного, недельного и месячного таймфрейма, если Offset установлен в 0, будет определен автоматически.
Benjamin Graham Net-Net AnalyserA simple indicator that displayers as a table, telling you whether or not the stock you have selected has a current price that is less than 67% of the company's net current asset value per share (NCAVPS) at its last reporting period (FQ, FY, TTM).
Benjamin Graham uses this 67% rule to decide whether or not a stock is significantly undervalued, and studies have shown that investing in companies whose share prices are less than 67% of their NCAVPS can be highly profitable, and will beat markets in the long run.
Feel free to use as you please or repurpose the code for your own projects.
Volume Price and FundamentalsVolume Price and Fundamentals indicators contains 4 exponential moving averages based upon Fibonnaci numbers as period (8, 21, 55 & 144) with crossovers and crossunders.
It also contain a table for volume and 50 Day Avg. Volume, Relative volume, Change in Volume, Volume Value, Up-Down Closing Basis days in last 50 days, Volume ratio (U/D Ratio) on last 50-day Up / Down days and along with fundamental analysis table with various Fundamental Analysis parameters and QoQ & YoY comparison basis for better investment decision making.
Chop and explode (ps5)Description : This is a renovated version of my previous mod that was based on the original script from fhenry0331.
Added are:
a data cleaning function
a seasonal random index function
an updated scaler and
a signalling procedure.
-
The following description is moved here from the old script.
The purpose of this script is to decipher chop zones from runs/movement/explosion spans. The chop is RSI movement between 40 and 60. Tight chop is RSI movement between 45 and 55. There should be an explosion after RSI breaks through 60 (long) or 40 (short). Tight chop bars are colored gray, a series of gray bars indicates a tight consolidation and should explode imminently. The longer the chop the longer the explosion will go for. The tighter the better. Loose chop (jig saw/gray bars on the silver background) will range between 40 and 60. The move begins with green and red bars.
Couple it with your trading system to help stay out of chop and enter when there is a movement.
FCF ROCEFree cash flow yield is a financial solvency ratio that compares the free cash flow per share a company is expected to earn against its market value per share. The ratio is calculated by taking the free cash flow per share divided by the current share price. Free cash flow yield is similar in nature to the earnings yield metric, which is usually meant to measure GAAP (generally accepted accounting principles) earnings per share divided by share price.
FCF roce is the modified roce that uses free cash flow instead of ebit
Kalman Gain Parameter MechanicsFrequently asked question is to explain how Gain parameter works in kalman funtion. This script serves as a visual representation of Gain parameter of Kalman function used in HMA-Kalman & Trendlines script. (The function creator's name was misspeled in that script as Kahlman)
To see better results set your Chart's timeframe to Daily.
BTC Twitter SentimentBTC Twitter Sentiment - shows the total numbers of all negative, neutral and positive Bitcoin related tweets.
On default settings, the tweets are plotted in red (negative) white (neutral) as well as green (positive). The three charts are stacked so the total number of tweets is easily discernible.
Furthermore, there's an optional smoothing setting in the options.
The Twitter Sentiment data is provided daily by IntoTheBlock; Since data is only updated once a day the graph might look chunky on lower timeframes, even with smoothing.
Reserve Balances with Federal Reserve BanksReserve balances with Federal Reserve Banks are the difference between "total factors supplying reserve funds" and "total factors, other than reserve balances, absorbing reserve funds." This item includes balances at the Federal Reserve of all depository institutions that are used to satisfy reserve requirements and balances held in excess of balance requirements. It excludes reserves held in the form of cash in bank vaults, and excludes service-related deposits
BTC Dominance Exclude Stablecoins(USDT, USDC, DAI)This index's goal is to show the true bitcoin dominance relative to other risky crypto assets, excluding the diluting effects of those ever-increasing stablecoin(USDT, USDC, DAI)'s market cap. In this index, we can see the BTC dominance has been solid increasing & construct bottom during recent fear/bear.
Xiaolai Chen
Sept 14th 2022