Granular Candle-by-Candle VWAPGranular Candle-by-Candle VWAP is a customizable Volume Weighted Average Price (VWAP) indicator designed for TradingView. Unlike traditional VWAP indicators that operate on the chart's primary timeframe, this script enhances precision by incorporating lower timeframe (e.g., 1-minute) data into VWAP calculations. This granular approach provides traders with a more detailed and accurate representation of the average price, accounting for intra-bar price and volume movements. The indicator dynamically adjusts to the chart's current timeframe and offers a range of customization options, including price type selection, visual styling, and alert configurations.
Customizable Features
Users have extensive control over various aspects of the Granular Candle-by-Candle VWAP indicator. Below are the key features that can be customized to align with individual trading preferences:
🎛️ Customizable Features
Users have extensive control over various aspects of the Granular Candle-by-Candle VWAP indicator. Below are the key features that can be customized to align with individual trading preferences:
🔢 Lookback Period
Description: Defines the number of lower timeframe bars used in the VWAP calculation.
Customization:
Input: VWAP Lookback Period (Number of Lower Timeframe Bars)
Default Value: 20 bars
Range: Minimum of 1 bar
Purpose: Allows traders to adjust the sensitivity of the VWAP. A smaller lookback period makes the VWAP more responsive to recent price changes, while a larger period smoothens out fluctuations.
📈 Price Type Selection
Description: Determines which price metric is used in the VWAP calculation.
Customization:
Input: Price Type for VWAP Calculation
Options:
Open: Uses the opening price of each lower timeframe bar.
High: Uses the highest price of each lower timeframe bar.
Low: Uses the lowest price of each lower timeframe bar.
Close: Uses the closing price of each lower timeframe bar.
OHLC/4: Averages the Open, High, Low, and Close prices.
HL/2: Averages the High and Low prices.
Typical Price: (High + Low + Close) / 3
Weighted Close: (High + Low + 2 × Close) / 4
Default Value: Close
Purpose: Offers flexibility in how the average price is calculated, allowing traders to choose the price metric that best fits their analysis style.
🕒 Lower Timeframe Selection
Description: Specifies the lower timeframe from which data is fetched for granular VWAP calculations.
Customization:
Input: Lower Timeframe for Granular Data
Default Value: 1 minute ("1")
Options: Any valid TradingView timeframe (e.g., "1", "3", "5", "15", etc.)
Purpose: Enables traders to select the granularity of data used in the VWAP calculation, enhancing the indicator's precision on higher timeframe charts.
🎨 VWAP Line Customization
Description: Adjusts the visual appearance of the VWAP line based on price position relative to the VWAP.
Customizations:
Color When Price is Above VWAP:
Input: VWAP Color (Price Above)
Default Value: Green
Color When Price is Below VWAP:
Input: VWAP Color (Price Below)
Default Value: Red
Line Thickness:
Input: VWAP Line Thickness
Default Value: 2
Range: Minimum of 1
Line Style:
Input: VWAP Line Style
Options: Solid, Dashed, Dotted
Default Value: Solid
Purpose: Enhances visual clarity, allowing traders to quickly assess price positions relative to the VWAP through color coding and line styling.
🔔 Alerts and Notifications
Description: Provides real-time notifications when the price crosses the VWAP.
Customizations:
Enable/Disable Alerts:
Input: Enable Alerts for Price Crossing VWAP
Default Value: Enabled (true)
Alert Conditions:
Price Crossing Above VWAP:
Trigger: When the closing price crosses from below to above the VWAP.
Alert Message: "Price has crossed above the Granular VWAP."
Price Crossing Below VWAP:
Trigger: When the closing price crosses from above to below the VWAP.
Alert Message: "Price has crossed below the Granular VWAP."
Purpose: Keeps traders informed of significant price movements relative to the VWAP, facilitating timely trading decisions.
📊 Plotting and Visualization
Description: Displays the calculated Granular VWAP on the chart with user-defined styling.
Customization Options:
Color, Thickness, and Style: As defined in the VWAP Line Customization section.
Track Price Feature:
Parameter: trackprice=true
Function: Ensures that the VWAP line remains visible even when the price moves far from the VWAP.
Purpose: Provides a clear and persistent visual reference of the VWAP on the chart, aiding in trend analysis and support/resistance identification.
⚙️ Performance Optimizations
Description: Ensures the indicator runs efficiently, especially on higher timeframes with large datasets.
Strategies Implemented:
Minimized Security Calls: Utilizes two separate request.security calls to fetch necessary data, balancing functionality and performance.
Efficient Calculations: Employs built-in functions like ta.sum for rolling calculations to reduce computational load.
Conditional Processing: Alerts are processed only when enabled, preventing unnecessary computations.
Purpose: Maintains smooth chart performance and responsiveness, even when using lower timeframe data for granular calculations.
Volume Weighted Moving Average (VWMA)
Moving AveragesWhile this "Moving Averages" indicator may not revolutionize technical analysis, it certainly offers a valuable and efficient solution for traders seeking to streamline their chart analysis process. This all-in-one tool addresses a common frustration among traders: the need to constantly search for and compare different types and lengths of moving averages.
Key Features
The indicator allows for the configuration of up to 5 moving averages simultaneously, providing a comprehensive view of price trends. Users can choose from 7 types of moving averages for each line, including SMA, EMA, WMA, VWMA, HMA, SMMA, and TMA. This variety ensures that traders can apply their preferred moving average types without the need for multiple indicators.
Each moving average can be fully customized in terms of length, color, line style, and thickness, allowing for clear visual differentiation. However, what sets this indicator apart is its "Smart Opacity" feature. When activated, this option dynamically adjusts the transparency of the moving average lines based on their direction, with ascending lines appearing more opaque and descending lines more transparent. This subtle yet effective visual cue aids in quickly identifying trend changes and potential trading signals.
Advantages
The primary benefit of this indicator lies in its convenience. By consolidating multiple moving averages into a single, customizable tool, it saves traders valuable time and reduces chart clutter. The Smart Opacity feature, while not groundbreaking, does offer an intuitive way to visualize trend strength and direction at a glance.
Moreover, the indicator's flexibility makes it suitable for various trading styles and experience levels. Whether you're a novice trader learning to interpret basic trend signals or an experienced analyst fine-tuning a complex strategy, this tool can adapt to your needs.
In conclusion, while this "Moving Averages" indicator may not be a game-changer in the world of technical analysis, it represents a thoughtful refinement of a fundamental trading tool. By focusing on user convenience and visual clarity, it offers a practical solution for traders looking to optimize their chart analysis process and make more informed trading decisions.
Median Moving Average @shrilssThe "Median Moving Average" (MMA) It allows users to select from two moving average lengths—short and long—and plots the median moving average, which is the midpoint between these two averages. Colored green for upward trends and red for downward trends, enhancing visual analysis.
Additionally, users can choose from a range of moving average types including Simple (SMA), Exponential (EMA), Weighted (WMA), Double Exponential (DEMA), Triple Exponential (TEMA), Hull (HMA), and Volume Weighted (VWMA).
Dynamic Price Targets @shrilssDynamic Price Targets is a designed to provide traders with a comprehensive view of dynamic price levels based on Volume Weighted Moving Average (VWMA) and standard deviation. This script allows users to identify potential support and resistance zones, aiding in strategic decision-making during market analysis.
The script calculates the VWMA of a chosen price source over a specified length, establishing a dynamic baseline for market trends. The standard deviation is then used to derive multiple upper and lower targets, each representing a certain deviation from the VWMA. These levels are color-coded for clarity, with upper targets displayed in shades of red and lower targets in shades of green.
Machine Learning: STDEV Oscillator [YinYangAlgorithms]This Indicator aims to fill a gap within traditional Standard Deviation Analysis. Rather than its usual applications, this Indicator focuses on applying Standard Deviation within an Oscillator and likewise applying a Machine Learning approach to it. By doing so, we may hope to achieve an Adaptive Oscillator which can help display when the price is deviating from its standard movement. This Indicator may help display both when the price is Overbought or Underbought, and likewise, where the price may face Support and Resistance. The reason for this is that rather than simply plotting a Machine Learning Standard Deviation (STDEV), we instead create a High and a Low variant of STDEV, and then use its Highest and Lowest values calculated within another Deviation to create Deviation Zones. These zones may help to display these Support and Resistance locations; and likewise may help to show if the price is Overbought or Oversold based on its placement within these zones. This Oscillator may also help display Momentum when the High and/or Low STDEV crosses the midline (0). Lastly, this Oscillator may also be useful for seeing the spacing between the High and Low of the STDEV; large spacing may represent volatility within the STDEV which may be helpful for seeing when there is Momentum in the form of volatility.
Tutorial:
Above is an example of how this Indicator looks on BTC/USDT 1 Day. As you may see, when the price has parabolic movement, so does the STDEV. This is due to this price movement deviating from the mean of the data. Therefore when these parabolic movements occur, we create the Deviation Zones accordingly, in hopes that it may help to project future Support and Resistance locations as well as helping to display when the price is Overbought and Oversold.
If we zoom in a little bit, you may notice that the Support Zone (Blue) is smaller than the Resistance Zone (Orange). This is simply because during the last Bull Market there was more parabolic price deviation than there was during the Bear Market. You may see this if you refer to their values; the Resistance Zone goes to ~18k whereas the Support Zone is ~10.5k. This is completely normal and the way it is supposed to work. Due to the nature of how STDEV works, this Oscillator doesn’t use a 1:1 ratio and instead can develop and expand as exponential price action occurs.
The Neutral (0) line may also act as a Support and Resistance location. In the example above we can see how when the STDEV is below it, it acts as Resistance; and when it’s above it, it acts as Support.
This Neutral line may also provide us with insight as towards the momentum within the market and when it has shifted. When the STDEV is below the Neutral line, the market may be considered Bearish. When the STDEV is above the Neutral line, the market may be considered Bullish.
The Red Line represents the STDEV’s High and the Green Line represents the STDEV’s Low. When the STDEV’s High and Low get tight and close together, this may represent there is currently Low Volatility in the market. Low Volatility may cause consolidation to occur, however it also leaves room for expansion.
However, when the STDEV’s High and Low are quite spaced apart, this may represent High levels of Volatility in the market. This may mean the market is more prone to parabolic movements and expansion.
We will conclude our Tutorial here. Hopefully this has given you some insight into how applying Machine Learning to a High and Low STDEV then creating Deviation Zones based on it may help project when the Momentum of the Market is Bullish or Bearish; likewise when the price is Overbought or Oversold; and lastly where the price may face Support and Resistance in the form of STDEV.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Sudden increase in volume [PINESCRIPTLABS]The indicator plots buying and selling histograms on the price chart, as well as graphical signals in the form of triangles to highlight buying and selling conditions. Buying conditions are based on a sudden increase in volume and oversold RSI, while selling conditions are based on a sudden increase in volume and overbought RSI.
In summary, this strategy aims to identify moments when there is a significant surge in trading volume along with overbought or oversold conditions in the RSI. These moments are considered potential signals for buying or selling in the market.
Sudden Volume Surge: It checks if the current volume is greater than a multiple of the exponential moving average of volume (EMA) calculated with a specific length (ema_length). This indicates a sudden surge in trading volume.
RSI Overbought and Oversold Levels: Two RSI values, rsi_overbought and rsi_oversold, are used as references. If the RSI value is below the rsi_oversold level, it is considered to be in oversold territory, and if the RSI value is above the rsi_overbought level, it is considered to be in overbought territory.
El indicador plotea histogramas de compra y venta en el gráfico de precios, así como señales gráficas en forma de triángulos para resaltar las condiciones de compra y venta. Las condiciones para la compra se basan en un aumento brusco de volumen y un RSI en sobreventa, mientras que las condiciones para la venta se basan en un aumento brusco de volumen y un RSI en sobrecompra.
En resumen, esta estrategia busca identificar momentos en los que haya un aumento significativo en el volumen de operaciones junto con condiciones de sobrecompra o sobreventa en el RSI. Estos momentos se consideran señales potenciales de compra o venta en el mercado.
Aumento brusco de volumen: Se verifica si el volumen actual es mayor que un múltiplo del promedio móvil exponencial del volumen (EMA) calculado con una longitud específica (ema_length). Esto indica un aumento repentino en el volumen de operaciones.
Niveles de RSI en sobrecompra y sobreventa: Se utilizan dos valores de RSI como referencia, rsi_overbought y rsi_oversold. Si el valor del RSI está por debajo del nivel rsi_oversold, se considera que está en territorio de sobreventa, y si el valor del RSI está por encima del nivel rsi_overbought, se considera que está en territorio de sobrecompra.
Price Strength Index + RSI Buy/Sell ZonesThe Price Strength Index + RSI Buy/Sell Zones indicator is a technical analysis tool designed to evaluate the strength of a financial asset's price movement by comparing it with a series of Volume Weighted Moving Averages (VWMAs) of different lengths calculated from historical data.
Hypothesis :
The core hypothesis behind this indicator is that assessing the relationship between the current price and a range of VWMAs with varying lengths can provide valuable insights into the strength and direction of a price trend. Additionally, it incorporates Relative Strength Index (RSI) conditions to further refine potential buy and sell signals.
How It Works :
Multiple VWMA Calculation: The indicator calculates multiple VWMAs, each with a different length, using historical price data and volume. These VWMAs represent weighted moving averages over various periods, helping to capture different aspects of the price trend.
Comparison with Current Price : For each of these VWMAs, the indicator compares the current bar's price with the VWMA value. This comparison is crucial in understanding how the current price relates to historical averages, shedding light on the strength and direction of the prevailing trend.
SMA of Percentage Above VWMA : The indicator calculates the Simple Moving Average (SMA) of the percentage of prices above the various VWMAs over a specified period. This moving average smoothens out the percentage data, providing a clearer trend signal.
Buy and Sell Zones : User-defined upper and lower thresholds for the percentage of prices above the VWMAs are used to define buy and sell zones. When the percentage falls below the lower threshold, it signals a potential buy zone, suggesting a weakening trend. Conversely, when it exceeds the upper threshold, it signifies a potential sell zone, indicating a strengthening trend.
RSI Integration : The RSI is calculated for the selected price source with a specified length. When the SMA of the percentage above VWMAs falls within the buy zone and the RSI is below the lower RSI threshold, it indicates an oversold condition, potentially signaling a buy opportunity. Conversely, when the SMA falls within the sell zone and the RSI is above the upper RSI threshold, it suggests an overbought condition, possibly signaling a sell opportunity.
Color Coding : The indicator employs color-coding to visually represent the buy and sell zones, as well as extreme RSI conditions. Green color denotes the buy zone, red represents the sell zone, and orange lines indicate the median and potential reversal points.
In summary, the Price Strength Index + RSI Buy/Sell Zones indicator leverages multiple VWMAs of different lengths to assess the relationship between current prices and historical moving averages. This comprehensive analysis, coupled with RSI conditions, aids traders in identifying potential buy and sell zones, as well as extreme RSI points within those zones, enhancing the evaluation of price strength and potential trend reversals.
VWMA/SMA Delta Volatility (Statistical Anomaly Detector)The "VWMA/SMA Delta Volatility (Statistical Anomaly Detector)" indicator is a tool designed to detect and visualize volatility in a financial market's price data. The indicator calculates the difference (delta) between two moving averages (VWMA/SMA) and uses statistical analysis to identify anomalies or extreme price movements. Here's a breakdown of its components:
Hypothesis:
The hypothesis behind this indicator is that extreme price movements or anomalies in the market can be detected by analyzing the difference between two moving averages and comparing it to a statistically derived normal distribution. When the MA delta (the difference between two MAs: VWMA/SMA) exceeds a certain threshold based on standard deviation and the Z-score coefficient, it may indicate increased market volatility or potential trading opportunities.
Calculation of MA Delta:
The indicator calculates the MA delta by subtracting a simple moving average (SMA) from a volume-weighted moving average (VWMA) of a selected price source. This calculation represents the difference in the market's short-term and long-term trends.
Statistical Analysis:
To detect anomalies, the indicator performs statistical analysis on the MA delta. It calculates a moving average (MA) of the MA delta and its standard deviation over a specified sample size. This MA acts as a baseline, and the standard deviation is used to measure how much the MA delta deviates from the mean.
Delta Normalization:
The MA delta, lower filter, and upper filter are normalized using a function that scales them to a specific range, typically from -100 to 100. Normalization helps in comparing these values on a consistent scale and enhances their visual representation.
Visual Representation:
The indicator visualizes the results through histograms and channels:
The histogram bars represent the normalized MA delta. Red bars indicate negative and below-lower-filter values, green bars indicate positive and above-upper-filter values, and silver bars indicate values within the normal range.
It also displays a Z-score channel, which represents the upper and lower filters after normalization. This channel helps traders identify price levels that are statistically significant and potentially indicative of market volatility.
In summary, the "MA Delta Volatility (Statistical Anomaly Detector)" indicator aims to help traders identify abnormal price movements in the market by analyzing the difference between two moving averages and applying statistical measures. It can be a valuable tool for traders looking to spot potential opportunities during periods of increased volatility or to identify potential market anomalies.
MA Directional Table"MA Directional Table" primary objective is to analyze the direction of the trend based on two Moving Averages (MA) for various timeframes and customizing the inputs to match your preferred style.
Features:
Moving Average Type: You can select which type of Moving Average to use (SMA, EMA, VWMA).
Moving Average Lengths: You can set the lengths for the short-term and long-term moving averages.
Table Position: The indicator provides a table which can be placed at the top or bottom, and to the left or right of the chart. It shows the trend status for multiple timeframes (1 min, 5 min, 15 min, 1 hour, 4 hours, 1 day).
Table Orientation: The table can be oriented either horizontally or vertically.
Price Condition: Optionally, the table color can be set to yellow if the current price deviates from the Moving Average trend and crosses MA1.
Cloud Settings: You can opt to show a cloud between the two moving averages. The color of the cloud changes based on the direction of the trend (bullish or bearish).
Extra MA: Optionally, an extra Moving Average can be plotted on the chart.
Dynamic Point of Control (POC)The Dynamic Point of Control (POC) indicator provides traders and analysts with insightful information about price levels, volume distribution, and sentiment within a specified historical range.
Instant Updates : POC recalculates with every new bar, keeping you ahead of the game.
Market Bias : Assess market sentiment through bullish volume share.
Customization : Tailor inputs to match your unique trading strategy.
Chart Presence : See POC and related data graphically on your price chart.
How to Use :
Traders can use the Dynamic POC indicator to identify Point of Control price level, understand volume distribution, and gauge market sentiment. The indicator's visual cues and customizable parameters make it a valuable tool for technical analysis and decision-making.
Volume-Weighted Kaufman's Adaptive Moving AverageThe Volume-Weighted Kaufman's Adaptive Moving Average (VW-KAMA) is a technical indicator that combines the Volume-Weighted Moving Average (VWMA) and the Kaufman's Adaptive Moving Average (KAMA) to create a more responsive and adaptable moving average.
Advantages:
Volume-Weighted: It takes into account the volume of trades, giving more weight to periods with higher trading volume, which can help filter out periods of low activity.
Adaptive: The indicator adjusts its smoothing constant based on market conditions, becoming more sensitive in trending markets and less sensitive in choppy or sideways markets.
Versatility: VW-KAMA can be used for various purposes, including trend identification, trend following, and determining potential reversal points and act as dynamic support and resistance level.
Scalp Tool
This script is primarily intended as a scalping tool.
The theory of the tool is based on the fact that the price always returns to its mean.
Elements used:
1. VWMA as a moving average. VWMA is calculated once based on source close and once based on source open.
2. the bands are not calculated like the Bollinger Band, but only a settlement is calculated for the lower bands based on the Lows and for the upper bands based on the Highs. Thus the bands do not become thicker or thinner, but remain in the same measure to the mean value above or below the price.
3. a volume filter on simple calculation of a MA with deviation. Therefore, it can be identified if a volume breakout has occurred.
4. support and resistance zones which are calculated based on the highs and lows over a certain length.
5. RSI to determine oversold and overbought zones. It also tries to capture the momentum by using a moving average (variable selectable) to filter the signals. The theory is that in an uptrend the RSI does not go below 50 and in a downtrend it does not go above 50.
However, this can be very different depending on the financial instrument.
Explanation of the signals:
The main signal in this indicator Serves for pure short-term trading and is generated purely on the basis of the bands and the RSI.
Only the first bands are taken into account.
Buy signal is generated when the price opens below the lower band 1 and closes above the lower band 1 or the RSI crosses a value of 25 from bottom to top.
Sell signal is generated when the price opens above the Upper Band 1 and closes below the Upper Band 1 or the RSI crosses a value of 75 from top to bottom.
The position should be closed when the price hits the opposite band. Alternatively, it can also be closed at the mean.
Other side signals:
1. breakouts:
The indicator includes 2 support and resistance zones, which differ only in length. For the breakout signals, the short version of the R/S is used. A signal is generated when the price breaks through the zones with increased volume. It is then assumed that the price will continue to follow the breakout.
The values of the S/R are adjustable and marked with "BK".
The value under Threshold 2 defines the volume breakout. 4 is considered as the highest value. The smaller the value, the smaller the volume must be during a breakout.
2. bounce
If the price hits a S/R (here the long variant is used with the designation "Support" or "Resistance") and makes a wick with small volume, the script assumes a bounce and generates a Sell or Buy signal accordingly.
The volume can be defined under "Threshold".
The S/R according to the designation as well.
Combined signals:
If the value of the S/R BK and the S/R is the same and the bounce logic of the S/R BK applies and an RSI signal is also generated, a signal is also plotted.
Here the idea was to get very strong signals for possible swing entries.
4. RSI Signals
The script contains two RSI.
RSI 1:
Bullish signal is generated when the set value is crossed from the bottom to the top.
Bearish signal is generated when the set value is crossed from the top to the bottom.
RSI 2:
Bullish signal is generated when the set value is crossed from the top to the bottom.
Bearish signal is generated when the set value is crossed from bottom to top.
For RSI 2 the theory is taken into account according to the description under Used elements point 5
Optical trend filter:
Also an optical trend filter was generated which fills the bands accordingly.
For this the VWMA is used and the two average values of the band.
Color definition:
Gray = Neutral
Red = Bearish
Green = Bullish
If the mean value is above the VWMA and the mean value based on the closing price is above the mean value based on the open price, the band is colored green. It is a bullish trend
If the mean value is below the VWMA and the mean value based on the closing price is below the mean value based on the open price, the band is colored red.
The band is colored gray if the mean value is correspondingly opposite. A sideways phase is assumed.
The script was developed on the basis of the pair BTCUSD in the 15 minute chart and the settings were defined accordingly on it. The display of S/R for forex pairs does not work correctly and should be hidden. The logic works anyway.
When using the script, all options should first be set accordingly to the asset and tested before trading afterwards. It applies of course also here that there is no 100% guarantee.
Also, a strong breakout leads to false signals and overheating of the indicator.
Vwma Oscillator [MMD]This line calculates the exponential moving average (EMA) of the product of the close price and volume, divided by the EMA of the volume. The EMA is calculated over a period of 4 bars.
This line calculates the difference between the value of a1 and the volume-weighted moving average (VWMA) of the close price. The VWMA is calculated over a period of 8 bars.
This line calculates a3 as twice the VWMA of a2 over a period of 8 bars, minus the VWMA of a2 over a period of 16 bars.
This line plots the value of a3 on the chart. The color of the plot is determined by the condition inside the color argument. If a3 is within 20% of its previous value (a3 ) in either direction, the color is set to silver. Otherwise, if a3 is greater than 0, the color is set to green; otherwise, it is set to red. The linewidth parameter sets the thickness of the plot, and the style parameter specifies that circles should be used to plot the values.
These lines plot two horizontal lines on the chart, one at 80% of the previous a3 value (a3 *0.8) and the other at 120% of the previous a3 value (a3 *1.2). The transp=100 parameter makes the lines transparent. The fill function is then used to fill the area between these lines with either a red or green color, depending on whether a3 at the current bar is greater or smaller than the corresponding values.
This line plots a horizontal line at a value of 0 on the chart. The color is set to gray, and the line width is set to 2.
Overall, this indicator calculates the values of a1, a2, and a3 based on moving averages and
Volume Weighted Pivot Point Moving Averages VPPMAAs traders and investors, we are constantly on the lookout for tools that can assist us in making informed decisions. While there are countless technical analysis tools available, sometimes even small, simple scripts can provide valuable insights. In this post, we will explore the Volume-Weighted Pivot Point Moving Average (PPMA) Indicator – a modest yet helpful script that could potentially enhance your trading experience.
Background
// © peacefulLizard50262
//@version=5
indicator("PPMA", overlay = true)
vppma(left, right)=>
signal = ta.change(ta.pivothigh(high, left, right)) or ta.change(ta.pivotlow(low, left, right))
var int count = na
var float sum = na
var float volume_sum = na
if not signal
count := nz(count ) + 1
sum := nz(sum ) + close * volume
volume_sum := nz(volume_sum ) + volume
else
count := na
sum := na
volume_sum := na
sum/volume_sum
left = input.int(50, "Pivot Left", 0)
plot(vppma(left, 0))
The Concept Behind PPMA Indicator
The Volume-Weighted Pivot Point Moving Average (PPMA) Indicator is a straightforward technical analysis tool that aims to help traders identify potential market turning points and trends. It does this by calculating a moving average based on price and volume data while considering pivot highs and pivot lows. The PPMA Indicator is designed to be more responsive than traditional moving averages by incorporating volume into its calculations.
Understanding the Script
The script is compatible with version 5 of the TradingView Pine Script language, and it features an overlay setting, allowing the indicator to be plotted directly onto the price chart. The customizable pivot left input enables traders to adjust the sensitivity of the pivot points.
The script first identifies pivot points, which are areas where the price changes direction. It then calculates the volume-weighted average price (VWAP) of each trading period between the pivot points. Finally, it plots the PPMA line on the chart, providing a visual representation of the volume-weighted average prices.
Using the PPMA Indicator
To use the PPMA Indicator, simply add the script to your TradingView chart. The indicator will plot the PPMA line directly onto the price chart. You can adjust the pivot left input to modify the sensitivity of the pivot points, depending on your preferred trading style.
When the PPMA line is trending upward, it may indicate a potential bullish trend. Conversely, a downward-trending PPMA line could suggest a bearish trend. The PPMA Indicator can be used in conjunction with other technical analysis tools to confirm potential trend changes and to establish entry or exit points for trades.
Conclusion
While the Volume-Weighted Pivot Point Moving Average (PPMA) Indicator may not be a game-changer, it is a modest yet helpful tool for traders looking to enhance their technical analysis. By incorporating volume into its calculations, the PPMA Indicator aims to provide more responsive signals compared to traditional moving averages. As with any trading tool, it is crucial to conduct your own analysis and combine multiple indicators before making any trading decisions.
Moving Average Lab - by InFinitoThe Moving Average Lab allows to create any possible combination of up to 3 given MAs. It is meant to help you find the perfect MA that fits your style, strategy and market type.
This script allows to average, weight, double and triple multiple types and lengths of Moving Averages
Currently supported MA types are:
SMA
EMA
VWMA
WMA
SMMA (RMA)
HMA
LSMA
DEMA
TEMA
Features:
- Double or Triple any type of Moving Average using the same logic used for calculating DEMAs and TEMAs:
In the following example you can see a normal, double and triple 200 VWMA
- Average 2 or 3 different types and lengths of Moving Average:
In the example you can see the average between a Double LSMA and a SMA
- Weight each MA manually:
The example shows the average of an HMA and a VWMA with the HMA having a weight of 2 and the VWMA having a weight of 1
- Average up to 3 personalized MAs:
The example shows the average of an EMA + a Double WMA + a Triple SMA with a 3:2:1 weighting
- Average different Moving Averages with different length each:
The example shows the average of an 800 SMA + a 400 VWMA + a 200 EMA
Volume Spread Analysis IchimokuThis version of the popular Ichimoku indicator is modified to let the user choose between his classic mode and the volume-weighted mode.
Every line of the indicator is customizable with this function.
The Kijun and Tenkan lines are choosable from:
1. The normal version, so the average of the high and the low of the selected period
2. The volume mode, so the average price of the selected input ponderated to the volume
The Senkau Span A is the average from the Kijun (fast line) and the Tenkan (slow line) lines and it's choosable from:
1. The normal price version
2. The volume mode
3. The average between points 1 and 2
4. The automatic average between the two fast lines that you've chosen
The Senkau Span B is the slowest line of the indicator, used to determine the long-term trend, and can be chosen from:
1. The normal average price between the high and the low of the selected period
2. The volume average price, using the Volume Weighted Moving Average
The Trama Backline is the popular "LUX Algo" T.R.A.M.A. indicator, which I'm thankful for, and can be fantastically used to display the current trend strength and condition. This line is readable in the following way:
- If the line is moving sideways, the trend may be in a consolidation phase
- If the line is moving upwards or downwards, the trend may be in a trend phase
Ratio Smoothed, Volume Weighted Moving AverageThis is experimental moving average doesn't use a period/length but instead buffers the price per share and transfers that price per share at a given ratio per bar while also releasing the previous values at a decay ratio.
The idea is that volume is the engine by which the price moves but spikes in volume can cause noise. By having a buffer of price per share units, this VWMA style indicator can behave more like a WMA combined with volume (VAWMA) but smooths out the noise of recent volume. The end result is a price movement that is smooth but also still based strongly up on the average price per share and will always eventually catch up to the true price per share value.
A metaphor to understand this could be a bucket with a hole in it where water is flowing sporadically into the bucket. The level of water in the bucket may change drastically but instead of all the water emptying out immediately, it is throttled by the hole in the bottom. As the level rises, the water pressure increases and the flow increases so that the virtual bucket never has a chance to fill up but also never really empties either.
VWMA Fibonacci Bands (VFIBs)This is a momentum indicator , utilizing Volume Weighted Moving Averages (VWMAs), Average True Range (ATR), and Fibonacci Levels.
This indicator can be used in most, if not all, financial markets. I have personally found it to be most useful in mid or large cap stocks, index funds, and cryptocurrencies in the top 25 by market cap. I have not tested this indicator in Forex markets, but I imagine that it would function well there, too.
The idea behind proper use of this indicator centers around mean reversion. If price is low compared to previous price action, mean reversion implies that it is likely to revert back to the mean, over time. If price is high, it implies that it will move lower. Generally, the different period VWMAs (center lines) will act as support when in an uptrend and resistance when in a downtrend. Additionally, it is rare for price to go above the upper bounds or lower bounds of the Fibonacci Bollinger Bands . Price action doing so may indicate a potential short or long position, respectively.
This indicator is intended to be used in tandem with the oscillator 'VFIBs Agreement', to be published shortly.
As we can see in the chart, the 50 week VWMA has been acting as resistance and recently dipped down to the bottom range of the band, only to bounce back. Holding above the 50 VWMA might indicate a bullish reversal, treating it as support moving forward.
3 Series Cross Indicator with Alerts - by WAMRAThis Indicator allows users to add any 3 combinations of moving averages (SMA, EMA, RMA, RSI, Stochastic RSI, WMA, VWAP ) with granular alert conditions.
Users can alert when all series are in climbing or declining mode.
Chart VWAP█ OVERVIEW
This indicator displays a Volume-Weighted Average Price anchored to the leftmost visible bar of the chart. It dynamically recalculates when the chart's visible bars change because you scroll or zoom your chart.
If you are not already familiar with VWAP, our Help Center will get you started. The typical VWAP is designed to be used on intraday charts, as it resets at the beginning of the day. Our Rolling VWAP , instead, resets on a rolling time window. You may also find the VWAP Auto Anchored built-in indicator worth a try.
█ HOW TO USE IT
Load the indicator on an active chart (see the Help Center if you don't know how). By default, it displays the chart's VWAP in orange and a simple average of the chart's visible close values in gray. This average can be used as a companion to the VWAP, since both are calculated from the same set of bars. The script's settings allow you to hide it.
You may also use the script's settings to enable the display of the chart's OHLC (open, high, low, close) levels and the values of the high and low. These are also calculated from the range of visible bars. You can complement the high and low lines with their price and their distance in percent from the chart's latest visible close . You can use the levels to quickly identify the distances from extreme points in the visible price range, as well as observe the visible chart's beginning and end prices.
█ NOTES FOR Pine Script™ CODERS
This script showcases three novelties:
• Dynamic recalculation on visible bars
• The VisibleChart library by PineCoders
• The new `anchor` parameter of ta.vwap()
Dynamic recalculation on visible bars
This script behaves in a novel way made possible by the recent introduction of two new built-in variables: chart.left_visible_bar_time and chart.right_visible_bar_time , which return the opening time of the leftmost and rightmost visible bars on the chart. These are only two of many new built-ins in the `chart.*` namespace. See this blog post for more information, or look up them up by typing "chart." in the Pine Script™ Reference Manual .
Any script using chart.left_visible_bar_time or chart.right_visible_bar_time acquires a unique property, which triggers its recalculation when traders scroll or zoom their chart, causing the range of visible bars to change. This new capability is what makes it possible for this script to calculate its VWAP on the chart's visible bars only, and dynamically recalculate if the user scrolls or zooms their chart.
This script is just a start to the party; endless uses for indicators that redraw on changes to the chart will no doubt emerge through the hands of our community's Pine Script™ programmers.
The VisibleChart library by PineCoders
The newly published VisibleChart library is designed to help programmers benefit from the new capabilities made possible by the fact that Pine Script™ code can now tell when it is executing on visible bars. The library's description, functions and example code will help programmers make the most of the new feature.
This script uses three of the library's functions:
• `PCvc.vVwap()` calculates a VWAP for visible bars.
• `PCvc.avg()` calculates the average of a source value for visible bars only. We use it to calculate the average close (the default source).
• `PCvc.chartXTimePct(25)` calculates a time value corresponding to 25% of the horizontal distance between visible bars, starting from the left.
The new `anchor` parameter of ta.vwap()
Our script also uses this new `anchor` parameter to reset the VWAP at the leftmost visible bar. See how simple the code is for the VisibleChart library's `vVwap()` function.
Look first. Then leap.
Weight Gain 4000 - (Adjustable Volume Weighted MA) - [mutantdog]Short Version:
This is a fairly self-contained system based upon a moving average crossover with several unique features. The most significant of these is the adjustable volume weighting system, allowing for transformations between standard and weighted versions of each included MA. With this feature it is possible to apply partial weighting which can help to improve responsiveness without dramatically altering shape. Included types are SMA, EMA, WMA, RMA, hSMA, DEMA and TEMA. Potentially more will be added in future (check updates below).
In addition there are a selection of alternative 'weighted' inputs, a pair of Bollinger-style deviation bands, a separate price tracker and a bunch of alert presets.
This can be used out-of-the-box or tweaked in multiple ways for unusual results. Default settings are a basic 8/21 EMA cross with partial volume weighting. Dev bands apply to MA2 and are based upon the type and the volume weighting. For standard Bollinger bands use SMA with length 20 and try adding a small amount of volume weighting.
A more detailed breakdown of the functionality follows.
Long Version:
ADJUSTABLE VOLUME WEIGHTING
In principle any moving average should have a volume weighted analogue, the standard VWMA is just an SMA with volume weighting for example. Actually, we can consider the SMA to be a special case where volume is a constant 1 per bar (the value is somewhat arbitrary, the important part is that it's constant). Similar principles apply to the 'elastic' EVWMA which is the volume weighted analogue of an RMA. In any case though, where we have standard and weighted variants it is possible to transform one into the other by gradually increasing or decreasing the weighting, which forms the basis of this system. This is not just a simple multiplier however, that would not work due to the relative proportions being the same when set at any non zero value. In order to create a meaningful transformation we need to use an exponent instead, eg: volume^x , where x is a variable determined in this case by the 'volume' parameter. When x=1, the full volume weighting applies and when x=0, the volume will be reduced to a constant 1. Values in between will result in the respective partial weighting, for example 0.5 will give the square root of the volume.
The obvious question here though is why would you want to do this? To answer that really it is best to actually try it. The advantages that volume weighting can bring to a moving average can sometimes come at the cost of unwanted or erratic behaviour. While it can tend towards much closer price tracking which may be desirable, sometimes it needs moderating especially in markets with lower liquidity. Here the adjustability can be useful, in many cases i have found that adding a small amount of volume weighting to a chosen MA can help to improve its responsiveness without overpowering it. Another possible use case would be to have two instances of the same MA with the same length but different weightings, the extent to which these diverge from each other can be a useful indicator of trend strength. Other uses will become apparent with experimentation and can vary from one market to another.
THE INCLUDED MODES
At the time of publication, there are 7 included moving average types with plans to add more in future. For now here is a brief explainer of what's on offer (continuing to use x as shorthand for the volume parameter), starting with the two most common types.
SMA: As mentioned above this is essentially a standard VWMA, calculated here as sma(source*volume^x,length)/sma(volume^x,length). In this case when x=0 then volume=1 and it reduces to a standard SMA.
RMA: Again mentioned above, this is an EVWMA (where E stands for elastic) with constant weighting. Without going into detail, this method takes the 1/length factor of an RMA and replaces it with volume^x/sum(volume^x,length). In this case again we can see that when x=0 then volume=1 and the original 1/length factor is restored.
EMA: This follows the same principle as the RMA where the standard 2/(length+1) factor is replaced with (2*volume^x)/(sum(volume^x,length)+volume^x). As with an RMA, when x=0 then volume=1 and this reduces back to the standard 2/(length+1).
DEMA: Just a standard Double EMA using the above.
TEMA: Likewise, a standard Triple EMA using the above.
hSMA: This is the same as the SMA except it uses harmonic mean calculations instead of arithmetic. In most cases the differences are negligible however they can become more pronounced when volume weighting is introduced. Furthermore, an argument can be made that harmonic mean calculations are better suited to downtrends or bear markets, in principle at least.
WMA: Probably the most contentious one included. Follows the same basic calculations as for the SMA except uses a WMA instead. Honestly, it makes little sense to combine both linear and volume weighting in this manner, included only for completeness and because it can easily be done. It may be the case that a superior composite could be created with some more complex calculations, in which case i may add that later. For now though this will do.
An additional 'volume filter' option is included, which applies a basic filter to the volume prior to calculation. For types based around the SMA/VWMA system, the volume filter is a WMA-4, for types based around the RMA/EVWMA system the filter is a RMA-2.
As and when i add more they will be listed in the updates at the bottom.
WEIGHTED INPUTS
The ohlc method of source calculations is really a leftover from a time when data was far more limited. Nevertheless it is still the method used in charting and for the most part is sufficient. Often the only important value is 'close' although sometimes 'high' and 'low' can be relevant also. Since we are volume weighting however, it can be useful to incorporate as much information as possible. To that end either 'hlc3' or 'hlcc4' tend to be the best of the defaults (in the case of 24/7 charting like crypto or intraday trading, 'ohlc4' should be avoided as it is effectively the same as a lagging version of 'hlcc4'). There are many other (infinitely many, in fact) possible combinations that can be created, i have included a few here.
The premise is fairly straightforward, by subtracting one value from another, the remaining difference can act as a kind of weight. In a simple case consider 'hl2' as simply the midrange ((high+low)/2), instead of this using 'high+low-open' would give more weight to the value furthest from the open, providing a good estimate of the median. An even better estimate can be achieved by combining that with 'high+low-close' to give the included result 'hl-oc2'. Similarly, 'hlc3' can be considered the basic mean of the three significant values, an included weighted version 'hlc2-o2' combines a sum with subtraction of open to give an estimated mean that may be more accurate. Finally we can apply a similar principle to the close, by subtracting the other values, this one potentially gets more complex so the included 'cc-ohlc4' is really the simplest. The result here is an overbias of the close in relation to the open and the midrange, while in most cases not as useful it can provide an estimate for the next bar assuming that the trend continues.
Of the three i've included, hlc2-o2 is in my opinion the most useful especially in this context, although it is perhaps best considered to be experimental in nature. For that reason, i've kept 'hlcc4' as the default for both MAs.
Additionally included is an 'aux input' which is the standard TV source menu and, where possible, can be set as outputs of other indicators.
THE SYSTEM
This one is fairly obvious and straightforward. It's just a moving average crossover with additional deviation (bollinger) bands. Not a lot to explain here as it should be apparent how it works.
Of the two, MA1 is considered to be the fast and MA2 is considered to be the slow. Both can be set with independent inputs, types and weighting. When MA1 is above, the colour of both is green and when it's below the colour of both is red. An additional gradient based fill is there and can be adjusted along with everything else in the visuals section at the bottom. Default alerts are available for crossover/crossunder conditions along with optional marker plots.
MA2 has the option for deviation bands, these are calculated based upon the MA type used and volume weighted according to the main parameter. In the case of a unweighted SMA being used they will be standard Bollinger bands.
An additional 'source direct' price tracker is included which can be used as the basis for an alert system for price crossings of bands or MAs, while taking advantage of the available weighted inputs. This is displayed as a stepped line on the chart so is also a good way to visualise the differences between input types.
That just about covers it then. The likelihood is that you've used some sort of moving average cross system before and are probably still using one or more. If so, then perhaps the additional functionality here will be of benefit.
Thanks for looking, I welcome any feedack
Chips Average Line (volume price) by RSUThis is a very important volume-price indicator for me.
Displays the average cost of chips for the short term (30 days), medium term (60 days), and long term (200 days).
Chip lines act as support and resistance. The longer the trend days, the greater the strength.
usage:
1. Breakout: If the stock rises, it must be above the short-term chip line. And gradually rise.
2. Sequence: When a bullish trend is formed, the short-term stack is higher than the mid-term stack, and the mid-flag stack is higher than the long-term stack. When there is a bear trend, the order is reversed.
3. Intensive: When the three chip lines are dense, there will be a periodical resonance effect, and the long-term trend will rise or fall sharply
Dashed Line Moving AveragesHere's a simple script which i concocted using ideas from various authors with the goal of creating a slightly better Moving Average dashed line script imo...I think i managed to do just that and a bit more.. =)
Features:
- Contains one of each VWMA SMA EMA. You can set the input length.
- Ability to set spacing between characters of the plotted moving average line
- Horizontal offset of the moving average lines (just in case)
- Can add any fancy characters that suits your taste e.g ( . , _ , -, !, *, rocket, lava, etc) to the moving average
- If you duplicate the script and modify the "Size" parameter of the plotchar() function's variables with the choices provided in the commented-out code; you can have some fun!
This script is for entertainment & educational purposes only.