RawCuts_01Library "RawCuts_01"
A collection of functions by:
mutantdog
The majority of these are used within published projects, some useful variants have been included here aswell.
This is volume one consisting mainly of smaller functions, predominantly the filters and standard deviations from Weight Gain 4000.
Also included at the bottom are various snippets of related code for demonstration. These can be copied and adjusted according to your needs.
A full up-to-date table of contents is located at the top of the main script.
WEIGHT GAIN FILTERS
A collection of moving average type filters with adjustable volume weighting.
Based upon the two most common methods of volume weighting.
'Simple' uses the standard method in which a basic VWMA is analogous to SMA.
'Elastic' uses exponential method found in EVWMA which is analogous to RMA.
Volume weighting is applied according to an exponent multiplier of input volume.
0 >> volume^0 (unweighted), 1 >> volume^1 (fully weighted), use float values for intermediate weighting.
Additional volume filter switch for smoothing of outlier events.
DIVA MODULAR DEVIATIONS
A small collection of standard and absolute deviations.
Includes the weightgain functionality as above.
Basic modular functionality for more creative uses.
Optional input (ct) for external central tendency (aka: estimator).
Can be assigned to alternative filter or any float value. Will default to internal filter when no ct input is received.
Some other useful or related functions included at the bottom along with basic demonstration use.
weightgain_sma(src, len, xVol, fVol)
Simple Moving Average (SMA): Weight Gain (Simple Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Standard Simple Moving Average with Simple Weight Gain applied.
weightgain_hsma(src, len, xVol, fVol)
Harmonic Simple Moving Average (hSMA): Weight Gain (Simple Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Harmonic Simple Moving Average with Simple Weight Gain applied.
weightgain_gsma(src, len, xVol, fVol)
Geometric Simple Moving Average (gSMA): Weight Gain (Simple Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Geometric Simple Moving Average with Simple Weight Gain applied.
weightgain_wma(src, len, xVol, fVol)
Linear Weighted Moving Average (WMA): Weight Gain (Simple Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Basic Linear Weighted Moving Average with Simple Weight Gain applied.
weightgain_hma(src, len, xVol, fVol)
Hull Moving Average (HMA): Weight Gain (Simple Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Basic Hull Moving Average with Simple Weight Gain applied.
diva_sd_sma(src, len, xVol, fVol, ct)
Standard Deviation (SD SMA): Diva / Weight Gain (Simple Volume)
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
ct (float) : Central tendency (optional, na = bypass). Internal: weightgain_sma().
Returns:
diva_sd_wma(src, len, xVol, fVol, ct)
Standard Deviation (SD WMA): Diva / Weight Gain (Simple Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
ct (float) : Central tendency (optional, na = bypass). Internal: weightgain_wma().
Returns:
diva_aad_sma(src, len, xVol, fVol, ct)
Average Absolute Deviation (AAD SMA): Diva / Weight Gain (Simple Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
ct (float) : Central tendency (optional, na = bypass). Internal: weightgain_sma().
Returns:
diva_aad_wma(src, len, xVol, fVol, ct)
Average Absolute Deviation (AAD WMA): Diva / Weight Gain (Simple Volume) .
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
ct (float) : Central tendency (optional, na = bypass). Internal: weightgain_wma().
Returns:
weightgain_ema(src, len, xVol, fVol)
Exponential Moving Average (EMA): Weight Gain (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Exponential Moving Average with Elastic Weight Gain applied.
weightgain_dema(src, len, xVol, fVol)
Double Exponential Moving Average (DEMA): Weight Gain (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Double Exponential Moving Average with Elastic Weight Gain applied.
weightgain_tema(src, len, xVol, fVol)
Triple Exponential Moving Average (TEMA): Weight Gain (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Triple Exponential Moving Average with Elastic Weight Gain applied.
weightgain_rma(src, len, xVol, fVol)
Rolling Moving Average (RMA): Weight Gain (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Rolling Moving Average with Elastic Weight Gain applied.
weightgain_drma(src, len, xVol, fVol)
Double Rolling Moving Average (DRMA): Weight Gain (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Double Rolling Moving Average with Elastic Weight Gain applied.
weightgain_trma(src, len, xVol, fVol)
Triple Rolling Moving Average (TRMA): Weight Gain (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: Triple Rolling Moving Average with Elastic Weight Gain applied.
diva_sd_ema(src, len, xVol, fVol, ct)
Standard Deviation (SD EMA): Diva / Weight Gain: (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
ct (float) : Central tendency (optional, na = bypass). Internal: weightgain_ema().
Returns:
diva_sd_rma(src, len, xVol, fVol, ct)
Standard Deviation (SD RMA): Diva / Weight Gain: (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
ct (float) : Central tendency (optional, na = bypass). Internal: weightgain_rma().
Returns:
weightgain_vidya_rma(src, len, xVol, fVol)
VIDYA v1 RMA base (VIDYA-RMA): Weight Gain (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: VIDYA v1, RMA base with Elastic Weight Gain applied.
weightgain_vidya_ema(src, len, xVol, fVol)
VIDYA v1 EMA base (VIDYA-EMA): Weight Gain (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
Returns: VIDYA v1, EMA base with Elastic Weight Gain applied.
diva_sd_vidya_rma(src, len, xVol, fVol, ct)
Standard Deviation (SD VIDYA-RMA): Diva / Weight Gain: (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
ct (float) : Central tendency (optional, na = bypass). Internal: weightgain_vidya_rma().
Returns:
diva_sd_vidya_ema(src, len, xVol, fVol, ct)
Standard Deviation (SD VIDYA-EMA): Diva / Weight Gain: (Elastic Volume).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
xVol (float) : Volume exponent multiplier (0 = unweighted, 1 = fully weighted).
fVol (bool) : Volume smoothing filter.
ct (float) : Central tendency (optional, na = bypass). Internal: weightgain_vidya_ema().
Returns:
weightgain_sema(src, len, xVol, fVol)
Parameters:
src (float)
len (simple int)
xVol (float)
fVol (bool)
diva_sd_sema(src, len, xVol, fVol)
Parameters:
src (float)
len (simple int)
xVol (float)
fVol (bool)
diva_mad_mm(src, len, ct)
Median Absolute Deviation (MAD MM): Diva (no volume weighting).
Parameters:
src (float) : Source input.
len (int) : Length (number of bars).
ct (float) : Central tendency (optional, na = bypass). Internal: ta.median()
Returns:
source_switch(slct, aux1, aux2, aux3, aux4)
Custom Source Selector/Switch function. Features standard & custom 'weighted' sources with additional aux inputs.
Parameters:
slct (string) : Choose from custom set of string values.
aux1 (float) : Additional input for user-defined source, eg: standard input.source(). Optional, use na to bypass.
aux2 (float) : Additional input for user-defined source, eg: standard input.source(). Optional, use na to bypass.
aux3 (float) : Additional input for user-defined source, eg: standard input.source(). Optional, use na to bypass.
aux4 (float) : Additional input for user-defined source, eg: standard input.source(). Optional, use na to bypass.
Returns: Float value, to be used as src input for other functions.
colour_gradient_ma_div(ma1, ma2, div, bull, bear, mid, mult)
Colour Gradient for plot fill between two moving averages etc, with seperate bull/bear and divergence strength.
Parameters:
ma1 (float) : Input for fast moving average (eg: bullish when above ma2).
ma2 (float) : Input for slow moving average (eg: bullish when below ma1).
div (float) : Input deviation/divergence value used to calculate strength of colour.
bull (color) : Colour when ma1 above ma2.
bear (color) : Colour when ma1 below ma2.
mid (color) : Neutral colour when ma1 = ma2.
mult (int) : Opacity multiplier. 100 = maximum, 0 = transparent.
Returns: Colour with transparency (according to specified inputs)
Volumeweighted
CMF and Scaled EFI OverlayCMF and Scaled EFI Overlay Indicator
Overview
The CMF and Scaled EFI Overlay indicator combines the Chaikin Money Flow (CMF) and a scaled version of the Elder Force Index (EFI) into a single chart. This allows traders to analyze both indicators simultaneously, facilitating better insights into market momentum and volume dynamics , specifically focusing on buying/selling pressure and momentum , without compromising the integrity of either indicator.
Purpose
Chaikin Money Flow (CMF): Measures buying and selling pressure by evaluating price and volume over a specified period. It indicates accumulation (buying pressure) when values are positive and distribution (selling pressure) when values are negative.
Elder Force Index (EFI): Combines price changes and volume to assess the momentum behind market moves. Positive values indicate upward momentum (prices rising with strong volume), while negative values indicate downward momentum (prices falling with strong volume).
By scaling the EFI to match the amplitude of the CMF, this indicator enables a direct comparison between pressure and momentum , preserving their shapes and zero crossings. Traders can observe the relationship between price movements, volume, and momentum more effectively, aiding in decision-making.
Understanding Pressure vs. Momentum
Chaikin Money Flow (CMF):
- Indicates the level of demand (buying pressure) or supply (selling pressure) in the market based on volume and price movements.
- Accumulation: When institutional or large investors are buying significant amounts of an asset, leading to an increase in buying pressure.
- Distribution: When these investors are selling off their holdings, increasing selling pressure.
Elder Force Index (EFI):
- Measures the strength and speed of price movements, indicating how forceful the current trend is.
- Positive Momentum: Prices are rising quickly, indicating a strong uptrend.
- Negative Momentum: Prices are falling rapidly, indicating a strong downtrend.
Understanding the difference between pressure and momentum is crucial. For example, a market may exhibit strong buying pressure (positive CMF) but weak momentum (low EFI), suggesting accumulation without significant price movement yet.
Features
Overlay of CMF and Scaled EFI: Both indicators are plotted on the same chart for easy comparison of pressure and momentum dynamics.
Customizable Parameters: Adjust lengths for CMF and EFI calculations and fine-tune the scaling factor for optimal alignment.
Preserved Indicator Integrity: The scaling method preserves the shape and zero crossings of the EFI, ensuring accurate analysis.
How It Works
CMF Calculation:
- Calculates the Money Flow Multiplier (MFM) and Money Flow Volume (MFV) to assess buying and selling pressure.
- CMF is computed by summing the MFV over the specified length and dividing by the sum of volume over the same period:
CMF = (Sum of MFV over n periods) / (Sum of Volume over n periods)
EFI Calculation:
- Calculates the EFI using the Exponential Moving Average (EMA) of the price change multiplied by volume:
EFI = EMA(n, Change in Close * Volume)
Scaling the EFI:
- The EFI is scaled by multiplying it with a user-defined scaling factor to match the CMF's amplitude.
Plotting:
- Both the CMF and the scaled EFI are plotted on the same chart.
- A zero line is included for reference, aiding in identifying crossovers and divergences.
Indicator Settings
Inputs
CMF Length (`cmf_length`):
- Default: 20
- Description: The number of periods over which the CMF is calculated. A higher value smooths the indicator but may delay signals.
EFI Length (`efi_length`):
- Default: 13
- Description: The EMA length for the EFI calculation. Adjusting this value affects the sensitivity of the EFI to price changes.
EFI Scaling Factor (`efi_scaling_factor`):
- Default: 0.000001
- Description: A constant used to scale the EFI to match the CMF's amplitude. Fine-tuning this value ensures the indicators align visually.
How to Adjust the EFI Scaling Factor
Start with the Default Value:
- Begin with the default scaling factor of `0.000001`.
Visual Inspection:
- Observe the plotted indicators. If the EFI appears too large or small compared to the CMF, proceed to adjust the scaling factor.
Fine-Tune the Scaling Factor:
- Increase or decrease the scaling factor incrementally (e.g., `0.000005`, `0.00001`, `0.00005`) until the amplitudes of the CMF and EFI visually align.
- The optimal scaling factor may vary depending on the asset and timeframe.
Verify Alignment:
- Ensure that the scaled EFI preserves the shape and zero crossings of the original EFI.
- Overlay the original EFI (if desired) to confirm alignment.
How to Use the Indicator
Analyze Buying/Selling Pressure and Momentum:
- Positive CMF (>0): Indicates accumulation (buying pressure).
- Negative CMF (<0): Indicates distribution (selling pressure).
- Positive EFI: Indicates positive momentum (prices rising with strong volume).
- Negative EFI: Indicates negative momentum (prices falling with strong volume).
Look for Indicator Alignment:
- Both CMF and EFI Positive:
- Suggests strong bullish conditions with both buying pressure and upward momentum.
- Both CMF and EFI Negative:
- Indicates strong bearish conditions with selling pressure and downward momentum.
Identify Divergences:
- CMF Positive, EFI Negative:
- Buying pressure exists, but momentum is negative; potential for a bullish reversal if momentum shifts.
- CMF Negative, EFI Positive:
- Selling pressure exists despite rising prices; caution advised as it may indicate a potential bearish reversal.
Confirm Signals with Other Analysis:
- Use this indicator in conjunction with other technical analysis tools (e.g., trend lines, support/resistance levels) to confirm trading decisions.
Example Usage
Scenario 1: Bullish Alignment
- CMF Positive: Indicates accumulation (buying pressure).
- EFI Positive and Increasing: Shows strengthening upward momentum.
- Interpretation:
- Strong bullish signal suggesting that buyers are active, and the price is likely to continue rising.
- Action:
- Consider entering a long position or adding to existing ones.
Scenario 2: Bearish Divergence
- CMF Negative: Indicates distribution (selling pressure).
- EFI Positive but Decreasing: Momentum is positive but weakening.
- Interpretation:
- Potential bearish reversal; price may be rising but underlying selling pressure suggests caution.
- Action:
- Be cautious with long positions; consider tightening stop-losses or preparing for a possible trend reversal.
Tips
Adjust for Different Assets:
- The optimal scaling factor may differ across assets due to varying price and volume characteristics.
- Always adjust the scaling factor when analyzing a new asset.
Monitor Indicator Crossovers:
- Crossings above or below the zero line can signal potential trend changes.
Watch for Divergences:
- Divergences between the CMF and EFI can provide early warning signs of trend reversals.
Combine with Other Indicators:
- Enhance your analysis by combining this overlay with other indicators like moving averages, RSI, or Ichimoku Cloud.
Limitations
Scaling Factor Sensitivity:
- An incorrect scaling factor may misalign the indicators, leading to inaccurate interpretations.
- Regular adjustments may be necessary when switching between different assets or timeframes.
Not a Standalone Indicator:
- Should be used as part of a comprehensive trading strategy.
- Always consider other market factors and indicators before making trading decisions.
Disclaimer
No Guarantee of Performance:
- Past performance is not indicative of future results.
- Trading involves risk, and losses can exceed deposits.
Use at Your Own Risk:
- This indicator is provided for educational purposes.
- The author is not responsible for any financial losses incurred while using this indicator.
Code Summary
//@version=5
indicator(title="CMF and Scaled EFI Overlay", shorttitle="CMF & Scaled EFI", overlay=false)
cmf_length = input.int(20, minval=1, title="CMF Length")
efi_length = input.int(13, minval=1, title="EFI Length")
efi_scaling_factor = input.float(0.000001, title="EFI Scaling Factor", minval=0.0, step=0.000001)
// --- CMF Calculation ---
ad = high != low ? ((2 * close - low - high) / (high - low)) * volume : 0
mf = math.sum(ad, cmf_length) / math.sum(volume, cmf_length)
// --- EFI Calculation ---
efi_raw = ta.ema(ta.change(close) * volume, efi_length)
// --- Scale EFI ---
efi_scaled = efi_raw * efi_scaling_factor
// --- Plotting ---
plot(mf, color=color.green, title="CMF", linewidth=2)
plot(efi_scaled, color=color.red, title="EFI (Scaled)", linewidth=2)
hline(0, color=color.gray, title="Zero Line", linestyle=hline.style_dashed)
- Lines 4-6: Define input parameters for CMF length, EFI length, and EFI scaling factor.
- Lines 9-11: Calculate the CMF.
- Lines 14-16: Calculate the EFI.
- Line 19: Scale the EFI by the scaling factor.
- Lines 22-24: Plot the CMF, scaled EFI, and zero line.
Feedback and Support
Suggestions: If you have ideas for improvements or additional features, please share your feedback.
Support: For assistance or questions regarding this indicator, feel free to contact the author through TradingView.
---
By combining the CMF and scaled EFI into a single overlay, this indicator provides a powerful tool for traders to analyze market dynamics more comprehensively. Adjust the parameters to suit your trading style, and always practice sound risk management.
Big Volumes HighlighterBig Volumes Highlighter
Overview:
The "Big Volume Highlighter" is a powerful tool designed to help traders quickly identify candles with the highest trading volume over a specified period. This indicator not only highlights the most significant volume candles but also color-codes them based on the candle's direction—green for bullish (close > open) and red for bearish (close < open). Whether you're analyzing volume spikes or looking for key moments in price action, this indicator provides clear visual cues to enhance your trading decisions.
Features:
Customizable Lookback Period: Define the number of candles to consider when determining the highest volume.
Automatic Color Coding: Candles with the highest volume are highlighted in green if bullish and red if bearish.
Visual Clarity: The indicator marks the significant volume candles with a triangle above the bar and changes the background color to match, making it easy to spot important volume events at a glance.
Use Cases:
Volume Spike Detection:
Quickly identify when a large volume enters the market, which may indicate significant buying or selling pressure.
Trend Confirmation: Use volume spikes to confirm trends or potential reversals by observing the direction of the high-volume candles.
Market Sentiment Analysis: Understand market sentiment by analyzing the direction of the candles with the biggest volumes.
How to Use:
Add the "Big Volume Highlighter" to your chart.
Adjust the lookback period to suit your analysis.
Observe the highlighted candles for insights into market dynamics.
This script is ideal for traders who want to incorporate volume analysis into their technical strategy, providing a simple yet effective way to monitor significant volume changes in the market.
Consolidation VWAP's [QuantVue]Introducing the Consolidation VWAP's Indicator , a powerful tool designed to identify consolidation periods in stock advance and automatically anchor three distinct VWAPs to key points within the consolidation.
Consolidation Period Identification:
The indicator automatically detects periods of consolidation or areas on the chart where a stock's price moves sideways within a defined range. This period can be seen as the market taking a "breather" as it digests the previous gains. Consolidations are important because they often act as a base for the next move, either continuing the previous uptrend or reversing direction.
Consolidation requirements can be customized by the user to match your instrument and timeframe.
Maximum Consolidation Depth
Minimum Consolidation Length
Maximum Consolidation Length
Prior Uptrend Amount
Anchored VWAP, or Anchored Volume-Weighted Average Price, is a technical analysis tool used to determine the average price of a stock weighted by volume, starting from a specific point in time chosen by the analyst.
Unlike traditional VWAP, which starts at the beginning of the trading session, the anchored VWAP allows traders to select any point on the chart, such as a significant event, price low, high, or a breakout, to begin the calculation.
VWAP incorporates price and volume in a weighted average and can be used to identify areas of support and resistance on the chart.
VWAP Anchored to Consolidation High: This VWAP is anchored at the highest price point within the identified consolidation period. It helps traders understand the
average price paid by buyers who entered at the peak of the consolidation.
VWAP Anchored to Consolidation Low: This VWAP is anchored at the lowest price point within the consolidation. It provides insights into the average price paid by
buyers who entered at the lowest point of the consolidation.
VWAP Anchored to Highest Volume in the Consolidation: This VWAP is anchored at the price level with the highest trading volume during the consolidation. It reflects the average price at
which the most trading activity occurred, often indicating a key support or resistance level.
The indicator also allows the trader to see past consolidation areas and previous anchored VWAP's.
Give this indicator a BOOST and COMMENT your thoughts!
We hope you enjoy.
Cheers!
VWAP LEVELS [PRO]32 VWAP levels with labels and a table to help you identify quickly where current price is in relation to your favorite VWAP pivot levels. To help reduce cognitive load, 4 colors are used to show you where price is in relation to a VWAP level as well as the strength of that respective level. Ultimately, VWAP can be an invaluable source of support and resistance; in other words you'll often see price bounce off of a level (whether price is increasing or decreasing) once or multiple times and that could be an indication of a price's direction. Another way that you could utilize this indicator is to use it in confluence with other popular signals, such as an EMA crossover. Many traders will wait till a bar's close on the 5m or 10m time frame above a VWAP level (developing 1D VWAP would be a popular choice) before making a decision on a potential trade especially if price is rising above the 1D VWAP *and* there's been a recent 100 EMA cross UP of the 200 EMA. These are 2 bullish signals that you could look for before possibly entering in to a trade.
I've made this indicator extremely customizable:
⚡Each VWAP level has 2 labels: 1 "at level" and 1 "at right", each label and price can be disabled
⚡Each VWAP label has its own input for label padding. The "at right" label padding input allows you to zoom in and out of a chart without the labels moving along their respective axis. However, the "at level" label padding input doesn't work the same way once you move the label out of the "0" input. The label will move slightly when you zoom in and out
⚡Both "current" and "previous" VWAP levels have their own plot style that can be changed from circles, crosses and lines
⚡Significant figures input allows you to round a price up or down
⚡A price line that allows you to identify where price is in relation to a VWAP level
⚡A table that's color coded the same way as the labels. The labels and table cells change to 1 of 4 colors when "OC Check Mode" is enabled. This theory examines if the VWAP from the Open is above or below the VWAP from Close and if price is above or below normal VWAP (HLC3). This way we have 4 states:
Red = Strong Downtrend
Light Red = Weak Downtrend
Light = Weak Uptrend
Green = Strong Uptrend
Something to keep in mind: At the start of a new year, week or month, some levels will converge and they'll eventually diverge slowly or quickly depending on the level and/or time frame. You could add a few labels "at level" to show which levels are converging at the time. Since we're at the beginning of a new year, you'll see current month, 2 month, 3 month etc converge in to one level.
🙏Thanks to (c)MartinWeb for the inspiration behind this indicator.
🙏Thanks to (c)SimpleCryptoLife for the libraries and code to help create the labels.
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!
Machine Learning: VWAP [YinYangAlgorithms]Machine Learning: VWAP aims to use Machine Learning to Identify the best location to Anchor the VWAP at. Rather than using a traditional fixed length or simply adjusting based on a Date / Time; by applying Machine Learning we may hope to identify crucial areas which make sense to reset the VWAP and start anew. VWAP’s may act similar to a Bollinger Band in the sense that they help to identify both Overbought and Oversold Price locations based on previous movements and help to identify how far the price may move within the current Trend. However, unlike Bollinger Bands, VWAPs have the ability to parabolically get quite spaced out and also reset. For this reason, the price may never actually go from the Lower to the Upper and vice versa (when very spaced out; when the Upper and Lower zones are narrow, it may bounce between the two). The reason for this is due to how the anchor location is calculated and in this specific Indicator, how it changes anchors based on price movement calculated within Machine Learning.
This Indicator changes the anchor if the Low < Lowest Low of a length of X and likewise if the High > Highest High of a length of X. This logic is applied within a Machine Learning standpoint that likewise amplifies this Lookback Length by adding a Machine Learning Length to it and increasing the lookback length even further.
Due to how the anchor for this VWAP changes, you may notice that the Basis Line (Orange) may act as a Trend Identifier. When the Price is above the basis line, it may represent a bullish trend; and likewise it may represent a bearish trend when below it. You may also notice what may happen is when the trend occurs, it may push all the way to the Upper or Lower levels of this VWAP. It may then proceed to move horizontally until the VWAP expands more and it may gain more movement; or it may correct back to the Basis Line. If it corrects back to the basis line, what may happen is it either uses the Basis Line as a Support and continues in its current direction, or it will change the VWAP anchor and start anew.
Tutorial:
If we zoom in on the most recent VWAP we can see how it expands. Expansion may be caused by time but generally it may be caused by price movement and volume. Exponential Price movement causes the VWAP to expand, even if there are corrections to it. However, please note Volume adds a large weighted factor to the calculation; hence Volume Weighted Average Price (VWAP).
If you refer to the white circle in the example above; you’ll be able to see that the VWAP expanded even while the price was correcting to the Basis line. This happens due to exponential movement which holds high volume. If you look at the volume below the white circle, you’ll notice it was very large; however even though there was exponential price movement after the white circle, since the volume was low, the VWAP didn’t expand much more than it already had.
There may be times where both Volume and Price movement isn’t significant enough to cause much of an expansion. During this time it may be considered to be in a state of consolidation. While looking at this example, you may also notice the color switch from red to green to red. The color of the VWAP is related to the movement of the Basis line (Orange middle line). When the current basis is > the basis of the previous bar the color of the VWAP is green, and when the current basis is < the basis of the previous bar, the color of the VWAP is red. The color may help you gauge the current directional movement the price is facing within the VWAP.
You may have noticed there are signals within this Indicator. These signals are composed of Green and Red Triangles which represent potential Bullish and Bearish momentum changes. The Momentum changes happen when the Signal Type:
The High/Low or Close (You pick in settings)
Crosses one of the locations within the VWAP.
Bullish Momentum change signals occur when :
Signal Type crosses OVER the Basis
Signal Type crosses OVER the lower level
Bearish Momentum change signals occur when:
Signal Type crosses UNDER the Basis
Signal Type Crosses UNDER the upper level
These signals may represent locations where momentum may occur in the direction of these signals. For these reasons there are also alerts available to be set up for them.
If you refer to the two circles within the example above, you may see that when the close goes above the basis line, how it mat represents bullish momentum. Likewise if it corrects back to the basis and the basis acts as a support, it may continue its bullish momentum back to the upper levels again. However, if you refer to the red circle, you’ll see if the basis fails to act as a support, it may then start to correct all the way to the lower levels, or depending on how expanded the VWAP is, it may just reset its anchor due to such drastic movement.
You also have the ability to disable Machine Learning by setting ‘Machine Learning Type’ to ‘None’. If this is done, it will go off whether you have it set to:
Bullish
Bearish
Neutral
For the type of VWAP you want to see. In this example above we have it set to ‘Bullish’. Non Machine Learning VWAP are still calculated using the same logic of if low < lowest low over length of X and if high > highest high over length of X.
Non Machine Learning VWAP’s change much quicker but may also allow the price to correct from one side to the other without changing VWAP Anchor. They may be useful for breaking up a trend into smaller pieces after momentum may have changed.
Above is an example of how the Non Machine Learning VWAP looks like when in Bearish. As you can see based on if it is Bullish or Bearish is how it favors the trend to be and may likewise dictate when it changes the Anchor.
When set to neutral however, the Anchor may change quite quickly. This results in a still useful VWAP to help dictate possible zones that the price may move within, but they’re also much tighter zones that may not expand the same way.
We will conclude this Tutorial here, hopefully this gives you some insight as to why and how Machine Learning VWAPs may be useful; as well as how to use them.
Settings:
VWAP:
VWAP Type: Type of VWAP. You can favor specific direction changes or let it be Neutral where there is even weight to both. Please note, these do not apply to the Machine Learning VWAP.
Source: VWAP Source. By default VWAP usually uses HLC3; however OHLC4 may help by providing more data.
Lookback Length: The Length of this VWAP when it comes to seeing if the current High > Highest of this length; or if the current Low is < Lowest of this length.
Standard VWAP Multiplier: This multiplier is applied only to the Standard VWMA. This is when 'Machine Learning Type' is set to 'None'.
Machine Learning:
Use Rational Quadratics: Rationalizing our source may be beneficial for usage within ML calculations.
Signal Type: Bullish and Bearish Signals are when the price crosses over/under the basis, as well as the Upper and Lower levels. These may act as indicators to where price movement may occur.
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Volume-Weighted RSI [wbburgin]The Volume-Weighted RSI takes a new approach to the traditional calculation of the RSI in using a price::volume calculation. As some traders consider volume to be a leading indicator for price, the volume-weighted RSI can come in handy if you want to visualize volume easier.
Usage
This indicator builds the RSI from the square of the volume change and the price. If the volume decreases rapidly with the price, the volume-weighted RSI will fall; if the volume increases rapidly with the price, the volume-weighted RSI will rise.
You may notice crosses and circles appearing above and below the indicator. These indicate abnormal volume or price:
A green cross indicates abnormal upward price
A red cross indicates abnormal downward price
A green circle indicates abnormal positive volume
A red circle indicates abnormal negative volume
A green bar indicates both abnormal price and volume (positive), while a red bar indicates both abnormal price and volume (negative).
The thresholds of what are considered "normal" and "abnormal" are controlled by the "SD Multiple" in your settings (standard deviation). A higher multiple will make less of these signals occur, and you can turn them and the bars off at any time.
I have a built-in Light Style and Dark Style so that your preference of background won't affect seeing the indicator. You can also change the colors and the overbought/oversold lines in your settings.
Moving Average Based Zig ZagMoving Average Based Zig Zag differs from the traditional Zig Zag indicator in that pivot points are determined by a moving average, Volume Weighted Hull Moving Average, rather than looking for the highest or lowest point in a left / right period.
Settings
Source: the source for the pivot points.
Moving Average Length: the length of the Volume Weighted Hull Moving Average, increase for longer zig zags, decrease for shorter zig zags.
Usage
Like all Zig Zag indicators, the Moving Average Based Zig Zag is not intended to be used as a live trading tool. This indicator is intended to be an alternative way of determining pivot points on your chart. Pivot points can be used for a multitude of different analytical techniques. One may use pivot points in order to draw potential support and resistance lines, trend lines or chart patterns. Additionally, pivot points can be used to determine variations of highs and lows important to market structure analysis such as break of structure or change of character.
Details
The moving average used is a Volume Weighted Hull Moving Average, this particular moving average was used due to it's relatively low-lag characteristics when compared to an Exponential Moving Average, additionally by considering volume in the moving average calculation, insignificant pivot points can be further filtered.
Rather than using built-in functions `ta.pivothigh()` and `ta.pivotlow()` to determine pivot points, this indicator waits for the moving average to pivot then searches for the highest or lowest value from the bar index of the moving average pivot to the bar index of the previous found price pivot. This method of determining pivots provides a more dynamic approach to determining pivot points.
Volume Weighted Reversal BandsThis is a vwap & vwma hybrid with upper & lower deviation bands that provide excellent price channels and reversal areas. It can be used on lower & higher timeframes, just increase the deviation % for higher timeframes. Try out the 1 minute timeframe with .5% deviation for great scalping levels.
Here is the calculation used for the main line.
(VWMA100 + VWMA500 + VWMA1000 + VWAP) / 4
So it combines 3 VWMAs with the VWAP and divides that number by 4 to give us a moving average. Then we add new levels above and below that moving average to get our channels. The channels are separated by the % deviation you choose in the settings. For tighter bands, lower the percentage deviation and for wider bands, increase the percentage deviation.
The fattest line in the middle is the main moving average and you can expect price to regularly return to this level. The thick lines are the main moving average plus or minus the percentage deviation you have set. There are 10 levels in each direction from the main moving average. The is also a thin short term moving average as well with a custom calculation. It takes 4 different length moving averages that are weighted and 4 more that are volume weighted and divides the total by 8.The lines will be green when price is above the line and red when price is below the line. The thin white line is the VWAP on its own.
These lines will act as dynamic support and resistance so you can scalp them back and forth. These levels work so well because they are volume weighted and the algos hedge their positions back and forth constantly.
For best results, use this indicator on tickers with the highest volume and trading action as the price will stick to these levels better when the big money players are hedging. Some great tickers for this indicator are APPL, SPY, BTC, ETH.
All colors and linewidths can be customized in the settings easily as well as turning off the VWAP or short moving average and adjusting the percentage deviation for the channels.
***MARKETS***
This indicator can be used on all markets, including stocks, crypto, futures and forex.
***TIMEFRAMES***
This indicator can be used on all timeframes.
***TIPS***
Try using numerous indicators of ours on your chart for extra confirmation. Our favorites to pair with these bands are the Scalper Ribbon and Trend Friend Signals. The 3 combined give you a lot of extra confirmation on whether the market is going to reverse at these levels.
Shadow Compact Volume BETAThis indicator will give you an overview of the trading volume of 1 candle, useful for new traders (This indicator will be updated more in the future). The current calculation method does not give any any trading signals!If you find it interesting or want to support the development of this indicator ,You can support me a cup of tea via the following link:
paypal.me/paulslim
Enjoy new good days!
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
Volume Risk Avoidance IndicatorPrice Pattern Analysis is the core of trading. But price patterns often fails.
VRAI (Volume Risk Avoidance Indicator) shows Volume Pressure, so that you can avoid volume-based risks.
For example, never short when you see green (buying pressure). Never long when you see red (selling pressure).
You still need to pick good price patterns, because the crossover of volume pressure is not reliable.
Enjoy!
Volume Profile, Pivot Anchored by DGTVolume Profile (also known as Price by Volume ) is an charting study that displays trading activity over a specified time period at specific price levels. It is plotted as a horizontal histogram on the finacial isntrumnet's chart that highlights the trader's interest at specific price levels. Specified time period with Pivots Anchored Volume Profile is determined by the Pivot Levels, where the Pivot Points High Low indicator is used and presented with this Custom indicator
Finally, Volume Weighted Colored Bars indicator is presneted with the study
Different perspective of Volume Profile applications;
Anchored to Session, Week, Month etc : Anchored-Volume-Profile
Custom Range, Interactive : Volume-Profile-Custom-Range
Fixed Range with Volume Indicator : Volume-Profile-Fixed-Range
Combined with Support and Resistance Indicator : Price-Action-Support-Resistance and Volume-Profile
Combined with Supply and Demand Zones, Interactive : Supply-Demand-and-Equilibrium-Zones
Disclaimer : Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitutes professional and/or financial advice. You alone the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
PJBG - HMA Smoothed VWMA [HMASVWMA]Problem: (1) lag of traditional MA's, (2) lack of Volume data in traditional MA's, and (3) choppiness of traditional MA's.
Solution: apply hull formula tick to tick, simply at a factor of 1:1.
Result: Smooth and fast MA that has volume data baked in it.
Benefit: See trend changes fast, and if it is supported by volume. Pleasant to the eyes.
Explanatory note: hull ma's generally cannot be volume weighted because the volume will spike the line tremendously.
Volume Profile and Volume Indicator by DGTVolume Profile (also known as Price by Volume) is an charting study that displays trading activity over a specified time period at specific price levels. It is plotted as a horizontal histogram on the finacial isntrumnet's chart that highlights the trader's interest at specific price levels.
The histogram is used by traders to predict areas of support and resistance. Price levels where the traded volume is high could be assumed as support and resistance levels.
Price may experience difficulty moving above or below areas with large bars. Usually there is a great deal of activity on both the buy and sell side and the market stays at that price level for a great deal of time
It is advised to use volume profile in conjunction with other forms of technical analysis to maximize the odds of success
Light version of Volume Profile is added to Price Action - Support & Resistance by DGT
RedK Volume-Accelerated Directional Energy Ratio (RedK VADER)The Volume-Accelerated Directional Energy Ratio (VADER) makes use of price moves (displacement) and the associated volume (effort) to estimate the positive (buying) and negative (selling) "energy" behind the scenes, enabling traders to "read the market action" in more details and adjust their trading decisions accordingly.
How does VADER work?
------------------------------------
I have always been a fan of technical analysis concepts that are simple, and that integrate both price action and volume together - The concept behind VADER is really a simple one.
Let's walk though it as we avoid getting too technical:
Large price moves that are associated with large volume means buyers (if the move is up) or sellers (when the move is down) are serious and are "in control" of the action
On the other hand, when the price moves are small but with large volume, it means there's a fight, or more of a balance of energy, between buying and selling.
Also when large price moves are associated with relatively limited volume, there's a lack of "energy" from either buyers or sellers - and moves likes these are usually short-lived.
The analogy with VADER, is that we look at price moves (change of close between 2 bars) as the displacement (or action result) and the associated volume as the "effort" behind this action -- Combining these 2 values together, the displacement and the effort, gives us a representation or a proxy of the underlying energy (in a specific direction).
when both values (displacement and effort) are high, then the resulting energy is high - and if one of these values are low, the resulting energy is low.
we then take an average of that relative energy in each direction (positive = buying and negative = selling) and calculate the net energy.
note that we're approaching the analogy here from a trading perspective and not from physics perspective :) -- we can be forgiven if the energy calculation in physics is different ..
VADER Plots
---------------------
the blue line with crosses represents the positive energy - or the buying strength
the orange line with circles represents the negative energy - or the selling strength
the thick Green / Red main line plot represents the net energy - and generally the main signal to be looking out for is when that line crosses 0 up or down - but i find it also very valuable to keep an eye on the individual energy lines as they sometimes "tell a story" like we see in the chart above,
Volume Calculation:
----------------------------
- VADER by default is a volume-weighted indicator - it uses the volume associated with change in bar close value (Full mode) as an accelerator in the calculation of the directional energy
- VADER introduces another method of integrating volume, by considering "relative" or "differential" volume (Relative mode) - in this mode, we consider the ratio of volume above the minimum volume observed within a "lookback" length - so practically, ignoring the minimum volume. in other words, if a price move is associated with very low volume, it gets very low "volume accelerator" (close to 0) and if the move is associated with very large volume, it gets the maximum volume accelerator (1 or close to 1) - The relative mode of volume calculation magnifies volume effect and ignores the low volume values that may just act as noise. test both modes and find which one works better for you.
- VADER also has the ability to work without volume (volume calculation = None) - and will revert to that mode when used with instruments that have no volume data. In that mode, VADER will behave similar to an RSI (but not exactly like it given the underlying calculation is different)
- We can also setup VADER at a specific resolution / timeframe that is different than the chart.
Using VADER & Other Thoughts
----------------------------------------
The main signal to look out for, is when VADER's Green / Red line crosses the zero line.
Green (above zero) represents that the net energy is with the buyers and we should favor long positions
Red (below zero) reflects that the sellers have control and we should favor short positions (or consider to close longs)
*** However, VADER should be used as a *secondary indicator* - given the big influence of volume on the calculation - VADER doesn't directly track price trend or momentum - VADER needs to be used in the context of other indicators that show trend and momentum - i would suggest you combine VADER with Moving Averages or other trend tracking indicators on the price chart, MACD, RSI and / or other trend and momentum indicators you're already familiar with.
Suggested setup:
There's more to add to VADER in future versions - alerts, control level, maybe improve visuals... etc - please share your feedback as you start experimenting with VADER.. good luck! (and of course, May the Force be with you :) )
Linear Regression, Volume WeightedProduces deviation lines based upon linear regression of volume adjusted price with the option to clean the data of outliers.
The regression line is more accurate than standard linear regression as each data point is effectively a volume unit (share) and the total number of data points is the total volume from the beginning to end.
Baekdoo baselineHi forks,
I'm trader Baekdoosan who trading Equity from South Korea. This Baekdoo baseline will give you the idea of big whale's approximate average price. The idea behind this indicator is to combine volume and price. Here's one of the equation.
...
HT4=highest(volume, 250)
NewH4=valuewhen(volume>HT4 , (open+close+low+high+close)/5, 1)
result4=ema(NewH4, 20)
...
As you can see it will update when highest volume is updated by certain period of time. At that update will be the price of the close weighted price. and I put shift value of 20 (offset of input value) due to putting time theorem of Ichimoku Balance Table. 20 days means for 1 month of market day.
Why this idea work? It is mainly for the support / resistance. Resistance is made for lots of individual's buy. When the price goes down, they are tend to hold. As time goes by price getting high to their average price, then they are selling it with small profit or the same price or with small loss. So resistance is made by lots of individuals. And supports are made by small number of big whales. If we see the volume only, then we cannot differentiate easily for lots of individuals and small number of big whales. But lower price's large volume will most probably be the whale where higher price's large volume will most probably tons of individuals.
hope this will help your trading on equity as well as crypto. I didn't try it on futures. Best of luck all of you. Gazua~!
RedK Volume-Weighted Directional Efficiency Index (DXF)RedK Volume-Weighted Directional Efficiency Index (DXF) is a momentum indicator - that builds on Kaufman's Efficiency Ratio (ER) concept.
DXF utilizes a restricted +100/-100 oscillator to represent the "quality" of a trend, and does a good job in detecting the possibility of an upcoming trend change (in both direction and quality), improving our ability to make decisions on trade entries and exits.
Here's a quick background on Kaufman's Efficiency Ratio (ER)
------------------------------------------------------------------------------- Copied from internet sources -----------------------------
Developed by Perry Kaufman and introduced in his book “New Trading Systems and Methods”, the Efficiency Ratio reflects relative market speed to volatility. There are cases, when it is used as a filter, which helps a trader to avoid ”choppy” markets or trading ranges and to identify smoother trends.
ER is the result of dividing the net change in price movement during n-periods by the sum of all bar-to-bar price changes during the same n-periods. In case the market is trending smoother, then the ratio will be higher. In case the ratio shows readings in proximity to zero, this implies that market movement is inefficient and ”choppy”.
If the Efficiency Ratio shows a reading of +100, this means that the trading instrument is in a bull trend and trending with perfect efficiency.
If the Efficiency Ratio shows a reading of -100, this means that the trading instrument is in a bear trend and trending with perfect efficiency.
It is impossible for any instrument to have a perfect Efficiency ratio, because any movement against the major trend during the examined period of time would cause the ratio to drop.
If the Efficiency Ratio shows a reading above +30 (common setting for the "Significant Level"), this is indicative of a quality bull trend. If the ratio shows a reading below -30, this is indicative of a quality bear trend.
------------------------------------------------------------------------------- End of Copy -------------------------------------------------------------------------------------------------------
Kaufman also used the ER as basis for his famous Kaufman Adaptive Moving Average (KAMA).
Read more on ER & Kama here
How is DXF different from other ER-based indicators?
------------------------------------------------------------------
- Let's get the easy part out of the way: DXF has a "volume-weighting" option ✔
This option is OFF by default (to avoid errors with instruments with no volume data)
- once this option is applied, it provides the benefit of combining the volume effect into the calculation - those who appreciate the effect of volume on price action will hopefully find this option valuable
- The calculation of ER and how it can be "best utilized":
Let's examine the ER concept a bit closer: as a (math) concept, the (original) Efficiency Ratio (ER) takes the positive change of the price of an instrument during a certain period, and divide it by the sum of (absolute) price moves that were observed during that same period.
So, in the trader's language, we will be saying "out of a total of $20 moves (up and down) that MSFT did in the past 10 days, MSFT only made a net change of $5 up during that period" - so the "10-day ER" for MSFT in that case is 5/20 = 25% -- then we continue to observe that ongoing "10-day ER" and if it increases, we can expect that MSFT is going to establish a strong move (trend) up --- right?
the magic word here is to "observe the ongoing ER" - many of the ER based indicators just use the ER as calculated by Kaufman's original method. IMHO, these are just "point-in-time readings" - if we hope to get real insights from the ER, we need to take an average of that reading - for our "time window" we're interested in - and only then we can identify trends and patterns in the ER value as it changes during that windowss- DXF does that - and that allows a trader to say "the (weighted) 5-day average of the 10-day ER for MSFT is increasing, and that why i expect an up-trend" -- makes sense ? both the "Lookback" used to calculate the ER, and the Length of observed "window" for the Average ER are adjustable in DXF settings
Other Uses and Settings :
---------------------------------
- As a momentum indicator, DXF can predict an upcoming change of trend - cause that will reflect on the average ER value. There are few examples in the chart where the price move and ER trend *do not agree* - The trader can see these signs and take decisions accordingly
- DXF can help reveal best entries and exits: assume we are long-term bullish on MSFT, and we want to "buy the dip" - DXF can help reveal the time where price is recovering from extreme weakness - and that would be the ideal buy opportunities for us - exampled marked on the chart
- the Stepping & Smoothing options enable better visualization of the DXF plot. the "raw" DXF is still shown as a silver line.
- The "Significant Levels" option is available and is set to -20/+20 by default .. also adjustable in indicator settings.
- Please use DXF in combination with other trend and volume indicators, and with thorough chart / price action analysis and not in isolation to ensure you get proper signal confirmation for trades. In the chart above, you can see DXF combined with a moving average that can act as a filter and to confirm the price moves.
---------------------------------------------------
As usual, feedback & comments are welcome - if you find this work useful in your trading arsenal, please share a comment - i would be more than happy to learn about that. Good luck!
Weighted Harrell-Davis Quantile Estimator with AbsoluteDeviation
QUANTILE ESTIMATORS
Weighted Harrell-Davis Quantile Estimator with Absolute Deviation Fences.
DISCLAIMER:
The Following indicator/code IS NOT intended to be a formal investment advice or recommendation by the author, nor should be construed as such. Users will be fully responsible by their use regarding their own trading vehicles/assets.
The following indicator was made for NON LUCRATIVE ACTIVITIES and must remain as is, following TradingView's regulations. Use of indicator and their code are published for work and knowledge sharing. All access granted over it, their use, copy or re-use should mention authorship(s) and origin(s).
WARNING NOTICE!
THE INCLUDED FUNCTION MUST BE CONSIDERED FOR TESTING. The models included in the indicator have been taken from open sources on the web and some of them has been modified by the author, problems could occur at diverse data sceneries, compiler version, or any other externality.
Purpose:
Weighted Quantiles or <> are quite difficult to find on must systems, also it's non-weighted approach are rarely used to estimate the location parameter of price distribution WICH IS NOT NORMAL, all this in favour of it's non-robust counterpart, the Arithmetic rolling Mean or <> and it's weighted variants like the WMA, VWAP, etc.
Also, a big drawback from this is that must statistics derived from Normal-Distribution parameter location (the Mean) definitely will not fit for an efficient, nor robust estimation for price distributions, so their moments like the standard deviation, kurtosis, skewness, etc. will not be the better tools to build derived algorithms or technical indicators among price/volume.
In an effort searching better statistical tools for price distributions, I found the excellent work of Andrey Akinshin that took me to port some of their Math research contributions for the compute benchmarking field , and bring it here at the TradingView ecosystem to take a shot at the price distribution crazy fields. For a better detail of what the weighted Harrell-Davis Quantile Estimator can do, who better than drink directly from the source at References:
References:
Weighted Quantile Estimators.
DoubleMAD outlier detector based on the Harrell-Davis quantile estimator.
Unbiased median absolute deviation based on the Harrell-Davis quantile estimator.
Quantile confidence intervals for weighted samples.
Licensing:
This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International Copyright (c) 2021 (CC BY-NC-SA 4.0)
Copyright's & Mentions:
The Gamma Functions & Beta Probability Density Functions C# implementations by the Math.NET Numerics, part of the Math.NET Project.
The Regularized Incomplete (Left) Beta Function C# implementation by the SAMTools, htslib project.
The Weighted Harrell-Davis Quantile estimator ; C# & R implementations by Andrey Akinshin.
External PineScript code, methods, support & consultancy by @PineCoders staff with special mention for:
+ "ma sorter ('sort by array' example)- JD" by @Duyck.
+ Porting, mods, compilation and debugging for this script by @XeL_Arjona for the TradingView's @PineCoders community.
VWMACDV2 w/Intraday Intensity Index Histogram & VBCB Hello traders! In this script i tried to combine Kıvanç Özbilgiç's Volume Based Coloured Bars, Volume Weighted Macd V2 and Intraday Intensity Index developed by Dave Bostian and added to Tradingview by Kıvanç Özbilgiç. Let's see what we got here;
VBCB, Paints candlestick bars according to the volume of that bar. Period is 30 by default. If you're trading stocks, 21 should be better.
Volume Weighted Macd V2, "Here in this version; Exponential Moving Averages used and Weighted by Volume instead of using only vwma (Volume Weighted Moving Averages)." Says, Kıvanç Özbilgiç.
III, "A technical indicator that approximates the volume of trading for a specified security in a given day. It is designed to help track the activity of institutional block traders and is calculated by subtracting the day's high and low from double the closing price, divided by the volume and multiplied by the difference between the high and the low."
*Histogram of vwmacd changes color according to the value of III. (Green if positive, yellow if negative value)*
VWMACD also comes with the values of 21,13,3... Which are fibonacci numbers and that's how i use it. You can always go back to the good old 26,12,9.
Other options according to the fibonacci numbers might be= 21,13,5-13,8,3-13,8,5... (For shorter terms of trading)
Trading combined with the bollinger bands is strongly advised for both VWMACD and III. VBCB is just the candy on top :)
Enjoy!
CBG Swing HighLow MAThis indicator will show the swing high and lows for the number of bars back. It's very easy to use and shows good support and resistance levels.
I then took it a step further and added a moving average with all the standard types in my indicators:
SMA
EMA
Weighted
Hull
Symmetrical
Volume Weighted
Wilder
Linear Regression
I then added Bollinger Bands to show the standard deviation from the midline.
Finally, I added a simple bar coloring scheme: green if above the upper BB, Red if below and orange if in the middle.
I am just testing this out so please use with caution. If anyone in the community wants to run some backtests, that would be great and we would all appreciate it.
Of course you can keep it all simple and turn off all the moving averages and bollinger bands.
Enjoy! :-)