Trend Strength Over TimeThe script serves as an indicator designed to assess and visualize trend strength and Volume strength over time. It employs a variety of calculations and conditions to offer insights into both bullish and bearish market trends. Let's explore the key conceptual elements of the code.
Trend Strength Conditions:
The script defines conditions to assess trend strength based on a comparison between each calculated percentile value and the highest high (bullish) or lowest low (bearish). Separate conditions are established for each percentile length, allowing for a nuanced understanding of trend dynamics across different timeframes.
Counting Bull and Bear Trends:
To quantify the strength of bullish and bearish trends, the script maintains counts for the number of conditions that are true for each. This count-based approach provides a quantitative measure of trend strength.
Weak Bull and Bear Counts:
Recognizing that trends are not always clear-cut, the script introduces the concept of weak trends. It counts instances where the percentiles fall between the highest high and lowest low, indicating a potential weakening of the prevailing trend.
Bull and Bear Strength:
Bull and bear strengths are calculated based on the counts, with adjustments made for weak trends. This step provides a more nuanced and comprehensive assessment of trend strength by considering both strong and weak signals.
Current Trend Value:
The culmination of these calculations is the determination of the current trend value. This value represents the balance between bullish and bearish forces, offering a dynamic indicator of the market's prevailing sentiment.
Volume Strength Calculation:
In addition to price-based indicators, the script incorporates volume strength as a crucial element. This is calculated using the simple moving averages (SMAs) of volume over different lengths, normalized relative to the SMA over a length of 144. Volume strength adds a layer of confirmation or divergence to the price-based trend analysis.
Color Change:
To facilitate quick and intuitive interpretation, the script dynamically changes the color of the plotted line on the chart based on the current trend value. Green indicates a bullish trend, red indicates a bearish trend, and blue suggests a neutral or indecisive market.
Plotting:
The script uses the plot function to visually present the calculated trend strength and volume strength on the chart. This visual representation aids traders in making informed decisions based on the identified trends and their strengths.
Volume Strength: A Detailed Explanation
In the context of the provided script, volume strength is a critical component used to assess the strength of a market trend. It provides insights into the level of participation and commitment of market participants, offering a complementary perspective to traditional price-based indicators. Let's delve into the concept and practical applications of volume strength.
Calculation of Volume Strength:
The script calculates volume strength by considering the simple moving averages (SMAs) of volume over different time periods (13, 21, 34, 55, 89). These individual SMAs are then normalized relative to the SMA over a more extended period of 144. The weights assigned to each SMA in the calculation are defined in the variable VCF (Volume Correction Factor).
Calculation of Volume Strength with Weights: The weights assigned to each SMA in this calculation are crucial for emphasizing the significance of shorter-term volume movements relative to a longer-term baseline.
Interpretation of Weights:
The choice of weights reflects the relative importance of shorter-term volume movements compared to longer-term trends. In this script, shorter-term SMAs (13, 21, 34, 55, 89) are assigned decreasing weights, while the longer-term SMA (144) serves as the baseline.
Shorter-term SMAs with higher weights may have a more immediate impact on the volume strength calculation. This implies that recent changes in volume carry more weight in assessing the current market conditions.
The decreasing weights for shorter-term SMAs might indicate that, as the timeframe lengthens, the significance of recent volume movements diminishes in relation to the longer-term trend. This approach allows for a focus on both short-term volatility and longer-term stability in volume patterns.
The purpose of normalization is to emphasize the current volume's significance in comparison to its historical context. This can help identify abnormal volume spikes or sustained increases in trading activity, which may indicate the strength or weakness of a trend.
Interpretation and Practical Use:
Confirmation of Trend:
Rising volume during an uptrend can validate the strength of the upward movement, suggesting that a significant number of market participants are actively buying. Conversely, decreasing volume during an uptrend might indicate weakening interest and a potential reversal.
In a downtrend, increasing volume on downward price movements reinforces the strength of the trend. A decrease in volume during a downtrend may suggest a potential weakening or exhaustion of the downward momentum.
Divergence Analysis:
Divergence occurs when there is a disagreement between the price movement and the corresponding volume. For example, if prices are rising but volume is declining, it could signal a lack of conviction in the upward movement, and a reversal might be imminent.
Conversely, if prices are falling, but volume is decreasing as well, it might suggest that the downward momentum is losing steam, and a potential reversal or consolidation could be on the horizon.
In conclusion, volume strength analysis provides traders with a powerful tool to gauge the conviction behind price movements. By incorporating volume data into the technical analysis, one can make more informed decisions, enhance trend identification, and improve risk management strategies.
Volume
Accumulation/Distribution Money Flow v1.0This indicator is intended to measure selling and buying pressure, calculates accumulation/distribution levels and suggests current trend intensity and direction.
Core calculations are based on open source script by cI8DH which was not updated ever since 2018. Also, it implements the technique to avoid price gaps issues as described in Twiggs® Money Flow .
The indicator can plot calculated A/D line, a smoothed A/D line and another smoother derivative from the smoothed line which serves as a signal line. By implementing crossovers detection between two lines and also measuring distance between them it plots the histogram of the difference and can also color chart bars accordingly.
You can also use settings to factor in price and/or volume into calculations.
Three options for visual color representation are available.
1) Simple color bars
In this case bars are colored in red and green by default, whereas green indicates positive distance between smoothed A/D line and signal line (upward movement), and red indicated negative distance (downward movement).
2) 4-color scheme
In this case pale green and pale red colors are added, whereas pale red used when the histogram is positive and A/D + signal lines are below zero lines (start of upward movement from lower levels), and pale green is where histogram is negative and both A/D and signal lines are above zero line (start of downward movement from top levels). Bright red and green colors indicate strong movement where the position of A/D + signal lines correspond to positive and.or negative histogram values. This option allows to visually track trend intensity more precisely.
3) Gradient bars color
In this scheme the candles are colored using gradient of either red or green color depending on the intensity and direction of the trend. For that color scheme you must specify the lookback parameter indicating number of bars back to determine highest/lowest values.
Pocket Pivot BreakoutPocket Pivot Breakout Indicator
The pocket pivot breakout indicator will show a blue arrow under the candle if both the following conditions are met:
1. The percentage change of the candle on that day from open is greater than 3%.
2. The volume on the day of 3% candle is higher than the highest red volume in the past 10 days.
The second condition is based on the 'Pocket Pivot' concept developed by Gil Morales and Chris Kacher.
If only one of the conditions is met, while the other is not, there will be no arrow.
How to use the Pocket Pivot Breakout indicator?
1. If the stock is breaking out of a proper base like (cup & handle, Darvas box etc.), you can use the blue arrow as an indicator to make your initial buy.
2. If you already own a stock, the blue arrow indicator can be used for pyramiding, following a continuation breakout from a proper base.
3. Avoid making a new entry or continuation entry if the stock is too extended from 10ma.
Gap-up > 0.5% Indicator
Gap-up Indicator displays a blue colored candle when a stock gaps up by more than 0.5% compared to previous day's close.
It is turned off by default. To activate it, check the box next to Gap-up > 0.5% in the indicator options.
How to use the Gap-up Indicator?
1. When a stock gaps up, it usually indicates strength, especially if on the day of the gap-up, the stock closes strongly.
2. This indicator should not be used in isolation but with a proper base breakout from a tight consolidation.
3. If a stock is already extended from 10ma, avoid taking any new or continuation entries.
Precautions
1. Avoid buying longs when the general market conditions are not favorable.
2. Avoid buying stocks below 200ma.
3. Avoid making a new entry or pyramid entry if a stock is too extended from 10ma.
Important Points
1. Always choose fundamentally strong stocks showing strong growth in earnings/margins/sales.
2. Buy these fundamentally strong stocks when they are breaking out of proper bases.
3. To learn more about pocket pivots and buyable gap-ups, read the book, Trade Like an O'Neil Disciple (by Gil Morales & Chris Kacher).
Cheers
Simranjit
WHALE SIGNAL 4H
WHALE SIGNAL 4H BASED ON VOLUME CHANGE AND MOVING AVERAGE
This script aims to highlight potential whale signals on the 4-hour timeframe by analyzing volume changes, and it provides options for customization through input parameters. Whale signals are then displayed on the chart with different colors for the last hit and the previous hits. The Detector parameter adds flexibility to consider neighboring bars in the detection process, Let's break down the key components:
1/The script defines input parameters that users can customize:
-VCH (Volume Change on 4H candle) with a default value of 3, 3 times the MA Value.
-Length_240 (Moving Average length for the last 21 bars on the 4-hour timeframe).
-Detector (a boolean parameter to enable or disable whale detection in the previous or next bar).
2/Logic Section:
The script defines a function bar(hit) to convert the bar index based on the timeframe.
It calculates the Volume Change (whale signal) by comparing the current volume with a threshold (VCH * vma).
The Detector parameter allows for flexibility in detecting whale signals in neighboring bars.
3/ Plotting Section:
The script defines a function is_whale() to check if there is a whale signal and if it occurred in the last three bars.
It uses the plot function to display whale signals on the chart with different colors and offsets.
Volume Spread Analysis [Ahmed]Greetings everyone,
I'm thrilled to present a Pine Script I've crafted for Volume Spread Analysis (VSA) Indicator. This tool is aimed at empowering you to make smarter trading choices by scrutinizing the volume spread across a specified interval.
The script delivers a comparative volume analysis, permitting you to fix the type and length of the moving average. It subsequently delineates the moving average (MA), MA augmented by 1 standard deviation (SD), and MA increased by 2 SD. You can fully personalize the color coding for these echelons.
Volume Spread Analysis is an analytical technique that scrutinizes candles and the volume per candle to predict price direction. It considers the volume per candle, the spread range, and the closing price.
To effectively leverage VSA, you need to adhere to a few steps:
1. Ensure you use candlesticks for trading. Other chart types like line, bar, and renko charts may not yield optimal results.
2. Confirm that your broker provides reliable volume data.
3. Be mindful of the chart's timeframe. Volume analysis may not be effective on very short timeframes such as a minute chart. I recommend using daily, weekly, or monthly charts.
Another tip is to examine the spread between the price bars and the volume bars to discern the trend.
The script not only makes it easier to integrate these principles into your trading but also brings precision and convenience to your analysis.
Please remember to adhere to Tradinview terms of service when using the script. Happy trading!
Volume Profile PlusThis indicator provides a high-resolution and high-precision implementation of Volume Profile with flexible range settings. Its key features include:
1. Support for a high resolution of up to 2,500 rows.
2. Capability to examine lower timeframe bars (default 5,000 intra-bars) for enhanced precision.
3. Three range modes — "Visible Range", "Anchored Range", and "All Range".
4. Highlighting of Point of Control and Value Area.
5. Extensive customization options allowing users to configure dimensions, on-chart placements, and color schemes.
🔵 Settings
The settings screen, along with the explanations for each setting, is provided below:
🔵 High Resolution using Polyline
Inspired by @fikira, this indicator utilizes the newly introduced `polyline` type in PineScript to plot the volume profile. It employs a single polyline instance to represent the entire histogram. With each polyline instance supporting up to 10,000 points and each histogram row requiring 4 points, this indicator can accommodate 2500 rows, resulting in a significantly higher resolution compared to conventional volume profile indicators that use `line`s or `box`es to draw the histogram.
🔵 High Precision Data-binning using Lower Timeframe Data
Conventional volume profile indicators often face one or both of the following limitations:
1. They only consider volume within the chart's current timeframe.
2. They assign each bar's total volume to a single price bucket based on the bar's average price, rather than distributing volume across multiple price buckets.
As a result, when the number of bars in the chart is low, those indicators may provide imprecise results, making it difficult to accurately identify significant volume nodes and the point of control.
To address these limitations and enhance accuracy, this indicator examines data from lower timeframes and distributes the volume to fine-grained price buckets. It intelligently selects an appropriate lower timeframe to ensure precise output while complying with a maximum specified number of bars to maintain good performance.
🔵 Three Range Modes
This indicator offers users the flexibility to choose from three range modes:
1. Visible Range (Default Mode): In this mode, the volume profile calculation begins at the time of the left-most bar displayed in the current viewport. As the user scrolls through the viewport, the volume profile updates automatically.
2. Anchored Range: This mode allows the user to set the start time either by using the datetime input boxes or by dragging the anchor line on the chart.
3. All Range: In this mode, the volume profile calculation is based on all the historical bars available in the chart.
Double Simple Moving AverageThe Double Simple moving average is an indicator developed to help traders identify dynamic levels of support and resistance as well as determine current trend direction.
This indicator shows both an SMA calculated on highs and one calculated on lows. In addition to that, it plots the deviation bands based on the space between the two main lines.
The gradient color between the two main lines can be used to determine the volumetric pressure and confirmation of the current trend.
Liquidity Price Depth Chart [LuxAlgo]The Liquidity Price Depth Chart is a unique indicator inspired by the visual representation of order book depth charts, highlighting sorted prices from bullish and bearish candles located on the chart's visible range, as well as their degree of liquidity.
Note that changing the chart's visible range will recalculate the indicator.
🔶 USAGE
The indicator can be used to visualize sorted bullish/bearish prices (in descending order), with bullish prices being highlighted on the left side of the chart, and bearish prices on the right. Prices are highlighted by dots, and connected by a line.
The displacement of a line relative to the x-axis is an indicator of liquidity, with a higher displacement highlighting prices with more volume.
These can also be easily identified by only keeping the dots, visible voids can be indicative of a price associated with significant volume or of a large price movement if the displacement is more visible for the price axis. These areas could play a key role in future trends.
Additionally, the location of the bullish/bearish prices with the highest volume is highlighted with dotted lines, with the returned horizontal lines being useful as potential support/resistances.
🔹 Liquidity Clusters
Clusters of liquidity can be spotted when the Liquidity Price Depth Chart exhibits more rectangular shapes rather than "V" shapes.
The steepest segments of the shape represent periods of non-stationarity/high volatility, while zones with clustered prices highlight zones of potential liquidity clusters, that is zones where traders accumulate positions.
🔹 Liquidity Sentiment
At the bottom of each area, a percentage can be visible. This percentage aims to indicate if the traded volume is more often associated with bullish or bearish price variations.
In the chart above we can see that bullish price variations make 63.89% of the total volume in the range visible range.
🔶 SETTINGS
🔹 Bullish Elements
Bullish Price Highest Volume Location: Shows the location of the bullish price variation with the highest associated volume using one horizontal and one vertical line.
Bullish Volume %: Displays the bullish volume percentage at the bottom of the depth chart.
🔹 Bearish Elements
Bearish Price Highest Volume Location: Shows the location of the bearish price variation with the highest associated volume using one horizontal and one vertical line.
Bearish Volume %: Displays the bearish volume percentage at the bottom of the depth chart.
🔹 Misc
Volume % Box Padding: Width of the volume % boxes at the bottom of the Liquidity Price Depth Chart as a percentage of the chart visible range
Oscillator Volume Profile [Trendoscope®]The Oscillator Volume Profile indicator is designed to construct a volume profile based on predefined oscillator levels. It integrates volume data with oscillator readings to offer a unique perspective on market dynamics.
🎲 Selectable Oscillators:
Users can select from an array of oscillator options for the basis of the volume profile, including:
Relative Strength Index (RSI)
Chande Momentum Oscillator (CMO)
Center of Gravity (COG)
Money Flow Index (MFI)
Rate of Change (ROC)
Commodity Channel Index (CCI)
Stochastic Oscillator (Stoch)
True Strength Index (TSI)
Williams %R (WPR)
The length parameters - Length, Fast Length, Slow Length allows users to define the period over which the chosen oscillator is calculated, tailoring the sensitivity of the indicator to their trading strategy.
🎲 Dynamic Overbought/Oversold Ranges:
This indicator enhances traditional concepts by introducing dynamic overbought and oversold levels. These adaptable thresholds are calculated using various methods, including:
🎯 Highest/Lowest Range Method : This method establishes the range based on the highest and lowest values of the oscillator within the last N bars.
🎯 Moving Average Range Method : The range is derived from a moving average of the oscillator, providing a smoothed threshold that reflects more recent market conditions.
In addition to these methods, the indicator incorporates a unique 'Sticky Border' feature:
🎯 Sticky Border: With this option enabled, the dynamic ranges maintain their levels until the oscillator breaks out of the range. Once a breakout occurs, the levels are recalculated and updated. This mechanism ensures that the borders remain consistent and relevant, only adjusting to significant market movements that warrant a recalculation.
Users can select their preferred method for determining dynamic ranges, allowing for a customized approach that aligns with their analysis and trading strategy. The sticky border feature further refines this functionality, offering continuity until a decisive market move occurs.
🎲 Volume Profile Calculation Parameters:
🎯 Trend Filter: The indicator provides a versatile trend filter with four selectable options:
Uptrend: The volume profile is calculated when the oscillator indicates an uptrend.
Downtrend: The volume profile is calculated when the oscillator indicates a downtrend.
Any: The volume profile is calculated regardless of the trend.
External: Users can input values from an external indicator. The volume profile is then calculated only when the external indicator's value is non-zero, integrating external analysis into the volume profile construction.
🎯 Precision: Users have the option to define the precision for calculating the volume profile, which is crucial due to the varying scales of different oscillators (e.g., some oscillators range from 0 to 100, while others from -1 to 1). Selecting an appropriate precision ensures that the volume profile is accurately aligned with the minimal price range significant to the chosen oscillator. This setting requires user intervention for optimal configuration, as automatic calculation is not feasible due to the diverse nature of oscillator ranges.
🎯 Number of Bars: Users can select a specific number of bars for volume profile calculation, or opt to include all available historical bars for a comprehensive profile.
🎲 Selecting the right precision:
Users must select the right precision based on their choice of indicator. For example, RSI values range from 0-100. Hence, the default precision of 1 work fine on RSI as the volume profiles are plotted from 0 to 100 at the interval of 0.1
But, the default precision of 1 will not be ok on TSI because TSI values range from -1 to 1. Hence, using 1 as precision will result in very less volume profile lines as shown below.
Due to this, it is necessary to increase the precision for oscillators such as TSI where the range between highest and lowest value is far less. Once we set the precision to 2, we can see more appropriate volume profile division.
🎲 Note of thanks:
This publication uses polyline feature for drawing volume profiles. The advantage of using polyline is that we can overcome max 500 lines issue that we face by using the regular line objects. More details of polyline can be found in the tradingview blog post
Further, using polyline for display of volume profiles is inspired by the publications of fikira and KioseffTrading
10x Bull Vs. Bear VP Intraday Sessions [Kioseff Trading]Hello!
This script "10x Bull Vs. Bear VP Intraday Sessions" lets the user configure up to 10 session ranges for Bull Vs. Bear volume profiles!
Features
Up To 10 Fixed Ranges!
Volume Profile Anchored to Fixed Range
Delta Ladder Anchored to Range
Bull vs Bear Profiles!
Standard Poc and Value Area Lines, in Addition to Separated POCs and Value Area Lines for Bull Profiles and Bear Profiles
Configurable Value Area Target
Up to 2000 Profile Rows per Visible Range
Stylistic Options for Profiles
This script generates Bull vs. Bear volume profiles for up to 10 fixed ranges!
Up to 2000 volume profile levels (price levels) Can be calculated for each profile, thanks to the new polyline feature, allowing for less aggregation / more precision of volume at price and volume delta.
Bull vs Bear Profiles
The image above shows primary functionality!
Green profiles = buying volume
Red profiles = selling volume
All colors are configurable.
Bullish & bearish POC + value areas for each fixed range are displayable!
That’s about it :D
This indicator is part of a series titled “Bull vs. Bear”.
If you have any suggestions please feel free to share!
Volume SentimentIn 1994 Tushar Chande and Stanley Kroll published a epic book of modern trading indicators called "The New Technical Trader". I highly recommend it. Two indicators that stood out was the Market Thrust and Thrust Oscillator. They suggested these as alternatives to the Arms Index. Rather than using the Advancing Stocks and their associated volume, I applied their logic to individual bars.
Bar Sentiment can be defined and the difference between the low and the close relative to the bar width. Smaller values are bearish and larger one are bullish. A bullish candle would close above its mid-point. Conversely, a close below the candle mid-point is considered bearish.
With that, this script sums the bullish or bearish (as defined above) volume over a user defined number of bars. It gives a unique indication of the volume compared to typical volume indicators. It also gives the user the option to set a "High Volume" alert when the total volume is greater than the moving average. This is helpful for identify increasing activity in your security.
Enjoy and happy trading!
Candle volume analysis The indicator is designed for traders who are more interested in market structures and price action using volumes. Volume analysis can help traders build a clearer understanding of zones of buyer and seller interest, as well as places to capture liquidity (traders' stop levels).
Key Features:
The indicator highlights candle volumes in selected colors, where the volume is greater individually than the volumes of the trader's chosen number of preceding candles. Or the volume that is greater than the sum of volumes of the trader's chosen number of preceding candles.
Volume DensityScript calculates the amount of volume involved per unit price and is colored based on its previous value. An increasing value along with a suitable price action indicates that there is more supply at that level and could be a potential reversal, a decreasing value indicates that there is less supply and the scrip may be in momentum or having a breakout.
Webby's Quick & Grateful Dead RSWebby's Quick & Grateful Dead RS combines a Relative Strength Line and Moving Averages to help traders hold a core position in a winning stock by identifying moments of strength and weakness in a stocks advance.
The Relative Strength (RS) line is something many investors are familiar with. It is used to measure a stocks performance versus the S&P 500 (default setting) and is typically calculated by dividing the closing price of the stock by the closing price of the S&P. This means if a stock moves up and the S&P moves down or the stock moves up more than the S&P the RS line will increase, if the stock moves down while the S&P moves up the line will decrease.
While the RS Line by itself is a powerful tool, adding moving averages to the RS line can help better understand trends. This work was done by Mike Webster (Webby) as he tried to reverse engineer how William O'Neil was able to hold some of his biggest winning positions.
This indicator plots the RS line along with two moving averages and clearly labels and alerts the 3 signals shared by Webby:
Quick Break - RS line crosses below the fast moving average
Quicksand - RS line moves lower than it was at the time of the Quick Break
Grateful Dead Break - RS line crosses below the slow moving average
To ensure your chart doesn't get skewed, please use the multiplier in the setting to adjust the vertical offset of the RS line and moving averages.
Liquidation Estimates (Real-Time) [LuxAlgo]The Liquidation Estimates (Real-Time) experimental indicator attempts to highlight real-time long and short liquidations on all timeframes. Here with liquidations, we refer to the process of forcibly closing a trader's position in the market.
By analyzing liquidation data, traders can gauge market sentiment, identify potential support and resistance levels, identify potential trend reversals, and make informed decisions about entry and exit points.
🔶 USAGE
Liquidation refers to the process of forcibly closing a trader's position. It occurs when a trader's margin account can no longer support their open positions due to significant losses or a lack of sufficient margin to meet the maintenance requirements.
Liquidations can be categorized as either a long liquidation or a short liquidation. A long liquidation is a situation where long positions are being liquidated, while short liquidation is a situation where short positions are being liquidated.
The green bars indicate long liquidations – meaning the number of long positions liquidated in the market. Typically, long liquidations occur when there is a sudden drop in the asset price that is being traded. This is because traders who were bullish on the asset and had opened long positions on the same will now face losses since the market has moved against them.
Similarly, the red bars indicate short liquidations – meaning the number of short positions liquidated in the futures market. Short liquidations occur when there is a sudden spike in the price of the asset that is being traded. This is because traders who were bearish on the asset and had opened short positions will now face losses since the market has moved against them.
Liquidation patterns or clusters of liquidations could indicate potential trend reversals.
🔹 Dominance
Liquidation dominance (Difference) displays the difference between long and short liquidations, aiming to help identify the dominant side.
🔹 Total Liquidations
Total liquidations display the sum of long and short liquidations.
🔹 Cumulative Liquidations
Cumulative liquidations are essentially the cumulative sum of the difference between short and long liquidations aiming to confirm the trend and the strength of the trend.
🔶 DETAILS
It's important to note that liquidation data is not provided on the Trading View's platform or can not be fetched from anywhere else.
Yet we know that the liquidation data is closely tied in with trading volumes in the market and the movement in the underlying asset’s price. As a result, this script analyzes available data sources extracts the required information, and presents an educated estimate of the liquidation data.
The data presented does not reflect the actual individual quantitative value of the liquidation data, traders and analysts shall look to the changes over time and the correlation between liquidation data and price movements.
The script's output with the default option values has been visually checked/compared with the liquidation chart presented on coinglass.com.
🔶 SETTINGS
🔹Liquidations Input
Mode: defines the presentation of the liquidations chart. Details are given in the tooltip of the option.
Longs Reference Price: defines the base price in calculating long liquidations.
Shorts Reference Price: defines the base price in calculating short liquidations.
🔶 RELATED SCRIPTS
Liquidation-Levels
Liquidity-Sentiment-Profile
Buyside-Sellside-Liquidity
Machine Learning: VWAP [YinYangAlgorithms]Machine Learning: VWAP aims to use Machine Learning to Identify the best location to Anchor the VWAP at. Rather than using a traditional fixed length or simply adjusting based on a Date / Time; by applying Machine Learning we may hope to identify crucial areas which make sense to reset the VWAP and start anew. VWAP’s may act similar to a Bollinger Band in the sense that they help to identify both Overbought and Oversold Price locations based on previous movements and help to identify how far the price may move within the current Trend. However, unlike Bollinger Bands, VWAPs have the ability to parabolically get quite spaced out and also reset. For this reason, the price may never actually go from the Lower to the Upper and vice versa (when very spaced out; when the Upper and Lower zones are narrow, it may bounce between the two). The reason for this is due to how the anchor location is calculated and in this specific Indicator, how it changes anchors based on price movement calculated within Machine Learning.
This Indicator changes the anchor if the Low < Lowest Low of a length of X and likewise if the High > Highest High of a length of X. This logic is applied within a Machine Learning standpoint that likewise amplifies this Lookback Length by adding a Machine Learning Length to it and increasing the lookback length even further.
Due to how the anchor for this VWAP changes, you may notice that the Basis Line (Orange) may act as a Trend Identifier. When the Price is above the basis line, it may represent a bullish trend; and likewise it may represent a bearish trend when below it. You may also notice what may happen is when the trend occurs, it may push all the way to the Upper or Lower levels of this VWAP. It may then proceed to move horizontally until the VWAP expands more and it may gain more movement; or it may correct back to the Basis Line. If it corrects back to the basis line, what may happen is it either uses the Basis Line as a Support and continues in its current direction, or it will change the VWAP anchor and start anew.
Tutorial:
If we zoom in on the most recent VWAP we can see how it expands. Expansion may be caused by time but generally it may be caused by price movement and volume. Exponential Price movement causes the VWAP to expand, even if there are corrections to it. However, please note Volume adds a large weighted factor to the calculation; hence Volume Weighted Average Price (VWAP).
If you refer to the white circle in the example above; you’ll be able to see that the VWAP expanded even while the price was correcting to the Basis line. This happens due to exponential movement which holds high volume. If you look at the volume below the white circle, you’ll notice it was very large; however even though there was exponential price movement after the white circle, since the volume was low, the VWAP didn’t expand much more than it already had.
There may be times where both Volume and Price movement isn’t significant enough to cause much of an expansion. During this time it may be considered to be in a state of consolidation. While looking at this example, you may also notice the color switch from red to green to red. The color of the VWAP is related to the movement of the Basis line (Orange middle line). When the current basis is > the basis of the previous bar the color of the VWAP is green, and when the current basis is < the basis of the previous bar, the color of the VWAP is red. The color may help you gauge the current directional movement the price is facing within the VWAP.
You may have noticed there are signals within this Indicator. These signals are composed of Green and Red Triangles which represent potential Bullish and Bearish momentum changes. The Momentum changes happen when the Signal Type:
The High/Low or Close (You pick in settings)
Crosses one of the locations within the VWAP.
Bullish Momentum change signals occur when :
Signal Type crosses OVER the Basis
Signal Type crosses OVER the lower level
Bearish Momentum change signals occur when:
Signal Type crosses UNDER the Basis
Signal Type Crosses UNDER the upper level
These signals may represent locations where momentum may occur in the direction of these signals. For these reasons there are also alerts available to be set up for them.
If you refer to the two circles within the example above, you may see that when the close goes above the basis line, how it mat represents bullish momentum. Likewise if it corrects back to the basis and the basis acts as a support, it may continue its bullish momentum back to the upper levels again. However, if you refer to the red circle, you’ll see if the basis fails to act as a support, it may then start to correct all the way to the lower levels, or depending on how expanded the VWAP is, it may just reset its anchor due to such drastic movement.
You also have the ability to disable Machine Learning by setting ‘Machine Learning Type’ to ‘None’. If this is done, it will go off whether you have it set to:
Bullish
Bearish
Neutral
For the type of VWAP you want to see. In this example above we have it set to ‘Bullish’. Non Machine Learning VWAP are still calculated using the same logic of if low < lowest low over length of X and if high > highest high over length of X.
Non Machine Learning VWAP’s change much quicker but may also allow the price to correct from one side to the other without changing VWAP Anchor. They may be useful for breaking up a trend into smaller pieces after momentum may have changed.
Above is an example of how the Non Machine Learning VWAP looks like when in Bearish. As you can see based on if it is Bullish or Bearish is how it favors the trend to be and may likewise dictate when it changes the Anchor.
When set to neutral however, the Anchor may change quite quickly. This results in a still useful VWAP to help dictate possible zones that the price may move within, but they’re also much tighter zones that may not expand the same way.
We will conclude this Tutorial here, hopefully this gives you some insight as to why and how Machine Learning VWAPs may be useful; as well as how to use them.
Settings:
VWAP:
VWAP Type: Type of VWAP. You can favor specific direction changes or let it be Neutral where there is even weight to both. Please note, these do not apply to the Machine Learning VWAP.
Source: VWAP Source. By default VWAP usually uses HLC3; however OHLC4 may help by providing more data.
Lookback Length: The Length of this VWAP when it comes to seeing if the current High > Highest of this length; or if the current Low is < Lowest of this length.
Standard VWAP Multiplier: This multiplier is applied only to the Standard VWMA. This is when 'Machine Learning Type' is set to 'None'.
Machine Learning:
Use Rational Quadratics: Rationalizing our source may be beneficial for usage within ML calculations.
Signal Type: Bullish and Bearish Signals are when the price crosses over/under the basis, as well as the Upper and Lower levels. These may act as indicators to where price movement may occur.
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Voluminati: Uncovering Market SecretsVoluminati: Uncovering Market Secrets
Overview:
The Voluminati indicator dives deep into the secrets of trading volume, providing traders with unique insights into the market's strength and direction. This advanced tool visualizes the Relative Strength Index (RSI) of trading volume alongside the traditional RSI of price, presenting an enriched perspective on market dynamics.
Features:
Volume RSI: A unique twist on the traditional RSI, the Volume RSI measures the momentum of trading volume. This can help identify periods of increasing buying or selling pressure.
Traditional RSI: The renowned momentum oscillator that measures the speed and change of price movements. Useful for identifying overbought or oversold conditions.
Moving Averages: Both the Volume RSI and traditional RSI come with optional moving averages. These can be toggled on or off and are customizable in type (SMA or EMA) and length.
Overbought & Oversold Fills: Visual aids that highlight regions where the Volume RSI is in overbought (above 70) or oversold (below 30) territories. These fills help traders quickly identify potential reversal zones.
How to Use:
Look for divergence between the Volume RSI and price, which can indicate potential reversals.
When the Volume RSI moves above 70, it might indicate overbought conditions, and when it moves below 30, it might indicate oversold conditions.
The optional moving averages can be used to identify potential crossover signals or to smooth out the oscillators for a clearer trend view.
Customizations:
Toggle the display of the traditional RSI and its moving average.
Choose the type (SMA/EMA) and length for both the Volume RSI and traditional RSI moving averages.
Note: Like all indicators, the Voluminati is best used in conjunction with other tools and analysis techniques. Always use proper risk management.
Bull Vs Bear Visible Range VP [Kioseff Trading]Hello!
This Script “Bull vs Bear Visible Range VP” Calculates Bull & Bear Volume Profiles for the Visible Range Alongside a Delta Ladder for the Visible Period!
Features
Volume Profile Anchored to Visible Range
Delta Ladder Anchored to Visible Range
Bull vs Bear Profiles!
Standard Poc and Value Area Lines, in Addition to Separated POCs and Value Area Lines for Bull Profiles and Bear Profiles
Configurable Value Area Target
Curved Profiles
Up to 9999 Profile Rows per Visible Range
Stylistic Options for Profiles
This Script Generates Bull vs. Bear Volume Profiles for the Visible Range!
Up to 9999 Volume Profile Levels (Price Levels) Can Be Calculated for Each Profile, Thanks to the New Polyline Feature, Allowing For Less Aggregation / More Precision of Volume at Price and Volume Delta.
Bull vs Bear Profiles
The Image Above Shows Primary Functionality!
Green Profiles = Buying Volume
Red Profiles = Selling Volume
Bullish & Bearish Pocs for the Visible Range Are Displayable!
Profiles Can Be Anchored on the Left Side for a More Traditional Look.
The indicator is robust enough to calculate on "small price periods", or for a price period spanning your entire chart fully zoomed out!
That’s About It :D
This Indicator Is Part of a Series Titled “Bull vs. Bear” - A Suite of Profile-Like Indicators I Will Be Releasing Over Coming Days. Thanks for Checking This Out!
If You Have Any Suggestions Please Feel Free to Share!
Zig-Zag Open Interest Footprint [Kioseff Trading]Hello!
This script "Zig Zag Open Interest Footprint" calculates open interest x price values for zig zag trends!
Features
Open interest footprints anchored to zig zag trends
Summed OI x price level footprints
Total OI (for each category) for the entire trend shown
Standard POC lines, in addition to separated POC lines for each category of open interest x price possibility
Up to 9999 profile rows per zigzag trend
Stylistic options for profiles
Configurable zig zag - footprints generated for small to large trends
The zigzag indicator is configurable as normal; minor and major trend volume footprints are calculable. This indicator can be thought of as "Open Interest Footprint for Trends''.
Up to 9999 open interest levels (price levels) can be calculated for each profile, thanks to the new polyline feature, allowing for less aggregation / more precision of open interest at price.
Zig Zag OI Footprints
The image above shows primary functionality!
Green = Higher OI + Higher Price
Yellow = Lower OI + Higher Price
Purple = Higher OI + Lower Price
Red = Lower OI + Lower Price
Profiles are generated for each trend identified by the zigzag indicator.
The image above shows the indicator calculating open interest x price for specific price blocks on the footprint. Aggregate open interest for the identified trend is displayed over the profile!
Neon highlighted values correspond to the highest open interest change for the category. This is a configurable option :D
The image above shows POC lines for each category of open interest x price!
Additionally, you can select to show a single POV for footprint - the single level the greatest amount of OI change occurred.
The indicator is robust enough to calculate on "long zig zags" and "short zig zags"; curved profiles can also be used!
The image above shows key levels, each OI footprint, and summed OI values for the current trend!
That's about it :D
This indicator is part of a series titled "Bull vs. Bear" - a suite of profile-like indicators I will be releasing over the coming days. Thanks for checking this out!
If you have any suggestions please feel free to share!
Asiri Colored CandleNote: To use this code, you must choose Hollow candle
This code color the candle based the relationship current volume to previous volume, according these features:
1- White candle when the current volume greater than the previous one, and all of them greater than moving average for 20 periods of volume
2- Green candle color when the current volume greater than the previous one, and all of them lower than moving average for 20 periods of volume
3- Blue candle it means (Bullish Candle) purchasing candles, with change 3% or higher
4- Yellow candle it means (Bearish Candle) with change 3% or higher
5- The number upper the candle means how much does the volume represent relative to the volume moving average
6- The number lower candle means value of MFI indicator value
كود برمجي يقوم بإعطاء لون للشموع بناء على الحجم
لطي تتمكن من استخدام هذا الكود يجب أن يكون نمط الشموع الذي على الشارت شموع مفرغة
من خصائصه التالي
1- إذا الحجم السفلي الحالي أكبر من الحجم السابق وكلاهما فوق متوسط 20 للحجم والسعر الحالي ارتفع عن السعر السابق يقوم بتلوين الشمعة بيضاء
2- إذا الحجم السفلي الحالي أكبر من الحجم السابق وكلاهما أسفل متوسط 20 للحجم والسعر الحالي ارتفع عن السعر السابق يقوم بتلوين الشمعة خضراء
3- إذا الحجم الحالي أقل من السابق ولكن تكونت شمعة شرائية ارتفعت الشمعة بـ 3% أو تغيرها كان 3% فأعلى يكون لونها أزرق
4- إذا تكونت شمعة بيعية انخفاضها أو تغيرها كان 3% بأعلى يكون لونها أصفر
5- الأرقام أعلى الشموع تبين كم أن الحجم المقابل للشمعة ضعف الحجم لمتوسط حجم 20 فترة سابقة للحجم يعني إذا كان أعلى الشمعة 3 فهذا يعني أن الحجم لهذه الشمعة ارتفع بـ 3 أضعاف متوسط 20 فترة سابقة للحجم ، كما أن هذا الرقم يظهر أعلى شمعة الدوجي التي إغلاقها مساوي لافتتاحها
6- الرقم أسفل الشمعة يبين قيمة مؤشر التدفق النقدي MFI
أخيرا تستطيع التعديل على الكود حسب ما تراه و إخفاء الأرقام أعلى أو أسفل الشموع
لا تنسوني من دعائكم
Zig-Zag Volume Profile (Bull vs. Bear) [Kioseff Trading]Hello!
Thank you @Pinecoders and @TradingView for putting polylines in production and making this viable!!
This script "Zig Zag Volume Profile" implements the polyline feature for Pine Script!
Features
Volume Profile anchored to zig zag trends
Bull vs Bear profiles!
Delta x price level
Standard POC and value area lines, in addition to separated POCs and value area lines for bull profiles and bear profiles
Up to 9999 profile rows per zigzag trend
Stylistic options for profiles
Configurable zig zag - profiles generated for small to large trends
Polylines!
This script generates Bull vs. Bear volume profiles for zig zag trends!
The zigzag indicator is configurable as normal; minor and major trend volume profiles are calculable. This indicator can be thought of as "Volume Profile/Delta for Trends''.
Up to 9999 volume profile levels (price levels) can be calculated for each profile, thanks to the new polyline feature, allowing for less aggregation / more precision of volume at price and volume delta.
Zig Zag Bull Vs Bear Profiles
The image above shows primary functionality!
Green profiles = buying volume
Red profiles = selling volume
Profiles are generated for each trend identified by the zigzag indicator.
The image above shows the indicator calculating volume delta for specific price blocks on the profile. Aggregate volume delta for the identified trend is displayed over the profile!
The image above shows Bull Profile POC lines and value area lines. Bear Profile POC lines and value area lines are also shown!
All colors and transparencies are configurable to the user's liking :D
Additionally, you can select to have the profiles drawn on contrasting sides. Bull Profile on left and Bear Profile on right.
For a more traditional look - you can select to draw the Bull & Bear profiles on the same x-point.
The indicator is robust enough to calculate on "long zig zags" and "short zig zags"; curved profiles can also be used!
The image above exemplifies usage of the indicator!
Bull & Bear volume profiles are calculated for trends on the 30-second timeframe.
The image above shows a more "utilitarian" presentation of the profiles. Once more, line and linefill colors/transparencies are all customizable; the indicator can look however you would like it to!
The image above shows key levels, the Bull vs. Bear profile, and volume delta for the current trend!
That's about it :D
This indicator is part of a series titled "Bull vs. Bear" - a suite of profile-like indicators I will be releasing over coming days. Thanks for checking this out!
Of course, a big thank you to @RicardoSantos for his MathOperator library that I use in every script.
If you have any suggestions please feel free to share!
Volume Profile with a few polylinesThe base of "Volume Profile with a few polylines" is another script of mine, Volume Profile (Maps) .
The structure of maps is used to gather the data. However, the drawings is done with polylines.
This enables coders to draw an entire volume profile with just a few polylines, while the range is broader.
This results in the benefit to draw more "lines" than with line.new() / box.new() alone.
🔶 CONCEPTS
🔹 Polylines
polyline.new creates a new polyline instance and displays it on the chart, sequentially connecting all of the points in the `points` array with line segments.
The segments in the drawing can be straight or curved depending on the `curved` parameter.
In this script, points are connected, starting from the bottom. The created line moves up until there is a price level where a volume value needs to be displayed,
at which the line goes to the left to the concerning volume value, coming back at the same price level until the line returns to its initial x-axis,
after which the line will continue to rise until all values are displayed.
A polyline can contain maximum 10000 points (10K).
Since the line has to go back and forth, each price/volume line takes 3 points.
In the case that 20K bars all have a different price, we would need 60K points, or just 6 polylines. A maximum of 100 polylines can be displayed.
The 3 highest volume values are displayed with line.new(), each with their own colour.
🔹 Maps
A map object is a collection that consists of key - value pairs
Each key is unique and can only appear once. When adding a new value with a key that the map already contains, that value replaces the old value associated with the key .
You can change the value of a particular key though, for example adding volume (value) at the same price (key), the latter technique is used in this script.
Volume is added to the map, associated with a particular price (default close, can be set at high, low, open,...)
When the map already contains the same price (key), the value (volume) is added to the existing volume at the associated price.
A map can contain maximum 50K values, which is more than enough to hold 20K bars (Basic 5K - Premium plan 20K), so the whole history can be put into a map.
🔹 Rounding function
This publication contains 2 round functions, which can be used to widen the Volume Profile
Round
• "Round" set at zero -> nothing changes to the source number
• "Round" set below zero -> x digit(s) after the decimal point, starting from the right side, and rounded.
• "Round" set above zero -> x digit(s) before the decimal point, starting from the right side, and rounded.
Example: 123456.789
0->123456.789
1->123456.79
2->123456.8
3->123457
-1->123460
-2->123500
Step
Another option is custom steps.
After setting "Round" to "Step", choose the desired steps in price,
Examples
• 2 -> 1234.00, 1236.00, 1238.00, 1240.00
• 5 -> 1230.00, 1235.00, 1240.00, 1245.00
• 100 -> 1200.00, 1300.00, 1400.00, 1500.00
• 0.05 -> 1234.00, 1234.05, 1234.10, 1234.15
•••
🔶 FEATURES
🔹 Volume * currency
Let's take as example BTCUSD, relative to USD, 10 volume at a price of 100 BTCUSD will be very different than 10 volume at a price of 30000 (1K vs. 300K)
If you want volume to be associated with USD, enable Volume * currency . Volume will then be multiplied by the price:
• 10 volume, 1 BTC = 100 -> 1000
• 10 volume, 1 BTC = 30K -> 300K
Polylines has the attributes curved & closed.
When "curved" is enabled the drawing will connect all points from the `points` array using curved line segments.
When "closed" is enabled the drawing will also connect the first point to the last point from the `points` array, resulting in a closed polyline.
They are default disabled, but can be enabled:
🔶 DETAILS
🔹 Put
When the map doesn't contain a price, it will be added, using map.put(id, key, value)
In our code:
map.put(originalMap, price, volume)
or
originalMap.put(price, volume)
A key (price) is now associated with a value (volume) -> key : value
Since all keys are unique, we don't have to know its position to extract the value, we just need to know the key -> map.get(id, key)
We use map.get() when a certain key already exists in the map, and we want to add volume with that value.
if originalMap.contains(price)
originalMap.put(price, originalMap.get(price) + volume)
-> At the last bar, all prices (source) are now associated with volume.
🔶 SETTINGS
Source : Set source of choice; default close , can be set as high , low , open , ...
Volume & currency : Enable to multiply volume with price (see Features )
Amount of bars : Set amount of bars which you want to include in the Volume Profile
🔹 Round -> ' Round/Step '
Round -> see Concepts
Step -> see Concepts
🔹 Display Volume Profile
Offset: shifts the Volume Profile (max. 500 bars to the right of last bar, see Features )
Max width Volume Profile: largest volume will be x bars wide, the rest is displayed as a ratio against largest volume (see Features )
Colours
Curved: make lines curved
Closed: connect last with first point
🔶 LIMITATIONS
• Lines won't go further than first bar (coded).
• The Volume Profile can be placed maximum 500 bar to the right of last price.
Watchlist Heatmap PlusIntroducing 'Watchlist Heatmap Plus,' an advanced indicator designed to supercharge your trading experience. With this tool, you can easily track up to 40 symbols in your watchlist and gain valuable insights into their performance. Here's what it does:
1. Data Visualization: Watchlist Heatmap Plus displays essential data for each symbol, including open, high, low, close, close percent, volume, and volume percent.
2. Dynamic Color Coding: The indicator leverages a dynamic color-coding system to make data interpretation a breeze. By default, red indicates a decrease or a lower value compared to the immediate previous candle, while green represents an increase or a higher value. This color scheme is consistently applied to open, high, low, close, and volume data, making it easy to spot trends at a glance. Close percent and volume percent are color-coded according to their actual values.
3. Customization Options: Users have the power to customize the displayed data to align with their trading strategy. They can choose from several data display options:
- Regular: Display the original data as is.
- Change: Show the difference between the current value and the previous candle.
- Change Percent: Display the percentage change between the current and previous values.
- Equal To, Less Than, Less Than or Equal To, Greater Than, Greater Than or Equal To: Perform comparison operations between the current and previous value, producing a boolean output.
4. Consistent Color Coding: Regardless of the data display option chosen, the color-coding functionality remains the same, based on the percentage change, allowing traders to quickly assess the health of each symbol.
Performance Considerations:
Please be aware that due to the complexity of this indicator and the substantial volume of data requests it handles, users may experience occasional data lag and performance slowdown, particularly when applied to certain timeframes. In some cases, there may be a risk of memory exhaustion, especially on smaller timeframes.
To optimize your experience and ensure smooth functionality, I recommend using this indicator on higher timeframes where data processing is less resource-intensive. Additionally, when using the indicator with the chart's replay feature, be cautious as it may encounter memory limits, affecting its performance.