Ehlers Deviation Scaled Super Smoother [CC]The Deviation Scaled Super Smoother was created by John Ehlers and this is an excellent moving average that changes direction very quickly and can keep up with the current underlying trend. This indicator works by applying a Hann Windowed Moving Average to the stock's momentum and scaling that by the Root Mean Square and then using that value in the input for a Super Smoother . I have included strong buy and sell signals in addition to normal ones so lighter colors are normal signals and darker colors are strong ones. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Deviation
WhaleCrew Crypto ArbitrageVisualizes the price difference (deviation) off BTC/ETH across multiple exchanges (Spot and/or Perpetuals)
Spot prices are represented by circles, while perpetual prices are shown as crosses.
Spot:
Binance
FTX
Bitfinex
Coinbase
Perpetuals:
Binance
FTX
Bybit
BitMEX
Volume TrendsThis script provides clear volume trends on any time frame. You set a long term volume trend moving average (ex 100 periods). A shorter term MA of your choice (10 in this example) will oscillate above and below based on the standard deviations of its current value relative to the long term #.
Similarly, large volume bars are plotted in terms of st dev above the long term MA.
Very useful in spotting capitulation bottoms and/or blow-off tops.
Standard deviation of the exponential moving average
This indicator emphasizes price movements when it moves away from or closer to the chosen moving average, within the envelope of its standard deviation. It serves as a complement to other indicators or can be used within a strategy by itself.
Tradingview ToolkitA new trader's biggest barrier to entry is lack of understanding where they are in terms of time and price and with tradingview free they are often limited to just 1 or 2 extra indicators as many new traders slap on RSI and MACD as 2/3 free ones. While these indicators are fine for trend analysis, its important to know where the price is in relation to time. Thus, this all-in-one script is meant to have a lot of customizable utility to save on indicator spots and act as a hotspot for many common needs.
-2 Sets of VWAP line w/ standard deviation bands with customizable timeframes.
-1 more customizable timeframe VWAP line (no std dev bands) to use as a long time frame reference
-Ability to plot previous VWAP close prices over current timeframe on all VWAP lines w/ basic color changing if price closes above/below
-2 Sets of Bollinger Bands with customizable source length and MA type
-3 customizable moving averages with custom timeframe/resolutions
-Inside candle barcolor repainter to easily notice if a candle was inside the range of the previous candle (price contraction)
Not meant to have everything on at once, but simply a place to enable and disable different things and save spots for more important things
Risk Position Sizing tool using Coefficient of VariationA way to manage portfolio risk using relative standard deviation, also known as coefficient of variation. This tool tells you how much of each stock in shares and in value to buy adjusted for their volatility risk for a given starting account capital. A problem many people have is how to diversify an account and adjusting it for the risk involved in each equity. Many would put in an equal amount of capital value into each share but is it really equal if some equities have more risk than others? A solution is to adjust the portfolio by giving less weight to those that are more volatile or risky. It's done by using a starting percent of the account, preferably a small percent of it, and buying up shares with that same amount for each equity. Each equity will also be divided by the COV to risk adjust the portfolio by giving less weight to the more volatile stocks. This is done until as much of the initial capital in the account as possible is spent.
COV is how far away the price is from the mean or average. The further the price is from the mean the more risk or volatility there is. It uses standard deviation in its calculation. The problem with SD and ATR is that they are not relative to the past or to other equities to compare to. An application where COV can be used is risk portfolio management formulas. This does not take into account correlation or other equation parts in some portfolio management formulas but only the risk or volatility, the default volatility length is mostly arbitrary, and the lower risk stocks may end up being the slowest in performance.
The text label will show how many shares will be bought and how much value each equity will have. At the end it will show the initial capital that was started off with, the total shares bought, the total value of all the shares, and the amount of capital left over. If the sources are not blank then they will be used, to blank them you will need to reset the settings to default otherwise they might still be read. If you want to add more than the given 10 equity spaces to the portfolio then you will need to add in the code manually and add it to the chart. The denominator is perhaps the important part in these types of risk position sizing tools, you can change to other things such as risk-reward ratio instead of volatility or change the volatility type, etc.
VWAP Alerts V3VWAP Alerts signal over bought/over sold conditions, relative to volume weighted average price, while deviation bands plot an extremely accurate point of mean reversion.
VWAP Alerts V3 includes multiple timeframe selection, along with multiplier input for deviation band setting
Alerts can be set for each individual band, for extreme oversold/overbought conditions, use "Vwap Low Deviation 4" and "Vwap High Deviation 4".
Alerts can also be set for VWAP bounces, by simply setting "VWAP Alert"
Exponential Deviation Bands Width [ChuckBanger]This indicator is a compliment to Exponential Deviation Bands . It is the difference between the upper and the lower bands divided by the middle band. It is an easy way to visualize consolidation before price movements or periods of higher volatility.
How it works
During a period of high volatility, the distance between the two bands will widen and Exponential Deviation Bands width will increase. And the opposite occurs during a period of low volatility, the distance between the two bands will contract and Exponential Deviation Bands width will decrease. Meaning there is a tendency for bands to alternate between expansion and contraction.
When the bands are relatively far apart, that is often is a sign that the current trend is ending. When the distance between the two bands is relatively narrow that often is a sign that the market is about to initiate a bigger move in either direction.
VWAP + Fibo Dev Extensions StrategyBased on my VWAP + Fibo deviations indicator, I tested some strategies to see if the indicator can be profitable; and I got it !
This strategy uses:
H1 timeframe
Weekly VWAP
+1.618 / +2.618 / -1.618 / -2.618 Deviations Extensions to create 2 bands
The value of the deviation
First, the 2 bands are plotted : +1.618/+2.618 painted in red and -1.618/-2.618 painted in lime.
Then, we wait for the deviation value to reach at least 150 (see thumbnail) to avoid littles moves when the gaps between bands are too short.
Entry long position :
first candle must crossunder the -1.618 level and low have to stay over the -2.618
low of the second one must stay in the lime band
enter the third one if the deviation value is over limit (150)
Exit long position :
TP : when a high crossover VWAP
SL : when a low crossunder -2.618
Entry short position :
first candle must crossover the +1.618 level and high have to stay under the +2.618
high of the second one must stay in the red band
enter the third one if the deviation value is over limit (150)
Exit short position :
TP : when a low crossunder VWAP
SL : when a high crossover +2.618
Notes :
this strategy uses pyramiding (5), be careful and calculate your risk management
the comission value is set to 0.08% to include slippages when entering a trade because of market orders
This strategy is not an advice to invest, make your own decisions.
Volume Weighted DeviationsVolume !weighted!
deviations.
Important: I don't really know how people generally compute deviations from VWAP/VWMA, but smth tells me generally it's just a Av Dev/St Dev based on mean, not on appropriate basis, like volume weighted mean in our case. This version is mathematically correct, it first calculates weighted mean, than utilizes this weighted in mean in AvDev & StDef functions modified to take into account weights.
Spread by//Every spread & central tendency measure in 1 script with comfortable visualization, including scrips's status line.
Spread measures:
- Standard deviation (for most cases);
- Average deviation (if there are extreme values);
- GstDev - Geometric Standard Deviation (exclusively for Geometric Mean);
- HstDev - Harmonic Deviation (exclusively for Harmonic Mean).
These modified functions will calculate everything right, they will take source, length, AND basis of your choice, unlike the ones from TW.
Central tendency measures:
- Mean (if everything's cool & equal);
- Median (values clustering towards low/high part of the rolling window);
- Trimean (3/more distinguishable clusters of data);
- Midhinhe (2 distinguishable clusters of data);
- Geometric Mean ( |low.. ... ... .. .... ... . . . . . . . . . . . .high| this kinda data); <- Exp law
- Harmonic Mean { |low. . . . . . . . . . . . . . .. . . .high| kinda data). <- Reciprocal law
Listen:
1) Don't hesitate using Standard Deviation with non-mean, like "Midhinge Standard Devition", despite what ol' stats gurus gonna say, it works when it's appropriate;
2) Don't check log space while using Geometric Mean & Geometric Standard Deviation, these 2 implement log stuff by design, I mean unless u wanna make it double xd
3) You can use this script, modify it how you want, ask me questions whatever, just make money using it;
4) Use Midrange & Midpoints in tandem when data follows ~addition law (like this . . . . . . . . . . . . . . . . . . . . .). <- just addition law
Look at the data, choose spread measure first, then choose central tendency measure, not vice versa.
!!!
Ain't gonna place ® sign on standard deviations like one B guy did in 1980s lmao, but if your wanna use Harmonic Deviations in science/write about/cite it/whatever, pls give me a lil credit at least, I've never seen it anywhere and unfortunately had to develop it by myself. it's useful when your data develops by reciprocals law (opposite to exponential).
Peace TW
VAMA Volume Adjusted Moving Average BandsThis indicator is standard deviation bands using a live analysis adaptation of Richard Arms' Volume Adjusted Moving Average as their basis. VAMA utilizes a period length that is based on volume increments rather than time.
• SampleN - N volume bars used as sample to calculate average volume , 0 equals all bars.
• VAMA Source - Price used for volume weighted calculations.
• VAMA Length - Specified number of volume ratio buckets to be reached.
• VAMA VI Fct - Size of volume ratio buckets.
• VAMA Strict - Must meet desired volume requirements, even if number of bars has to exceed VAMA Length to do it.
• STDV Factor - Standard Deviation multiplier.
• STDV Length - Standard Deviation period.
• Brightness - Color opaqueness for the band fills.
Please see previous published example here for more details on VAMA's usage and inability to redraw the past on time based charts.
NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
Harmonic MADsNo, it's not a new saturation plugin for your fruity loops.
...
These are Mean Average Deviations calculated from Harmonic Mean.
...
In my previous research I tried to develop "Harmonic Average Deviations", since applying stdevs on Harmonic Mean calculated from reciprocals ain't make sense. Din't work out, prolly cuz by definition stdevs doesn't like negatives. So in the end I ended up using Mean Average Deviations, and turned out it works great. Generally market data doesn't distribute normally, so t's a great tool, now weird kurtosis won't be a problem.
Bollinger Bands T3/SMA/EMAThis is Bollinger Bands script with an option to choose three different moving averages. The simple moving average is the original settings used by Mr Bollinger. Exponential is a popular choice as it adds more value to the recent price movements. T3 is a lot faster at adapting to the recent price. Compared to exponential, it gives even more value to the recent prices and furthermore, it is smoother. I use it to polish my True Range scripts.
Another upgrade is the ability to have a different colour of the channel when the baseline moves up or down.
Back to calculation? Is it better to use T3 with Bollinger? My opinion is that it depends on the trader. Both of them give you slightly different information and it is essential to look at the historical behaviour and answer for yourself. Will I use T3 calculation? Well, I built this script to find out if I want to.
Have a great trade!
Realized Volatility IIR Filters with BandsDISCLAIMER:
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 by Invitation Only 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 AS 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.
WHAT'S THIS...?
Work derived by previous own research for study:
This is mainly an INFINITE IMPULSE RESPONSE FILTERING INDICATOR , it's purpose is to catch trend given by the nature of lag given by a VOLATILITY ESTIMATION ALGORITHM as it's coefficient. It provides as well an INFINITE IMPULSE RESPONSE DEVIATION FILTER that uses the same coefficients of the main filter to plot deviation bands as an auxiliary tool.
The given Filter based indicator provides my own Multi Volatility-Estimators Function with only 3 models:
ELASTIC VOLUME WEIGHTED VOLATILITY : This is a Modified Daigler & Padungsaksawasdi "Volume Weighted Volatility" as on DOI: 10.1504/IJBAAF.2018.089423 but with Elastic Volume Weighted Moving Average instead of VWAP (intraday) for faster (but inaccurate) calculation. A future version is planned on the way using intra-bar inspection for intraday timeframe as described in original paper.
GARMAN & KLASS / YANG-ZANG EXTENSION : As one of the best range based (OHLC) with open gaps inclusion in a single bar.
PETER MARTIN'S ULCER INDEX : This is a better approach to measure realized volatility than standard deviation of log returns given it's proven convex risk metric for DrawDowns as shown in Chekhlov et al. (2005) . Regarding this particular model, I take a different approach to use it as coefficient feed: Given that the UI only takes in consideration DrawDawns, I code myself the inverse of this to compute Draw-Ups as well and use both of them to filter minimums volatility levels in order to create a SLOW version of the IIR filter, and maximums of both to calculate as FAST variation. This approach can be used as a better proxy instead of any other common moving average given that with NO COMPOUND IN TIME AT ALL (N=1) or only using as long as N=3 bars of compund, the filter can catch a trend easily, making the indicator nearly a NON PARAMETRIC FILTER.
NOTES:
This version DO NOT INCLUDE ALERTS.
This version DO NOT INCLUDE STRATEGY: ALL Feedback welcome.
DERIVED WORK:
Incremental calculation of weighted mean and variance by Tony Finch (fanf2@cam. ac .uk) (dot@dotat.at), 2009.
Volume weighted volatility: empirical evidence for a new realised volatility measure by Chaiyuth Padungsaksawasdi & Robert T. Daigler, 2018.
Basic DSP Tips & Trics by TradingView user @alexgrover
CHEERS!
@XeL_Arjona 2020.
Historical Volatility Percentile + SMAHistorical Volatility Percentile tells you the percentage of the days from the past year (252 trading days) that have lower volatility than the current volatility.
I included a simple moving average as a signal line to show you how volatile the stock is at the moment.
I have included simple colors to let you know when to enter or exit a position.
Buy when price higher than EMA & historical volatility higher than SMA
Sell when price lower than EMA & historical volatility higher than SMA
Please let me know if you would like me to publish any other indicators! I always love to hear from you guys.
Mean Absolute Deviation BandsThe other way to build bands around price that uses Mean Absolute Deviation instead of Standard Deviation.
MAD is also a measure of variability, but less frequently used. MAD is better for use with distributions other than the Gaussian.
MAD is always less than or equal to Standard Deviation and the resulting bands are more tighter for the same parameters if we compare it to Bollinger Bands.
If you use band stops this can be useful.
KLemurs DeviationMarket: Stocks and ETF's
This overlay shows the deviation of the exponential moving average of the mid candle price of the currently loaded chart, away from the exponential moving average of the S&P and DOW combined and averaged mid candle price. The top and bottom lines also give a visual perspective of what a certain percentage (default 1%) looks like on the current charts window. This may help with making quick decisions for things like setting trailing stop trades with a percentage. This can be used for stocks, ETF's, and index's and It may be useful in finding potential stocks or ETF's if you are interested in these kinds of deviations. Defaults are set for a dark screen but can be edited to your taste. It's optimized to be an overlay on the current chart window as opposed to being a separate window.
Percentage Lines (editable)
This is three lines. The upper line (default green) plots the set percentage (default 1%) above the current chart’s ema. The middle line (default white) plots the current chart’s ema. The lower line (default red) plots the set percentage (default 1%) below the current chart’s ema.
Deviation Band (editable)
This is the colored band on the overlay between the upper and lower percentage lines. The band’s fill color indicates the deviation of the current charts ema from the ema of the combined S&P and DOW’s ema as follows:
- Red (default) = Current Chart’s ema is descending and the S&P/DOW ema is descending OR the Current Chart’s ema is below (underperforming) the S&P/DOW ema.
- Orange (default) = The Current Chart and S&P/DOW ema’s are both either ascending or descending together.
- Green (default) = The Current Chart’s ema is ascending but the S&P/DOW ema is descending.
To Set Line Colors
BY default, the upper line color uses the same colors as the ascending band color and the lower line uses the same color as the descending band color. To set the line colors, see "plotColor", "plotColorUp", or" plotColorDown" in variable settings within the script or use the “Central Plot Line”, “Upper Plot Line, or “Lower Plot Line” in the input dialogue to change this.
To Set Band Colors
To set the band colors, see "plotColor", "plotColorUp", or "plotColorDown" in variable settings within the script or use the “Color0”, “Color1", or “Color2” in the input dialogue to change this.
To Set EMA Lookback Period
The ema lookback period defaults to 5. This is the number of candles back that the script will use to determine the ema. See “CCemaN” in variable settings within the script or use the “EMA Period” in the input dialogue to change this.
To Set Percentage
To set the percentage that plots the upper and lower lines, see "CCP" in variable settings within the script or use “Upper/Lower Bands Percentage” in the input dialogue to change this. The default is .01 (or 1%).
Standard Deviation Measurement ToolIf you like the script please come back and leave me a comment or find me on the interwebs. I get notified you "liked" it... but I have no idea if you actually use it. So, let me know =)
The script uses the open price as the mean and calculates the standard deviation from the open price on a per candle basis
- Goal: -
To establish a mean based on the Open Price and calculate the standard deviation.
The reason for this is if the Open is the mean, then the Standard deviation implies a standardized distance a given candle can be expected to travel
from the open price
- Edge: -
If you know that there is a 68%/95%/99.7% probability that price will NOT move more than
One Standard Deviation/Two Standard Deviations/Three Standard Deviations from the open price respectively
you can set reasonable price targets that relate to those probabilities in a given timeframe.
e.g. if you're on a 1h chart and your target is 3.5% from the open price, but 1 standard deviation of the hourly candle is equal to 0.78%.
You can make assumptions on either:
- The reasonableness of your target
or
- The holding period likely required for the trade.
Also, Standard Deviation is a function of volatility and this tool provides a unique mechanism for measuring volatility as well on a candle by candle basis
- Customization Options-
- Set 3 independent upper and lower standard deviations.
- Each set of standard deviations are on a switch so you can show 1, 2, or 3 sets of standard deviations
- You can set the distribution width
- Though it's not recommended, you can change the mean source.
- There is a switch to show the standard deviation on only the real-time bar or real-time and historical bars.
- How I Think About This Script -
This strategy is predicated the same principle as Bollinger Bands: the reality that 68% of all data points will fall within one standard deviation of the mean, 96% of all data points will fall within two standard deviations, and 98% of al data points will fall within 3 standard deviations. By understanding the standard deviation, you can possibly infer an edge by understanding the probabilistic range price will be bound to the limits of standard deviation rules according to their probabilistic outcomes for the single candle on any given timeframe. Bollinger Bands are designed to provide this information with the mean being a 20-period moving average and this indicator.
This indicator is designed to provide standard deviation information with the mean being based on the distance price travels away from the open of individual candles in the lookback period.
If you use a strategy where you enter on major candle closes, this can be useful to set targets for those entries based on the intended hold period or at least add/remove validity to other target metrics.
Example:
Your target is at the 1.618 Fibonacci level and your confirmation triggers on the 4h candle close (H4 if that's your thing lol). You set up the indicator based on the standard deviation of price movement in 4h candles over the last week.
Let's say the indicator shows that the 1.618 Fibonacci level is 3 standard deviations away.
This being the case this statistically indicates that within the next 4 hours, you have a very low probability of achieving your target (>2%). This doesn't invalidate your target, but it does indicate a low probability of achieving it in the next 4hrs. With this information, you can infer that you are either going to be (a) really lucky (b) in this trade for a lot longer than 4hrs or (c) your target is unrealistic given your intended hold period.
You can develop a more probabilistically favorable hold period calculation by looking at the standard deviation on a higher time frame (e.g. 1d-1w).
Bonus feature: You'll find that the 2 and 3 standard deviations will often "cluster" and these clusters often provide future S/R levels. That's a pretty sweet feature no one things to look for. But, try it. Find a cluster of 2nd and 3rd stdevs that are in somewhat of a horizontal pattern (usually the result of a range) and you'll find that to be a good s/r area. Even better if you use the 3.2 standard deviation, you'll find that is a fantastic breakout signal!
Summary
So, you can use it for target setting, a confluence test, a reasonableness test, or just a measurement tool.
This was the first TV script I ever wrong.. Got taken down. But, I've re-released it because there are other TV scripts that attempt to do this but are completely wrong.
Please be careful about using other people's scripts. Always validate the math of the script before you use it if possible.
Stay safe out there and I hope all your dreams come true.
Mean Deviation IndexThe Mean Deviation Index (MDX) is used to see how much price is deviating from the mean. This indicator takes both volatility and mean deviation in consideration.
It uses the standard deviation of the ATR to filter an EMA, and uses this as the mean. It then only plots > or < 0 if price is more than one x ATR away from the mean. If index is positive, the background turns green, meaning price is more than 1 x ATR above the mean. If the index is negative, the background turns red, meaning price is more than 1 x ATR below the mean. This setting can be changed by changing the setting "ATR Multiplier", but the default is 1 x ATR.
There are two main ways to use this index.
1. Use it aggressively to find trends (by combining it with other indicators) by entereding each time the background changes color to green for longs or red for shorts.
2. Use it spot breakouts, waiting for a pullback, and then entering on the next move in the same direction. In this context for a short, you wait for the background color to turn green, then wait for the index to pull back, and then enter once it starts moving up again.
Exponential Deviation Bands [ChuckBanger]This is Exponential Deviation Bands. It is a price band indicator based on exponential deviation rather than the more traditional standard deviation, as you find in the well-known Bollinger Bands calculation. As compared to standard deviation bands, exponential deviation bands apply more weight to recent data and generate fewer breakouts. There fore it is a much better tool to identifying trends.
One strategy on the daily can be
Buy next bar if closing price crosses below the lower bands
Sell if price is equal to the current value of the upper bands