Mag7 IndexThis is an indicator index based on cumulative market value of the Magnificent 7 (AAPL, MSFT, NVDA, TSLA, META, AMZN, GOOG). Such an indicator for the famous Mag 7, against which your main security can be benchmarked, was missing from the TradingView user library.
The index bar values are calculated by taking the weighted average of the 7 stocks, relative to their market cap. Explicitly, we are multiplying each bar period's total outstanding stock amount by the OHLC of that period for each stock and dividing that value by the combined sum of outstanding stock for the 7 corporations. OHLC is taken for the extended trading session.
The index dynamically adjusts with respect to the chosen main security and the bars/line visible in the chart window; that is, the first close value is normalized to the main security's first close value. It provides recalculation of the performance in that chart window as you scroll (this isn't apparent in the demo chart above this description).
It can be useful for checking market breadth, or benchmarking price performance of the individual stock components that comprise the Magnificent 7. I prefer comparing the indicator to the Nasdaq Composite Index (IXIC) or S&P500 (SPX), but of course you can make comparisons to any security or commodity.
Settings Input Options:
1) Bar vs. Line - view as OHLC colored bars or line chart. Line chart color based on close above or below the previous period close as green or red line respectively.
2) % vs Regular - the final value for the window period as % return for that window or index value
3) Turn on/off - bottom right tile displaying window-period performance
Inspired by the simpler NQ 7 Index script by @RaenonX but with normalization to main security at start of window and additional settings input options.
Please provide feedback for additional features, e.g., if a regular/extended session option is useful.
Forecasting
US CPIIntroducing "US CPI" Indicator
The "US CPI" indicator, based on the Consumer Price Index (CPI) of the United States, is a valuable tool for analyzing inflation trends in the U.S. economy. This indicator is derived from official data provided by the U.S. Bureau of Labor Statistics (BLS) and is widely recognized as a key measure of inflationary pressures.
What is CPI?
The Consumer Price Index (CPI) is a measure that examines the average change in prices paid by consumers for a basket of goods and services over time. It is an essential economic indicator used to gauge inflationary trends and assess changes in the cost of living.
How is "US CPI" Calculated?
The "US CPI" indicator in this script retrieves CPI data from the Federal Reserve Economic Data (FRED) using the FRED:CPIAUCSL symbol. It calculates the rate of change in CPI over a specified period (typically 12 months) and applies technical analysis tools like moving averages (SMA and EMA) for trend analysis and smoothing.
Why Use "US CPI" Indicator?
1. Inflation Analysis: Monitoring CPI trends provides insights into the rate of inflation, which is crucial for understanding the overall economic health and potential impact on monetary policy.
2. Policy Implications: Changes in CPI influence decisions by policymakers, central banks, and investors regarding interest rates, fiscal policies, and asset allocation.
3. Market Sentiment: CPI data often impacts market sentiment, influencing trading strategies across various asset classes including currencies, bonds, and equities.
Key Features:
1. Customizable Smoothing: The indicator allows users to apply exponential moving average (EMA) smoothing to CPI data for clearer trend identification.
2. Visual Representation: The plotted line visually represents the inflation rate based on CPI data, helping traders and analysts assess inflationary pressures at a glance.
Sources and Data Integrity:
The CPI data used in this indicator is sourced directly from FRED, ensuring reliability and accuracy. The script incorporates robust security protocols to handle data requests and maintain data integrity in a trading environment.
In conclusion, the "US CPI" indicator offers a comprehensive view of inflation dynamics in the U.S. economy, providing traders, economists, and policymakers with valuable insights for informed decision-making and risk management.
Disclaimer: This indicator and accompanying analysis are for informational purposes only and should not be construed as financial advice. Users are encouraged to conduct their own research and consult with professional advisors before making investment decisions.
Evolving RThe "Evolving R" script is a script that allows to calculate a dynamic reward-to-risk ratio at any given point of time during the trade. Its fundamentals are based on Tom Dante's concept of an evolving reward-to-risk. The script requires a user to input their preferred stop loss price and the target price for a specific asset, and calculates the ratio between two differences: (a) the absolute difference between the target price and the current price and (b) the absolute difference between the stop loss price and the current price.
The output of the script displays the ratio discussed as a value called "Evolving R" in the table. In order to use it successfully, the user of the script has to input:
(a) Stop loss price for the asset
(b) Target price for the asset
Theoretically, as long as the evolving R value holds above or equal to 0.25, the trade is worth holding. However, if the evolving R value drops below 0.25, the table turns red and signifies that such a trade possesses more risk than there is a reward remaining: this alerts the user to possibly take profits prematurely without risking their unrealized gains for a minor amount of additional gain.
The graphics of the script are represented by green and red areas: the green area indicates the area between the current price and the target price, while the red area shows the distance between the current price and the stop loss price. This visual representation allows users to understand the relative reward-to-risk ratio graphically in addition to the given evolving R value output.
The script is used for any type of trading: whether trend-trading or in a ranging market, it doesn't suggest a user which market conditions they should use.
[KVA] ICT Dealing rangesNaive aproach of Dynamic Detection of Dealing Ranges:
The script dynamically identifies dealing ranges based on sequences of upward or downward price movements. It uses arrays to track the highest highs and lowest lows after detecting two consecutive up or down bars, a fundamental step towards understanding market structure and potential shifts in momentum.
ICT Concept: Order Blocks & Fair Value Gaps. This aspect can be linked to the identification of order blocks (bullish or bearish) and fair value gaps. Order blocks are essentially the last bearish or bullish candle before a significant price move, which this script could approximate by identifying the highs and lows of potential reversal zones.
Red and Green Ranges for Bullish and Bearish Movements:
The script separates these movements into red (bearish) and green (bullish) ranges, effectively categorizing potential areas of selling and buying pressure.
ICT Concept: Liquidity Pools. Red ranges could be indicative of areas where selling might occur, potentially leading to liquidity pools below these ranges. Conversely, green ranges might indicate potential buying pressure, with liquidity pools above. These areas are critical for ICT traders, as they often represent zones where price may return to "hunt" for liquidity.
Horizontal Lines for High and Low Points:
The indicator draws horizontal lines at the high and low points of these ranges, offering visual cues for significant levels.
ICT Concept: Breaker Blocks & Mitigation Sequences. The high and low points of these ranges can be seen as potential breaker blocks or areas for future mitigation sequences. In ICT terms, breaker blocks are areas where institutional orders have overwhelmed retail stop clusters, creating potential entry points for trend continuation or reversal. The high and low points marked by the indicator could serve as references for these sequences, where price might return to retest these levels.
Customizability and Historical Depth:
With inputs like rangePlot and maxBarsBack, the indicator allows for customization of the number of ranges to display and how far back in the chart history it looks to identify these ranges. This flexibility is crucial for tailoring the analysis to different trading strategies and timeframes.
ICT Concept: Market Structure Analysis. The ability to adjust the depth and number of ranges plotted caters to a detailed market structure analysis, an essential component of ICT methodology. Traders can adjust these parameters to better understand the distribution of buying and selling pressure over time and how actions have shaped price movements.
ATR Price Targets w/POC
ATR Price Targets with Point of Control (POC):
This script is designed to help traders identify key price target levels based on configurable multipliers of the the Average True Range (ATR) and the volume based Point of Control (POC). It is intended for intraday traders looking to capture significant price movements.
Features:
ATR Price Targets: The script calculates three levels of price targets above and below the first bar of the day, based on the ATR of the last 22 days (assuming 5-minute candles). These targets are adjustable through the settings, allowing traders to set their own ATR multipliers.
Point of Control (POC): The POC is determined as the price level of the highest volume bar since the start time, providing an indication of the most traded price within the specified period.
Customizable Start Time: Traders can set their desired start time for the calculation of price targets and POC, allowing for flexibility in aligning the indicator with their trading strategy.
Plot Lines: The ATR price targets are plotted as lines for easy visualization on the chart.
Usage:
The ATR price targets can be used as potential take-profit or stop-loss levels.
The POC can serve as a key level for assessing market sentiment and potential reversals.
Traders can adjust the ATR multipliers and start time based on their specific trading style and market conditions.
Settings:
ATR Price Targets 1, 2, 3: Adjust the multipliers for the ATR price targets. By default, these are set to 1*ATR for T1+/T1-, 3*ATR for T2+/T2- and ATR*6 for T3+/T3-. Adjust with caution as the price targets found in defaults have proven to be more accurate over intraday cycles for volatile stocks.
Start Hour & Start Minute: Set the starting hour and minute for the calculations. By default, these are set to the opening 5 minute intraday bar, but can also be set to the opening bar of pre-market hours.
Buffett IndicatorThis is an open-source version of the Buffett indicator. The old version was code-protected and broken, so I created another version.
It's computed simply as the entire SPX 500 capitalization divided by the US GDP. Since TradingView does not have data for the SPX 500 capitalization, I used quarterly values of SPX devisors as a proxy.
I tried to create another version of the Buffett indicator for other countries/indexes, but I can't find the data. If you can help me find data for index divisors, I can add more choices to this indicator.
It's interesting to see how this indicator's behavior has changed in the last few years. Levels that looked crazy are not so crazy anymore.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Murrey Math
The Murrey Math indicator is a set of horizontal price levels, calculated from an algorithm developed by stock trader T.J. Murray.
The main concept behind Murrey Math is that prices tend to react and rotate at specific price levels. These levels are calculated by dividing the price range into fixed segments called "ranges", usually using a number of 8, 16, 32, 64, 128 or 256.
Murrey Math levels are calculated as follows:
1. A particular price range is taken, for example, 128.
2. Divide the current price by the range (128 in this example).
3. The result is rounded to the nearest whole number.
4. Multiply that whole number by the original range (128).
This results in the Murrey Math level closest to the current price. More Murrey levels are calculated and drawn by adding and subtracting multiples of the range to the initially calculated level.
Traders use Murrey Math levels as areas of possible support and resistance as it is believed that prices tend to react and pivot at these levels. They are also used to identify price patterns and possible entry and exit points in trading.
The Murrey Math indicator itself simply calculates and draws these horizontal levels on the price chart, allowing traders to easily visualize them and use them in their technical analysis.
HOW TO USE THIS INDICATOR?
To use the Murrey Math indicator effectively, here are some tips:
1. Choose the appropriate Murrey Math range : The Murrey Math range input (128 by default in the provided code) determines the spacing between the levels. Common ranges used are 8, 16, 32, 64, 128, and 256. A smaller range will give you more levels, while a larger range will give you fewer levels. Choose a range that suits the volatility and trading timeframe you're working with.
2. Identify potential support and resistance levels: The horizontal lines drawn by the indicator represent potential support and resistance levels based on the Murrey Math calculation. Prices often react or reverse at these levels, so they can be used to spot areas of interest for entries and exits.
3. Look for price reactions at the levels: Watch for price action like rejections, bounces, or breakouts at the Murrey Math levels. These reactions can signal potential trend continuation or reversal setups.
4. Trail stop-loss orders: You can place stop-loss orders just below/above the nearest Murrey Math level to manage risk if the price moves against your trade.
5. Set targets at future levels: Project potential profit targets by looking at upcoming Murrey Math levels in the direction of the trend.
7. Adjust range as needed: If prices are consistently breaking through levels without reacting, try adjusting the range input to a different value to see if it provides better levels.
In which asset can this indicator perform better?
The Murrey Math indicator can potentially perform well on any liquid financial asset that exhibits some degree of mean-reversion or trading range behavior. However, it may be more suitable for certain asset classes or trading timeframes than others.
Here are some assets and scenarios where the Murrey Math indicator can potentially perform better:
1. Forex Markets: The foreign exchange market is known for its ranging and mean-reverting nature, especially on higher timeframes like the daily or weekly charts. The Murrey Math levels can help identify potential support and resistance levels within these trading ranges.
2. Futures Markets: Futures contracts, such as those for commodities (e.g., crude oil, gold, etc.) or equity indices, often exhibit trading ranges and mean-reversion trends. The Murrey Math indicator can be useful in identifying potential turning points within these ranges.
3. Stocks with Range-bound Behavior: Some stocks, particularly those of large-cap companies, can trade within well-defined ranges for extended periods. The Murrey Math levels can help identify the boundaries of these ranges and potential reversal points.
4. I ntraday Trading: The Murrey Math indicator may be more effective on lower timeframes (e.g., 1-hour, 30-minute, 15-minute) for intraday trading, as prices tend to respect support and resistance levels more closely within shorter time periods.
5. Trending Markets: While the Murrey Math indicator is primarily designed for range-bound markets, it can also be used in trending markets to identify potential pullback or continuation levels.
Momentum Ghost Machine [ChartPrime]Momentum Ghost Machine (ChartPrime) is designed to be the next generation in momentum/rate of change analysis. This indicator utilizes the properties of one of our favorite filters to create a more accurate and stable momentum oscillator by using a high quality filtered delayed signal to do the momentum comparison.
Traditional momentum/roc uses the raw price data to compare current price to previous price to generate a directional oscillator. This leaves the oscillator prone to false readings and noisy outputs that leave traders unsure of the real likelihood of a future movement. One way to mitigate this issue would be to use some sort of moving average. Unfortunately, this can only go so far because simple moving average algorithms result in a poor reconstruction of the actual shape of the underlying signal.
The windowed sinc low pass filter is a linear phase filter, meaning that it doesn't change the shape or size of the original signal when applied. This results in a faithful reconstruction of the original signal, but without the "high frequency noise". Just like any filter, the process of applying it requires that we have "future" samples resulting in a time delay for real time applications. Fortunately this is a great thing in the context of a momentum oscillator because we need some representation of past price data to compare the current price data to. By using an ideal low pass filter to generate this delayed signal we can super charge the momentum oscillator and fix the majority of issues its predecessors had.
This indicator has a few extra features that other momentum/roc indicators dont have. One major yet simple improvement is the inclusion of a moving average to help gauge the rate of change of this indicator. Since we included a moving average, we thought it would only be appropriate to add a histogram to help visualize the relationship between the signal and its average. To go further with this we have also included linear extrapolation to further help you predict the momentum and direction of this oscillator. Included with this extrapolation we have also added the histogram in the extrapolation to further enhance its visual interpretation. Finally, the inclusion of a candle coloring feature really drives how the utility of the Momentum Machine .
There are three distinct options when using the candle coloring feature: Direct, MA, and Both. With direct the candles will be colored based on the indicators direction and polarity. When it is above zero and moving up, it displays a green color. When it is above zero and moving down it will display a light green color. Conversely, when the indicator is below zero and moving down it displays a red color, and when it it moving up and below zero it will display a light red color. MA coloring will color the candles just like a MACD. If the signal is above its MA and moving up it will display a green color, and when it is above its MA and moving down it will display a light green color.
When the signal is below its MA and moving down it will display a red color, and when its below its ma and moving up it will display a light red color. Both combines the two into a single color scheme providing you with the best of both worlds. If the indicator is above zero it will display the MA colors with a slight twist. When the indicator is moving down and is below its MA it will display a lighter color than before, and when it is below zero and is above its MA it will display a darker color color.
Length of 50 with a smoothing of 100
Length of 50 with a smoothing of 25
By default, the indicator is set to a momentum length of 50, with a post smoothing of 2. We have chosen the longer period for the momentum length to highlight the performance of this indicator compared to its ancestors. A major point to consider with this indicator is that you can only achieve so much smoothing for a chosen delay. This is because more data is required to produce a smoother signal at a specified length. Once you have selected your desired momentum length you can then select your desired momentum smoothing . This is made possible by the use of the windowed sinc low pass algorithm because it includes a frequency cutoff argument. This means that you can have as little or as much smoothing as you please without impacting the period of the indicator. In the provided examples above this paragraph is a visual representation of what is going on under the hood of this indicator. The blue line is the filtered signal being compared to the current closing price. As you can see, the filtered signal is very smooth and accurately represents the underlying price action without noise.
We hope that users can find the same utility as we did in this indicator and that it levels up your analysis utilizing the momentum oscillator or rate of change.
Enjoy
Price Action Fractal Forecasts [AlgoAlpha]🔮 Price Action Fractal Forecasts - Unleash the Power of Historical Patterns! 🌌✨
Dive into the future with AlgoAlpha's Price Action Fractal Forecasts ! This innovative indicator utilizes the mesmerizing complexity of fractals to predict future price movements, offering traders a unique edge in the market. By analyzing historical price action and identifying repeating patterns, this tool forecasts future price trends, providing visually engaging and actionable insights.
Key Features:
🔄 Flexible Data Series Selection: Choose your preferred data series for precise analysis.
🕰 Flexible Training and Reference Data Windows: Customize the length of training data and reference periods to match your trading style.
📈 Custom Forecast Length: Adjust the forecast horizon to suit your strategic objectives.
🌈 Customizable Visual Elements: Tailor the colors of forecast deviation cones, data reference areas, and more for optimal chart readability.
🔄 Anticipatory and Repetitive Forecast Modes: Select between anticipating future trends or identifying repetitive patterns for forecasts.
🔎 Enhanced Similarity Search: Leverages correlation metrics to find the most similar historical data segments.
📊 Forecast Deviation Cone: Visualize potential price range deviations with adjustable multipliers.
🚀 Quick Guide to Maximizing Your Trading with Price Action Fractal Forecasts:
🛠 Add the Indicator: Search for "Price Action Fractal Forecasts" in TradingView's Indicators & Strategies. Customize settings according to your trading strategy.
📊 Strategic Forecasting: Monitor the forecast deviation cone and forecast directional changes for insights into potential future price movements.
🔔 Alerts for Swift Action: Set up notifications based on forecast changes to stay ahead of market movements without constant monitoring.
Behind the Magic: How It Works
The core of the Price Action Fractal Forecasts lies in its ability to compare current market behavior with historical data to unearth similar patterns. It first establishes a training data window to analyze historical prices. Within this window, it then defines a reference length to identify the most recent price action that will serve as the basis for comparison. The indicator searches through the historical data within the training window to find segments that closely match the recent price action in the reference period.
Depending on whether you choose the anticipatory or repetitive forecast mode, the indicator either looks ahead to predict future prices based on past outcomes following similar patterns or focuses on the repeating patterns within the reference period itself for forecasts. The forecast's direction can be configured to reflect the mean average of forecasted prices or the end-point relative to the start-point of the forecast, offering flexibility in how forecasts are interpreted.
To enhance the comprehensiveness and visualization, the indicator features a forecast deviation cone. This cone represents the potential range of price movements, providing a visual cue for volatility and uncertainty in the forecasted prices. The intensity of this cone can be adjusted to suit individual preferences, offering a visual guide to the level of risk and uncertainty associated with the forecasted price path.
Embrace the fractal magic of markets with AlgoAlpha's Price Action Fractal Forecasts and transform your trading today! 🌟🚀
Daily Close GAP Detector [Yosiet]User Manual for "Daily Close GAP Detector "
Overview
This script is designed to help traders identify and react to significant gaps in daily market prices. It plots daily open and close prices and highlights significant gaps with a cross. The script is particularly useful for identifying potential breakouts or reversals based on these gaps.
Configuration
GAP Close Threshold: This input allows you to set a threshold for the gap size that you consider significant. The default value is 0.001.
Timeframe Seeker: This input lets you choose the timeframe for the gap detection. The default is 'D' for daily.
Features
Daily Open and Close Lines: The script plots daily open and close prices. If the close price is lower than the open price, the line is colored red; otherwise, it's green.
Gap Detection: It calculates the difference between the current day's close and the previous day's close, both adjusted for the selected timeframe. If this difference exceeds the threshold, it's considered a significant gap.
Significant Gap Indicator: A cross is plotted on the chart to indicate significant gaps. The color of the cross indicates whether the gap is a short or long gap: red for short gaps and green for long gaps.
Alert Conditions: The script sets up alert conditions for short and long gap breakouts. You can customize the alert messages to include details like the ticker symbol, interval, price, and exchange.
How to Use
Add the Script to Your Chart: Copy the script into the Pine Script editor on TradingView and add it to your chart.
Configure Inputs: Adjust the "GAP Close Threshold" and "Timeframe Seeker" inputs as needed.
Review the Chart: The script will overlay daily open and close prices on your chart, along with crosses indicating significant gaps.
Set Alerts: Use the script's alert conditions to set up alerts for short and long gap breakouts. You can customize the alert messages to suit your trading strategy.
Extending the Code
To extend this script, you can modify the gap detection logic, add more indicators, or integrate it with other scripts for a more comprehensive trading strategy. Remember to test any changes thoroughly before using them in live trading.
Pi Cycle Indicator Low and High
The Pi Cycle Indicator is a technical analysis tool used in finance, particularly within cryptocurrency markets, to identify potential market tops or bottoms. It is based on two moving averages: the 111-day moving average and the 350-day moving average of Bitcoin's price. The indicator suggests that when these two moving averages converge or cross each other, it may signal significant market turning points. The name "Pi Cycle" comes from the mathematical relationship between these two moving averages, roughly equivalent to the mathematical constant Pi (3.14). Traders and analysts use this indicator to gauge potential trend reversals and make informed decisions regarding their trading strategies. However, like any technical analysis tool, it should be used in conjunction with other indicators and fundamental analysis for a comprehensive understanding of market conditions.
Order-Block Detector ICT/SMT + FVG + SignalsOrderBlock-Finder
This script shows order-blocks (OB) and fair-value-gaps (FVG). Additionaly there are entry signals for OB and FVG. The Dist-Parameter tell how many candles should exist between the beginning of the OB or FVG and the pullback.
Order-Blocks
An order block in trading typically refers to a significant grouping of buy or sell orders at a particular price level within a financial market. These blocks of orders can influence price movement when they are executed. Here's a breakdown:
Buy Order Block: This occurs when there's a large concentration of buy orders at a specific price level. It indicates a significant interest among traders to purchase the asset if the price reaches that level.
Sell Order Block: Conversely, a sell order block happens when there's a notable accumulation of sell orders at a particular price level. This suggests that many traders are willing to sell the asset if the price reaches that level.
Impact on Price: Order blocks can influence price movement because when the market approaches these levels, the orders within the block may be triggered, leading to increased buying or selling pressure, depending on the type of block. This surge in trading activity can cause the price to either bounce off the level or break through it.
Support and Resistance: Order blocks are often associated with support and resistance levels. A buy order block may act as support, preventing the price from falling further, while a sell order block may serve as resistance, hindering upward price movement.
Fair-Value-Gap
The fair value gap in trading refers to the difference between the current market price of an asset and its calculated fair value. This concept is often used in financial markets, especially in the context of stocks and other securities. Here's a breakdown:
Market Price: The market price is the price at which an asset is currently trading in the market. It is determined by the interaction of supply and demand forces, as well as various other factors such as news, sentiment, and economic conditions.
Fair Value: Fair value represents the estimated intrinsic value of an asset based on fundamental analysis, which includes factors such as earnings, dividends, cash flow, growth prospects, and prevailing interest rates. It's essentially what an asset should be worth based on its fundamentals.
Fair Value Calculation: Analysts and investors use various methods to calculate the fair value of an asset. Common approaches include discounted cash flow (DCF) analysis, comparable company analysis (CCA), and dividend discount models (DDM), among others.
Fair Value Gap: The fair value gap is the numerical difference between the calculated fair value of an asset and its current market price. If the market price is higher than the fair value, it suggests that the asset may be overvalued. Conversely, if the market price is lower than the fair value, it indicates that the asset may be undervalued.
Trading Implications: Traders and investors often pay attention to the fair value gap to identify potential trading opportunities. If the market price deviates significantly from the fair value, it may present opportunities to buy or sell the asset with the expectation that the market price will eventually converge towards its fair value.
CVD Divergence Strategy.1.mmThis is the matching Strategy version of Indicator of the same name.
As a member of the K1m6a Lions discussion community we often use versions of the Cumulative Volume Delta indicator
as one of our primary tools along with RSI, RSI Divergences, Open interest, Volume Profile, TPO and Fibonacci levels.
We also discuss visual interpretations of CVD Divergences across multiple time frames much like RSI divergences.
RSI Divergences can be identified as possible Bullish reversal areas when the RSI is making higher low points while
the price is making lower low points.
RSI Divergences can be identified as possible Bearish reversal areas when the RSI is making lower high points while
the price is making higher high points.
CVD Divergences can also be identified the same way on any timeframe as possible reversal signals. As with RSI, these Divergences
often occur as a trend's momentum is giving way to lower volume and areas when profits are being taken signaling a possible reversal
of the current trending price movement.
Hidden Divergences are identified as calculations that may be signaling a continuation of the current trend.
Having not found any public domain versions of a CVD Divergence indicator I have combined some public code to create this
indicator and matching strategy. The calculations for the Cumulative Volume Delta keep a running total for the differences between
the positive changes in volume in relation to the negative changes in volume. A relative upward spike in CVD is created when
there is a large increase in buying vs a low amount of selling. A relative downward spike in CVD is created when
there is a large increase in selling vs a low amount of buying.
In the settings menu, the is a drop down to be used to view the results in alternate timeframes while the chart remains on current timeframe. The Lookback settings can be adjusted so that the divs show on a more local, spontaneous level if set at 1,1,60,1. For a deeper, wider view of the divs, they can be set higher like 7,7,60,7. Adjust them all to suit your view of the divs.
To create this indicator/strategy I used a portion of the code from "Cumulative Volume Delta" by @ contrerae which calculates
the CVD from aggregate volume of many top exchanges and plots the continuous changes on a non-overlay indicator.
For the identification and plotting of the Divergences, I used similar code from the Tradingview Technical "RSI Divergence Indicator"
This indicator should not be used as a stand-alone but as an additional tool to help identify Bullish and Bearish Divergences and
also Bullish and Bearish Hidden Divergences which, as opposed to regular divergences, may indicate a continuation.
CVD Divergence Indicator.1.mmAs a member of the K1m6a Lions discussion community we often use versions of the Cumulative Volume Delta indicator
as one of our primary tools along with RSI, RSI Divergences, Open interest, Volume Profile, TPO and Fibonacci levels.
We also discuss visual interpretations of CVD Divergences across multiple time frames much like RSI divergences.
RSI Divergences can be identified as possible Bullish reversal areas when the RSI is making higher low points while
the price is making lower low points.
RSI Divergences can be identified as possible Bearish reversal areas when the RSI is making lower high points while
the price is making higher high points.
CVD Divergences can also be identified the same way on any timeframe as possible reversal signals. As with RSI, these Divergences
often occur as a trend's momentum is giving way to lower volume and areas when profits are being taken signaling a possible reversal
of the current trending price movement.
Hidden Divergences are identified as calculations that may be signaling a continuation of the current trend.
Having not found any public domain versions of a CVD Divergence indicator I have combined some public code to create this
indicator and matching strategy. The calculations for the Cumulative Volume Delta keep a running total for the differences between
the positive changes in volume in relation to the negative changes in volume. A relative upward spike in CVD is created when
there is a large increase in buying vs a low amount of selling. A relative downward spike in CVD is created when
there is a large increase in selling vs a low amount of buying.
In the settings menu, the is a drop down to be used to view the results in alternate timeframes while the chart remains on current timeframe. The Lookback settings can be adjusted so that the divs show on a more local, spontaneous level if set at 1,1,60,1. For a deeper, wider view of the divs, they can be set higher like 7,7,60,7. Adjust them all to suit your view of the divs.
To create this indicator/strategy I used a portion of the code from "Cumulative Volume Delta" by @ contrerae which calculates
the CVD from aggregate volume of many top exchanges and plots the continuous changes on a non-overlay indicator.
For the identification and plotting of the Divergences, I used similar code from the Tradingview Technical "RSI Divergence Indicator"
This indicator should not be used as a stand-alone but as an additional tool to help identify Bullish and Bearish Divergences and
also Bullish and Bearish Hidden Divergences which, as opposed to regular divergences, may indicate a continuation.
Fibonacci Archer Box [ChartPrime]Fibonacci Archer Box (ChartPrime) is a full featured Fibonacci box indicator that automatically plots based on pivot points. This indicator plots retracement levels, time lines, fan lines, and angles. Each one of these features are fully customizable with the ability to disable individual features. A unique aspect to this implementation is the ability to set targets based on retracement levels and time zones. This is set to 0.618 by default but you can pick any Fibonacci zone you like. Also included are markings that show you when Fibonacci levels are met or exceeded. These moments are plotted on the chart as colored dots that can be enabled or disabled. Along with these markings are crosses that can be shown when targets are hit. Both of these markings are colored with the related Fibonacci level colors.
When there is a zig-zag, this indicator will test to see if the zig-zag meets the criteria set up by the user before plotting a new Fibonacci box. You can pick from either higher highs or lower highs for bearish patterns, and higher lows or lower lows for bullish patterns. Both patterns can be set to use both when finding new boxes if you want to make it more sensitive. You also have the option to filter based on minimum and maximum size. If the box isn't within the selected size range, it will simply be ignored. The pivot levels can be configured to use either candle wicks or candle bodies. By default this is configured to use candle wick with a lookforward of 5 and lookback of 10.
We have included alerts for Fibonacci level crosses, Fibonacci time crosses, and target hits. All alerts are found in the add alert section built into tradingview to make alert creation as easy as possible. Each alert is labeled with their correct names to make navigation simple.
W.D. Gann, a renowned figure in the world of trading and market analysis, is often questioned for his use of Fibonacci levels in his strategies. However, evidence points to the fact that Gann did not directly employ Fibonacci price levels in his work. Instead, Gann had his unique approach, dividing price ranges into thirds, eighths, and other fractions, which, although somewhat aligning with Fibonacci levels, are not exact matches. It is clear that Gann was familiar with Fibonacci and the golden ratio, as references to them appear in his recommended reading list and some of his writings. Despite this awareness, Gann chose not to incorporate Fibonacci levels explicitly in his methodologies, preferring instead to use his divisions of price and time. Notably, Gann's emphasis on the 50% level—a marker not associated with Fibonacci numbers—further illustrates his departure from Fibonacci usage. This level, despite its popularity among some Fibonacci enthusiasts, does not stem from Fibonacci's sequence. This is why we opted to call this indicator Fibonacci Archer Box instead of a Gann Box as we didn't feel like it was appropriate.
In summary, the Fibonacci Archer Box (ChartPrime) is a tool that incorporates Fibonacci retracements and projections with an automated pivot point-based plotting system. It allows for customization across various features including retracement levels, timelines, fan lines, and angles, and integrates visual cues for level crosses and target hits. While it acknowledges the methodologies of W.D. Gann, it distinctively utilizes Fibonacci techniques, providing a straightforward tool for market analysis. We hope you enjoy using this indicator as much as we enjoyed making it!
Enjoy
Sector ETF macro trendThe Sector ETF Macro Trend indicator is designed for technical analysis of broad economic trends through sector-specific exchange-traded funds (ETFs). It uses logarithmic price transformation, linear regression, and volatility analysis to examine sector trends and stability, providing a technical basis for analytical assessment.
Core Analysis Techniques
Logarithmic Transformation and Regression: Converts ETF closing prices logarithmically to reveal sector growth patterns and dynamics. Linear regression on these prices defines the main trend direction, essential for trend analysis.
Volatility Bands for Market State Assessment: Applies standard deviation on logarithmic prices to create dynamic bands around the trendline, identifying overbought or oversold sector conditions by marking deviations from the central trend.
Sector-Specific Analysis: Selection among different sector ETFs allows for precise examination of sectors like technology, healthcare, and financials, enabling focused insights into specific market segments.
Adaptability and Insight
Customizable Parameters: Offers flexibility in modifying regression length and smoothing factors to accommodate various analysis strategies and risk preferences.
Trend Direction and Momentum: Evaluates the ETF's trajectory against historical data and volatility bands to determine sector trend strength and direction, aiding in the prediction of market shifts.
Strategic Application
Without providing explicit trading signals, the indicator focuses on trend and volatility analysis for a strategic view on sector investments. It supports:
Identifying macroeconomic trends through ETF performance analysis.
Informing portfolio decisions with insights into sector momentum and stability.
Forecasting market movements by analyzing overbought or oversold conditions against the ETF price movement and volatility bands.
The Sector ETF Macro Trend indicator serves as a technical tool for analyzing sector-level market trends, offering detailed insights into the dynamics of economic sectors for thorough market analysis.
Historical Price Projection [LuxAlgo]The Historical Price Projection tool aims to project future price behavior based on historical price behavior plus a user defined growth factor.
The main feature of this tool is to plot a future price forecast with a surrounding area that exactly matches the price behavior of the selected period, with or without added drift.
Other features of the tool include:
User-selected period up to 500 bars anywhere on the chart within 5000 bars
User selected growth factor from 0 (no growth) to 100, this is the percentage of drift to be used in the forecast.
User selected area wide
Show/hide forecast area
🔶 USAGE
This tool generates a price projection with exactly the same price behavior over the period selected by the user, plus a growth factor .
The user must confirm the selection of the anchor point in order for the tool to be executed; this can be done directly on the chart by clicking on any bar, or via the date field in the settings panel.
As we can see on this chart, the four phases of the market cycle are clearly defined and marked, so we choose the distribution phase as our anchor point because in our analysis, we want to see how the market would behave if we were currently at the same point in the cycle.
In the image above, the growth factor parameter is set to 0 so that the projection matches the selection. The tool will use up to 500 bars after the selection point.
The growth factor is defined as the percentage of drift that the tool will use.
Drift is defined as follows:
For periods with a positive return: average negative return within the period
For negative return periods: average positive return within the period
On the chart above, we have selected the same period but added a growth factor of 10, so that the tool uses a 10% drift in its calculations of future prices.
As the return in the selected period is negative, the added drift will make the projection more bearish than the prices from the selection.
On this chart we have changed the selected period, we have chosen the accumulation phase of the last cycle as the anchor point, again with a growth factor of 10%.
As we can see, prices explode higher, making the projection very bullish, as the added effect of both the bullish selected period and the 10% drift is taken into account.
This last chart is a long-term chart, a quarterly chart of the Dow, and it will serve as a review exercise.
What if... everything goes south and the crash of '29 is repeated?
The answer is in the chart, and it is not for the faint of heart
In this case we have chosen a growth factor of 0 to see exactly the same price behaviour projected into the future.
🔶 SETTINGS
🔹 Data Gathering
Anchor point: Starting point for data collection, up to 500 bars will be used.
🔹 Data Transformation
Growth Factor: Values from 0 to 100, is the amount of drift used to calculate the next price in the series.
Area Width: Values from 0 to 100, controls the width of the area around the forecast as an increment/decrement of the growth factor.
🔹 Style
Price line width: Size of the price line.
Bullish color
Bearish color
Show Area: Show forecast area.
Area color
BTC/USD Inflation priced in! ~Period 2009 - 2023 (by TAS)The script creates a custom indicator titled "BTC Adjusted for Economic Factors.
Adjusted BTC Price is plotted in red, making it more prominent. The adjusted price is Bitcoin's historical closing prices adjusted for cumulative inflation over time, based on the Core Consumer Price Index (CPI) annual inflation rates from 2009 onwards.
The script calculates the adjusted price of Bitcoin by taking into account the effect of inflation on its value. It uses annual CPI rates for each year from 2009 to 2022 to calculate a cumulative inflation factor. The script assumes a placeholder inflation rate of 2.5% for 2023, indicating that this value should be updated when the actual rate is available. The script suggests adding CPI rates for additional years as they become available to maintain the accuracy of the adjustment.
Here's a breakdown of how the script works:
Core CPI Annual Inflation Rates: It starts by defining the annual inflation rates for each year from 2009 to 2022, expressed as a percentage divided by 100 to convert to a decimal.
Cumulative Inflation Calculation: The script calculates cumulative inflation starting from the year 2009 up to the current year. For each year that has passed since 2009, it multiplies the cumulative inflation factor by (1 + cpiRate), where cpiRate is the inflation rate for that year. This effectively compounds the inflation rate over time.
Adjusting Bitcoin's Price: The script then adjusts Bitcoin's closing price (close) for the calculated cumulative inflation to get the adjusted price (adjustedPrice).
Plotting the Prices: Finally, it plots both the original and the adjusted Bitcoin prices on the chart, allowing users to visually compare how inflation has theoretically impacted Bitcoin's value over time.
--------------------------------------------------------------------------------------------------
Important to notice, Fib. Retracements from the 2017 cycle top to the recent top (¬80K) doesn't look invalidated.
--------------------------------------------------------------------------------------------------
Inputs and feedback are welcome!
Adaptive Timber! Indicator (ATI)The Adaptive Timber! Indicator (ATI) is a powerful tool designed to identify potential overbought conditions and generate reversal signals in financial markets. It combines multiple technical indicators and market conditions to provide a comprehensive assessment of the likelihood of a price reversal.
How it works:
The ATI uses a combination of the Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), momentum, and volume to detect overbought conditions and potential reversals. The indicator adapts to the current timeframe, adjusting its parameters accordingly to provide more accurate signals.
Key components:
RSI: The ATI uses the RSI to determine overbought conditions. When the RSI exceeds a specified reversal threshold, it indicates a potential overbought state.
MACD: The indicator monitors the MACD line and signal line to identify moments when they are close to crossing, suggesting a potential trend reversal.
Momentum: The ATI checks if the momentum is increasing, providing confirmation of a potential reversal.
Volume: It analyzes volume to confirm the strength of the reversal signal. A decrease in volume along with overbought conditions adds confidence to the reversal indication.
Timeframe Adaptability: The indicator automatically adjusts its parameters based on the current timeframe, ensuring optimal performance across different time horizons.
How to use:
When the ATI identifies a potential reversal, it displays a colored triangle above the price bars. The color of the triangle represents the strength of the reversal signal: red for a strong signal, orange for a moderate signal, and yellow for a weak signal. Additionally, the indicator plots purple triangles below the price bars as an early warning signal for potential trend reversals.
Traders can use these visual cues along with other technical analysis techniques and risk management strategies to make informed trading decisions. The ATI can be particularly useful for identifying potential short-selling opportunities or for determining exit points in existing long positions.
Creators:
The Adaptive Timber! Indicator (ATI) is the result of a collaborative effort led by Claude , an AI assistant with expertise in financial analysis and programming. The development of the ATI was made possible through the valuable contributions and insights from GPT4 , an advanced language model, Clay , a skilled trader, and Pi AI , Clay's trading assistant.
Claude played a crucial role in designing and implementing the indicator's algorithm, ensuring its robustness and adaptability across different timeframes. GPT4 provided guidance and suggestions for refining the indicator's logic and optimizing its performance. Clay and Pi AI offered their trading expertise and real-world experience to help shape the indicator's functionality and usability.
We would like to express our gratitude to all the members of our trading team for their dedication and hard work in bringing the Adaptive Timber! Indicator to life. We wish all traders the best of luck in their trading endeavors and hope that the ATI will be a valuable addition to their technical analysis toolkit, empowering them to make more informed and profitable trading decisions.
CandleStick [TradingFinder] - All Reversal & Trend Patterns🔵 Introduction
"Candlesticks" patterns are used to predict price movements. We have included 5 of the best candlestick patterns that are common and very useful in "technical analysis" in this script to identify them automatically. The most important advantage of this indicator for users is saving time and high precision in identifying patterns.
These patterns are "Pin Bar," "Dark Cloud," "Piercing Line," "3 Inside Bar," and "Engulfing." By using these patterns, you can predict price movements more accurately and therefore make better decisions in your trades.
🔵 How to Use
Pin Bar : This pattern consists of a Candle where "Open Price," "Close Price," "High Price," and "Low Price" form the "Candle Body," and it also has "Long Shadow" and "Short Shadow." In the visual appearance of the Pin Bar pattern, we have a candle body and a pin bar shadow, where the candle body is smaller relative to the shadow.
Just as the candle body plays an important role in analysis, the pin bar shadow can also be influential. The larger the pin bar shadow, the stronger the expectation of a trend reversal.
When a "bearish pin bar" occurs at resistance or the chart ceiling, it can be predicted that the price trend will be downward. Similarly, at support points and the chart floor, a "bullish pin bar" can indicate an upward price movement.
Additionally, patterns like "Hammer," "Shooting Star," "Hanging Man," and "Inverted Hammer" are types of pin bars. Pin bars are formed in two ways: bullish pin bars have a long lower shadow, and bearish pin bars have a long upper shadow. Important: Displaying "Bullish Pin Bar" is labeled "BuPB," and "Bearish Pin Bar" is labeled "BePB."
Dark Cloud : The Dark Cloud pattern is one type of two-candle patterns that occurs at the end of an uptrend. The 2-candle pattern indicates the shape of this pattern, which actually consists of 2 candles, one bullish and one bearish. This pattern indicates a trend reversal and is quite powerful.
The Dark Cloud pattern is seen when, after a bullish candle at the end of an uptrend, a bearish candle opens at a higher level (weakly, equal, or higher) than the closing point of the bullish candle and finally closes at a point approximately in the middle of the previous candle. In this indicator, the Dark Cloud pattern is identified as "Wick" and "Strong" .
The difference between these two lies in the strictness of their conditions. Important: Strong Dark Cloud is labeled "SDC," and Weak Dark Cloud is labeled "WDC."
Piercing Line : The Piercing candlestick pattern consists of 2 candles, the first being bearish and consistent with the previous trend, and the second being bullish. The conditions of the pattern are such that the first candle is bearish and a price gap is created between the two candles upon the opening of the next candle because its opening price is below (weakly equal to or less than) the closing price of the previous candle.
Additionally, its closing price must be at least 50% above the red candle.
This means that the second candle must penetrate at least 50% into the first candle. Important: Strong Piercing Line is labeled "SPL," and Weak Piercing Line is labeled "WPL."
3 Inside Bar (3 Bar Reversal) : The 3 Inside Bar pattern is a reversal pattern. This pattern consists of 3 consecutive candles and can be either bullish or bearish. In the bullish pattern (Inside Up) formed at the end of a downtrend, the last candle must be bullish, and the third candle from the end must be bearish.
Additionally, the close price must be more than 50% of the third candle from the end. In the bearish pattern (Inside Down) formed at the end of an uptrend, the last candle must be bearish, and the third candle from the end must be bullish. Additionally, the close price must be less than 50% of the third candle from the end. Important: Bullish 3 Inside Bar is labeled "Bu3IB," and Bearish 3 Inside Bar is labeled "Be3IB."
Engulfing : The Engulfing candlestick pattern is a reversal pattern and consists of at least two candles, where one of them completely engulfs the body of the previous or following candle due to high volatility.
For this reason, the term "engulfing" is used for this pattern. This pattern occurs when the price body of a candle encompasses one or more candles before it. Engulfing candles can be bullish or bearish. Bullish Engulfing forms as a reversal candle at the end of a downtrend.
Bullish Engulfing indicates strong buying power and signals the beginning of an uptrend. This pattern is a bullish candle with a long upward body that completely covers the downward body before it. Bearish Engulfing, as a reversal pattern, is a long bearish candle that engulfs the upward candle before it.
Bearish Engulfing forms at the end of an uptrend and indicates the pressure of new sellers and their strong power. Additionally, forming this pattern at resistance levels and the absence of a lower shadow increases its credibility. Important: Bullish Engulfing is labeled "BuE," and Bearish Engulfing is labeled "BeE."
🔵 Settings
This section, you can use the buttons "Show Pin Bar," "Show Dark Cloud," "Show Piercing Line," "Show 3 Inside Bar," and "Show Engulfing" to enable or disable the display of each of these candlestick patterns.
Engulfing [TradingFinder] Bullish & Bearish CandleStick Pattern🔵 Introduction
The candlestick engulfing pattern is important pattern in technical analysis that can be observed in candlestick charts. This pattern occurs when a complete candle engulfs or "engulfs" the body of a previous candle, meaning that the body of the new candle completely covers the body of the previous candle.
The candlestick engulfing pattern has two types: the bullish engulfing pattern and the bearish engulfing pattern.
• Bullish Engulfing Pattern: This pattern occurs when a market candle opens with a larger and higher body than the previous market candle and completely covers the body of the previous candle. This pattern may indicate the presence of strong buying pressure and a potential change in price direction upwards.
• Bearish Engulfing Pattern: This pattern occurs when a market candle opens with a larger and lower body than the previous market candle and completely covers the body of the previous candle. This pattern may indicate the presence of strong selling pressure and a potential change in price direction downwards.
The candlestick engulfing pattern is usually used as a valid signal for a change in price direction in the market and can enhance a combination of crossover investments and technical analysis. However, it should always be evaluated alongside other indicators and market factors, and counter decisions should be made accordingly.
🔵 Recognition Method
Correct, the candlestick engulfing pattern is one of the important patterns in technical analysis that is typically used as a strong signal for a valid change in price direction in the market. This pattern occurs when a candle (usually in the market) opens with a larger and higher (for bullish engulfing pattern) or lower (for bearish engulfing pattern) body than a previous market candle and completely covers the body of the previous candle.
Example of Bullish Engulfing Pattern:
• First Candle: A bearish (downward) candle with a small red body.
• Second Candle: A bullish (upward) candle with a larger body that completely covers the body of the previous candle.
This pattern may indicate a change in price direction from downward to upward.
Example of Bearish Engulfing Pattern:
• First Candle: A bullish (upward) candle with a small green body.
• Second Candle: A bearish (downward) candle with a larger body that completely covers the body of the previous candle.
This pattern may indicate a change in price direction from upward to downward.
The most important point is that the candlestick engulfing pattern should be carefully considered and always evaluated alongside other market indicators and overall conditions. For example, the engulfing pattern near important support or resistance levels, during significant market command changes, or accompanied by other technical signals can have greater signaling power.
🟣 "Bullish Engulfing" Candle
• The first candle is bullish and the second candle is bearish.
• At the end of a downtrend.
• The closing of the first candle is above the opening of the second candle.
• The high of the first candle is higher than the high of the second candle.
Optimal Condition:
• The closing of the first candle is higher than the high of the second candle.
• More than 80% of the first candle is bullish.
🟣 "Bearish Engulfing" Candle
• The first candle is bearish and the second candle is bullish.
• At the end of an uptrend.
• The closing of the first candle is below the opening of the second candle.
• The low of the first candle is lower than the low of the second candle.
Optimal Condition:
• The closing of the first candle is below the opening of the second candle.
• More than 80% of the first candle is bearish.
🔵 Settings
The "Engulf Filter" option allows the "Optimal Condition" to be executed and will show fewer candlesticks.
🔵 Status
Off: Default mode, showing more identifications.
• Green color indicates optimal "Bullish Engulfing" candles.
• Red color indicates optimal "Bearish Engulfing" candles.
On: By changing the default to "On," the number of identifications decreases and the optimal condition is applied.
• Blue color indicates "Bullish Engulfing" candles.
• Black color indicates "Bearish Engulfing" candles.
🟣 Important Note
"Engulfing" candles are very useful signals in the direction of the overall trend, but we do not expect a suitable movement from "Engulfing" candles against the trend.
Semaphore PlotThe Semaphore Plot V2, crafted by OmegaTools for the TradingView platform, is a sophisticated technical analysis tool designed to offer traders nuanced insights into market dynamics. This closed-source script embodies a novel approach by synthesizing multiple technical analysis methodologies into a coherent analytical framework. This detailed description aims to demystify the operational essence of the Semaphore Plot V2 and elucidate its application in trading scenarios without overstepping into claims of infallibility or price prediction accuracy.
Analytical Foundations and Integration:
At its core, the Semaphore Plot V2 is founded on the integration of several analytical dimensions, each contributing to a comprehensive market overview:
1. Dynamic Trend Analysis: Unlike conventional trend indicators that might rely solely on moving averages, the Semaphore Plot V2 examines the market's direction through a more complex lens. It assesses momentum, utilizing derivatives of price movements to understand the velocity and acceleration of trends. This analysis is deepened by examining the rate of change (ROC), providing a multi-tiered view of how swiftly market conditions are evolving.
2. Volatility Insights: Recognizing volatility as a pivotal component of market behavior, the script incorporates volatility metrics to analyze market conditions. By evaluating historical price ranges and applying statistical models, it aims to gauge the potential for future price fluctuations, thus offering insights into market stability or turbulence without predicting specific movements.
3. Linear Regression and Predictive Analysis: The script utilizes linear regression to analyze price data points over a specified period, offering a statistical basis to understand the trajectory of market trends. This regression analysis is complemented by market momentum indicators, forming a predictive model that suggests potential areas where market activity might concentrate. It's important to note that these "predictions" are not certainties but rather statistically derived zones of interest based on historical data.
4. Market Sentiment and Risk Evaluation: Incorporating an evaluation of market sentiment, the script analyzes trends in trading volume and price action to deduce the prevailing market mood. Risk assessment tools, such as the analysis of statistical deviations and Value at Risk (VaR), are also applied to offer a perspective on the risk associated with current market conditions.
Operational Mechanism:
- By processing the integrated analysis, the script generates semaphore signals which are plotted on the trading chart. These signals are not direct buy or sell signals but are designed to highlight areas where, based on the script’s complex analysis, market activity might see significant developments.
- Additionally, the Semaphore Plot V2 features an information table that provides a retrospective analysis of the signals' alignment with market movements, offering traders a tool to assess the script's historical context.
Application and Utility:
- Traders can leverage the Semaphore Plot V2 by applying it to their TradingView charts and adjusting input settings such as lookback periods and sensitivity according to their preferences.
- The semaphore signals serve as markers for areas of potential interest. Traders are encouraged to interpret these signals within the context of their overall market analysis, incorporating other fundamental and technical analysis tools as necessary.
- The informational table serves as a resource for evaluating the historical context of the signals, providing an additional layer of insight for informed decision-making.
The Essence of Originality:
The Semaphore Plot V2 distinguishes itself through the innovative melding of traditional technical analysis components into a unique analytical concoction. This originality lies not in the creation of new technical indicators but in the novel integration and application of existing methodologies to offer a holistic view of market conditions.
Responsible Usage Disclaimer:
The financial markets are characterized by uncertainty, and the Semaphore Plot V2 is intended to serve as an analytical tool within a trader's arsenal, not a standalone solution for trading decisions. It is critical for users to understand that the script does not guarantee trading success nor does it claim to predict exact price movements. Traders should employ the Semaphore Plot V2 alongside comprehensive market analysis and sound risk management practices, acknowledging that past performance is not indicative of future results and that trading involves the risk of loss.
Machine Learning: Multiple Logistic Regression
Multiple Logistic Regression Indicator
The Logistic Regression Indicator for TradingView is a versatile tool that employs multiple logistic regression based on various technical indicators to generate potential buy and sell signals. By utilizing key indicators such as RSI, CCI, DMI, Aroon, EMA, and SuperTrend, the indicator aims to provide a systematic approach to decision-making in financial markets.
How It Works:
Technical Indicators:
The script uses multiple technical indicators such as RSI, CCI, DMI, Aroon, EMA, and SuperTrend as input variables for the logistic regression model.
These indicators are normalized to create categorical variables, providing a consistent scale for the model.
Logistic Regression:
The logistic regression function is applied to the normalized input variables (x1 to x6) with user-defined coefficients (b0 to b6).
The logistic regression model predicts the probability of a binary outcome, with values closer to 1 indicating a bullish signal and values closer to 0 indicating a bearish signal.
Loss Function (Cross-Entropy Loss):
The cross-entropy loss function is calculated to quantify the difference between the predicted probability and the actual outcome.
The goal is to minimize this loss, which essentially measures the model's accuracy.
// Error Function (cross-entropy loss)
loss(y, p) =>
-y * math.log(p) - (1 - y) * math.log(1 - p)
// y - depended variable
// p - multiple logistic regression
Gradient Descent:
Gradient descent is an optimization algorithm used to minimize the loss function by adjusting the weights of the logistic regression model.
The script iteratively updates the weights (b1 to b6) based on the negative gradient of the loss function with respect to each weight.
// Adjusting model weights using gradient descent
b1 -= lr * (p + loss) * x1
b2 -= lr * (p + loss) * x2
b3 -= lr * (p + loss) * x3
b4 -= lr * (p + loss) * x4
b5 -= lr * (p + loss) * x5
b6 -= lr * (p + loss) * x6
// lr - learning rate or step of learning
// p - multiple logistic regression
// x_n - variables
Learning Rate:
The learning rate (lr) determines the step size in the weight adjustment process. It prevents the algorithm from overshooting the minimum of the loss function.
Users can set the learning rate to control the speed and stability of the optimization process.
Visualization:
The script visualizes the output of the logistic regression model by coloring the SMA.
Arrows are plotted at crossover and crossunder points, indicating potential buy and sell signals.
Lables are showing logistic regression values from 1 to 0 above and below bars
Table Display:
A table is displayed on the chart, providing real-time information about the input variables, their values, and the learned coefficients.
This allows traders to monitor the model's interpretation of the technical indicators and observe how the coefficients change over time.
How to Use:
Parameter Adjustment:
Users can adjust the length of technical indicators (rsi_length, cci_length, etc.) and the Z score length based on their preference and market characteristics.
Set the initial values for the regression coefficients (b0 to b6) and the learning rate (lr) according to your trading strategy.
Signal Interpretation:
Buy signals are indicated by an upward arrow (▲), and sell signals are indicated by a downward arrow (▼).
The color-coded SMA provides a visual representation of the logistic regression output by color.
Table Information:
Monitor the table for real-time information on the input variables, their values, and the learned coefficients.
Keep an eye on the learning rate to ensure a balance between model adjustment speed and stability.
Backtesting and Validation:
Before using the script in live trading, conduct thorough backtesting to evaluate its performance under different market conditions.
Validate the model against historical data to ensure its reliability.