Cerca negli script per "volume"
Volume CloudsI know it isn't much, but it is my first time coding an indicator!
You might need to modify distance to fit the volatility and time frame of the chart you are looking at (if candles stay on top of cloud in an ugly mess, increase distance until signals can be seen). Sometimes heikin ashi candles can really help clear the picture up as well.
How to use:
The lines are the Volume Weighted Moving Average (green) and Simple Moving Average (red).
Cloud is green when VWMA is above SMA ( bullish ) and red when SMA is above VWMA ( bearish ).
The thicker the cloud, the stronger the signal. Also, the farther price strays from the cloud, the more pressure there is for it to return.
Look for divergences:
When price passes below a green cloud you have a bullish divergence (or if cloud turns green at crossing point)
Price pass above red cloud = bearish divergence.
Or confirmations:
Price passes below red cloud = bearish confirmation.
Price pass above green cloud = bullish confirmation.
I hope this helps you at least a little! Twitter: GarrettZ
volume stopsLooks at increasing or decreasing volume over the last 3 bars as well as how the last three price bars have close. The idea is to use a color bar as confirmation of support/resistance at that level.
Volume weighted Balance of PowerIt's a simple indication.
I multiplied the output of bop with volume, make it more smoother.
Volume MTFThis is a simple indicator you can use to separate volume from price on your chart. You can also select different time frames (MTF).
Thanks to LazyBear for cleaning up my previous messy code.
CVD - Cumulative Volume Delta Candles█ OVERVIEW
This indicator displays cumulative volume delta in candle form. It uses intrabar information to obtain more precise volume delta information than methods using only the chart's timeframe.
█ CONCEPTS
Bar polarity
By bar polarity , we mean the direction of a bar, which is determined by looking at the bar's close vs its open .
Intrabars
Intrabars are chart bars at a lower timeframe than the chart's. Each 1H chart bar of a 24x7 market will, for example, usually contain 60 bars at the lower timeframe of 1min, provided there was market activity during each minute of the hour. Mining information from intrabars can be useful in that it offers traders visibility on the activity inside a chart bar.
Lower timeframes (LTFs)
A lower timeframe is a timeframe that is smaller than the chart's timeframe. This script uses a LTF to access intrabars. The lower the LTF, the more intrabars are analyzed, but the less chart bars can display CVD information because there is a limit to the total number of intrabars that can be analyzed.
Volume delta
The volume delta concept divides a bar's volume in "up" and "down" volumes. The delta is calculated by subtracting down volume from up volume. Many calculation techniques exist to isolate up and down volume within a bar. The simplest techniques use the polarity of interbar price changes to assign their volume to up or down slots, e.g., On Balance Volume or the Klinger Oscillator . Others such as Chaikin Money Flow use assumptions based on a bar's OHLC values. The most precise calculation method uses tick data and assigns the volume of each tick to the up or down slot depending on whether the transaction occurs at the bid or ask price. While this technique is ideal, it requires huge amounts of data on historical bars, which usually limits the historical depth of charts and the number of symbols for which tick data is available.
This indicator uses intrabar analysis to achieve a compromise between the simplest and most precise methods of calculating volume delta. In the context where historical tick data is not yet available on TradingView, intrabar analysis is the most precise technique to calculate volume delta on historical bars on our charts. Our Volume Profile indicators use it. Other volume delta indicators in our Community Scripts such as the Realtime 5D Profile use realtime chart updates to achieve more precise volume delta calculations, but that method cannot be used on historical bars, so those indicators only work in real time.
This is the logic we use to assign intrabar volume to up or down slots:
• If the intrabar's open and close values are different, their relative position is used.
• If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
• As a last resort, when there is no movement during an intrabar and it closes at the same price as the previous intrabar, the last known polarity is used.
Once all intrabars making up a chart bar have been analyzed and the up or down property of each intrabar's volume determined, the up volumes are added and the down volumes subtracted. The resulting value is volume delta for that chart bar.
█ FEATURES
CVD Candles
Cumulative Volume Delta Candles present volume delta information as it evolves during a period of time.
This is how each candle's levels are calculated:
• open : Each candle's' open level is the cumulative volume delta for the current period at the start of the bar.
This value becomes zero on the first candle following a CVD reset.
The candles after the first one always open where the previous candle closed.
The candle's high, low and close levels are then calculated by adding or subtracting a volume value to the open.
• high : The highest volume delta value found in intrabars. If it is not higher than the volume delta for the bar, then that candle will have no upper wick.
• low : The lowest volume delta value found in intrabars. If it is not lower than the volume delta for the bar, then that candle will have no lower wick.
• close : The aggregated volume delta for all intrabars. If volume delta is positive for the chart bar, then the candle's close will be higher than its open, and vice versa.
The candles are plotted in one of two configurable colors, depending on the polarity of volume delta for the bar.
CVD resets
The "cumulative" part of the indicator's name stems from the fact that calculations accumulate during a period of time. This allows you to analyze the progression of volume delta across manageable chunks, which is often more useful than looking at volume delta cumulated from the beginning of a chart's history.
You can configure the reset period using the "CVD Resets" input, which offers the following selections:
• None : Calculations do not reset.
• On a fixed higher timeframe : Calculations reset on the higher timeframe you select in the "Fixed higher timeframe" field.
• At a fixed time that you specify.
• At the beginning of the regular session .
• On a stepped higher timeframe : Calculations reset on a higher timeframe automatically stepped using the chart's timeframe and following these rules:
Chart TF HTF
< 1min 1H
< 3H 1D
<= 12H 1W
< 1W 1M
>= 1W 1Y
The indicator's background shows where resets occur.
Intrabar precision
The precision of calculations increases with the number of intrabars analyzed for each chart bar. It is controlled through the script's "Intrabar precision" input, which offers the following selections:
• Least precise, covering many chart bars
• Less precise, covering some chart bars
• More precise, covering less chart bars
• Most precise, 1min intrabars
As there is a limit to the number of intrabars that can be analyzed by a script, a tradeoff occurs between the number of intrabars analyzed per chart bar and the chart bars for which calculations are possible.
Total volume candles
You can choose to display candles showing the total intrabar volume for the chart bar. This provides you with more context to evaluate a bar's volume delta by showing it relative to the sum of intrabar volume. Note that because of the reasons explained in the "NOTES" section further down, the total volume is the sum of all intrabar volume rather than the volume of the bar at the chart's timeframe.
Total volume candles can be configured with their own up and down colors. You can also control the opacity of their bodies to make them more or less prominent. This publication's chart shows the indicator with total volume candles. They are turned off by default, so you will need to choose to display them in the script's inputs for them to plot.
Divergences
Divergences occur when the polarity of volume delta does not match that of the chart bar. You can identify divergences by coloring the CVD candles differently for them, or by coloring the indicator's background.
Information box
An information box in the lower-left corner of the indicator displays the HTF used for resets, the LTF used for intrabars, and the average quantity of intrabars per chart bar. You can hide the box using the script's inputs.
█ INTERPRETATION
The first thing to look at when analyzing CVD candles is the side of the zero line they are on, as this tells you if CVD is generally bullish or bearish. Next, one should consider the relative position of successive candles, just as you would with a price chart. Are successive candles trending up, down, or stagnating? Keep in mind that whatever trend you identify must be considered in the context of where it appears with regards to the zero line; an uptrend in a negative CVD (below the zero line) may not be as powerful as one taking place in positive CVD values, but it may also predate a movement into positive CVD territory. The same goes with stagnation; a trader in a long position will find stagnation in positive CVD territory less worrisome than stagnation under the zero line.
After consideration of the bigger picture, one can drill down into the details. Exactly what you are looking for in markets will, of course, depend on your trading methodology, but you may find it useful to:
• Evaluate volume delta for the bar in relation to price movement for that bar.
• Evaluate the proportion that volume delta represents of total volume.
• Notice divergences and if the chart's candle shape confirms a hesitation point, as a Doji would.
• Evaluate if the progress of CVD candles correlates with that of chart bars.
• Analyze the wicks. As with price candles, long wicks tend to indicate weakness.
Always keep in mind that unless you have chosen not to reset it, your CVD resets for each period, whether it is fixed or automatically stepped. Consequently, any trend from the preceding period must re-establish itself in the next.
█ NOTES
Know your volume
Traders using volume information should understand the volume data they are using: where it originates and what transactions it includes, as this can vary with instruments, sectors, exchanges, timeframes, and between historical and realtime bars. The information used to build a chart's bars and display volume comes from data providers (exchanges, brokers, etc.) who often maintain distinct feeds for intraday and end-of-day (EOD) timeframes. How volume data is assembled for the two feeds depends on how instruments are traded in that sector and/or the volume reporting policy for each feed. Instruments from crypto and forex markets, for example, will often display similar volume on both feeds. Stocks will often display variations because block trades or other types of trades may not be included in their intraday volume data. Futures will also typically display variations.
Note that as intraday vs EOD variations exist for historical bars on some instruments, differences may also exist between the realtime feeds used on intraday vs 1D or greater timeframes for those same assets. Realtime reporting rules will often be different from historical feed reporting rules, so variations between realtime feeds will often be different from the variations between historical feeds for the same instrument. The Volume X-ray indicator can help you analyze differences between intraday and EOD volumes for the instruments you trade.
If every unit of volume is both bought by a buyer and sold by a seller, how can volume delta make sense?
Traders who do not understand the mechanics of matching engines (the exchange software that matches orders from buyers and sellers) sometimes argue that the concept of volume delta is flawed, as every unit of volume is both bought and sold. While they are rigorously correct in stating that every unit of volume is both bought and sold, they overlook the fact that information can be mined by analyzing variations in the price of successive ticks, or in our case, intrabars.
Our calculations model the situation where, in fully automated order handling, market orders are generally matched to limit orders sitting in the order book. Buy market orders are matched to quotes at the ask level and sell market orders are matched to quotes at the bid level. As explained earlier, we use the same logic when comparing intrabar prices. While using intrabar analysis does not produce results as precise as when individual transactions — or ticks — are analyzed, results are much more precise than those of methods using only chart prices.
Not only does the concept underlying volume delta make sense, it provides a window on an oft-overlooked variable which, with price and time, is the only basic information representing market activity. Furthermore, because the calculation of volume delta also uses price and time variations, one could conceivably surmise that it can provide a more complete model than ones using price and time only. Whether or not volume delta can be useful in your trading practice, as usual, is for you to decide, as each trader's methodology is different.
For Pine Script™ coders
As our latest Polarity Divergences publication, this script uses the recently released request.security_lower_tf() Pine Script™ function discussed in this blog post . It works differently from the usual request.security() in that it can only be used at LTFs, and it returns an array containing one value per intrabar. This makes it much easier for programmers to access intrabar information.
Look first. Then leap.
Delta Volume Channels [LucF]█ OVERVIEW
This indicator displays on-chart visuals aimed at making the most of delta volume information. It can color bars and display two channels: one for delta volume, another calculated from the price levels of bars where delta volume divergences occur. Markers and alerts can also be configured using key conditions, and filtered in many different ways. The indicator caters to traders who prefer chart visuals over raw values. It will work on historical bars and in real time, using intrabar analysis to calculate delta volume in both conditions.
█ CONCEPTS
Delta Volume
The volume delta concept divides a bar's volume in "up" and "down" volumes. The delta is calculated by subtracting down volume from up volume. Many calculation techniques exist to isolate up and down volume within a bar. The simplest techniques use the polarity of interbar price changes to assign their volume to up or down slots, e.g., On Balance Volume or the Klinger Oscillator . Others such as Chaikin Money Flow use assumptions based on a bar's OHLC values. The most precise calculation method uses tick data and assigns the volume of each tick to the up or down slot depending on whether the transaction occurs at the bid or ask price. While this technique is ideal, it requires huge amounts of data on historical bars, which usually limits the historical depth of charts and the number of symbols for which tick data is available.
This indicator uses intrabar analysis to achieve a compromise between the simplest and most precise methods of calculating volume delta. In the context where historical tick data is not yet available on TradingView, intrabar analysis is the most precise technique to calculate volume delta on historical bars on our charts. TradingView's Volume Profile built-in indicators use it, as do the CVD - Cumulative Volume Delta Candles and CVD - Cumulative Volume Delta (Chart) indicators published from the TradingView account . My Volume Delta Columns Pro indicator also uses intrabar analysis. Other volume delta indicators such as my Realtime 5D Profile use realtime chart updates to achieve more precise volume delta calculations. Indicators of that type cannot be used on historical bars however; they only work in real time.
This is the logic I use to assign intrabar volume to up or down slots:
• If the intrabar's open and close values are different, their relative position is used.
• If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
• As a last resort, when there is no movement during an intrabar and it closes at the same price as the previous intrabar, the last known polarity is used.
Once all intrabars making up a chart bar have been analyzed and the up or down property of each intrabar's volume determined, the up volumes are added and the down volumes subtracted. The resulting value is volume delta for that chart bar, which can be used as an estimate of the buying/selling pressure on an instrument.
Delta Volume Percent (DV%)
This value is the proportion that delta volume represents of the total intrabar volume in the chart bar. Note that on some symbols/timeframes, the total intrabar volume may differ from the chart's volume for a bar, but that will not affect our calculations since we use the total intrabar volume.
Delta Volume Channel
The DV channel is the space between two moving averages: the reference line and a DV%-weighted version of that reference. The reference line is a moving average of a type, source and length which you select. The DV%-weighted line uses the same settings, but it averages the DV%-weighted price source.
The weight applied to the source of the reference line is calculated from two values, which are multiplied: DV% and the relative size of the bar's volume in relation to previous bars. The effect of this is that DV% values on bars with higher total volume will carry greater weight than those with lesser volume.
The DV channel can be in one of four states, each having its corresponding color:
• Bull (teal): The DV%-weighted line is above the reference line.
• Strong bull (lime): The bull condition is fulfilled and the bar's close is above the reference line and both the reference and the DV%-weighted lines are rising.
• Bear (maroon): The DV%-weighted line is below the reference line.
• Strong bear (pink): The bear condition is fulfilled and the bar's close is below the reference line and both the reference and the DV%-weighted lines are falling.
Divergences
In the context of this indicator, a divergence is any bar where the slope of the reference line does not match that of the DV%-weighted line. No directional bias is assigned to divergences when they occur.
Divergence Channel
The divergence channel is the space between two levels (by default, the bar's low and high ) saved when divergences occur. When price has breached a channel and a new divergence occurs, a new channel is created. Until that new channel is breached, bars where additional divergences occur will expand the channel's levels if the bar's price points are outside the channel.
Prices breaches of the divergence channel will change its state. Divergence channels can be in one of five different states:
• Bull (teal): Price has breached the channel to the upside.
• Strong bull (lime): The bull condition is fulfilled and the DV channel is in the strong bull state.
• Bear (maroon): Price has breached the channel to the downside.
• Strong bear (pink): The bear condition is fulfilled and the DV channel is in the strong bear state.
• Neutral (gray): The channel has not been breached.
█ HOW TO USE THE INDICATOR
Load the indicator on an active chart (see here if you don't know how).
The default configuration displays:
• The DV channel, without the reference or DV%-weighted lines.
• The Divergence channel, without its level lines.
• Bar colors using the state of the DV channel.
The default settings use an Arnaud-Legoux moving average on the close and a length of 20 bars. The DV%-weighted version of it uses a combination of DV% and relative volume to calculate the ultimate weight applied to the reference. The DV%-weighted line is capped to 5 standard deviations of the reference. The lower timeframe used to access intrabars automatically adjusts to the chart's timeframe and achieves optimal balance between the number of intrabars inspected in each chart bar, and the number of chart bars covered by the script's calculations.
The Divergence channel's levels are determined using the high and low of the bars where divergences occur. Breaches of the channel require a bar's low to move above the top of the channel, and the bar's high to move below the channel's bottom.
No markers appear on the chart; if you want to create alerts from this script, you will need first to define the conditions that will trigger the markers, then create the alert, which will trigger on those same conditions.
To learn more about how to use this indicator, you must understand the concepts it uses and the information it displays, which requires reading this description. There are no videos to explain it.
█ FEATURES
The script's inputs are divided in four sections: "DV channel", "Divergence channel", "Other Visuals" and "Marker/Alert Conditions". The first setting is the selection method used to determine the intrabar precision, i.e., how many lower timeframe bars (intrabars) are examined in each chart bar. The more intrabars you analyze, the more precise the calculation of DV% results will be, but the less chart coverage can be covered by the script's calculations.
DV Channel
Here, you control the visibility and colors of the reference line, its weighted version, and the DV channel between them.
You also specify what type of moving average you want to use as a reference line, its source and length. This acts as the DV channel's baseline. The DV%-weighted line is also a moving average of the same type and length as the reference line, except that it will be calculated from the DV%-weighted source used in the reference line. By default, the DV%-weighted line is capped to five standard deviations of the reference line. You can change that value here. This section is also where you can disable the relative volume component of the weight.
Divergence Channel
This is where you control the appearance of the divergence channel and the key price values used in determining the channel's levels and breaching conditions. These choices have an impact on the behavior of the channel. More generous level prices like the default low and high selection will produce more conservative channels, as will the default choice for breach prices.
In this section, you can also enable a mode where an attempt is made to estimate the channel's bias before price breaches the channel. When it is enabled, successive increases/decreases of the channel's top and bottom levels are counted as new divergences occur. When one count is greater than the other, a bull/bear bias is inferred from it.
Other Visuals
You specify here:
• The method used to color chart bars, if you choose to do so.
• The display of a mark appearing above or below bars when a divergence occurs.
• If you want raw values to appear in tooltips when you hover above chart bars. The default setting does not display them, which makes the script faster.
• If you want to display an information box which by default appears in the lower left of the chart.
It shows which lower timeframe is used for intrabars, and the average number of intrabars per chart bar.
Marker/Alert Conditions
Here, you specify the conditions that will trigger up or down markers. The trigger conditions can include a combination of state transitions of the DV and the divergence channels. The triggering conditions can be filtered using a variety of conditions.
Configuring the marker conditions is necessary before creating an alert from this script, as the alert will use the marker conditions to trigger.
Markers only appear on bar closes, so they will not repaint. Keep in mind, when looking at markers on historical bars, that they are positioned on the bar when it closes — NOT when it opens.
Raw values
The raw values calculated by this script can be inspected using a tooltip and the Data Window. The tooltip is visible when you hover over the top of chart bars. It will display on the last 500 bars of the chart, and shows the values of DV, DV%, the combined weight, and the intermediary values used to calculate them.
█ INTERPRETATION
The aim of the DV channel is to provide a visual representation of the buying/selling pressure calculated using delta volume. The simplest characteristic of the channel is its bull/bear state. One can then distinguish between its bull and strong bull states, as transitions from strong bull to bull states will generally happen when buyers are losing steam. While one should not infer a reversal from such transitions, they can be a good place to tighten stops. Only time will tell if a reversal will occur. One or more divergences will often occur before reversals.
The nature of the divergence channel's design makes it particularly adept at identifying consolidation areas if its settings are kept on the conservative side. A gray divergence channel should usually be considered a no-trade zone. More adventurous traders can use the DV channel to orient their trade entries if they accept the risk of trading in a neutral divergence channel, which by definition will not have been breached by price.
If your charts are already busy with other stuff you want to hold on to, you could consider using only the chart bar coloring component of this indicator:
At its simplest, one way to use this indicator would be to look for overlaps of the strong bull/bear colors in both the DV channel and a divergence channel, as these identify points where price is breaching the divergence channel when buy/sell pressure is consistent with the direction of the breach. I have highlighted all those points in the chart below. Not all of them would have produced profitable trades, but nothing is perfect in the markets. Also, keep in mind that the circles identify the visual you would be looking for — not the trade's entry level.
█ LIMITATIONS
• The script will not work on symbols where no volume is available. An error will appear when that is the case.
• Because a maximum of 100K intrabars can be analyzed by a script, a compromise is necessary between the number of intrabars analyzed per chart bar
and chart coverage. The more intrabars you analyze per chart bar, the less coverage you will obtain.
The setting of the "Intrabar precision" field in the "DV channel" section of the script's inputs
is where you control how the lower timeframe is calculated from the chart's timeframe.
█ NOTES
Volume Quality
If you use volume, it's important to understand its nature and quality, as it varies with sectors and instruments. My Volume X-ray indicator is one way you can appraise the quality of an instrument's intraday volume.
For Pine Script™ Coders
• This script uses the new overload of the fill() function which now makes it possible to do vertical gradients in Pine. I use it for both channels displayed by this script.
• I use the new arguments for plot() 's `display` parameter to control where the script plots some of its values,
namely those I only want to appear in the script's status line and in the Data Window.
• I wrote my script using the revised recommendations in the Style Guide from the Pine v5 User Manual.
█ THANKS
To PineCoders . I have used their lower_tf library in this script, to manage the calculation of the LTF and intrabar stats, and their Time library to convert a timeframe in seconds to a printable form for its display in the Information box.
To TradingView's Pine Script™ team. Their innovations and improvements, big and small, constantly expand the boundaries of the language. What this script does would not have been possible just a few months back.
And finally, thanks to all the users of my scripts who take the time to comment on my publications and suggest improvements. I do not reply to all but I do read your comments and do my best to implement your suggestions with the limited time that I have.
Bullish/Bearish VolumeThe "Bullish/Bearish Volume" indicator helps traders identify discrepancies between price movement and trading volumes. Sometimes the price trends in one direction while trading volumes indicate opposing intentions among market participants. This indicator aims to identify such divergences, assisting traders in making more informed and balanced trading decisions.
Key features:
1. Directional Volume Differences: The indicator calculates volumes by separating them into two main categories: buying and selling. When the closing price is higher than the opening price, buying volume is shown in green, while selling volume is shown in red when the closing price is lower than the opening price. This accurate classification helps identify which volume type predominates in the current interval.
2. Histograms by Fixed Time Intervals: Collecting data from a fixed time interval (1 minute), the indicator analyzes and sums up buying and selling volumes regardless of the selected chart timeframe. This provides a more detailed market view, allowing traders to accurately gauge sentiment within any chosen timeframe.
3. Total Volume: The indicator aggregates buying and selling volumes, representing total trading activity in gray transparent bars. This gives traders a clear visual representation of overall volume activity in the market for a selected period.
4. Volume Delta and its Moving Average: The volume delta (the difference between buying and selling volumes) is highlighted in blue, allowing for monitoring shifts in the balance of buying and selling power. Additionally, the indicator includes a moving average of the delta, shown as a blue line, to smooth out short-term fluctuations and help traders easily identify long-term trends in volume shifts.
5. Volume Volatility: A histogram representing volume volatility offers insight into trading activity variability, uncovering abnormal spikes or lulls in market dynamics.
Bullish/Bearish Volume is a powerful tool that can break down market flows into understandable signals, enabling traders to better recognize imbalances and make informed decisions.
Movement based on Buying/Selling VolumeDescription:
The "Buying Selling Volume" indicator calculates buying and selling volumes based on price movements within a specified lookback period. It then computes exponential moving averages (EMAs) of these volumes to determine trend direction. The indicator visually represents trend direction on the chart.
Volume Calculation and Normalization (Lines #1 - #12):
The indicator first computes the buying volume (BV) and selling volume (SV) based on price movements within the specified lookback period. These volumes are calculated proportionally to the distance between the closing price and the high and low of each candle.
To ensure consistent behavior and prevent division by zero, the volumes are normalized using a conditional statement to handle cases where the high and low are equal, which implies a lack of price movement.
Additionally, the volume (vol) is normalized to ensure non-zero division in subsequent calculations.
Total Volume and Proportional Volume Calculation (Lines #13 - #20):
The total volume (TP) is computed by summing the buying and selling volumes.
The proportional buying volume (BPV) and selling volume (SPV) are then calculated based on their respective contributions to the total volume.
These proportional volumes are scaled by the total volume to ensure accurate representation relative to market activity.
Evaluating Buying and Selling Pressure (Lines #21 - #24):
The code segment assigns positive or negative values to represent buying and selling pressure, respectively, based on the comparison between BPV and SPV. This step involves determining whether the buying pressure exceeds the selling pressure or vice versa.
The calculated values, denoted as BPc1 and SPc1, encapsulate the relative strength of buying and selling forces within the market.
EMA Calculation and Trend Identification (Lines #25 - #32):
The BPc1 and SPc1 values are subjected to exponential moving average (EMA) calculations using the specified lookback period (LookbackL). This process involves smoothing out the buying and selling pressure data to reveal underlying trends.
The resulting EMAs, represented by ema1B and ema1S, serve as crucial indicators of trend direction. A bullish trend is indicated when ema1B exceeds ema1S, while a bearish trend is signaled when ema1B falls below ema1S.
Secondary Volume Analysis and Trend Confirmation (Lines #33 - #42):
A similar volume analysis and EMA calculation process is repeated in this segment, using a different lookback period (LookbackL2). This allows for a secondary assessment of market dynamics and trend direction.
The resulting EMAs, denoted as ema1B2 and ema1S2, are compared to validate the trend direction identified in the primary analysis.
Visual Representation and Trend Display (Lines #43 - #46):
Finally, the indicator visualizes the identified trends on the chart by plotting colored shapes based on the comparison between the primary and secondary trend directions.
A green color indicates alignment in bullish trends, a red color signifies alignment in bearish trends, while a neutral color (gray) represents no clear consensus between the primary and secondary analyses.
Ideal Usage:
1. **Trend Confirmation:** Traders can use this indicator to confirm trend direction before entering trades.
2. **Reversal Signals:** Changes in trend direction, indicated by shifts in plotted shape colors, can signal potential market reversals.
Warnings:
1. **False Signals:** Like any technical indicator, false signals may occur, especially during low-volume or choppy market conditions. Additional analysis and risk management techniques are essential to mitigate potential losses.
2. **Parameter Sensitivity:** Adjusting lookback periods can impact the indicator's sensitivity to price movements. Traders should test different parameter settings and consider market conditions when using the indicator.
Buy Sell Volume SeparateDescription:
The script is designed to provide traders with a unique and comprehensive analysis of trading volume dynamics. Unlike existing scripts, the script offers a distinct advantage by presenting both buy and sell volumes on separate scales, simplifying trading decisions.
Key Features:
1. Dual Volume Scales: The script provides two separate volume scales, one for buy volumes and another for sell volumes. This separation allows to easily distinguish between buying and selling pressure, aiding in more precise trade entries and exits.
2. Clear and Intuitive Chart: The script ensures that the chart it generates is clean and easy to understand. The buy and sell volumes are color-coded for clarity, and you can quickly identify significant volume spikes and trends.
How to Use:
1. Adding the Script: To use the script, simply add it to your TradingView chart.
2. Interpreting Buy and Sell Volumes: On the chart, you will see two separate volume scales—one for buy volumes and one for sell volumes. Green bars represent buying pressure, while red bars indicate selling pressure. Pay attention to the relative strengths and patterns of these bars to gauge market sentiment.
3. Informed Trading Decisions: Armed with insights into both buy and sell volumes, you can make more informed trading decisions. Look for divergences, patterns, or significant volume spikes to identify potential entry and exit points.
WIG20 Total Value-Weighted VolumeThis Pine Script creates a custom indicator for TradingView that calculates and visualizes the total "value-weighted volume" of the 20 stocks in the WIG20 index (a major Polish stock market index). Here's a breakdown of what it does:
Functionality:
Stock Selection:
The script allows you to input the ticker symbols for the 20 stocks that make up the WIG20 index (e.g., "PKO" for PKO Bank Polski, "PKN" for PKN Orlen, etc.). These are customizable via input fields, so you can adjust them to match the current WIG20 constituents.
Data Retrieval:
For each of the 20 stocks, it fetches two pieces of data from the current chart timeframe (e.g., daily, hourly):
Volume: The number of shares traded (e.g., v01 for the first stock).
Average Price: The midpoint price of the candle, calculated as (open + close) / 2 (e.g., p01 for the first stock). This represents a typical price for that period.
Value-Weighted Volume Calculation:
For each stock, it multiplies the volume by its average price (e.g., vw01 = v01 * p01). This converts the raw volume (in shares) into a monetary value (e.g., in Polish złoty, PLN, assuming the prices are in PLN).
The result, called "value-weighted volume," reflects the total monetary amount traded for each stock rather than just the number of shares.
Total Value-Weighted Volume:
It sums the value-weighted volumes of all 20 stocks into a single value, totalValueVolume. This represents the combined monetary trading activity across the WIG20 index for each time period (e.g., each candle on the chart).
Statistical Analysis:
The script calculates a rolling mean and standard deviation of the totalValueVolume over a user-defined lookback period (default is 20 bars, adjustable via input).
It then computes a "3-sigma" threshold, which is the mean plus three times the standard deviation. This threshold identifies unusually high trading activity (statistically significant outliers).
Candle Direction:
It checks whether the current candle on the chart (e.g., the WIG20 index itself) is bullish or bearish:
Bullish: If the close price is higher than the open price (close > open).
Bearish: If the close price is lower than the open price (close < open).
Color-Coded Visualization:
The totalValueVolume is plotted as a histogram on the chart with dynamic colors:
Blue: If the value-weighted volume is below the 3-sigma threshold (normal trading activity).
Green: If the value-weighted volume exceeds the 3-sigma threshold and the candle is bullish (indicating unusually high buying activity).
Red: If the value-weighted volume exceeds the 3-sigma threshold and the candle is bearish (indicating unusually high selling activity).
Purpose:
What It Shows: The indicator highlights the total monetary trading volume across the WIG20 stocks, adjusted for each stock’s price, and flags periods of exceptional activity (above 3 sigma) with colors that indicate market direction (bullish or bearish).
Use Case: Traders or analysts might use this to:
Identify significant market events where trading volume spikes (e.g., news-driven moves).
Assess whether those spikes align with bullish (green) or bearish (red) sentiment, based on the WIG20 index’s price movement.
Compare monetary trading activity across different periods, rather than just share volume, which gives more weight to higher-priced stocks.
Key Features:
Customizable: You can tweak the stock symbols and lookback period to fit your needs.
Statistical Insight: The 3-sigma rule helps spot outliers in trading activity.
Visual Clarity: The histogram’s color changes make it easy to see when volume spikes occur and whether they’re tied to upward or downward price moves.
Example Output:
On a daily WIG20 chart, if one day’s total value-weighted volume is exceptionally high (above 3 sigma) and the WIG20 closes higher than it opened, the histogram bar for that day turns green. If it closes lower, it turns red. Otherwise, it stays blue.
In essence, this script transforms raw volume data into a price-adjusted, statistically informed indicator that visually emphasizes significant trading events with directional context!
Cumulative Buying and Selling Volume with 3 Lookback PeriodsScript Overview:
This script is designed to help traders identify market momentum by analyzing buying and selling volume. It calculates the cumulative buying and selling pressure over three different lookback periods, providing insights into whether the bulls or bears are dominating at any given time. The script does this by computing the cumulative buying and selling volume for each period and comparing them through exponential moving averages (EMA) to smooth out short-term fluctuations.
Purpose and Use:
The primary goal of this script is to highlight shifts in market sentiment based on volume dynamics. Volume is a critical component in market analysis, often signaling the strength behind price movements. By focusing on cumulative buying and selling pressure, the script gives traders an idea of whether the market is trending towards more buying or selling during specific periods. Traders can use this tool to:
Identify potential entry points when buying pressure is strong.
Recognize potential selling opportunities when selling pressure is increasing.
Detect periods of indecision when neither buying nor selling dominates.
Key Concepts:
1. Buying Volume (BV):
The buying volume is calculated based on the price range of each candle. It represents the volume allocated to the bullish side of the market:
When the close is near the high, the buying volume is higher.
Formula: BV = volume * (close - low) / (high - low).
2. Selling Volume (SV):
Similarly, selling volume is derived based on the position of the close relative to the low:
When the close is near the low, selling volume is higher.
Formula: SV = volume * (high - close) / (high - low)
3. Lookback Periods:
The script allows users to define three different lookback periods (5, 10, and 20 by default). These periods smooth out the cumulative buying and selling volumes using EMA calculations:
Shorter periods capture more immediate changes in volume dynamics.
Longer periods provide a broader perspective on market trends.
4. Cumulative Volume Calculation:
For each lookback period, cumulative buying and selling volumes are tracked separately and then smoothed with EMA:
emaBuyVol and emaSellVol are the smoothed values for buying and selling volumes over the lookback periods.
5. Market Pressure Comparison:
Buying Pressure: If the EMA of buying volume is greater than the EMA of selling volume for a particular lookback period, the script considers that buying pressure dominates for that period.
Selling Pressure: Conversely, if selling volume dominates over buying volume for a period, the script registers selling pressure.
6. Overall Market Pressure:
The script aggregates the buying and selling pressures from the three lookback periods to determine the overall market sentiment:
If the majority of periods show buying pressure, the market is bullish.
If the majority show selling pressure, the market is bearish.
If neither side dominates, it suggests a neutral or indecisive market.
Visual Cues:
The script provides visual feedback to help traders quickly interpret the market pressure:
Background Color:
Green (#2bff00) when buying pressure dominates.
Red (#ff0000) when selling pressure dominates.
Gray (#404040) when there is no clear dominance.
Bar Color: The script also colors the price bars based on the dominant market pressure:
Green for buying pressure.
Red for selling pressure.
Gray for neutral or balanced market pressure.
Reset Mechanism:
At the start of each new candle, the cumulative volumes for all three periods are reset to zero. This ensures that the cumulative volumes are only measured for the current candle, preventing carryover from previous periods that could distort the analysis.
How Traders Can Use This Script:
Trend Confirmation: Traders can use the script as a trend confirmation tool. When the background turns green (buying dominance), it suggests bullish momentum. When red, bearish momentum is likely. This information can be used to confirm existing positions or signal new trades in the direction of the market pressure.
Reversal Detection: A sudden shift in the background color (from green to red or vice versa) can indicate a potential reversal. This can be particularly useful when combined with other technical indicators such as price action or support/resistance levels.
Multiple Timeframes: Since the script supports three different lookback periods, it provides a comprehensive view of market pressure across short-term, medium-term, and long-term perspectives. Traders can tailor the lookback periods based on their preferred timeframe to match their trading style, whether it’s intraday trading or longer-term swing trading.
Risk Management: The script's clear visual cues help traders manage risk by highlighting when selling pressure increases, allowing them to consider reducing long positions or tightening stop-losses.
Buying and Selling Pressure with Delta VolumeScript Name
"Buying and Selling Pressure with Delta Volume"
Purpose
The script is designed to analyse and visualise buying and selling pressure for each candle on a trading chart. It estimates the volume attributed to buying and selling within each candle and calculates the delta volume, which is the difference between buying and selling volume. This can help traders understand market dynamics and the balance of power between buyers and sellers.
Components
Volume Data:
The script uses the volume data from the current chart's timeframe.
Candle Spread:
The spread is calculated as the difference between the high and low prices of each candle.
Handling Doji Candles:
If the spread is zero (which can happen with Doji candles), it sets the spread to na (not available) to prevent division by zero errors.
Buying and Selling Pressure:
Buying Pressure: Estimated as the proportion of the candle's volume attributed to the price moving up from the low to the close.
Selling Pressure: Estimated as the proportion of the candle's volume attributed to the price moving down from the high to the close.
Delta Volume:
The difference between buying pressure and selling pressure, representing the net buying or selling volume for each candle.
Plotting
Buying Pressure:
Plotted as green histogram bars.
Selling Pressure:
Plotted as red histogram bars.
Delta Volume:
Plotted as blue histogram bars and a blue line, indicating the difference between buying and selling pressure.
A horizontal line at zero (grey colour) is added to help visualise positive and negative delta volume.
EM Visible Range Volume Profile█ OVERVIEW
ᴇᴍ VRVP (Visible Range Volume Profile) indicator calculates the volume profile within the visible range of prices.
Volume Profile is an advanced technical analysis indicator that shows trading activity over a specified period of time at certain price levels.
The indicator plots a histogram on the chart that reflects dominant or significant price levels based that are based on volume.
VP concept
VP Components
Open, High, Low, Close:
There are different types of volume profile indicators but the majority of them will designate the OHLC.
Point of Control:
A price level with the most traded volume during one session, also known as POC.
High Volume Node (HVN):
Area of high volume relative to surrounding price action.
Low Volume Node (LVN):
Area of low volume relative to surrounding price action.
Analysis of price in relation to high and low volume nodes is useful when building context around your trades.
█ VOLUME PROFILE STRATEGIES
The distribution of a volume profile can help you determine the strength of a trend and spot potential reversal zones. Let’s take a look at the five different distribution types.
Neutral D
In order for price to break away from value, either the buyers or the sellers will have to become more aggressive than the other side. When this occurs, it gives us with a vital piece of information.
Now we know who were the agressors at this price level: either the buyers or the sellers. That's why this is a good level for a trading setup if the price bounces back.
Bearish P and Bullish P
Bearish P — reversal. Bullish P — confirmation.
Bearish Ь and Bullish Ь
Bearish Ь — confirmation. Bullish Ь — reversal.
Examples
█ INPUTS
Width — amplitude of the VP histogram.
Grid — the number of columns of the VP histogram.
Delta of volumes — combinatorial determination of the ratios of sellers and buyers.
In quoted units — conversion in units of quoted currency.
Logarithmic scale — recalculation the grid step to the logarithmic scale of the chart.
HTF — (Higher Timeframe) calculation of VP for the period of the selected timeframe. ISO: Isolated computation in HTF period.
Palette: Total volume, Volume of buyers, Volume of sellers, HTF bars.
Warnings: colour of the «⚠» icon, language of information in the Tooltip.
Addition: ᴇᴍ CHN-RMA — a grid of moving averages with periods of centered hexagonal numbers.
█ ОБЩИЕ СВЕДЕНИЯ
ᴇᴍ VRVP (Visible Range Volume Profile) рассчитывает профиль объёма в видимом диапазоне цен.
Профиль объёма — это продвинутый индикатор технического анализа, который показывает торговую активность за условленный период времени на определённых ценовых уровнях.
Индикатор строит на графике гистограмму, отражающую доминирующие или значимые ценовые уровни, основанные на объёме.
█ НАСТРОЙКИ
Ширина — амплитуда гистограммы VP.
Сетка — количество колонок гистограммы VP.
Дельта объёмов — комбинаторное определение соотношений продаж и покупок.
В котируемых единицах — пересчёт в единицах котируемой валюты.
Логарифмическая шкала — пересчёт шага сетки на логарифмическую шкалу графика.
HTF — (Higher Timeframe) расчёт VP за период выбранного таймфрейма. ISO: Изолированное вычисление в HTF-периоде.
Палитра: Суммарный объём, Объём покупок, Объём продаж, Бары HTF.
Предупреждения: цвет значка «⚠», язык информации в Tooltip.
Дополнение: ᴇᴍ CHN-RMA — сетка скользящих средних с периодами центрированных гексагональных чисел.
Aggregated Volume (Multi-Exchange)Indicator: Aggregated Volume (Multi-Exchange)
Overview:
The Aggregated Volume (Multi-Exchange) indicator is designed to aggregate trading volume data from multiple exchanges for a specific cryptocurrency pair. The goal is to provide a consolidated view of the total trading volume across different platforms, helping traders and analysts gauge the overall market activity for a given asset.
Features:
Multi-Exchange Support: The indicator allows you to aggregate trading volume data from various exchanges. Users can enable or disable volume data from specific exchanges (e.g., Binance, Bybit, Kucoin, etc.).
Spot and Futures Volumes: The indicator can sum the volume for spot trading and futures trading separately if desired. However, in the current version, it only sums the volume for specific pairs across multiple exchanges, without distinguishing between spot and futures volumes (though this feature can be added if necessary).
Customizable Exchange Selection: Users can select which exchanges' volume data to include in the aggregation.
Real-Time Updates: The volume data is updated in real-time as new bars are formed on the chart, providing an up-to-date picture of the trading volume.
Purpose:
The primary purpose of this indicator is to consolidate trading volume information from multiple exchanges for the same trading pair (e.g., BTC/USD). Traders can use this aggregated volume to gain a better understanding of market activity across various platforms, as well as assess the level of liquidity and interest in a particular asset.
By viewing the total aggregated volume, traders can:
Track market trends: Higher aggregated volume can signal increased market interest, making it easier to spot trends or potential breakouts.
Analyze liquidity: This indicator can help traders assess liquidity in the market, especially when using multiple exchanges.
Identify potential market manipulation: If there is a sudden spike in volume on multiple exchanges, it could signal market manipulation or an event-driven surge.
How it Works:
Volume Aggregation: The indicator collects and sums the volume data for a given symbol (e.g., BTC/USD) from different exchanges like Binance, Bybit, Kucoin, and others.
Multiple Exchanges: The volume data is aggregated from each selected exchange and plotted as a single volume value on the chart.
Real-Time Volume Plotting: The total aggregated volume is then plotted as a histogram on the chart, with the color of the bars changing depending on whether the price is rising or falling (typically green for rising prices and red for falling prices).
Inputs/Settings:
Exchange Selection: A list of checkboxes where users can choose which exchanges' volume data to include (e.g., Binance, Bybit, Kucoin, etc.).
Color Settings: Users can set the color for the histogram bars based on price direction (e.g., green for rising and red for falling).
Volume Calculation: The indicator calculates the volume for a specific cryptocurrency pair across selected exchanges in real-time.
Daily VolumeShows a table in the top right of the chart with a few options:
Only show intraday: By default the table will not be visible on timeframes of 1D or above, but this can be changed to show all the time if desired.
Daily volume: Displays the volume for the day so far, regardless of what timeframe is currently showing.
Yesterday's volume: Displays the volume from the previous day. As with the daily volume , it will show the entire previous day's volume regardless of the current timeframe.
Average Volume: Displays the average volume based on a user-specified number of days. The default value is 30 days.
Text color and table color: Choose the color settings for the table text and background.
Falling and Growing VolumeFalling & Growing Volume is an indicator which shows growing and falling volumes in different colors. If current volume greater then previous volume then it is considered as growing volume otherwise as falling volume.
BTC Volume: Bitfinex Total/Long/ShortQuick little script to show Bitfinex LONG/SHORT positions in context to overall volume on the TF. Works best on small TFs to eliminate fluctuation in margin positions impacting the 'accuracy' of volume.
Base Color Scheme
Blue: Total Bitfinex traded volume
Yellow: Assumed Volume of BTCUSDLONGS (Close Position - Open Position)
Orange: Assumed Volume of BTCUSDSHORTS (Close Position - Open Position)
Work is based on conversations and community interaction through Crypto Traders Pro.
Propagation Volumes and TrendsWith this, i calculate RSI of the HL2 of the volume and use like an oscillator, this will use to measure the strength of the trend and the "Volume Flow" to follow the trend.
I use like foundation the LazyBear "Volume Flow Indicator" "honor a quien honor merece"
Background:
I think the volume as the price could be represented by candles or other graphic to use indicators and strengthen their analysis, due to lack of registration of this it is first necessary to calculate a volume graph, if the candle traditionally negative price brand then the total volume is taken as negative for the period. An example of this is in the On Balance Volume indicator, the problem is that there is no way to analyze the volume using other methods. An approximate volume of the spread could be the use of the price spread to make a synthetic behavior
As traditionally is observed if Open> Close then the candle and the volume will be negative and vice versa; the next step, is estimate the amounts of the candle necessary to calculate the ratio to use for the volume and thus idealize their spread within the candle:
VLOW = Volume x Low
vHigh = x High Volume
VOpen = vClose
vClose = Volume x Close
This graph can show a stable synthetic form of fluctuations in the volume trend affected by price.
ideas, comments and suggestions (or corrections).They are always welcome
Delta Volume[integral]Delta Volume – Visualizing Accumulated Candle Dominance
This indicator measures and accumulates the net difference between bullish and bearish candle volumes over a user-defined range of bars. It integrates the volume dominance over time, offering traders a unique view into how buying or selling pressure has been distributed.
🔍 Concept & Logic
Delta Volume Calculation
For each bar, the script looks x to y bars back in time (e.g., from 10 bars ago to 5 bars ago) and:
Adds volume for bullish candles (close > open)
Subtracts volume for bearish candles (close < open)
This gives us a snapshot of volume dominance for that range.
What is Integration in This Context?
Integration, in this script, refers to the accumulation (summation) of these dominance differences over a period.
Much like integrating a function in calculus (i.e., area under the curve), here we are integrating the "net advantage" of buyers vs. sellers.
Over time, this builds a cumulative picture of directional pressure, showing whether buyers (positive integration) or sellers (negative integration) are in control.
Why It Matters
Unlike simple volume charts, this tool filters noise by focusing on who is dominating the market—buyers or sellers—and tracks that dominance over time.
It gives a macro-level view of pressure buildup, which can precede major breakouts or reversals.
📊 Visual Features
Buy Volume (green columns): Sum of volumes from bullish candles.
Sell Volume (red columns): Sum of volumes from bearish candles.
Candle Difference (white line): Net dominance difference (Buy - Sell).
Integrated Dominance Difference: Cumulative label showing the total buyer-seller dominance over the defined integration period.
Zero Line (dashed): Balance point.
🧠 Use Case
Detect divergences between price and cumulative volume pressure.
Confirm trend strength when integrated delta volume aligns with price movement.
Spot accumulation or distribution phases invisible on price action alone.
⚠️ If you're applying this to symbols with no volume data (e.g., certain Forex or indices), the script will stop with an error message.
Bullish/Bearish Volume Indicator ABDJO1- red bars are bearish volume
2- yellow bars are a weakness of bearish volume.
3-green bars are a strong bullish volume.
4-Orange bars are a weakness of bullish volume.
1. Price Movements
The chart does not explicitly show price movements, but the volume bars can give us indirect clues. Typically, a transition from green (strong bullish volume) to red (bearish volume) suggests a potential reversal from an uptrend to a downtrend. The presence of orange bars (weakness of bullish volume) following green bars indicates a decrease in buying momentum, which often precedes a price decline.
2. Trading Volume
Green Bars: Represent strong bullish volume, indicating strong buying interest.
Orange Bars: Indicate a weakening of bullish volume, suggesting that buyers are losing strength or interest at higher price levels.
Yellow Bars: Represent a weakening of bearish volume, which could indicate that selling pressure is decreasing and a potential reversal or stabilization in price might occur.
Red Bars: Signify strong bearish volume, indicating strong selling pressure.
3. Price-Volume Relationship
The transition from green to orange and then to red bars shows a typical pattern where initial strong buying interest (green) is followed by a decrease in buyer enthusiasm (orange), and eventually overtaken by sellers (red). This pattern often corresponds to a peak in prices followed by a reversal to the downside.
4. Technical Indicators
Without specific price data, traditional indicators like MA (Moving Averages), MACD (Moving Average Convergence Divergence), or KDJ (Stochastic Oscillator) cannot be calculated directly. However, the volume pattern itself can be used as a rudimentary momentum indicator, with decreasing bullish volume (orange) and increasing bearish volume (red) suggesting a bearish momentum.
5. Support and Resistance Levels
Support Level: Could be hypothesized near the transition point from yellow to green bars, where buyers previously started to overpower sellers.
Resistance Level: Likely near the transition from green to orange bars, where sellers begin to regain control and buying momentum fades.
6. Overall Trend Patterns
The overall trend, inferred from the volume bars, suggests a bullish phase losing momentum and transitioning into a bearish phase. This is typical of a market top where buying interest wanes and sellers begin to dominate.
7. Future Projections and Recommendations
Given the observed shift from bullish to bearish volume, there is a higher likelihood of a downward price movement in the near term. Investors should consider this a potential sell signal, especially as bearish volume (red bars) increases. Caution is advised for buyers, and it might be prudent for holders to take profits or set stop-loss orders to protect against potential declines.
Plot futures volumes with indexMost of the times, F&O traders like to draw their own trendlines or mark other levels on the underlying instrument where volumes of the underlying is a key parameter. When such an instrument is a non-tradeable index, then one needs to switch to the futures chart for volumes. This script plots the volumes from futures on the underlying index so that traders don't need to switch charts just for futures volumes! Hope it is useful to some. Cheers!
Multi-Exchange Volume w Candle HighlightI've been investigating the value of studying candle volume. I realised all the exchanges give different volume. So I've made an indicator that shows the volume from multiple exchanges.
You can choose a primary exchange for the main changes and a secondary exchange for a line chart in front. These exchanges are INDEPENDANT of the exchange you are looking at so if your broker does not show volume, you can use the volume supplied by another broker who does. For example, you might be looking at a chart from Saxo exchange (who I don't think supplies volume) but see volume from FXCM as the primary with pattern confirmation from Oanda as the secondary.
You'll can see the patterns are the same but FXCM has higher overall volume than Oanda
In addition you can choose to highlight the high volume bars and highlight the high volume candles.
I find it useful as I can look at a move and easily see whether there is volume behind it - if there is a move with low volume is it sustainable?
You have the option to switch all the extra features on and off so if you prefer you can just look at a classic volume chart whilst looking at a candle chart from an exchange that does not supply volume.
I'm honest as to whether I find my scripts useful in my trading (they are always technically correct) or not and I think this one is good.