rv_iv_vrpThis script provides realized volatility (rv), implied volatility (iv), and volatility risk premium (vrp) information for each of CBOE's volatility indices. The individual outputs are:
- Blue/red line: the realized volatility. This is an annualized, 20-period moving average estimate of realized volatility--in other words, the variability in the instrument's actual returns. The line is blue when realized volatility is below implied volatility, red otherwise.
- Fuchsia line (opaque): the median of realized volatility. The median is based on all data between the "start" and "end" dates.
- Gray line (transparent): the implied volatility (iv). According to CBOE's volatility methodology, this is similar to a weighted average of out-of-the-money ivs for options with approximately 30 calendar days to expiration. Notice that we compare rv20 to iv30 because there are about twenty trading periods in thirty calendar days.
- Fuchsia line (transparent): the median of implied volatility.
- Lightly shaded gray background: the background between "start" and "end" is shaded a very light gray.
- Table: the table shows the current, percentile, and median values for iv, rv, and vrp. Percentile means the value is greater than "N" percent of all values for that measure.
-----
Volatility risk premium (vrp) is simply the difference between implied and realized volatility. Along with implied and realized volatility, traders interpret this measure in various ways. Some prefer to be buying options when there volatility, implied or realized, reaches absolute levels, or low risk premium, whereas others have the opposite opinion. However, all volatility traders like to look at these measures in relation to their past values, which this script assists with.
By the way, this script is similar to my "vol premia," which provides the vrp data for all of these instruments on one page. However, this script loads faster and lets you see historical data. I recommend viewing the indicator and the corresponding instrument at the same time, to see how volatility reacts to changes in the underlying price.
Historical Volatility
Portfolio Performance - Effects of RebalancingFunction:
- Can be used to evaluate the performance of a portfolio containing 2 assets over a set time interval
- Shows the % return of the portfolio over the time interval defined by the user
- Includes a threshold rebalancing algorithm to show the effects that rebalancing has on the portfolio over the long term
- Created to evaluate of the performance of portfolios containing different weightings of stocks and bonds over time assuming that the user would rebalance the portfolio when asset weights crossed a threshold
Instructions:
- To be used with dividends adjustments turned on
- Add this script to a symbol. e.g. AMEX:SPY
- Click the chart to define the entry time and the exit time. i.e. the time interval
- Define the initial investment of the portfolio. Default setting is $100,000
- Define the second asset to be included in the portfolio. e.g. BATS:AGG
- The strategy comes pre-populated with a portfolio that has a weight of 80% asset 1 and 20% asset 2. i.e. 80% AMEX:SPY and 20% BATS:AGG if the symbols mentioned above were chosen
- The 7 lines show the weighted % return of each portfolio over the time period defined by the user
- Each line (except the blue) is the return based on a different rebalancing threshold. The default settings are 1%, 2.5%, 5%, 10%, 15%, 20%, 30%
- The blue line is the % return of a portfolio that was made up of 100% asset 1 over the time interval. i.e. 100% AMEX:SPY
- Asset weights and rebalancing thresholds are adjustable via the settings
- Each plot can be turned on and turned off via a tick box in the settings
[BM] SSS 50% Rule EvaluatorSara Strat Sniper 50% Rule Evaluator
█ OVERVIEW
This indicator is based on Sara Strat Sniper's - 50% Rule for trading Outside Bars and helps you to evaluate the historical success rate of that rule.
█ FEATURES
Calculation
• You can choose to evaluate only the current bar to see if it forms an outside bar (success) or not (fail), but you can also choose to include the next bar to see if that one forms a compound outside bar.
• You can enable a start and/or end date to limit the calculation period.
Table
• Show or hide the table with the calculation results.
• Show or hide the calculation details (up/down data).
• Position of the table, opacity, cell width and text size can be customized.
Colors
• Table colors can be customized.
• You can choose to show the inside/outside bars in customizable bar colors.
• You can choose to identify successful/failed/recovered outside bars in customizable background colors.
█ LIMITATIONS
• This script uses a special characteristic of the `security()` function allowing the inspection of intrabars — which is not officially supported by TradingView.
• Intrabar inspection only works on some chart timeframes: 5, 10, 15, 30, 45 and 195 minutes, 1, 2, 3, 4, 5, 6, 7 and 8 hours, 1, 2, 3, 4 and 5 days, 1, 2, 3 and 4 weeks, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 and 12 months. The script’s code can be modified to run on other resolutions.
• There is a limit to how far back intrabar calculations can be performed, and is dependant on both the intrabar resolution and your subscription (which determines the number of available bars).
ETHE PremiumShows the premium/discount for Grayscale ETHE vs. the fractional amount of ETH per share held.
GBTC PremiumCalculates the historical and current premium/discount for a share of Grayscale GBTC vs. Bitcoin spot price.
Portfolio Performance - 2 AssetsFunction:
- Can be used to evaluate the performance of portfolios containing 2 assets over a set time interval
- Created to evaluate of the performance of portfolios containing different weightings of stocks and bonds over time
- Shows the % return of each portfolio over the time interval defined by the user
- Capable of showing the risk adjusted % return of each portfolio over the time interval defined by the user (setting turned off by default)
Instructions:
- To be used with dividends adjustments turned on
- Add this script to a symbol. e.g. NASDAQ:BND
- Click the chart to define the entry time and the exit time. i.e. the time interval
- Define the second asset to be included in the portfolio. e.g. AMEX:VOO
- The strategy comes pre-populated with 6 portfolios with the most common stock/bond weightings (100% stocks/0% bonds, 80% stocks/20% bonds, 60% stocks/40% bonds, et cetera)
- The 6 lines show the weighted % return of each portfolio over the time period defined by the user
- All asset weights are adjustable via the settings
- Each plot can be turned on and turned off via a tick box in the settings
- There are 6 plots that show the risk adjusted returns of each portfolio (setting turned off by default)
Live off your portofolio (decumulate)This indicator simulates living off your portofolio consisting of a single security or stock such as the SPY etf or even Bitcoin. The simulation starts at a certain point on the chart (which you input as year and month).
Withrawals from the portofolio are made each month according to the yearly withdrawal rate you enter, such as the 4% SWR. The monthly withdrawal income is calculated in USD at the beginning of the retirement period and then adjusted according to the US inflation (CPI) on 01/01 of each year.
The blue graph represents the USD value of the remaining portofolio.
This indicator is meant to be used on daily, weekly or monthly time frame. It may not work properly (and makes little sense to use) on intraday timeframe or larger time frames such as quarterly (3M).
When withdrawing, the indicator considers that fractional stock values can be used (the portofolio value is kept as a float). This may not be true, as most stock brokers currently don't allow this.
It does not explicitly take into account dividends. In order to do this you will have to enable "Adjust for dividends" by clicking on "adj" in the lower right corner of the screen, or by using the indicator on a Total Return (TR) index such as DAX. Unfortunately SPX does not have dividend data, you will have to use the SPY etf (which doesn't have a long history)
Price Action [Morty]This price action indicator uses the higher timeframe SSL channel to identify trends.
The long entry signal is a bullish candlestick pattern when the price retraces to EMA20 in an uptrend.
The short entry signal is a bearish candlestick pattern when the price retraces to the EMA20 in a downrend.
Currently, this indicator shows engulfing patterns, pin bar patterns, 2 bar reversal patterns and harami patterns.
It also shows a volatility squeeze signal when the Bollinger bands is within the Kelter channels.
The buy and sell signal can also be filter by the ADX indicator greater than a threshold.
You can set your stoploss to the previous low/high when you go long/short.
The risk/reward ratio could be 1 to 1.5.
This indicator can be used in any market.
VixFix RVol + EMAThis indicator plots Realised Volatility (measured using VixFix method) against its long-term exponential moving average.
RVol breaking above its EMA = Sell signal
RVol breaking below its EMA = Buy signal
60-day VixFix look back period and 900 day EMA work well for lower volatility tickers (equity ETFs, megacap stocks). Higher volatility tickers could benefit from shorter look back period and EMA.
Outside DayThis strategy is taken from Perry Kaufman's book "Trading System and Methods".
You can enter on the direction of the candle, or opposite to it. I find that the opposite tends to yield better results in volatile assets, allowing a better reward to risk ratio. There is no stop loss in this strategy, only a fixed take profit and a time limitation.
GreatBlueTradingTeam FibDev SignalsScript Purpose:
This script was designed to look for trend reversals and be used with other TA tools to help build confluence for day traders.
TA Used:
Without diverging too much information, this script relies on Highs, Lows, Opens, EMAs, Standard Deviations, Fib Numbers, and Fib Levels.
Script Overview:
First we look at the price action found on the Daily chart to create a set of zones using Fibs and Standard Deviations thats serves as our gauge on how far the price will move on any given day. Then, we create another set of zones ("intraday" zones if you will) that are built on much faster price action and relevant to the chart time period that is selected. These zones are also created using a combination of Fibs and Standard Deviations. From here, we compare the intraday price action with these two zones and look for areas where we feel overbought or oversold conditions are forming to create the bullish or bearish signals provided by the indicator.
Script Shortcomings:
Due to the fact this script is looking for breaks in trends, or trend reversals, it is subject to high risk especially in times of strong market trends where it could experience repeated failed signals. We recommend using this script in combination with other forms of TA for additional confluence as well as general market awareness that may influence trends and market behavior.
Script Access:
Please PM us to obtain information about accessing this script, or view our profile for contact information.
Bollinger Band Gradient (BBG)The Bollinger Band Gradient Indicator uses plenty of Bollinger Bands to create a gradient-looking indicator to help with layered entries . It is similar to a Ribbon but better. This indicator is best used with any volume-related indicator so you can recede from entering into any position with too much momentum to rebound off of any line. Note that this indicator is best used with another strategy like pair trading. It is not recommended to trade based on this indicator only . Please stay aware of any news about the stock you are trading because some events may have a big impact and force the market to go bullish/bearish by a lot. This indicator can be used with all chart types and works well with many other indicators. It allows for complete customization and offers easy-to-understand settings which can be designated to a certain individual. You can modify all settings for the BBs which allows for an even more personalized and adapted Indicator that reflects your trading/ investing needs. You also have the option to choose which type of MAs will be used to create the Bollinger Bands , a few of which include: SMA, EMA, WMA, HMA, RMA, DMA, LSMA, VAMA, TMA, MF.
Bollinger Bands are a way to measure and visualize volatility . As volatility increases, the wider the bands become, and the more they deviate from the basis. Likewise, when volatility decreases, the gap between the bands and basis decreases. Yet a big advantage for not only this but many other indicators is created due to the ample count of different settings that are widely used, it is difficult to view the market through the eyes of all types of investors/traders . This indicator manages to counter exactly this issue, you will be able to see all of these settings on one chart and at one time and enter/exit positions accordingly.
Using this indicator will allow you to visualize entry and exit points with ease and make order layering (buying/selling in layers) much more simple. You can choose a certain amount of Bollinger Bands you would like displayed and customize all technical and style-related settings related to the BBs .
A few of the technical settings you can change for the Bollinger Bands are:
Bollinger Band count (Select how many BBs you want to be displayed.)
MA type used to make the Bollinger Bands ( EMA, SMA, WMA, etc.)
Source (close, open, high, low.)
BB length separately (The length of each Bollinger Band, its lookback. How many previous candles should it be based on? Choose each Bollinger Band's lookback length.)
BB deviator separately(The standard Deviator applied for the BB for both the upper and lower line.)
A few of the style settings you can change for each Bollinger Band are:
Fill (the color used to fill from the upper to the lower band)
Fill opacity % (the opacity used when filling the upper line to the lower line)
This indicator is unique because it can be used for all strategies and all trading styles , for example, day trading or long-term investing, really anything if used correctly. The reason it can be used in so many instances is a result of the detailed and in-depth settings tab that allows for complete customization. This allows the indicator to be used and to be useful in various situations and allows you to dominate the market. Integrated alerts also enhance your efficiency while using this indicator because you can choose to be notified at the crossing of any of the Bollinger Bands.
The technical part of this indicator plots the selected amount of Bollinger Bands using custom-built specified Bollinger Bands accordingly. Then it uses the style settings and styles it as you selected.
Bollinger Band Layer Entry (BBLE) The Bollinger Band Layer Entry Indicator uses plenty of Bollinger Bands to create an onion-looking layered indicator to help with layered entries. It is similar to a Ribbon but better. This indicator is best used with any volume-related indicator so you can recede from entering into any position with too much momentum to rebound off of any line. Note that this indicator is best used with another strategy like pair trading. It is not recommended to trade based on this indicator only. Please stay aware of any news about the stock you are trading because some events may have a big impact and force the market to go bullish/bearish by a lot. This indicator can be used with all chart types and works well with many other indicators. It allows for complete customization and offers easy-to-understand settings which can be designated to a certain individual. You can modify every single factor of the BBs which allows for an even more personalized and adapted Indicator that reflects your trading/ investing needs. You also have the option to choose which type of MAs will be used to create the Bollinger Bands , a few of which include: EMA, SMA, WMA, HMA, RMA, DMA, LSMA, VAMA, TMA, MF.
Bollinger Bands are a way to measure and visualize volatility. As volatility increases, the wider the bands become, and the more they deviate from the basis. Vice versa, when volatility decreases, the gap between the bands and basis decreases. Yet a big advantage for not only this but many other indicators is created due to the ample count of different settings that are widely used, it is difficult to view the market through the eyes of all types of investors/traders. This indicator manages to counter exactly this issue, you will be able to see all of these settings on one chart and at one time and enter/exit positions accordingly.
Using this indicator will allow you to visualize entries with ease and make order layering (buying/selling in layers) much more simple. You can choose a certain amount of Bollinger Bands you would like displayed and customize all technical and style-related settings related to each of the BBs separately.
A few of the technical settings you can change for each Bollinger Band are:
Bollinger Band count (Select how many BBs you want to be displayed.)
MA type used to make the Bollinger Bands (EMA, SMA, WMA, etc.)
Source (close, open, high, low.)
BB length (The length of each Bollinger Band, its lookback. How many previous candles should it be based on? Choose each Bollinger Band's lookback length.)
BB deviator (The standard Deviator applied for the BB for both the upper and lower line.)
Offset
A few of the style settings you can change for each Bollinger Band are:
Upper, Lower, Basis line opacity % (separate for each)
Upper, Lower, Basis line color (separate for each)
Fill (the color used to fill from the upper to the lower band) (separate for each)
Fill opacity % (the opacity used when filling the upper line to the lower line) (separate for each)
This indicator is unique because it can be used for all strategies and all trading styles, for example, day trading or long-term investing, really anything if used correctly. The reason it can be used in so many instances is a result of the detailed and in-depth settings tab that allows complete customization of each separate Bollinger Band. This allows the indicator to be used and to be useful in various situations and allows you to dominate the market. Integrated alerts also enhance your efficiency while using this indicator because you can choose to be notified at the crossing of any of the Bollinger Bands.
The technical part of this indicator plots the selected amount of Bollinger Bands using custom-built specified Bollinger Bands accordingly. Then it uses the style settings and styles it as you selected.
Average Daily RangeRe-Re-upload!
There are a handful of decent Average Daily Range indicators out there.
Often they are built using Pinescript v2 (severely outdated) or have no customization or are "Closed Source"
In this version, you can select two multipliers to display on chart
Primary Mult - Large Green or Red crosses, by default set to 1 or 100% of ADR
Secondary Mult - Small Aqua or Maroon crosses, by default set to 0.5 or 50% of ADR
Cheers,
EFX
Advanced Forex SessionsEssential for ALL Forex Day Traders!
Don't waste your time trading Forex Sessions with little to no volume or volatility!
The Advanced Forex Sessions tool will search through all 4 sessions, tally up the total volume and ticks moved, and show you which session has the most movement.
It will show you the two best sessions on chart and optionally color the background too.
Configure the position & size of the Infographic table as well as custom Forex Session times and colors.
Forex Trading SessionsThere are a million Forex Trading Session indicators out there, but I couldn't find one with all of the following requirements:
1. Automatically show the Sessions that actually affect the current pair (for instance, Tokyo session doesn't matter when trading EURGBP)
2. Editable colors or at the very least no distracting colors
3. Editable times for each exchange session
4. Unique indication of the start of a session vs the end of a session. (Sometimes, I don't notice a background going from Navy Blue to Black)
This indicator has everything I could ever want in a Sessions Tool:
Subdued default colors
Editable colors
Editable session ranges
Obvious, but not obnoxious indication of start and stop
Automatically hide irrelevant Sessions
Cheers. EFX
Bar StatisticsThis script calculates and displays some bar statistics.
For the bar length statistics, it takes every length of upper or lower movements and calculates their average (with SD), median, and max. That way, you can see whether there is a bias in the market or not.
Eg.: If for 10 bars, the market moved 2 up, then 1 down, then 3 up, then 2 down, and 2 up, the average up bars length would be at 2.33, while the average for the down length would be at 1.5, showing that upper movements last longer than down movements.
For the range statistics, it takes the true range of each bar and calculates where the close of the bar is in relation to the true low of it. So if the closing of the bar is at 10.0, the low is at 9.0, and the high is at 10.2, the candle closed in the upper third of the bar. This process is calculated for every bar and for both closing prices and open prices. It is very useful to locate biasses, and they can you a better view of the market, since for most of the time a bar will open on an extreme and close on another extreme.
Eg.: Here on the DJI, we can see that for most of the time, a month opens at the lower third (near the low) and closes at the upper third (near the high). We can also see that it is very difficult for a month to open or close on the middle of the candle, showing how important the first and the last day are for determining the trend of the rest of the month.
myRangestatCalculates the average daily range as well as the standard deviation of the daily range over a given period.
Adding both values gives you a statistical range (bottom to top or top to bottom) in which price can be expected to move.
pricing_tableThis script helps you evaluate the fair value of an option. It poses the question "if I bought or sold an option under these circumstances in the past, would it have expired in the money, or worthless? What would be its expected value, at expiration, if I opened a position at N standard deviations, given the volatility forecast, with M days to expiration at the close of every previous trading day?"
The default (and only) "hv" volatility forecast is based on the assumption that today's volatility will hold for the next M days.
To use this script, only one step is mandatory. You must first select days to expiration. The script will not do anything until this value is changed from the default (-1). These should be CALENDAR days. The script will convert to these to business days for forecasting and valuation, as trading in most contracts occurs over ~250 business days per year.
Adjust any other variables as desired:
model: the volatility forecasting model
window: the number of periods for a lagged model (e.g. hv)
filter: a filter to remove forecasts from the sample
filter type: "none" (do not use the filter), "less than" (keep forecasts when filter < volatility), "greater than" (keep forecasts when filter > volatility)
filter value: a whole number percentage. see example below
discount rate: to discount the expected value to present value
precision: number of decimals in output
trim outliers: omit upper N % of (generally itm) contracts
The theoretical values are based on history. For example, suppose days to expiration is 30. On every bar, the 30 days ago N deviation forecast value is compared to the present price. If the price is above the forecast value, the contract has expired in the money; otherwise, it has expired worthless. The theoretical value is the average of every such sample. The itm probabilities are calculated the same way.
The default (and only) volatility model is a 20 period EWMA derived historical (realized) volatility. Feel free to extend the script by adding your own.
The filter parameters can be used to remove some forecasts from the sample.
Example A:
filter:
filter type: none
filter value:
Default: the filter is not used; all forecasts are included in the the sample.
Example B:
filter: model
filter type: less than
filter value: 50
If the model is "hv", this will remove all forecasts when the historical volatility is greater than fifty.
Example C:
filter: rank
filter type: greater than
filter value: 75
If the model volatility is in the top 25% of the previous year's range, the forecast will be included in the sample apart from "model" there are some common volatility indexes to choose from, such as Nasdaq (VXN), crude oil (OVX), emerging markets (VXFXI), S&P; (VIX) etc.
Refer to the middle-right table to see the current forecast value, its rank among the last 252 days, and the number of business days until
expiration.
NOTE: This script is meant for the daily chart only.
Average Daily Range Fibonacci LevelsThe Average Daily Range is a simple concept, calculated as the difference between daily highs and lows averaged over some period. This indicator uses that range in conjunction with Fibonacci ratios to create zones centered on the day's open that tends to act as areas of support and resistance.
The thicker White lines are the ADR levels; all other lines are the same value adjusted by the various Fibonacci values.
A simpler version of this concept can be seen in my other script, Average Daily Range Zones, which does not include the Fibonacci ratio zones.
Thanks to @Hank Hill for the original idea and TV for the feedback and support on the use of the security() function.
Also thanks to @GoldenCross for the Fibonacci obsession.
Average Daily Range ZonesThe Average Daily Range is a simple concept, calculated as the difference between daily highs and lows averaged over some period. This range is is overlaid and centered on the day's open, and tends to act as areas of support and resistance . This indicator provides two aggregation periods, creating a range that represents volatility in the ADR; a wider spread indicates greater recent volatility , and vice-versa.
Thanks to @Hank Hill for the original idea and ToS script this is based on, and TV for the feedback and support on the use of the security() function.
tr_volThis indicator shows the annualized volatility, computed using the ewma method. It also uses average true range (ATR) as the daily return, rather than the typical close-to-close percentage change. You can uncomment the "comparison" series to see how it compares to the standard deviation, daily log return method. The standard deviation method weights all periods equally and doesn't account for intra-day ranges, meaning it is less responsive to new information than the ewma method and doesn't weight large intra-day moves as heavily.
The long-run median is also displayed. This feature sometimes fails if there are too many bars.
Volatility IndexThis indicator is based on Historical Volatility (HV) built-in indicator with minor tweaks to match the Bitcoin Volatility Index (from Bybt).
Also, you can select a symbol to compare its volatility with the volatility of the currently selected symbol.