Volume Analysis - Heatmap and Volume ProfileHello All!
I have a new toy for you! Volume Analysis - Heatmap and Volume Profile . Honestly I started to work to develop Volume Heatmap then I decided to improve it and add more features such Volume profile, volume, difference in Buy/Sell volumes etc. I tried to put my abilities into this script and tried to use some new Pine Language™ features ( method, force_overlay, enum etc features ). I hope the usage of these new features would be an example for Pine Programmers.
Lets talk about how it works:
- It gets number of Rows/Columns from the user for each candle to create heatmap
- It calculates the number of the candles to analyze. Number of the candles may change by number of Rows/columns or if any volume / difference in volumes / volume profile is enabled
- It gets Closing/Opening price, Volume and Time info from lower time frame for each candle ( it can be up to 100K for each candle )
- After getting the data it calculates lower time frame to analyze
- Then it calculates how closing price moves, how much volume on each move and create boxes by the volume/move in each box
- The colors for each box calculated by volume info and closing price movements in the lower time frame
- It shows the boxes on Absolute places or Zero Line optionally
- it shows Volume, Cumulative volume, Difference between Buy/Sell volume for each column
- it changes empty box color by Chart background color, also you can change transparency
- At this time it creates Volume Profile with up to 25 rows
- As a new Pine Language™ feature, it can show Volume Profile in the indicator window or in Main chart, shows Value Area, Value Area High (VAH), Value Area Low (VAL), and draw it and POC (Point Of Control) in the indicator window and/or in the main chart
- Honestly the feature I like is that: For the markets that are not open 24/7, it combines the data from the lower time period without any gaps. For example, if you work for a market that is closed on Saturdays and Sundays, it ensures data integrity by omitting weekends and holidays. so for example if the data is like "ABC---DEF-X---YL-Z" then it makes this data like "ABCDEFXYLZ". In this way, there will be no data breaks in the displayed boxes, there will be no empty colons, and it will appear as if data is coming in at any time.
- Finally it shows Info Panel to give info, its background color automatically changes by the Chart background color
- Important! You should set your "Plan" accordingly, your plan is "Premium or Higher" or "Lower tier". so the script can understand the minimum time frame it can get data!!
I tried to share many screenshots below to explain it much better
How it looks?
it shows Highest Buy/Sell volumes brighter, move volume -> brighter
Volume Profile ( up to 25 row s) ( number of contained candles should be more than 1 )
Volume Profile can be shown in the main chart optionally
How the main chart looks:
Closing price shown and you can enable it, change colors & line width
Can include many candles according to Row&Column number you set
Optionally it can show cumulative volume for each candle
Closing prices from lower time frame
Shows Candle Body by changing background colors
It can shows all included candles on Zero line
You can change the colors of many things
You can set Empty box and border transparency
Table, Empty box Colors adjustment done automatically by chart background color
Sometimes we can not get data from some historical candles if time frame is high such 2days, 1 week etc, and it looks like:
It also checks if Chart time frame and Chart type is suitable
Enjoy!
Cumulativevolume
Liquidity Swings [UAlgo]The "Liquidity Swings " indicator is designed to help traders identify liquidity swings within the market. This tool is particularly useful for visualizing areas where liquidity is accumulating and where it is being swept, providing valuable insights for making informed trading decisions. By tracking the pivots in price and associating them with volume, the indicator highlights zones of potential support and resistance, helping traders understand market dynamics more clearly.
🔶 Key Features
Liquidity Swing Sensitivity: Adjustable sensitivity settings to fine-tune the detection of liquidity swings according to market conditions and trader preferences.
Two modes of liquidity calculation:
Cumulative Liquidity: Aggregates unswept liquidity over multiple swings until it is swept, providing a broader view of liquidity accumulation.
Individual Liquidity: Displays the accumulated liquidity for each swing independently, offering a more granular perspective.
Visual Customization: Options to customize the colors and sizes of liquidity lines, areas, and informational text for better visual clarity.
Dynamic Updates: The indicator dynamically updates liquidity zones and labels, adjusting to new market data to keep traders informed in real-time.
🔶 Disclaimer
The "Liquidity Swings " indicator is provided for educational and informational purposes only.
It should not be considered as financial advice or a recommendation to buy or sell any financial instrument.
The use of this indicator involves inherent risks, and users should employ their own judgment and conduct their own research before making any trading decisions. Past performance is not indicative of future results.
🔷 Related Scripts
Liquidity Sweeps
Williams %R Liquidity Sweeps
Price and Volume Stochastic Divergence [MW]Introduction
This indicator creates signals of interest for entering and exiting long and short positions on equities. It primarily uses up and down trends defined by the change in cumulative volume with some filtering provided by a short period exponential moving average (9 EMA by default).
Settings
Moving Average Period : The moving average over which the cumulative volume delta is calculated. Default: 14
Short Period EMA : The EMA used to represent price action, and is used to generate the EMA Delta line. Default: 27 (3*3*3)
Long Period EMA : The second EMA used to calculate the EMA Delta line. Default: 108 (2*2*3*3*3)
Stochastic K Value : The value used for stochastic curve smoothing. Default: 3
Dot Size : The diameter of the larger indicator. Default: 10
Dot Transparency : The transparency level of the outer ring of the primary BUY/SELL signal. Default: 50 (0 is opaque, 100 is transparent)
Band Distance from 0 to 100 : The upper and lower band distance. Default: 20
Calculations
The cumulative volume delta (CVD) is calculated using candle bodies and wicks. For a red candle, buying volume is calculated by multiplying the volume by the spread percentage of the average of the top and bottom wicks, while Selling Volume is calculated multiplying the volume by the spread percentage of the average of the top and bottom wicks - in addition to the spread percentage of the candle body.
For a green candle, buying volume is calculated by multiplying the volume by the spread percentage of the average of the top and bottom wicks - plus the spread percentage of the candle body - while Selling Volume is calculated using only the spread percentage average of the top and bottom wicks.
Once we have the CVD, we can then perform a stochastic calculation of the CVD value.
stochastic calculation = (current value - lowest value in period) / (highest value in period - lowest value in period)
We’ll do the same stochastic calculation for the short term EMA (27 EMA default) as well as for the difference between the short term and long term EMA.
When the stochastic CVD value is rising from zero and the short term EMA stochastic value equals 100, then it’s a major bullish signal. When the stochastic CVD value is falling from 100 and the short term EMA stochastic value equals 0, then it’s a major bearish signal.
Sometimes, after a bullish or bearish signal, the stochastic CVD will reverse direction triggering a new opposing signal.
How to Interpret
The CVD indicates when there is either more buying than selling or vice versa. A value over 50 for the stochastic CVD curve represents more buying taking place. A value below 50 represents more selling. One might intuitively believe that when there is more buying volume than selling volume that the price would follow suit. This is not always the case.
Most of the time buying volume will precede consistent price movement upwards, and selling volume will precede consistent price movement downwards. When this divergence occurs, the indicator generates a signal. When this divergence begins to fail, and buying or selling volume reverses, then another signal is generated indicating that the buying/selling impulse is headed back into the direction of price action.
These interactions are visually represented on the chart with the coral line that represents CVD, and the yellow line that represents the EMA, or the average price. When the coral line goes up and the yellow line stays down, that’s the BUY signal. When the coral line goes down and the yellow line stays up, that’s the sell signal. When the coral line switches direction, the chart generates another signal showing that volume is moving in a direction that supports the price.
The orange line represents the stochastic representation of the difference between the short EMA (27 by default) and the long EMA (108 by default). EMA differences is a method that can be used to define a trend. When a short term EMA is above a longer term EMA, that may represent a bullish trend. When it is below, that may represent a bearish trend. When all 3 lines are rising or falling in the same direction at the same time, it tends to indicate a movement that has the potential to continue.
Other Usage Notes and Limitations
It's important for traders to be aware of the limitations of any indicator and to use them as part of a broader, well-rounded trading strategy that includes risk management, fundamental analysis, and other tools that can help with reducing false signals, determining trend direction, and providing additional confirmation for a trade decision. Diversifying strategies and not relying solely on one type of indicator or analysis can help mitigate some of these risks.
This indicator can be paired with the MW Volume Impulse indicator if it is desired to see the actual buying and selling cumulative volume deltas. Also, in many cases, the BUY and SELL signals tend to correspond with Keltner Bands (ATR Bands) becoming extended. Lastly, volume weighted average price (VWAP) along with other macro events can impact price and negate signals. To view VWAP lines, you may choose to use the Multi VWAP or Multi VWAP for Gaps indicator to help ensure that the signals you see in this indicator are not being affected by VWAP lines.
Gross and Net LTF Volume + Trailing Percentile Sessions CVOL Hi Traders !
Gross volume, net lower time frame (LTF) volume and trailing session percentile Cumulative session volume:
The code calculates and plots the following volume indicators:
Volume (Gross Volume): The total volume for the current bar.
Net lower time frame volume: The difference between the buy and sell volumes of the lower time frame.
Cumulative daily session volume: The cumulative sum of the volume for the current day.
Percentile Cumulative daily session volume: The percentile of the cumulative daily session volume (calculated on a rolling basis).
The above indicators may be plotted exclusively or exclusively.
Why is Volume important:
Volume is the number of shares or contracts traded (of a financial asset) during a given time period (timeframe). It is a crucial indicator in technical analysis and quantitative trading, as volume helps in identifying
Price Confirmation: Volume confirms price movements by indicating the level of interest and participation in the market. When prices move significantly, accompanied by strong volume, it suggests that the movement is likely to be sustained. Conversely, if prices move without significant volume, it suggests that the movement may be temporary or lacking conviction.
Trend Strength: Volume can help identify the strength and direction of a trend. During an uptrend, increasing volume alongside price increases indicates that the upward momentum is gaining traction. Conversely, decreasing volume during an uptrend suggests that the upward momentum may be weakening.
Reversal Points: Sharp volume spikes in the opposite direction of the prevailing trend can signal a potential reversal point. This is because large volume indicates a significant shift in trader sentiment, suggesting that the trend may be changing direction.
Liquidity: High volume indicates that a security is liquid, meaning that it can be easily bought and sold without significant price impact. Liquidity is important for traders who want to execute large orders without significantly affecting the market price.
For example, suppose we want to identify positive price confirmation and positive trend strength, in this case we may use the CVOL (with trailing percentile).
The above image showcases price expansion conditional on high positive volume (increasing CVOL), The price expansion also exhibits Volume confluences (the colored bars).
Positive Confluence: Increase in positive total volume and an increase in positive lower time frame volume in relative and absolute terms.
Negative Confluence : Increase in negative total volume and an increase in negative lower time frame volume in relative and absolute terms.
Also note how the percentile color does not change, this means that the new volume bars are > than the highest percentile (80%) of volume values from the beginning of the session.
Strategy - Relative Volume GainersStrategy - Relative Volume Gainers
Overview:
This trading strategy, called "Relative Volume Gainers," is designed for Long Entry opportunities in the stock market. The strategy aims to identify potential trading candidates based on specific technical conditions, including volume, price movements, and indicator alignments.
Strategy Rules:
The strategy is focused solely on Long Entry positions.
The volume for the current trading day must be greater than or equal to the volume of the previous day.
The percentage change in price must be greater than or equal to 2.5%.
The Last Traded Price (LTP) must be greater than or equal to the Exponential Moving Average (EMA) 200.
The Relative Volume for the current trading day (calculated over the last 30 days) must be greater than or equal to the Simple Moving Average (SMA) of Relative Volume over the same 30 days.
The current candle on the chart should be Green or Bullish, indicating positive price movement.
The price difference between bid and ask prices should be kept to a minimum.
It's recommended to also analyze market depth for better insights.
Strategy Requirements:
Add the Exponential Moving Average (EMA) 200 to your trading chart.
This strategy can be applied on charts of any timeframe.
For intraday trading, particularly for early entry, consider using a 1-minute timeframe.
It is advisable to create a screener to identify potential trades in real-time market conditions.
Risk Warning:
Stocks that meet the strategy criteria might exhibit high volatility and a high beta, making them inherently risky to trade. Exercise caution and adhere to predetermined risk management strategies.
Determine your trading quantity based on your entry price and stop loss in order to manage risk effectively.
Quantity Calculation Formula:
Quantity calculation is crucial to manage risk and position sizing. The following formulas can be used based on your trading scenario:
Quantity with Leverage:
Quantity = (((Using Capital / 100) * Risk Percent) / (Entry Price - Stop Loss)) * Leverage
Eg: Quantity = (((10000 / 100) * 0.2) / (405.5 - 398.5)) * 5
Quantity = 14
Risk = Rs.100 (Rs.100 is 1% of Rs.10000. So the risk is 1%, means we lose only Rs.100 when the SL is hit. If SL is increased the Quantity will get reduced to maintain a fixed risk of Rs.100)
Quantity without Leverage:
Quantity = (((Using Capital / 100) * Risk Percent) / (Entry Price - Stop Loss))
Note:
Always stay informed about market conditions and be prepared for potential rapid price movements when trading stocks that meet the strategy criteria. Strictly adhere to your predefined risk management strategy to safeguard your capital.
MW Volume ImpulseMW Volume Impulse
Settings
* Moving Average Period: The moving average period used to generate the moving average line for the bar chart. Default=14
* Dot Size: The size of the dot that indicates when the moving average of the CVD is breached. Default=10
* Dot Transparency: The transparency of the dot that indicates when the moving average of the CVD is breached. Default=50
* EMA: The exponential moving average that the price must break through, in addition to the CVD moving
* Accumulation Length: Period used to generate the Cumulative Volume Delta (CVD) for the bar chart. Default=14
Introduction
Velocity = Change in Position over time
Acceleration = Change in Velocity over time
For this indicator, Position is synonymous with the Cumulative Volume Delta (CVD) value. What the indicator attempts to do is to determine when the rate of acceleration of buying or selling volume is changing in either or buying or selling direction in a meaningful way.
Calculations
The CVD, upon which these changes is calculated using candle bodies and wicks. For a red candle, buying volume is calculated by multiplying the volume by the spread percentage of the average of the top and bottom wicks, while Selling Volume is calculated multiplying the volume by the spread percentage of the average of the top and bottom wicks - in addition to the spread percentage of the candle body.
For a green candle, buying volume is calculated by multiplying the volume by the spread percentage of the average of the top and bottom wicks - plus the spread percentage of the candle body - while Selling Volume is calculated using only the spread percentage average of the top and bottom wicks.
How to Interpret
The difference between the buying volume and selling volume is the source of what generates the red and green bars on the indicator. But, more specifically, this indicator uses an exponential moving average of these volumes (14 EMA by default) to determine that actual bar size. The change in this value indicates the velocity of volume and, ultimately, the red and green bars on the indicator.
- When the bar height is zero, that means that there is no velocity, which indicates either a balance between buyers and sellers, or very little volume.
- When the bar height remains largely unchanged from period to period - and not zero - it means that the velocity of volume is constant in one direction. That direction is indicated by the color of the bar. Buyers are dominating when the bars are green, and sellers are dominating when the bars are red.
- When the bar height increases, regardless of bar color, it means that volume is accelerating in a buying direction.
- When the bar height decreases, regardless of bar color, it means that volume is accelerating in a selling direction.
The white line represents the moving average of the bar values, while the red and white - and green and white - dots show when the moving average has been breached by the Cumulative Volume Delta value AND the price has broken the 7 EMA (which is user editable). As with most moving averages, a breach can indicate a move in a bearish or bullish direction, and the sensitivity can be adjusted for differing market conditions
Other Usage Notes and Limitations
For better use of the signal, consider the following,
1. Volume moving below the moving average can indicate that the volume may be ready to exit an overbought condition, especially if the bars were making lower highs prior to the signal - regardless of bar color.
3. Volume moving above the moving average can indicate that the volume may be ready to exit an oversold condition, especially if the bars were making higher lows prior to the signal - regardless of bar color.
Additionally, a green dot that occurs with a positive (green) Cumulative Volume Delta can indicate a buying condition, while a red dot that occurs with a negative (red) Cumulative Volume Delta can indicate a selling condition. What this means is that buying or selling momentum briefly went against the direction of buying or selling Cumulative Volume Delta , but was not strong enough to change the buying or selling direction. In cases like this, once the volume begins to accelerate again in the direction of the buying or selling volume - indicated by a red or green dot - then the price is more likely to favor the direction of the Cumulative Volume Delta and its corresponding acceleration.
Although a red or green signal can indicate a change in direction, this script cannot predict the magnitude or duration of the change. It is best used with accompanying indicators that can be used to confirm a direction change, such as a moving average, or a supply or demand range.
RVOL Relative Volume - IntradayHello All,
Relative Volume is one of the most important indicators and Traders should check it while trading/analyzing. it is used to identify whether the volume flows are increasing or decreasing. Relative volume measures current volume in relation to the “usual” volume for this time of the day. What is considered “usual"? For that, we have to use a historical baseline known as the average daily volume. That means how much volume a security does on a daily basis over a defined period. (This scripts runs on the time frames greater or equal 1 minute and less than 1 day)
The common definition for real-time relative volume is: Current volume for this time of day / Average volume for this time of day. It does not mean taking the volume (for example) from 10:30 am to 10:45 am and comparing it to what it does from 10:30 am to 10:45 am every day. What it truly means is to compare cumulative volumes. Therefore, this is the precise definition of real-time relative volume:
Current cumulative volume up to this time of day / Average cumulative volume up to this time of day
What should we understand while checking RVOL;
- Relative volume tell us if volume flows are increasing or decreasing
- A high relative volume tells us that there is increased trading activity in a security today
- Increased volume flows often accompany higher volatility i.e. a significant price move
Let see an example:
P.S. if you want to get more info about RVOL/Relative Volume then you can search it on the net. While developing the script this was used as reference, you can also check it for more info.
Enjoy!
Weis Wave Volume NumbersWhat is it?
This is an indicator to complement @modhelius' Weis Wave Volume Indicator.
Original code has been modified to display wave volume (cumulative) numbers above or below the latest candle of the corresponding wave on the main pane. Since we are concerned only with relative volume, VOLUME NUMBERS HAVE BEEN SCALED DOWN. (If you need actual volume numbers, uncheck "Scale Down Volume" option in Settings). Rising wave volume is denoted in green. Falling wave volume is denoted in red. Developing wave volume is postfixed with a '_'. Confirmed wave volumes won't have this.
Who is it for?
This indicator is useful if you already use Weis Waves in your analysis and could do with an additional numerical representation of the wave volume on the main pane. Can be used in conjunciton with @modhelius' Weis Wave Volume (WWV) indicator (need to be added separately) to complement the visual representation of the waves. Can be used independently as well.
Pelase note that if you use any other Weis Wave indicator (other than @modhelius'), the numbers and the waveforms might not match.