[kai]mATRThis indicator is for calculating the volatility of any interval
mTR (green line): TR is extended to calculate multiple bars at once with magnification setting.
mATR (red line): ATR is extended to calculate multiple bars at once with magnification setting.
dev (blue line): standard deviation
If you turn on "divide source" in the settings, it will be the price volatility.
dev will be the same as BBW
このインジケーターは任意の区間のボラリティを計算するための物です
mTR(緑線) : TRを倍率設定で複数のバーをまとめて計算する用に拡張したものです
mATR(赤線) : ATRを倍率設定で複数のバーをまとめて計算する用に拡張したものです
dev(青線) : 標準偏差
設定で「divide source 価格変動率」をONにすると価格変動率になります
devはBBWと同じになります
Standard Deviation
Projected Bollinger Bands - Quadratic RegressionBased on the work of Alex Groove : https://www tradingview com/script/YnoXd2AY-forecasting-quadratic-regression/
and also based on https://www tradingview com/script/YnoXd2AY-forecasting-quadratic-regression/ by capissimo
Notes:
1. This Bollinger Bands uses the QREG as its middle line (not MA as the original Bollinger Bands) so this should be acknowledged.
2. This indicator forecasts 3 candles (periods) ahead.
3. The label's position is quite messy, so you need to adjust the chart zoom in order to make the indicator doesn't overlap anything.
4. You need to manually set the time frame in the indicator settings because i'm not able to make the indicator recognizes it automatically
I'm trying to make the Bollinger Bands Forecasting from Quadratic Regression, and i'm really sure that there are a lot of mistakes here and there, so i 'm hoping corrections coming from you guys...
CHEERS!!!
[KL] Bollinger Bands Consolidation StrategyThis strategy will enter into long position based on the volatility of prices implied by indicators of (a) Bollinger bands, and (b) ATR.
Application of Bollinger bands ("BOLL")
Using plain vanilla settings for BOLL (i.e. 20 period moving average, and 2 standard deviations of closing prices), we are interested to know about the shape of the area that is bounded by the upper and lower bands.
In theory, consolidation happens when volatility of price decreases. Visually speaking, this is represented by the narrowing of the upper/lower bands. This strategy considers the narrowing of BOLL bands as the primary indicator for long-entry.
Application of ATRs (as confirmations)
Firstly, to confirm that BOLL bands are narrowing (as mentioned above), the ATR at a potential point of entry is compared against the standard deviation of prices over BOLL's lookback periods. Once again, visualizing the shape of BOLL bands during consolidation, we assume the lines begin to squeeze when the distance between the center line and upper/lower band is less than two current ATRs.
Secondly, this strategy looks into the moving average of ATRs to assure that prices are not too choppy when entering into market. If the moving average of ATR decreases at a point in time such that all the above conditions are met, then we can assert that the volatility of price is decreasing.
Thirdly, ATR is used for determining the size of our trailing stop loss. We will keep the multiplier fixed at two.
Kolmogorov-Smirnov TestThe Kolmogorov–Smirnov test aims to tell you if the distribution of prices (or log returns) tends to follow a normal distribution or not. You can read about this test on Wikipedia . It seems to be a basic but trusted measure in the quantitative trading world.
When KS-t columns are blue, then it's safe to assume normal distribution. When they are red, the normal distribution assumption is proven wrong by the magnitude of the KS-t value.
In the plotting tab of the script, you can activate another option that displays the probability of the distribution being actually normal. It's values are bounded between 0 and 1, like all probabilities.
This test can be useful when using statistical concepts for trading markets, like standard deviations, z-scores, etc because they all depend on the assumption of prices (or log returns) being normaly distributed.
If you see something wrong, don't hesitate to message me.
Happy trading to all.
Best Volume Indicator - BTCIn order to make more sense of trading volume in crypto …
Based on the Better Volume Indicator (curtesy of Emini-Trading (emini-watch.com) and the TradingView Adaption by LazyBear ().
My tweaks/adaptations:
- altered the calculation of low volume (c11) in the LB adaptation since it represents the original code better (in my opinion)
- takes volume of multiple exchanges into consideration
- added standard-deviation bands in order to identify peak amount of trading volume
- added three EMA's in order to assess the amount of trading volume even better
- changed the color coding of the original Better Volume Indicator (my preference)
volume climax up = green (instead of red)
volume climax down = red (instead of white)
low volume = yellow
churn = blue (instead of green)
climax + churn = purple
"normal" volume = gray (instead of cyan)
Z-Score of RSIA way to see whether RSI is overbought or oversold inside its Bollinger Bands in the form of an oscillator. Z-score tells you how far the data is from the mean in terms of standard deviations. The numbers shown in the indicator are the number of standard deviations away from the average or mean. Like Bollinger Bands, if it is above the standard deviation border lines then it is considered to be outside the distribution or Bollinger Band. If it is above the upper border line then is it is overbought, if it is below the lower border line then is is oversold.
Example of how standard deviation works: 1 standard deviation contains 68% of the data, 2 SD (the default for BB) contains 95% of data, 3 SD for 99%, etc. If the data goes past that, it is considered to be outside the distribution. In statistics, data that is within the distribution is considered to be "significant".
The z-score line is colored green if it is above zero and red if it is below zero. Above zero means that the RSI is above the average line or the middle line of the Bollinger Bands, and vice-versa if it is below. A red vertical bar is shown when the the z-score is above the upper border line to show that it is overbought and a green vertical bar is shown when the z-score is below the lower border line to show that it is oversold. This is the equivalent of when the RSI is above and below its Bollinger Bands.
atr_channelThe original bollinger bands have a fixed deviation of 2%, this channel calculates the ATR % (Atr Percentage) and places the upper and lower bands
Price Action IndexI've created a simple oscillator which I think does a good job of easily showing you when price is worth watching or not. I think all too often you get stuck looking at something like an RSI and end up trading noise.
From my observations and experiences, I've found that there are 2 major catalysts for price movement--
Price is either trending and reaches a top or bottom, or
Price is consolidating and ready to make a move in some direction
These movements can be seen quite well from a Bollinger Band, which is what mostly gave me the inspiration. When I watch a chart with a BB on it I see that either you're looking to trade price moving out of a squeeze or riding price up/down the band until it crosses over and makes a move to the moving average.
My solution was to multiply the direction of price by the strength of its deviation.
Price gets converted into a signal between -1.0 (bottom of the range) and 1.0 (top of the range)
Standard Deviation gets converted into a stochastic signal between 0 (next to no deviation from mean) and 100 (highest deviation in lookback)
These 2 get multiplied by each other
The result tells you if price action is trending bullish and if its approaching max strength (perhaps Overbought), example: Price is hitting highs (1.0) and deviation is also at its highest (100) = 100, opposite for bearish
Result can also tell you if price is at the top of the range but the deviation is so tiny and we're mostly pinned to the mean (1.0 * 5 = only 5)
How to Trade this Indicator--
If the indicator is stuck near the middle and purple:
- Don't make directional trades or you'll be eaten alive by the chop
- Good idea to sell options, Iron Condors/Butterflies, etc
- Wait for a move to breakout --> the purple will fade away and give way to a direction
--- As in all trading scenarios, be mindful of fakeouts/short moves to one direction that very quickly get reversed
If the indicator is heading higher:
- This would indicate there is a bull trend going on, get long
- If we are reaching the overbought area, this is an ideal place to take profits or look at spreads like Bearish Call Spreads (sell calls)
- I think you can make your own determination of when to sell by either selling when we're in the overbought area (if it reaches there) or staying bullish so long as it is above the zone
If the indicator is heading lower:
- Bear trend, shorting is possible
- Can use this as a contrarian signal to buy lows
A couple of charts with the indicator and a purple squeeze box I've drawn (can sometimes get noisy in real-time, but hindsight is 20/20)--
Bitcoin on Daily with default 20 length
Gamestop on 30 minute time frame with 100 length
Please feel free to use this indicator for your trading or your own indicators. This particular script is very stripped down/bare bones from what I have been working on as an ongoing project. If TradingView ever returns scripts you can sell, I would probably open that up for a small premium.
Origin VWAP: OVWAPDraw a VWAP support/resistance line anchored to the origin of the data series (like a daily VWAP, but from the beginning of time, never resetting).
Ideally the origin would be the first bar after the IPO. Tradingview (or your connected broker) doesn't always have a complete dataset, and in that case the OVWAP will be 'wrong', but converging to the correct value over time.
You can try to simulate this with the built-in VWAP indicator but it has several bugs and limitations. Firstly, the longest time period is century, but it is not 100 years, ie. a rolling century but the beginning of the century: 21 years ago. Secondly, even if your dataset is less than 21 years, if you use a lower time frame then the built-in VWAP's origin becomes the left-most loaded bar (about 5,000 bars ago) - it will draw the wrong value. The new Anchored VWAP drawing tool can't be used on lower time frames as it won't draw the line at all unless it sees the point where you anchored it.
You may want to cut 'n paste this code to use in some larger strategy. Unfortunately that's probably not possible. This script uses the 'resolution=' option of 'study()' set to '1W', so the whole script runs at the 1 week resolution. You would think it would be possible to instead use the 'security()' function to request data at the '1W' resolution, but it just resamples the current data set and so is limited to the rightmost 5,000 bars.
Look in the options to enable standard deviation lines.
CV_VWAP_GMECoefficient of variance GME ‰
Gray area: Regional price variance of GME in per milles
Light gray thick line: NYSE:GME deviation from global mean
1. Select a chart 24-hour ticker like FX_IDC:USDEUR
2. Select a timescale (5 min, 15 min, ...)
3. Monitor the regional price variance
Exchanges included: NYSE, XETR, BMV, FWB, SWB, BITTREX, FTX
Currency conversion: Forex
Adapted from Detecting the great short squeeze on Volkswagen, Godfrey, K. (2016, February 18).
Coefficient of Variation - EMA and SMA StDevYet another way to try and measure volatility. An alternative to using ATR is Standard Deviation, it can be used to measure volatility or what is also known as risk. SD measures how dispersed or far away the data is from the mean. It's commonly seen in risk management formulas or portfolio diversification formulas. The problem however is that the numbers that ATR and SD give off from one equity might not be relative to others or its own past. For example, SPY can give a large number despite not being as volatile as other equities while others being compared to can have smaller volatility numbers and still be more volatile looking.
A solution I thought of is to use percentages that are relatable to different equities. I found out another name for this idea comes from statistics and is known as coefficient of variation, also known as relative standard deviation. This helps see the volatility as a percentage and not just a number that only relates to what is being seen at the moment. I put in a border line on the zero level to see where zero is at but also to edit in case there is such a thing as a percentage number that can be too high or too low for volatility to be looked at if needed. The average and standard deviation formulas can use either simple moving average or exponential moving average.
LordPepe Stochastic SignalsThis is the Lord Pepe. Howdy. Basic buy/sell indicator to accumulate along a downtrend and release your stack during the uptrend and oversold levels of the stochastic. The buys should be used to stack, and sells indicate levels of profit taking, they do not signal a long term reversal, only < 25% of stack should be released on "OB" signals.
OB - overbought (sell)
OS - oversold (buy)
Annualised Price Volatility %Annualised Price Volatility in percent, also called Instrument Risk, as outlined by Rob Carver in his excellent books, 'Systematic Trading' and 'Leveraged Trading'.
This is written for those who have read one of his books and want to use this tool on TradingView.
Trend strength, oscillators, and volume indicators are all the rage. Finding a great setup is, of course, key. You've decided to go long. Great!
But how much is your capital at risk?
How does that compare with your level of risk tolerance?
When trading, it's key to understand just how risky a certain instrument is. An uptrend is an uptrend, but is it at an annualised volatility of 2% per year or 500% per year? If it's the former, I know I can put a good chunk of capital into trading it. But if its the latter, I don't want to put so much money at risk. Volatility is rarely in a straight line. It's usually up and down.
I won't give the whole game away. To find out more about how to use this concept of risk, I'd highly recommend the books 'Leveraged Trading' and 'Systematic Trading' by Rob Carver.
Do you have any thoughts, ideas, or questions? Let me know in the comments or send me a message! I'd be glad to help you out.
Muqwishi Volumetric CandleIntroduction
Have you ever heard that each candle represents a battle between bulls (buyer) and bears (seller)? If you know the answer, apparently you understand what the price action means. What if I ask you, how much was bloody in each battle between bulls and bears?!. This indicator may give a clear picture of how to identify the candle’s strength by implementing the Standard Deviation on volume and reshape the candle.
The Muqwishi Volumetric Candles indicator works to weigh each candle instantaneously and updates its color level from lightness to darkness based on the rate of the volumetric standard deviation.
Here’s how the idea started with the conceptual design, then improved till achieved to the implemented design of a structured candle.
The conceptual design mentioned for reviewing how the idea started. However, I want you to understand the “implemented design” in which the indicator has been built to address it. As I stated structurally for the implemented design section, wick and border are identified by the user through “Chart Properties” unlike core and body is measured by the indicator.
The candle’s body is ”Dynamic” that colored based on the amount of volume standard deviation in which the low volume standard deviation is a lighter candle’s color and the high volume standard deviation is a darker candle’s color. The core is “Static” color represents zero volume standard deviation which the volume at the average level. In the case where the core is darker than the body means the volume standard deviation is lower than the average volume level, and when the core is lighter than the body mean the volume standard deviation is higher than the average volume level, and when the core’s color has the same body’s color means the volume is in the average level. The image is the best guide to understand the idea.
Rarely seeing a volume standard deviation below -2σ, even though the volume is apparently dead. However, it’s possible to see more than 3.9σ, and mostly it has the same effect as 3.9σ. Personally, any candle above 1.5σ is taking my attention, and more than 2σ I look around seeking for reasons to not take a trade.
§§ Note, if you have misunderstood the standard deviation concept, there are many great sources to understand it such as Wikipedia, YouTube,... etc. In a basic example, How much is your height relative to the height of average people in your city!!?. Similarly, how much is the amount of volume relative to the average volume of a number series of previous bars?!.
Indicator Overview
Before I get into this section, this is NOT meant to be an educational or recommendation. Just showing you how I use this indicator based on an experience.
The chart above has been remarked as an example of how I apply it. Again, it’s a personal preference, and it doesn’t mean this’s an efficient way.
Indicator Setting
➤ Ensure to visualize the indicator to the front for recognition of the candle’s core.
For more information check the image: drive.google.com
➤ Indicator’s title.
Generates two outputs. The first one is the coordinate location for the char “Core”, don’t pay attention to it. The second one colored in blue is referring to the measurement of the volume standard deviation as your cursor point move at any candle on the chart. For more information check the image: drive.google.com
➤ Indicator’s inputs.
■ Length: Number of previous bars covered in the calculation. Prefer between 14-20.
■ Long Candle Color: Choose a color for bullish candles.
■ Short Candle Color: Choose a color for bearish candles.
■ Color Mode: Kinda color style.
● Lightness: From lightness to darkness colored as low volume SD to high volume SD.
● Saturation: From narrow range to wide range colored as low volume SD to high volume SD.
■ Reverse Mode: Yes → Darkness to Lightness colored as low SD to high SD.
■ Show Core: No → Hide cores.
Summarize
■ Users should have a fundamental knowledge of Standard Deviation.
■ The candle’s body is dynamic colored. Got light as low volume standard deviation, and Dark as high volume standard deviation occurred.
■ The Candle’s core is static colored. Represents the average volume which Standard Deviation equals zero.
■ This’s not a trading signal. It works to visualize the level of transactions made per candle.
Final Comments
■ My goal was to achieve the conceptual design, but there’re many obstacles that go beyond the coding ability.
■ Let me know if you have any questions, comments, and any improvements to the project.
■ I hope every time you found this indicator useful and scaled up your trading skills, please present support through PayPal that linked in the signature box below. That will help to get me excited and post many ideas.
■ Trade Safe. ✌
EMA Cross Levels + Standard DeviationPlots the price level that the most recent EMA crossover occurred at(Green if bullish and red if bearish).
Also calculates standard deviation over a shorter window-length/lookback period (of 'n_std_fast' length) and another over a much longer span of periods(n='n_std_slow', > 'n_std_fast').
These are the two dotted lines appearing as bands around the cross-level line.
Expected Range and SkewThis is an open source and updated version of my previous "Confidence Interval" script. This script provides you with the expected range over a given time period in the future and the skew of that range. For example, if you wanted to know the expected 1 standard deviation range of MSFT over the next 20 days, this will tell you that. Additionally, this script will also tell you the skew of the expected range.
How to use this script:
1) Enter the length, this will determine the number of data points used in the calculation of the expected range.
2) Enter the amount of time you want projected forward in minutes, hours, and days.
3) Input standard deviation of the expected range.
4) Pick the type of data you want shown from the dropdown menu. Your choices are either the expected range or the skew of the expected range.
5) Enter the x and y coordinates of the label (optional). This is useful so it doesn't impede your view of the plot.
Here are a few notes about this script:
First, the expected range line gives you the width of said range (upper bound - lower bound), and the label will tell you specifically what the upper and lower bounds of the expected range are.
Second, this script will work on any of the default timeframes, but you need to be careful with how far out you try to project the expected range depending on the timeframe you're using. For example, if you're using the 1min timeframe, it probably won't do you any good trying to project the expected range over the next 20 days; or if you're using the daily timeframe it doesn't make sense to try to project the expected range for the next 5 hours. You can tell if the time horizon you're trying to project doesn't work well with the chart timeframe you're using if the current price is outside of either the upper or lower bounds provided in the label. If the current price is within the upper and lower bounds provided in the label, then the time horizon that you're projecting over is reasonable for the chart timeframe you're using.
Third, this script does not countdown automatically, so the time provided in the label will stay the same. For example, in the picture above, the expected range of Dow Futures over the next 23 days from January 12th, 2021 is calculated. But when tomorrow comes it won't count down to 22 days, instead it will show the range over the next 23 days from January 13th, 2021. So if you want the time horizon to change as time goes on you will have to update this yourself manually.
Lastly, if you try to set an alert on this script, you will get a warning about it possibly repainting. This is because of the label, not the plot itself. The label constantly updates itself, which triggers the warning. I tested setting alerts on this script both with and without the inclusion of the label, and without the label the repainting warning did not occur. So remember, if you set an alert on this script you will get a warning about it possibly repainting, but this is because of the label constantly updating, not the plot itself.
Indices Sector SigmaSpikes█ OVERVIEW
“The benchmark Dow Jones Industrial Average is off nearly 300 points as of midday today...”
“So what? Is that a lot or a little? Should we care?”
-Adam H Grimes-
This screener aims to provide Bird-Eye view across sector indices, to find which sector is having significant or 'out-of-norm' move in either direction.
The significance of the move is measured based on Sigma Spikes, a method proposed by Adam H. Grimes, where Standard Deviation of returns used as a baseline.
*You can google his blog or read his book, got some gold in there, especially on how he use indicators for trading
█ Understanding Sigma Spikes
As described by Grimes, moves in markets are only meaningful when we consider what “normal” is for that market.
Without that baseline, the daily change number, and even the percent change on the day doesn’t really mean much.
To overcome that problem, Sigma Spikes, as a measure of volatility, attempt to put todays change in price (aka return) in context of the standard deviation of 20 days daily's return.
Refer chart below:
1. The blue bars refer to each days return
2. The orange line is 1 time standard deviation of past 20days daily's return (today not included)
3. The red line is 2 time standard deviation of past 20days daily's return (today not included)
Using the ratio of today's return over the Std Deviation, determining your threshold (1,2,3,etc) will be the key that tells if today's move is significant or not.
*Threshold referring to times standard deviation, and different market may require different threshold.
*20 Days period are based on the Lookback Period, adjustable from user input window.
█ Features
- Scan up to 13 symbols at a time (Bursa (MYX) indices are defaulted, but you may change to any symbols/index from the user input setting)
█ Limitation
- Due to multiple use of security() function required to call other symbols, expect the screener to be slow at certain times
- Custom Timeframe currently accept only Daily and Weekly. I'll try to include lower timeframe in the next update
█ Disclaimer
Past performance is not an indicator of future results.
My opinions and research are my own and do not constitute financial advice in any way whatsoever.
Nothing published by me constitutes an investment recommendation, nor should any data or Content published by me be relied upon for any investment/trading activities.
I strongly recommends that you perform your own independent research and/or speak with a qualified investment professional before making any financial decisions.
Any ideas to further improve this indicator are welcome :)
(JS) VWAP BandsThis is a pretty simple script here - I took the VWAP and combined it with Bollinger Bands.
The bands can vary a lot based on chart resolution, so I wanted to make sure the resolution could be modified so you can use the resolution you're most comfortable with, or find the most success with.
Length:
Length of bars used to calculate the bands.
Standard Deviation Band 1-3:
There's three bands all together, this option allows you to modify the number of standard deviations per band.
VWAP Period:
This modifies when you want the VWAP to begin (Session, Week, Month, Year).
Offset:
This moves the VWAP and the bands the amount of bars you select, default is of course set to zero.
Source:
This selects the source of calculation, HLC/3 is the default VWAP calculation.
This is a pretty self explanatory script, I thought being able to see the standard deviations of the VWAP could prove to be useful - hope you all like it!
SDev Adjusted StochasticDescription : This Stochastic variant will auto-adjust stochastic period based on volatility measured by standard deviation.
The idea behind it are in highly volatile market, %K period will be reduced to account for recent price range,
while in low volatility market, %K period will be increased to account less of the recent price range.
This idea is based on one of medium article written by Sofien Kaabar with slight modification on the adjusting logic implementation. Any ideas to further improve this indicator are welcome :)
Disclaimer:
I always felt Pinescript is a very fast to type language with excellent visualization capabilities, so I've been using it as code-testing platform prior to actual coding in other platform.
Having said that, these study scripts was built only to test/visualize an idea to see its viability and if it can be used to optimize existing strategy.
While some of it are useful and most are useless, none of it should be use as main decision maker.
Standard deviation zones Support & Resistance [LM]Hi Guy,
I would like to introduce you Standard deviation zones Support & Resistance horizontals. It draws line horizontals on high and low st dev zone. The colors are dynamic depending whether price is below or above the line.
Credit is due to @Zeiierman for st dev zone calculation so shout out to him.
There are various sections in setting:
general setting where you can select source for zone calculation
tops setting
bottom setting
show and hide section of the first timeframe
show and hide section of the second timeframe
Be aware that when new zone starts and is not finished yet than the top will trail the high of unfinished zone that could be also at the high of current candle and next candle it can change
Any suggestions are welcomed
Mulitple Bollinger Bands with MAsIn this indicator, I used Bollinger Bands and many standard deviation values together. These values are: 0.618 (Yellow), 1, 1.618 (Yellow), 2, 2.618 (Yellow), 3, 3.618 (Yellow), 4, 4.618 (Yellow). Like the indicator I just published, I also added multiple moving average options for the Bollinger Bands calculation. You can create your own strategies for where it bounces in ups and downs.
Türkçe:
Bu indikatörde Bollinger Bantları ile birçok standart sapma değerini birlikte kullandım. Bu değerler: 0.618 (Sarı), 1, 1.618 (Sarı), 2, 2.618 (Sarı), 3, 3.618 (Sarı), 4, 4.618 (Sarı). Daha yayınladığım indikatör gibi burada da Bollinger Bantları hesaplaması için birden çok hareketli ortalama seçeneği de ekledim. Yükseliş ve düşüşlerde sektiği yerler için kendi stratejileriniz oluşturabilirsiniz.
Divergence Indicator [Nic]This divergence indicator can track the correlation between one or more symbols. I use it to track the divergences between the VIX volatility index, gold, bonds, as well as other market leading indicators.
When using with Vix, lower coefficients can lead to false signals. When in a high vix bear market signals, there is more noise and more false (or missing) signals can occur. Please use with other technical tools.
Linear Regression (Log Scale)This code is a slightly modified version of Tradingviews' built-in "linear regression" script which can be correctly plotted on logarithmic charts.