Range BreakerStrategy Description: Range Breaker
The Range Breaker strategy is a breakout trading strategy that aims to capture profits when the price of a financial instrument moves out of a defined range. The strategy identifies swing highs and swing lows over a specified lookback period and enters long or short positions when the price breaks above the swing high or below the swing low, respectively. It also employs stop targets based on a percentage to manage risk and protect profits.
Beginner's Guide:
Understand the concepts:
a. Swing High: A swing high is a local peak in price where the price is higher than the surrounding prices.
b. Swing Low: A swing low is a local trough in price where the price is lower than the surrounding prices.
c. Lookback Period: The number of bars or periods the strategy analyzes to determine swing highs and swing lows.
d. Stop Target: A predetermined price level at which the strategy will exit the position to manage risk and protect profits.
Configure the strategy:
a. Set the initial capital, order size, commission, and pyramiding as needed for your specific trading account.
b. Choose the desired lookback period to identify the swing highs and lows.
c. Set the stop target multiplier and stop target percentage as desired to manage risk and protect profits.
Backtest the strategy:
a. Set the backtest start date to analyze the strategy's historical performance.
b. Observe the backtesting results to evaluate the strategy's effectiveness and adjust the parameters if necessary.
Implement the strategy:
a. Apply the strategy to your preferred financial instrument on the TradingView platform.
b. Monitor the strategy's performance and adjust the parameters as needed to optimize its effectiveness.
Risk management:
a. Always use a stop target to protect your trading capital and manage risk.
b. Don't risk more than a small percentage of your trading capital on a single trade.
c. Be prepared to adjust the strategy or stop trading it if the market conditions change significantly.
Adjusting the Lookback Period and Timeframes for Optimal Strategy Performance
The Range Breaker strategy uses a lookback period to identify swing highs and lows, which serve as the basis for determining entry and exit points for long and short positions. By adjusting the lookback period and analyzing different timeframes, you can potentially find the best strategy configuration for each specific asset.
Adjusting the lookback period:
The lookback period is a critical parameter that affects the sensitivity of the strategy to price movements. A shorter lookback period will make the strategy more sensitive to smaller price fluctuations, resulting in more frequent trading signals. On the other hand, a longer lookback period will make the strategy less sensitive, generating fewer signals but potentially capturing larger price movements.
To optimize the lookback period for a specific asset, you can test different lookback values and compare their performance in terms of risk-adjusted returns, win rate, and other relevant metrics. Keep in mind that using an overly short lookback period may lead to overtrading and increased transaction costs, while an overly long lookback period may cause the strategy to miss profitable trading opportunities.
Analyzing different timeframes:
Timeframes refer to the duration of each bar or candlestick on the chart. Shorter timeframes (e.g., 5-minute, 15-minute, or 30-minute) focus on intraday price movements, while longer timeframes (e.g., daily, weekly, or monthly) capture longer-term trends. The choice of timeframe affects the number of trading signals generated by the strategy and the length of time each position is held.
To find the best strategy for each asset, you can test the Range Breaker strategy on different timeframes and analyze its performance. Keep in mind that shorter timeframes may require more active monitoring and management due to the increased frequency of trading signals. Longer timeframes, on the other hand, may require more patience as positions are held for extended periods.
Finding the best strategy for each asset:
Every asset has unique price characteristics that may affect the performance of a trading strategy. To find the best strategy for each asset, you should:
a. Test various lookback periods and timeframes, observing the strategy's performance in terms of profitability, risk-adjusted returns, and win rate.
b. Consider the asset's historical price behavior, such as its volatility, liquidity, and trend-following or mean-reverting tendencies.
c. Evaluate the strategy's performance during different market conditions, such as bullish, bearish, or sideways markets, to ensure its robustness.
d. Keep in mind that each asset may require a unique set of strategy parameters for optimal performance, and there may be no one-size-fits-all solution.
By experimenting with different lookback periods and timeframes, you can fine-tune the Range Breaker strategy for each specific asset, potentially improving its overall performance and adaptability to changing market conditions. Always practice proper risk management and be prepared to make adjustments as needed.
Remember that trading strategies carry inherent risk, and past performance is not indicative of future results. Always practice proper risk management and consider your own risk tolerance before trading with real money.
Fundamental Analysis
Fierytrading: Volatility DepthDear Tradingview community,
I'd like to share one of my staple indicators with you. The volatility depth indicator calculates the volatility over a 7-day period and plots it on your chart.
This indicator only works for the DAILY chart on BTC/USD.
Colors
I've color coded the indicator as follows:
- Red: Extreme Volatility
- Orange: High Volatility
- Yellow: Normal Volatility
- Green: Low Volatility
Red: extreme changes in price. Often during local tops and bottoms.
Orange: higher than average moves in price. Often before or after a "red" period. Often seen in the middle of bear or bull markets.
Yellow: normal price action. Often seen during early stage bull-markets and late stage bear-markets.
Green: very low price movement. Often during times of indecision. Once this indicator becomes green, you can expect a big move in either direction. Low volatility is always followed by high volatility.
In a long-term uptrend, a green period often signals a bullish break out. In a long-term downtrend it often signals a bearish break out.
How to use
Save the indicator and apply it to your chart. You can change the length in the settings, but it's optimized for 7 days, so no need to change it.
I've build in alerts for all 4 different volatility periods. In most cases, the low volatility alert is enough.
Good luck!
Rule of 40The rule of 40 is a popular metric for measuring the quality of SaaS companies. It measures growth and profitability. Companies are considered good if this sum is above 40.
It is the sum of the year over year sales growth and profit margin.
Rule of 40 = YoY sales growth + profit margin
Cobra's CryptoMarket VisualizerCobra's Crypto Market Screener is designed to provide a comprehensive overview of the top 40 marketcap cryptocurrencies in a table\heatmap format. This indicator incorporates essential metrics such as Beta, Alpha, Sharpe Ratio, Sortino Ratio, Omega Ratio, Z-Score, and Average Daily Range (ADR). The table utilizes cell coloring resembling a heatmap, allowing for quick visual analysis and comparison of multiple cryptocurrencies.
The indicator also includes a shortened explanation tooltip of each metric when hovering over it's respected cell. I shall elaborate on each here for anyone interested.
Metric Descriptions:
1. Beta: measures the sensitivity of an asset's returns to the overall market returns. It indicates how much the asset's price is likely to move in relation to a benchmark index. A beta of 1 suggests the asset moves in line with the market, while a beta greater than 1 implies the asset is more volatile, and a beta less than 1 suggests lower volatility.
2. Alpha: is a measure of the excess return generated by an investment compared to its expected return, given its risk (as indicated by its beta). It assesses the performance of an investment after adjusting for market risk. Positive alpha indicates outperformance, while negative alpha suggests underperformance.
3. Sharpe Ratio: measures the risk-adjusted return of an investment or portfolio. It evaluates the excess return earned per unit of risk taken. A higher Sharpe ratio indicates better risk-adjusted performance, as it reflects a higher return for each unit of volatility or risk.
4. Sortino Ratio: is a risk-adjusted measure similar to the Sharpe ratio but focuses only on downside risk. It considers the excess return per unit of downside volatility. The Sortino ratio emphasizes the risk associated with below-target returns and is particularly useful for assessing investments with asymmetric risk profiles.
5. Omega Ratio: measures the ratio of the cumulative average positive returns to the cumulative average negative returns. It assesses the reward-to-risk ratio by considering both upside and downside performance. A higher Omega ratio indicates a higher reward relative to the risk taken.
6. Z-Score: is a statistical measure that represents the number of standard deviations a data point is from the mean of a dataset. In finance, the Z-score is commonly used to assess the financial health or risk of a company. It quantifies the distance of a company's financial ratios from the average and provides insight into its relative position.
7. Average Daily Range: ADR represents the average range of price movement of an asset during a trading day. It measures the average difference between the high and low prices over a specific period. Traders use ADR to gauge the potential price range within which an asset might fluctuate during a typical trading session.
Utility:
Comprehensive Overview: The indicator allows for monitoring up to 40 cryptocurrencies simultaneously, providing a consolidated view of essential metrics in a single table.
Efficient Comparison: The heatmap-like coloring of the cells enables easy visual comparison of different cryptocurrencies, helping identify relative strengths and weaknesses.
Risk Assessment: Metrics such as Beta, Alpha, Sharpe Ratio, Sortino Ratio, and Omega Ratio offer insights into the risk associated with each cryptocurrency, aiding risk assessment and portfolio management decisions.
Performance Evaluation: The Alpha, Sharpe Ratio, and Sortino Ratio provide measures of a cryptocurrency's performance adjusted for risk. This helps assess investment performance over time and across different assets.
Market Analysis: By considering the Z-Score and Average Daily Range (ADR), traders can evaluate the financial health and potential price volatility of cryptocurrencies, aiding in trade selection and risk management.
Features:
Reference period optimization, alpha and ADR in particular
Source calculation
Table sizing and positioning options to fit the user's screen size.
Tooltips
Important Notes -
1. The Sharpe, Sortino and Omega ratios cell coloring threshold might be subjective, I did the best I can to gauge the median value of each to provide more accurate coloring sentiment, it may change in the future.
The median values are : Sharpe -1, Sortino - 1.5, Omega - 20.
2. Limitations - Some cryptos have a Z-Score value of NaN due to their short lifetime, I tried to overcome this issue as with the rest of the metrics as best I can. Moreover, it limits the time horizon for replay mode to somewhere around Q3 of 2021 and that's with using the split option of the top half, to remain with the older cryptos.
3. For the beginner Pine enthusiasts, I recommend scimming through the script as it serves as a prime example of using key features, to name a few : Arrays, User Defined Functions, User Defined Types, For loops, Switches and Tables.
4. Beta and Alpha's benchmark instrument is BTC, due to cryptos volatility I saw no reason to use SPY or any other asset for that matter.
Rainbow IndicatorName of the indicator: Rainbow indicator
A brief description of the indicator:
Using this indicator, you can see the "margin of safety" for opening a position in shares of fundamentally strong companies with an acceptable P/E level, as well as the price range for closing a position.
The background to the creation of the indicator:
I got the idea to create this indicator thanks to the concept of the "margin of safety", which was invented by the father of value investing - Benjamin Graham. According to his idea, it is reasonable to buy shares of a company only when the price offered by the market is lower than the "intrinsic value" calculated on the basis of financial statements. The value of this difference is the "margin of safety”. At the same time, the indicator does not copy Graham's idea but develops it relying on my own methodology.
So, according to Graham, the "margin of safety" is a good discount to the intrinsic value of the company. That is, if a company's stock is trading at prices that are well below the company's intrinsic value (on a per-share basis), it's a good opportunity to consider buying it. In this case, you will have a certain margin of safety in case the company is in financial distress and its stock price goes down. Accordingly, the greater the discount, the better.
When it comes to the intrinsic value of a company, there are many approaches to determining it - from calculating the Price-to-book value financial ratio to the discounted cash flow method. As for my approach, I am not trying to find the cherished intrinsic value, but I am trying to understand how fundamentally strong the company is in front of me, and in how many years the investment in it will pay off. To determine fundamental strength, I use the appropriate Fundamental Strength Indicator . To estimate the payback period, I use the P/E ratio (*). If I am satisfied with both of these indicators, I move on to the Rainbow Indicator.
(*) If you want to learn more about the P/E ratio, I suggest reading my two articles on TradingView:
Price / Earnings: Interpretation #1
Price/Earnings: amazing interpretation #2
Indicator calculation methodology:
The Rainbow indicator starts with a simple moving average of one year (this is the thick red line in the center). Hereinafter a year will mean the last 252 trading days.
Applying a moving average of this length - is a good way to smooth out sharp price fluctuations which can happen during a year as much as possible, keeping the trend direction as much as possible. Thus, the moving average becomes for me the center of fluctuations of the imaginary pendulum of the market price.
Then the deviations are calculated from the center of fluctuations. To do this, a certain amount of earnings per share is subtracted from and added to the moving average. This is the diluted EPS of the last year.
Deviations with a "-" sign form the Lower Rainbow of four colors:
- The blue spectrum of the lower rainbow begins with a deflection of -4 EPS and ends with a deflection of -8 EPS.
- Green spectrum of the lower rainbow begins with a deflection of -8 EPS and ends with a deflection of -16 EPS.
- The orange spectrum of the lower rainbow begins with a deflection of -16 EPS and ends with a deflection of -32 EPS.
- Red spectrum of the lower rainbow begins with a deflection of -32 EPS and goes to infinity.
The Lower Rainbow is used to determine the price ranges that can be considered for buying stocks. It is in the spectra of the Lower Rainbow that the very "margin of safety" according to my methodology is located. The Lower Rainbow has the boundaries between the spectra as a solid line . And only the red spectrum of the Lower Rainbow has only one boundary.
Deviations with a "+" sign form the Upper Rainbow of four similar colors:
- The red spectrum of the upper rainbow begins with a deflection of 0 EPS and ends with a deflection of +4 EPS.
- The orange spectrum of the upper rainbow begins with a deflection of +4 EPS and ends with a deflection of +8 EPS.
- Green spectrum top rainbow begins with a deflection of +8 EPS and ends with a deflection of +16 EPS.
- The blue spectrum of the upper rainbow begins with a deflection of +16 EPS and goes to infinity.
The Upper Rainbow is used to determine the price ranges that can be considered for selling stocks already purchased. The top rainbow has boundaries between the spectra in the form of crosses . And only the blue spectrum of the upper rainbow has only one boundary.
The presence of the Empty Area (the size of 4 EPS) above the Lower Rainbow creates some asymmetry between the two rainbows - the Lower Rainbow looks wider than the Upper Rainbow. This asymmetry is deliberate because the market tends to fall much faster and deeper than it grows . Therefore, a wider Lower Rainbow is conducive to buying stocks at a good discount during a period of massive "sell-offs.
The situation, when the Lower Rainbow is below the center of fluctuations (the thick red line) and the Upper Rainbow, is above the center of fluctuations is called an Obverse . It is only possible to buy a stock in an Obverse situation .
The situation when the Lower Rainbow is above the center of fluctuations and the Upper Rainbow is below the center of fluctuations is called Reverse . In this situation, the stock cannot be considered for purchase , according to my approach.
Selling a previously purchased stock is possible in both situations: Reverse and Obverse. After loading the indicator, you can see a hint next to the closing price - Reverse or Obverse now.
Due to the fact that the size of the deviation from the center of fluctuation depends on the size of the diluted EPS, several important conclusions can be made:
- The Obverse situation is characteristic of companies that show a profit over the last year.
- The Reverse situation is typical for companies that show a loss over the last year.
- An increase in the width of both rainbows in the Obverse situation tells us about an increase in profits for the company.
- A decrease in the width of both rainbows in the Obverse situation tells us about a decrease in the company's profits.
- An increase in the width of both rainbows in the Reverse situation tells us about an increase in the company's losses.
- A decrease in the width of both rainbows in the Reverse situation tells us about a decrease in the company's losses.
- The higher the profit level of the company, the greater your "margin of safety" should be. This will provide the necessary margin of safety in case you go into a cycle of declining financial results. The appropriate width of the Lower Rainbow will just create this "margin".
- Increased profits in the company (after buying its stock) will allow you to stay in position longer by widening the Upper Rainbow.
- A decrease in profits in the company (after buying its stock) will allow you to close your position more quickly by narrowing the Upper Rainbow.
Conditions for opening and closing positions:
So, the Lower Rainbow has four differently colored spectra: blue, green, orange, and red. Each one highlights the desired range of prices acceptable for buying in an Obverse situation. The blue spectrum is upper with respect to the green spectrum, and the green spectrum is lower with respect to the blue spectrum, etc.
- If the current price is in the Blue Spectrum of the Lower Rainbow, that is a reason to consider that company for buying the first portion (*) of the stock.
- If the current price has fallen below (into the Green Spectrum of the Lower Rainbow), that is a reason to consider this company to buy a second portion of the stock.
- If the current price has fallen below (into the Orange Spectrum of the Lower Rainbow), it is a reason to consider this company to buy a third portion of the stock.
- If the current price has fallen below (into the Red Spectrum of the Lower Rainbow), that is a reason to consider that company to buy a fourth portion of the stock.
(*) The logic of the Rainbow Indicator implies that no more than 4 portions of one company's stock can be purchased. One portion refers to the number of shares you can consider buying at the current price (depending on your account size and personal diversification ratio - see information below).
The Upper Rainbow also has four differently colored spectra: blue, green, orange, and red. Each of them highlights the appropriate range of prices acceptable for closing an open position.
- If the current price is in the red spectrum of the Upper Rainbow, I close one portion of an open position bought in the red spectrum of the Lower Rainbow.
- If the current price is in the orange spectrum of the Upper Rainbow, I close one portion of an open position bought in the orange spectrum of the Lower Rainbow.
- If the current price is in the green spectrum of the Upper Rainbow, I close one portion of an open position bought in the green spectrum of the Lower Rainbow.
- If the current price is in the blue spectrum of the Upper Rainbow, I close one portion of an open position bought in the blue spectrum of the Lower Rainbow.
This position-closing logic applies to both the Obverse and Reverse situations. In both cases, the position is closed in portions in four steps. However, there are 3 exceptions to this rule when it is possible to close an entire position in whole rather than in parts:
- If there is a Reverse situation and the current price is above the thick red line.
- If I decide to invest in another company and I do not have enough available cash to purchase the necessary number of portions.
- If I find out about events that pose a real threat to the further existence of the company (for example, a bankruptcy filing), I can close the position earlier, without waiting for the price to hit the corresponding Upper Rainbow spectrum.
So, the basic scenario of opening and closing a position assumes the gradual purchase of shares in 4 stages and their gradual sale in 4 stages. However, there is a situation where one of the stages is skipped in the case of buying shares and in the case of selling them. For example, because the Fundamental Strength Indicator and the P/E ratio became acceptable for me only at a certain stage (spectrum) or the moment was missed for a transaction due to technical reasons. In such cases, I buy or sell more than one portion of a stock in the spectrum I am in. The number of additional portions will depend on the number of missed spectra. For example, if I have no position in the stock of the company in question, all conditions for buying the stock have been met, and the current price is in the orange spectrum of the Lower Rainbow, I can buy three portions of the stock at once (for the blue, green, and orange spectrum). I will sell these three portions in the corresponding Upper Rainbow spectra (orange, green, and blue). However, if for some reason the orange spectrum of the Upper Rainbow was missed, and the current price is in the green spectrum - I will sell two portions of the three (in the green spectrum). I will sell the last, third portion only when the price reaches the blue spectrum of the Upper Rainbow.
The Rainbow Indicator also helps calculate the number of shares that can be considered for purchase at the current price position in the Lower Rainbow spectra. To do this, you need to go to the indicator settings.
+ Cash in - Cash out +/- Closed profit/loss + Dividends - Fees - Taxes
Here I indicate the amount of funds deposited to my account, withdrawn from it, profit/loss on closed positions, dividends credited to the account, and taxes deducted from the account.
Diversification coefficient
The diversification coefficient determines how diversified I want my portfolio to be. For example, a diversification coefficient of 20 means that I plan to buy 20 share portions of different companies, but no more than 4 portions per company (based on the number of Lower Rainbow spectra).
The cost of purchased shares of this company (fees excluded)
Here I specify the amount of already purchased shares of the company in question in the currency of my portfolio. For example, if at this point in time, I have purchased 1000 shares at $300 per share, and my portfolio is expressed in $, I enter - $300,000.
The cost of all purchased shares in the portfolio (fees excluded)
Here I enter the amount of all purchased shares for all companies in the currency of my portfolio (without commissions spent on the purchase). This is necessary to determine the amount of available funds available to purchase shares.
After entering all the necessary data, I go to the checkbox, by checking it I confirm that the company in question has been studied with the Fundamental Strength Indicator and the P/E ratio, and their values are satisfactory to me. No calculation is performed without the checkbox checked. This is done intentionally because the application of the Rainbow Indicator for stock acquisition purposes is possible only after studying the Fundamental Strength of the company and an acceptable P/E value.
Next, I click "Ok" and get the calculation in the form of a table on the left.
Free cash in the portfolio
This is the amount of free cash available to purchase stocks. Please note that the price of the stock and the funds in your portfolio must be denominated in the same currency. On TradingView, you can choose which currency to display the stock price in.
Cash amount for one portion
The amount of cash needed to buy one portion of a stock. Depends on the diversification ratio entered.
Potential portions amount
Number of portions, available for purchase at the current price. Can be a fractional number.
Cash amount to buy
The amount of cash needed to buy portions available for purchase at the current price.
Shares amount to buy
Number of shares in portions available for purchase at the current price.
The table also contains additional information in the form of the current value of the company's market capitalization and P/E ratio.
Mandatory requirements for using the indicator:
- works only on a daily timeframe;
- the indicator is only applicable to shares of public companies;
- quarterly income statements for the last year are required;
- an acceptable for you P/E ratio is required to consider the company's stock for purchase;
- the Rainbow Indicator only applies in tandem with the Fundamental Strength Indicator. To consider a company's stock for purchase, you need confirmation that the company is fundamentally strong.
What is the value of the Rainbow Indicator?
- clearly demonstrates a company's profit and loss dynamics;
- shows the price ranges that can be used to open and close a position;
- takes into account the principle of gradual increase and decrease of a position;
- allows calculating the number of shares to be purchased;
- shows the current value of the P/E ratio;
- shows the current capitalization of the company.
Example:
As an example, consider the situation with NVIDIA Corporation stock (ticker - NVDA).
September 02, 2022:
Fundamental Strength Indicator - 11.46 (fundamentally strong company).
P/E - 39.58 (acceptable to me).
Current Price - $136.47 (is in the Orange Spectrum of the Lower Rainbow).
Situation - Obverse.
The basic conditions for buying this company's stock are met. The Rainbow Indicator settings are filled out as follows:
The table to the left of the Rainbow Indicator shows how many shares are possible to buy in the Orange Spectrum of Lower Rainbow at the current price = 10 shares. This corresponds to 2.73 portions.
To give you an example, I buy 10 shares of NVDA at $136.47 per share.
October 14, 2022:
NVDA's stock price has moved into the red spectrum of the Lower Rainbow.
The Fundamental Strength Indicator is 10.81 (fundamentally strong company).
P/E is 35.80 (an acceptable level for me).
Current Price - $112.27 (is in the Red Spectrum of the Lower Rainbow).
Situation - Obverse.
The basic conditions for buying this company's stock are still met. The Rainbow Indicator settings are populated as follows:
The table to the left of the Rainbow Indicator shows how many shares are possible to buy in the Lower Rainbow Red Spectrum at the current price (5 shares). This corresponds to 1.12 portions.
To give you an example, I buy 5 shares of NVDA at $112.27 per share. A total of 3.85 portions were purchased, which is the maximum possible number of portions at the current price level. The remainder in the form of 0.15 portions can be purchased only at a price level below $75 per share.
January 23, 2023:
The price of NVDA stock passes through the red spectrum of the Upper Rainbow and stops in the orange spectrum. As an example, I sell 5 shares bought in the red spectrum of the Lower Rainbow, for example at $180 per share (+60%). And also a third of the shares bought in the orange spectrum, 3 shares out of 10, for example at $190 a share (+39%). That leaves me with 7 shares.
January 27, 2023:
NVDA's stock price has continued to rise and has moved into the green spectrum of the Upper Rainbow. This is a reason to close some of the remaining 7 shares. I divide the 7 shares by 2 and round up to a whole number - that's 4 shares. For my example, I sell 4 shares at $199 a share (+46%). Now I am left with 3 shares of stock.
February 02, 2023:
The price of NVDA stock moves into the blue spectrum of the Upper Rainbow, and I close the remaining 3 shares, for example, at $216 per share (+58%). The entire position in NVDA stock is closed.
As you can see, the Fundamental Strength Indicator and the P/E ratio were not used in the process of closing the position. Decisions were made only on the basis of the Rainbow Indicator.
As another example, let's look at the situation with the shares of Papa Johns International, Inc. (ticker PZZA).
November 01, 2017:
Fundamental Strength Indicator - 13.22 points (fundamentally strong company).
P/E - 21.64 (acceptable to me).
Current Price - $62.26 (is in the blue spectrum of the Lower Rainbow).
Situation - Obverse.
The basic conditions for buying shares of this company are met. The settings of the Rainbow Indicator are filled as follows:
The table to the left of the Rainbow Indicator shows how many shares are possible to buy in the Lower Rainbow Blue Spectrum at the current price - 8 shares. This corresponds to 1 portion.
To give you an example, I buy 8 shares of PZZA at a price of $62.26.
August 8, 2018:
PZZA's share price has moved into the green spectrum of the Lower Rainbow.
The Fundamental Strength Indicator is a 9.83 (fundamentally strong company).
P/E is 16.07 (an acceptable level for me).
Current Price - $38.94 (is in the green spectrum of the Lower Rainbow).
Situation - Obverse.
The basic conditions for buying shares of this company are still met. The Rainbow Indicator settings are populated as follows:
The table to the left of the Rainbow Indicator shows how many shares are possible to buy in the Lower Rainbow Green Spectrum at the current price - 12 shares. This corresponds to 0.93 portions.
To give you an example, I buy 12 shares of PZZA at a price of $38.94. A total of 1.93 portions were purchased.
October 31, 2018:
PZZA's stock price moves into the Upper Rainbow red spectrum and is $54.54 per share. Since I did not have any portions purchased in the Lower Rainbow red spectrum, there is no closing part of the position.
February 01, 2019:
After a significant decline, PZZA's stock price moves into the orange spectrum of the Lower Rainbow at $38.51 per share. However, I am not taking any action because the company's Fundamental Strength on this day is 5.02 (a fundamentally mediocre company).
March 27, 2019:
PZZA's stock price passes the green and blue spectrum of the Upper Rainbow. This allowed to close the previously purchased 12 shares, for example, at $50 a share (+28%) and 8 shares at $50.38 a share (-19%).
Closing the entire position at once was facilitated by a significant narrowing in both rainbows. As we now know, this indicates a decline in earnings at the company.
Risk disclaimer:
When working with the Rainbow Indicator, keep in mind that the release of the Income statement (from which diluted EPS is derived) occurs some time after the end of the fiscal quarter. This means that the new relevant data for the calculation will only appear after the publication of the new statement. In this regard, there may be a significant change in the Rainbow Indicator after the publication of the new statement. The magnitude of this change will depend on both the content of the new statement and the number of days between the end of the financial quarter and the publication date of the statement. Prior to the publication date of the new statement, the latest actual data will be used for the calculations. Also, once again, please note that the Rainbow Indicator can only be used in tandem with the Fundamental Strength Indicator and the P/E ratio. Without these additional filters, the Rainbow Indicator loses its intended meaning.
The Rainbow Indicator allows you to determine the price ranges for opening and closing a position gradually, based on available data and the methodology I created. You can also use it to calculate the number of shares you can consider buying taking into account the position you already have. However, this Indicator and/or its description and examples cannot be used as the sole reason for buying or selling stocks or for any other action or inaction related to stocks.
Fundamental Strength IndicatorName of the indicator: Fundamental Strength Indicator
A brief description of the indicator:
Using this indicator, you can evaluate a company in terms of the strength of its financial performance and see how that score has changed over time.
The background to the creation of the indicator:
The main idea that inspired me to create this indicator is: " Even if you buy just 1 share of a company, treat it like buying the whole business ". However, when I need to evaluate the business of thousands of public companies traded on exchanges, there is an objective difficulty: it is very time-consuming. To solve this problem, I had to create a scoring system of the fundamental analysis of the company, embodied in this indicator.
What the indicator looks like:
- First, it is a Histogram with bars of three colors: green, orange, and red. The width of the histogram depends on the depth of data from the company statements. The more historical data, the wider the histogram over time.
The green color of the bars means that the company has been showing excellent financial results by the sum of the factors in that time period. According to my terminology, the company has a " strong foundation " during this period. Green corresponds to values between 8 and 15 (where 15 is the maximum possible positive value on the sum of the factors).
The orange color of the bars means that according to the sum of factors during this period the company demonstrated mediocre financial results, i.e. it has a " mediocre foundation ". Orange color corresponds to values from 1 to 7.
The red color of the bars means that according to the sum of factors in this period of time, the company demonstrated weak financial results, i.e. it has a " weak foundation ". The red color corresponds to values from -15 to 0 (where -15 is the maximum possible negative value on the sum of factors).
- Second, this is the Blue Line , which is the moving average of the Histogram bars over the last year (*). Averaging over the year is necessary in order to obtain a weighted estimate that is not subject to medium-term fluctuations. It is by the last value of the blue line that the actual Fundamental Strength of the company is determined.
(*) The last year means the last 252 trading days, including the current trading day.
- Third, these are operating, investing, and financing Cash Flows expressed in Diluted net income. These flows look like thick green, orange, and red lines, respectively.
- Fourth, this is the Table on the left, which shows the latest actual value of the Fundamental Strength and Cash Flows.
Indicator settings:
In the indicator settings, I can disable the visibility of the Histogram, Blue Line, Cash Flows (each separately), and Table. It helps to study each of the parameters separately. It is also possible to change the color, transparency, and thickness of lines.
Mandatory requirements for using the indicator:
- works only on a daily timeframe;
- only applies to shares of public companies;
- company financial statements for the last 4 quarters and more are required;
- it is necessary to have the data from the Balance sheet, Income statement, and Cash flow statement, required for the calculation.
If at least one component required for calculating the Fundamental Strength is missing, the message " no data to calculate the Fundamental Strength correctly " is displayed. In the same case, but for the operating cash flow, the message " no data to calculate the Operating Cash Flow correctly " is shown, and similarly for other flows.
What is the value of the Fundamental Strength Indicator:
- allows for a quantitative assessment of a company's financial performance in points (from -15 to 15 points);
- allows you to visually track how the company's financial performance has changed (positively/negatively) over time;
- allows to visually trace the movement of main cash flows over time;
- speeds up the process of selecting companies for your shortlist (if you are focused on financial results when selecting companies);
- allows you to protect yourself from investing in companies with weak and mediocre fundamentals.
Indicator calculation methodology:
Guided by the "Treat stock investments as buying the whole business" approach, you can imagine what kind of business an investor is interested in owning and simultaneously determine the input parameters for calculating the indicator.
(!) Here it is important to emphasize that the idea of a benchmark business for investment is a subjective notion, so be sure to check whether it coincides with your own opinion.
For me, a benchmark business is:
- A business that operates efficiently without diminishing the return on shareholders' investment. To assess the efficiency and profitability of a business, I use the following financial ratios (*): Diluted EPS and Return on Equity (ROE). The first two parameters for calculating the indicator are there.
- A business that scales sales and optimizes its costs. From this point of view, the following financial ratios are suitable: Gross margin, Operating expense ratio, and Total revenue. Plus three other metrics.
- A business that turns goods/services into cash quickly and does not fall behind on payments to suppliers. The following financial ratios will fit here: Days payable, Days sales outstanding, and Inventory to revenue ratio. These are three more metrics.
- A business that does not resort to significant accounts payable and shows financial strength. Here I use the following financial ratios: Current ratio, Interest coverage, and Debt to revenue ratio. These are the last three parameters.
(*) If you want to learn more about these financial ratios, I suggest reading my two articles on TradingView:
Financial ratios: digesting them together
What can financial ratios tell us?
Next, each of the parameters is assigned a certain number of points based on its last value or the position of that value relative to the annual maximum and minimum.
For example, if the Current ratio:
- greater than or equal to 2 (+1 point);
- less than or equal to 1 (-1 point);
- more than 1 but less than 2 (0 points).
Or for example, if Diluted EPS:
- near or above the annual high (+2 points);
- near the annual minimum and below (-2 points);
- between the annual maximum and minimum (0 points).
And so on with each of the parameters.
As a result, the maximum number of points a company can score is 15 points. The minimum number of points a company can score is -15 points. These levels are marked with horizontal dotted lines: the green line is for the maximum value, and the red line is for the minimum.
I track the number of points for each day of a company's life on a three-color Histogram. The resulting average value for the last year is on the Blue Line. For me, it is the last value of the Blue Line that determines - this is the actual Fundamental Strength of the company.
The business valuation model I created is more suitable for companies that produce goods or services, and where tangible assets play a significant role in the business. For example, when analyzing companies in the financial sector, you may see the message "no data to calculate the Fundamental Strength correctly". Many of them may simply be missing data that is used as input for the calculation: Inventory to revenue ratio, Days sales outstanding, etc.
Examples:
Below I will evaluate various companies using the Fundamental Strength Indicator.
Tesla, Inc.
The indicator shows that since 2020, Tesla Inc. has been steadily increasing its Fundamental Strength (from 3.27 in Q1 2020 to 12.79 in Q1 2023). This is noticeable both by the color change of the Histogram from orange to green and by the rising Blue Line. If you look in detail at what has been happening with the financials during this time, it's clear what meaningful work the company has done. Revenues have almost quadrupled. Earnings per share have increased 134 times. At the same time, total debt to revenue fell almost 10 times.
Keurig Dr Pepper Inc.
The company, formed in 2018 by the merger of Keurig Green Mountain and Dr Pepper Snapple Group, has failed to deliver outstanding financial results, causing its Fundamental Strength to fall from 4.63 in Q1 2018 to -0.53 in Q1 2023. During this period, the drop in diluted earnings per share was accompanied by higher debt and deteriorating liquidity.
Costco Wholesale Corporation
Wholesaler Costco has been surprisingly stable in its financial performance and with steady growth in both earnings and revenue. This is the reason why the Histogram bars are exceptionally green throughout the calculation of the indicator. The Fundamental Strength has not changed in three years and is high at 11 points.
As an additional filter, for example, when comparing two companies where all other conditions are equal - I use the dynamics of Cash Flows expressed in Diluted net income (*). These are the thick green, orange, and red lines over the Histogram.
Why do I use income as a unit of measure of Cash Flows? Because it is a good way to make the scale of indicator values the same for companies from different countries, with different currencies. It also allows you to use a single value scale for both Cash Flows and Fundamental Strength.
(*) If you want to learn more about Cash Flows, I suggest reading my two articles on TradingView:
Cash flow statement or Three great rivers
Cash flow vibrations
So, an additional filter shows the dynamics of Cash Flows over time.
To interpret the dynamics of Cash Flows, I pay attention to the following patterns:
- How the cash flows are positioned in relation to each other;
- In which zone each of the cash flows is located - in the positive or negative;
- What is the trend of each of the cash flows;
- How volatile each of the cash flows is.
As an example, let's look at several companies in order to interpret the dynamics of their Cash Flows.
John B. Sanfilippo & Son, Inc.
This is the most ideal situation for me: operating cash flow (green line) is above the other cash flows, investment cash flow (orange line) is near zero and practically unchanged, and financial cash flow (red line) is consistently below zero. This picture shows that the company lives off its operating cash flow, does not increase its debt, does not spend a substantial amount of money on expensive purchases, and retains (does not sell off) assets.
Parker Hannifin Corporation
With stable operating cash flow (green line), the company implements investment programs by raising additional funding. This is noticeable due to an increase in financial cash flow (red line) and a simultaneous decrease in investment cash flow (orange line) with a significant deepening into negative areas. Apparently, there is not enough operating cash flow to realize the planned investments. One has to wonder how sustainable a company can be if it invests in its development using borrowed funds without a subsequent increase in operating cash flow.
Schlumberger N. V.
The chaotic intertwining of cash flows outside of the Fundamental Strength range (-15 to 15) is indicative of the company's rich life, but to me, it is an indicator of high riskiness of its actions. And as we can see, Fundamental Strength has only begun to strengthen in the last year, when the external appearance of cash flow has normalized.
Risk disclaimer:
When working with the Fundamental Strength Indicator and the additional filter in the form of Cash Flows, you should understand that the publication of the Balance sheet, Income statement, and Cash flow statement takes place sometime after the end of the financial quarter. This means that new relevant data for the calculation will only appear after the publication of the new statements. In this regard, there may be a significant change in the values of the Indicator after the publication of new statements. The magnitude of this change will depend both on the content of the new statements and on the number of days between the end of the financial quarter and the publication date of the statements. Until the date of publication of the new statements, the latest relevant data will be used for calculations.
I would like to draw your attention to the fact that the calculation of Fundamental Strength and Cash Flows requires the availability of data for all parameters of the valuation model . It uses data that is exclusively available on TradingView (there is no reconciliation with other sources). If at least one parameter is missing, I switch to another company's analysis to continue using the indicator.
Thus, the Fundamental Strength Indicator and an additional filter in the form of Cash Flows make it possible to evaluate the financial results of the company based on the available data and the methodology I created. A simple visualization in the form of a three-color Histogram, a Blue line, and three thick Cash Flow lines significantly reduces the time for selecting fundamentally strong companies that fit the criteria of the selected model. However, this Indicator and/or its description and/or examples cannot be used as the sole reason for buying or selling stocks or for any other action or inaction related to stocks.
Buy the Blood (BTC Bottom Indicator), by Scipio Pro"Buy the blood." We all plan to do it, but when , exactly?
This indicator analyzes on-chain flow data from CEXs to detect when the masses panic. In other words, it reveals when Bitcoins likely move from weak hands into stronger hands. These moments typically mark bottoms.
A buy signal should be taken as "get ready to buy". After all, blood in the streets often means no rush; you may choose to buy days later if a wick partly fills or at the candle's low, depending on your risk appetite.
It's important to note this indicator is fed daily data, so it should be used on the daily timeframe and higher. Secondly, this indicator is purpose-built for Bitcoin. Don't worry, though -- if you get access to this indicator you also get access to any other available "Buy the Blood" indicator.
Last thing, while the script uses request.security, it makes sure the indicator does not repaint.
As always, use at your own risk. Using indicators is no substitute for using one's brain.
Financial Radar Chart by zdmreRadar chart is often used when you want to display data across several unique dimensions. Although there are exceptions, these dimensions are usually quantitative, and typically range from zero to a maximum value. Each dimension’s range is normalized to one another, so that when we draw our spider chart, the length of a line from zero to a dimension’s maximum value will be the similar for every dimension.
This Charts are useful for seeing which variables are scoring high or low within a dataset, making them ideal for displaying performance.
How is the score formed?
Debt Paying Ability
if Debt_to_Equity < %10 : 100
elif < 20% : 90
elif < 30% : 80
elif < 40% : 70
elif < 50% : 60
elif < 60% : 50
elif < 70% : 40
elif < 80% : 30
elif < 90% : 20
elif < 100% : 10
else: 0
ROIC
if Return_on_Invested_Capital > %50 : 100
elif > 40% : 90
elif > 30% : 80
elif > 20% : 70
elif > 10% : 50
elif > 5% : 20
else: 0
ROE
if Return_on_Equity > %50 : 100
elif > 40% : 90
elif > 30% : 80
elif > 20% : 70
elif > 10% : 50
elif > 5% : 20
else: 0
Operating Ability
if Operating_Margin > %50 : 100
elif > 30% : 90
elif > 20% : 80
elif > 15% : 60
elif > 10% : 40
elif > 0 : 20
else: 0
EV/EBITDA
if Enterprise_Value_to_EBITDA < 3 : 100
elif < 5 : 80
elif < 7 : 70
elif < 8 : 60
elif < 10 : 40
elif < 12 : 20
else: 0
FREE CASH Ability
if Price_to_Free_Cash_Flow < 5 : 100
elif < 7 : 90
elif < 10 : 80
elif < 16 : 60
elif < 18 : 50
elif < 20 : 40
elif < 22 : 30
elif < 30 : 20
elif < 40 : 15
elif < 50 : 10
elif < 60 : 5
else: 0
GROWTH Ability
if Revenue_One_Year_Growth > %20 : 100
elif > 16% : 90
elif > 14% : 80
elif > 12% : 70
elif > 10% : 50
elif > 7% : 40
elif > 4% : 30
elif > 2% : 20
elif > 0 : 10
else: 0
Top12/Bottom88 Weighted Ratio I multiplied the price of each of the top QQQ holdings by their percentage weight, and the bottom 88 holdings for a total of 100. I divide the top 12 weighted price by the bottom 88 weighted price. So I can see when money is flowing in and out of the megacaps. It needs to be updated every quarter, which I may need to do now....
Custom Group Financials [Technimentals]This script allows the user to build custom groups and combine the same financial data from 40 different symbols simultaneously and plot it data as a total or as an average.
By default, the top 40 symbols in the QQQ are used. Between them they account for the majority of the index. This is a good workaround for the lack of ETF financial data in TradingView.
This functions much like any other financial indicator. You choose the financial data and period:
FY = Financial Year
FQ = Financial Quarter
TTM = Trailing Twelve Months
Bare in mind that some data only exists in FY data.
Thanks to @LucF for writing most of this code!
Enjoy!
Joel Greenblatt Magic FormulaJoel Greenblatt Magic Formula. I always wanted to make this.
The Indicator shows 3 values.
ROC,EY,SUM.
ROC= Return On Capital.
EY=Earnings Yield
SUM= Addition of Two.
Formula:
ROC=EBIT / (Net Working Capital + Net Fixed Assets).
EY = EBIT / Enterprise value
Enterprise Value=(Market value of equity + Net Interest-bearing debt)
To implement the strategy, investors start by identifying a universe of stocks, typically large-cap or mid-cap companies that trade on a major stock exchange. Next, they rank the stocks based on their ROC and EY. The companies with the best combination of these two metrics are considered the best investments (based on this ranking).
For example, a stock that ranks 10th on EY and 99th on ROIC gets a value of 109. The two ranks are simply added together and all stocks are ranked on the sum of the two ranks. The stocks with the lowest values are best.
All credits to "The Little Book That Beats The Market" by Joel Greenblatt
The Magic Formula strategy is a stock selection method popularized by Joel Greenblatt’s book The Little Book That Beats the Market.
It involves ranking companies based on Two factors:
A high return on capital and A high Earnings Yield.
The companies with the best combination of these two metrics are considered the best investments. The strategy aims to find undervalued companies with strong financials that have the potential for high returns over the long term.
MTF Trendlines on chart_Pro[vn]Hello Traders .
👉This is an indicator of the trendlines in the analysis series with my trendlines.
- It statistics the upper and lower trend lines of the current Time Frame.
- Pine Script strategy draws pivot points and trendlines on the chart.
- This strategy allows the user to specify the interval to calculate the pivot points and the number of pivot points used to generate the trend lines.
- In the process of trading with the trendline, I see different timeframes showing each trendline differently, many times the trendline in the 15m frame has been broken but I don't know where the price is going, and it takes a lot of time to find support points, resistance to entry or take profit, So I came up with the idea of drawing different timeframes on the same chart in a specified timeframe, and I found it shortened the time to find support and resistance points in trading without having to switch back and forth between timeframes.
- For example, when the H1 trendline breaks downwards, we can determine a high probability that the price will be supported by the trendlines below it. for us to find entry points or exit orders effectively. Or when the price breaks the H1 trendline to go up, the chart shows us the trend lines above that broken H1 line so that we have a more effective entry or take profit point because it is a resistance zone....
- It can shows 7 pairs of trendlines during different times in the chart.
- each timeframe will display two trendlines, one up, and one down.When the price crosses a trendline, only one valid trendline is displayed, while the line crossed is not displayed.
- The upper trendline (down trend) is a red horizontal line, with the timeframe name and the value of its trendline, for example 4H(1.234) means timeframe = H4, the current value of the trendline is 1.234.
- The trendline below (up trend) is the blue horizontal line that also represents the same value as the line above.
- In the Settings section, up to 6 different timeframes can be selected to display those trendlines on the chart.
- Small timeframes such as m1, m3, m5 or D1 I leave the default (cannot be changed) in the 'Length' setting = 50, timeframe is H6, H8, H12 'Length' = 30, the rest of the time can be changed, the default is 20 ...
- Some cases I have applied with this indicator to look for entry points and take profit ...
Xin chào Trader Việt nam.
- Đây là chỉ báo về các đường xu hướng trendline trong chuỗi phân tích với đường xu hướng của tôi. Chỉ báo này là muti trendlines trên biểu đồ , nó hiển thị được tối da 7 cặp đường xu hướng trong các thời gian khác nhau trên 1 biểu đồ.Dựa vào đó các trader có cái nhìn trực quan nhất không phải thay đổi qua lại các thời gian để tìm các đường trendlines, và có thể tìm được những cú hồi hoặc phá ngưỡng để vào lệnh hoặc chốt lời .
- Thực ra trong quá trình giao dịch với đường xu hướng, tôi thấy các khung thời gian khác nhau thì hiển thị mỗi đường xu hướng khác nhau, nhiều khi đường xu hướng trong khung 15m đã bị phá nhưng không biết giá đi đến đâu, và mất rất nhiều thời gian để tìm các điểm hỗ trợ, kháng cự để vào lệnh hoặc chốt lời, nên tôi nảy ra ý tưởng vẽ ra các khung thời gian khác nhau trên cùng 1 biểu đồ trong một khung thời gian được chỉ định, và tôi thấy rút ngắn được thời gian để tìm các điểm hõ trợ , kháng cự trong giao dịch mà không cần phải chuyển qua lại giữa các khung thời gian .
- Chẳng hạn ,khi đường xu hướng H1 bị phá vỡ xuống dưới thì ta có thể xác định được khả năng cao giá sẽ được hỗ trợ bởi những đường xu hướng bên dưới nó. để ta tìm điểm vào lệnh hoặc thoát lệnh cho hiệu quả.Hoặc khi giá phá vỡ đường xu hướng H1 để đi lên , thì trên biểu đồ đã hiện cho ta các đường trendline bên trên đường H1 bị phá vỡ đó để ta có điểm vào hoặc chốt lời hiệu quả hơn vì đó là vùng kháng cự....
- Đường xu hướng bên trên(down trend) là đường kẻ ngang màu đỏ ,có kèm tên timeframe và giá trị của đường xu hướng của nó,ví dụ 4H(1.234) nghĩa là timeframe=4H, giá trị hiện tại đường trendline là 1.234.
- Đường xu hướng bên dưới (up trend) là đường ngang màu xanh cũng thể hiện giá trị như đường bên trên.
- Các timeframe nhỏ như 1m, 3m, 5m hoặc 1D tôi để mặc định (không thay đổi được) trong setting mục 'Length' = 50, timeframe là 6H,8H,12H 'Length' = 30, các thời gian còn lại có thể thay đổi được ,mặc định là 20
- Để điều chỉnh có thể vào setting để thiết lập các thời gian theo nhu cầu.
DOTS [CHE]This indicator is a must-have for every trader as it provides a practical tool to quickly evaluate the current price of a security. Designed specifically for manual trading, this indicator is based on "The Forbidden RSI " indicator and provides an easy way to identify overbought and oversold conditions in the market. By using this indicator, traders can make informed decisions about when to enter or exit a trade, maximizing their potential profits and minimizing their risks. Its simple yet effective design makes it an ideal choice for traders of all experience levels. Whether you are a seasoned professional or just starting out, this indicator can help you take your trading to the next level.
Description:
This is a Pine Script code designed to create an indicator that identifies overbought and oversold conditions in a security. The code first defines a function named "func" that takes three arguments - "close", "length", and "tr". It then calculates a value "k" based on the "close" and "length" arguments using this function.
The code then checks if "k" is greater than a variable named "OverBought" and assigns the resulting Boolean value to "OverboughtCond". It also checks if "k" is less than a variable named "OverSold" and assigns the resulting Boolean value to "OversoldCond".
The code then plots a small circle above the bar if "OverboughtCond" is true and below the bar if "OversoldCond" is true. The circles are colored green for "Overbought" and red for "Oversold". The code also creates a label with the name "Overbought" above the bar and a label with the name "Oversold" below the bar if the respective conditions are met.
Finally, the code sets up alert conditions for both the "Overbought" and "Oversold" cases, with a custom message that includes the name of the security, the current price, and the indicator's name.
I've tested the script for weeks and I hope it brings you as much success as it did me
best regards
Chervolino
Reversal Points [CC]This original script was created based on a suggestion from @kerpiciwuasile. My original Reversal Points script was removed because I modeled it after an indicator by Demark, but this script will have no such issues. Reversal points are an exciting concept for me because it is such a useful tool when placing trades. This is my first attempt at a new overall layout for my script and I included a bunch of customization so let me know what you think.
My script works by finding lows that are surrounded by bars that have higher lows and highs that are surrounded by lower highs. I use this logic to find short term lows or highs and I use the same concept to find mid-term lows or highs but a mid-term high is a short term high surrounded by lower short term highs and a mid-term low is a short term low surrounded by higher short term lows. And of course this means that long term highs or lows use the same logic to find highs or lows that are surrounded by mid-term highs or lows. I would recommend to buy at the long term low points or sell at the long term high points.
Keep in mind of course that short term highs and lows are very common and reversal points will get rarer as you look for longer term reversal points. I would recommend to experiment and see which reversal points work best for you and of course, know that there is no magical formula to use for all stocks.
Also there are a few scenarios where you want to enable or disable the inside bar setting. You would want to ignore inside bars if the market is currently very volatile or if you are using this indicator on a crypto chart. This is not an exact science but more of a recommendation, so feel free to experiment with it.
Reversal points are crucial for traders as they signal a potential change in the market trend, providing opportunities for entry or exit.
In summary, this code snippet is a powerful tool for traders to detect and visualize reversal points on a trading chart, providing valuable insights into potential trend changes and facilitating more informed trading decisions.
Let me know if you would like me to publish other scripts or if you want me to do something custom for you!
Stock Comparison to S&P 500This indicator, "Stock Comparison to S&P 500," is designed to help traders compare the financial health and valuation of a chosen stock to the S&P 500 index. It compares several key financial metrics of the stock to the corresponding metrics of the S&P 500, including earnings growth, price-to-earnings ratio, price-to-book ratio, and price-to-sales ratio.
The indicator calculates the differences between each metric of the selected stock and the S&P 500, and then weights them using a formula that takes into account the importance of each metric. The resulting value represents the overall comparison between the stock and the S&P 500.
The indicator also displays the differences between the individual metrics in separate plots, allowing traders to see how each metric contributes to the overall comparison. Additionally, it colors the plots green if the selected stock is performing better than the S&P 500 in a particular metric and red if it's performing worse.
Traders can use this indicator to gain insight into the relative financial health and valuation of a selected stock compared to the S&P 500 index, which can help inform their trading decisions.
BTCUSD Price prediction based on central bank liquidityIn recent months the idea that Bitcoin prices are increasingly linked to liquidity provided by central banks has gained strength. Multiple opinion leaders in the bitcoin space have shared their thoughts to explain why this is happening and why it makes sense. Some of these people I'm talking about are Preston Pysh, Dr. Jeff Ross, Steven McClurg, Lynn Alden among others.
The reality is that the correlation between market liquidity, measured as Assets held by the Federal Reserve, Bank of Japan and European Central bank, and Bitcoin prices is high. This made me wonder whether a regression between "market liquidity" and BTCUSD prices made sense in order to understand where Bitcoin prices are in relation to the liquidity in the market. After several trials I ended up fitting a polynomial regression of degree 5 between Market Liquidity and BTCUSD prices since 2013. This regression resulted in r-squared value of 90.93%. I initially visualized the results in python notebooks but then I thought it would be cool to be able to see them in real-time in tradingview.
That's where this script comes handy...
This script takes the coefficients and intercept from the polynomial regression I built and applies them to the "market_liquidity" index. In addition, it adds upper and lower bound lines to the prediction based on a 95% confidence interval. As you will see, particularly since 2020, the price of bitcoin has rarely been above or below the lines representing the 95% confidence interval. When price has actually crossed these lines it's been in moments where Bitcoin was highly overbought or oversold. Therefore this indicator could be used to understand when it's a good moment to enter or exit the market based on central bank fundamentals.
Here's the detailed step-by-step description of what the script does
1) It defines the coefficients obtained from running the regression betweeen "market liquidity" and BTCUSD. Market liquidity is defined as:
Market liquidity = FRED:WALCL + FX_IDX:JPYUSD*FRED:JPNASSETS + FX:EURUSD*FRED:ECBASSETSW - FRED:RRPONTSYD - FRED:WTREGEN
2) It defines a scale factor. The reason for this is that coefficients from the regression are very small numbers, given the huge numbers of the value of assets held by central banks. Pinescript doesn't support numbers with many decimals and rounds them to 0, so the coefficients had to be scaled up in order to be able to calculate the regression results.
3) It calculates market liquity with the formula defined above. Market liquidity is calculated in US Dollars.
4) It calculates the predicted BTCUSD price based on the coefficients and the market liquidity values.
5) It scales down the values by the same factor used to scale the coefficients up
6) It defines the standard deviation of the "potential_btcusd_price_scaled" and the actual BTCUSD prices.
7) It defines upper and lower bounds to the BTCUSD price prediction using a z-score of 1.96, which is equivalent to 95% confidence interval.
8) Lastly it plots the BTCUSD price prediction (orange) and the upper (red) and lower(green) confidence intervals.
The script can be updated as the correlation of BTCUSD to central bank assets changes (the slope values can be updated).
How to use it:
When actual BTCUSD price (blue line in the chart) crosses over the red line (upper bound) or crosses under the green line (lower bound) it should be taken as a sign that the price of BTCUSD may be overvalued or undervalued based on the value of assets held by major central banks.
Global LiquidityThe "Global Liquidity" script is an indicator that calculates and displays the global liquidity value using a formula that takes into account the money supply of several major economies. The script utilizes data from various sources, such as the Federal Reserve Economic Data (FRED), Economics, and FX_IDC.
The indicator plots the global liquidity value as a candlestick chart and breaks it down into two categories: the Euro-Atlantic region (West) and the rest of the world (East). The values are denominated both in inflation-adjusted dollars and in trillions of dollars. The script also calculates the spread between the Euro-Atlantic region and the rest of the world.
Traders and investors can use this indicator to gauge the overall liquidity of the global economy and to identify potential investment opportunities or risks. By breaking down the liquidity value into different regions, traders can also gain insights into regional economic trends and dynamics.
Note that this script is subject to the terms of the Mozilla Public License 2.0 and was created by rodopacapital.
Ema Short Long Indicator[CHE]█ CONCEPTS
This Pine Script is an EMA Short Long indicator that displays the crossing EMA lines on the chart. The indicator uses three exponential moving averages (EMAs) to generate the buy and sell signals. The EMA lines are plotted as green (uptrend) and red (downtrend) lines. When the green line is above the white signal line, the indicator generates a buy signal, when the green line is below the white signal line, the indicator generates a sell signal. Arrows are also displayed marking the buy and sell signals. There is also an option to allow indicator repainting or not. Finally, users can also set alerts to be alerted to potential trading opportunities.
Note: please do not disable "time frame gaps". Allows to calculate the indicator on a Timeframe (TF) different from that of the chart Time window. The TF should ideally be higher than the charts to provide a broader perspective than
the TF of the chart. Using TFs lower than the chart's will deliver fragmentary results, since only the last value of intrabar is displayed (multiple values cannot be displayed for a single chart bar). The Gaps setting determines the behavior when the TF is higher than the TF of the chart. If 'gaps' is checked, higher TF values only come in and are interconnected on the diagram when the higher TF completed. This has the advantage of avoidance Real-time epainting. If Gaps is not enabled, Gaps are filled with the last higher TF value calculated, which will not produce a repaint Values on historical bars but repaint values realtime.
█ HOW TO USE IT
Load the indicator on an active chart (see the Help Center if you don't know how).
Time period
By default, the script uses an auto-stepping mechanism to adjust the time period of its moving window to the chart's timeframe. The following table shows chart timeframes and the corresponding time period used by the script. When the chart's timeframe is less than or equal to the timeframe in the first column, the second column's time period is used to calculate the Ema Short Long Indicator :
Chart Time
timeframe period
1min 🠆 1H
5min 🠆 4H
1H 🠆 1D
4H 🠆 3D
12H 🠆 1W
1D 🠆 1M
1W 🠆 3M
█ DESCRIPTION
The script begins by setting up the chart indicator with a short title, "ESLI", and enabling it as an overlay. It then initializes several variables for time conversions, to be used later in the script.
The timeStep_translate() function converts the timeframe of the chart into a string representing a larger time interval, based on the number of seconds in the timeframe. The resulting string is used to label the horizontal axis of the chart.
Next, the script defines several input variables that can be modified by the user. These include the colors of the EMA lines and the signals, whether or not the indicator is allowed to repaint (i.e. update past values based on future data), and the number of periods used to calculate the EMA and signal lines.
The f_security() function calls the request.security() function to fetch data from the specified security and timeframe, and is used to calculate the EMA and signal lines using the ta.ema() function. The clo variable is assigned the closing price data, adjusted for repainting and timeframe.
The EMA line is calculated using a weighted average of the EMA over the specified period and two times that period, as well as three times that period, divided by six. The signal line is calculated as the EMA of the EMA line over the specified period.
The col_css variable sets the color of the EMA line based on whether it is currently above or below the signal line. The script then plots the EMA and signal lines, and uses the plotshape() function to indicate long and short signals based on the crossovers and crossunders of the EMA and signal lines.
Finally, the script sets up alert conditions using the alertcondition() function to notify the user when a long or short signal is generated, including information about the symbol and closing price.
█ SPECIAL THANKS
Special thanks to LOXX, I wanted to take a moment to express my gratitude for his valuable input in the EMA calculation. His insights and expertise have greatly helped me in improving my Pine Script coding skills. Thanks to his suggestion, I was able to better understand the EMA formula and implement it effectively in my script.
Your generosity in sharing your knowledge and experience is truly appreciated. It is through collaboration and exchanging ideas that we can all grow and become better in our craft.
This script provides exact signals that, with suitable additional indicators, provide very good results.
Best regards
Chervolino
Fundamental Value and Dividend Growth InvestingThis script is an original implementation of a Fundamental Value and Dividend Growth Investing Strategy for traders who want to incorporate these concepts in their trading decisions. The script uses technical indicators to determine buy and sell signals based on a set of criteria.
To use the script, traders can input various parameters, such as the length of the simple moving averages (SMA), the rate of change (ROC) length, and the dividend yield. The script calculates the SMA for the long and short periods, the ROC, and the dividend.
The buy signal is triggered when the current closing price is greater than the short-term SMA, the short-term SMA crosses above the long-term SMA, the ROC is positive, and the closing price is greater than the dividend. The sell signal is triggered when the current closing price is less than the long-term SMA, the long-term SMA crosses above the short-term SMA, and the ROC is negative.
The script plots the signals and the indicators, such as the SMA200, the SMS50, the dividend, and the ROC. The script also includes alert conditions for the buy and sell signals.
The concept underlying the calculations of this script is the Fundamental Value and Dividend Growth Investing Strategy. This strategy aims to identify stocks that are trading below their intrinsic value and have a history of increasing dividends. The SMA and ROC indicators help identify the trends in the stock price, while the dividend yield helps identify stocks with a history of dividend growth.
Overall, this script offers traders an original and useful tool for incorporating Fundamental Value and Dividend Growth Investing Strategy into their trading decisions.
Fundamental ScreenerThis indicator is designed to compare the year-over-year earnings and sales growth, as well as the P/E ratio of up to 10 stocks simultaneously .
This provides valuable insights into the fundamental performance of multiple stocks at the same time, allowing traders to quickly identify which stocks are outperforming or underperforming their peers.
The earnings and sales growth figures are calculated on a year-over-year basis , comparing the most recent quarter to the same quarter 1 year ago.
The P/E ratio is a valuation metric that measures a company's stock price relative to its trailing twelve months earnings per share.
By comparing these three key metrics across multiple stocks, traders can quickly identify which stock in a group has superior fundamentals.
Customization
Chose to compare 5 or 10 symbols
Table position, color, and size
RS RatingHello everyone.
The RS Rating (or Relative Strenght Rating) is a metric that tracks a stock's price performance relative to the rest of the market. Specifically, it looks at a stock's relative strength over the last 52 weeks.
It allows you to identify at a glance stocks that are outperforming the market and may be poised for further gains.
Designed for break-out traders, trend follower, value investors, the RS Rating can help you identify promising opportunities and make informed investment decisions.
The Rating stands as follow:
- From 1 (worst) to 99 (best)
- 99 rating means the stock is outperforming 99% of all stocks in terms of relative share price performance over the last 52 weeks.
The RS Rating is accompanied by the RS line which is a representation of the progress of the asset against the comparative symbol. (Here SP500)
Of course this script is inspired by the IBD rating system.
The results may be equivalent but it is not guaranteed.
This indicator proposes a scoring system in the style of the one proposed by IBD.
Indeed for an optimal result, it would be necessary to compare the relative performance of all actions, which is not yet possible on PineScript.
Here is the formula for calculating the score:
RS Score = 40% * P3 + 20% * P6 + 20% * P9 + 20% * P12
With
P3 = Performance over the last 3 months
P6 = Performance over the last 6 months
P9 = Performance over the last 9 months
P12 = Performance over the last 12 months
There is no equivalent solution for the moment on TradingView.
The rating score will only appear on the daily timeframe.
For now it's my pleasure to share!
Cuban's Open Interest Spaghetti [CE]Cuban's Open Interest Spaghetti is an indicator built for traders to track the open interest changes of highly correlated markets, spreads, and ecosystems.
The tool provides three different viewing modes for tracking open interest; a rolling bar lookback, a specific data and time anchor, and a visible range -- similar to the native Tradingview 'Compare' tool.
Included are pre-built lists for tracking the open interest of all 160+ Binance Futures assets, including custom fields for creating new spreads or watchlists. This gives the trader the ability to monitor the entire futures ecosystem within a single charting window.
We have also added an optional table to the right of the screen so that the trader can clearly see outperforming assets. This table is toggleable using radio buttons within the Style menu.
To improve asset visibility, the script also calculates the 'long tail' of the asset distribution and automatically lowers the visibility of clustered assets in the center.
While the Compare tool only allows for % returns and absolute value on the chart asset or separate scale, Cuban's Open Interest Spaghetti allows the trader to use a separate oscillator window with the open interest on a % scale. This gives the trader the ability to watch OI changes in real-time within any Tradingview window.
Within the user inputs, the user gains the ability to customize the following:
Lookback mode
Rolling lookback period
Timezone and time anchor
Percentage of assets highlighted
Dynamic label offset
Asset lists
TO DO:
Add % labels to assets in the tails of the distribution