Black-Scholes Options Pricing ModelThis is an updated version of my "Black-Scholes Model and Greeks for European Options" indicator, that i previously published. I decided to make this updated version open-source, so people can tweak and improve it.
The Black-Scholes model is a mathematical model used for pricing options. From this model you can derive the theoretical fair value of an options contract. Additionally, you can derive various risk parameters called Greeks. This indicator includes three types of data: Theoretical Option Price (blue), the Greeks (green), and implied volatility (red); their values are presented in that order.
1) Theoretical Option Price:
This first value gives only the theoretical fair value of an option with a given strike based on the Black-Scholes framework. Remember this is a model and does not reflect actual option prices, just the theoretical price based on the Black-Scholes model and its parameters and assumptions.
2)Greeks (all of the Greeks included in this indicator are listed below):
a)Delta is the rate of change of the theoretical option price with respect to the change in the underlying's price. This can also be used to approximate the probability of your option expiring in the money. For example, if you have an option with a delta of 0.62, then it has about a 62% chance of expiring in-the-money. This number runs from 0 to 1 for Calls, and 0 to -1 for Puts.
b)Gamma is the rate of change of delta with respect to the change in the underlying's price.
c)Theta, aka "time decay", is the rate of change in the theoretical option price with respect to the change in time. Theta tells you how much an option will lose its value day by day.
d) Vega is the rate of change in the theoretical option price with respect to change in implied volatility .
e)Rho is the rate of change in the theoretical option price with respect to change in the risk-free rate. Rho is rarely used because it is the parameter that options are least effected by, it is more useful for longer term options, like LEAPs.
f)Vanna is the sensitivity of delta to changes in implied volatility . Vanna is useful for checking the effectiveness of delta-hedged and vega-hedged portfolios.
g)Charm, aka "delta decay", is the instantaneous rate of change of delta over time. Charm is useful for monitoring delta-hedged positions.
h)Vomma measures the sensitivity of vega to changes in implied volatility .
i)Veta measures the rate of change in vega with respect to time.
j)Vera measures the rate of change of rho with respect to implied volatility .
k)Speed measures the rate of change in gamma with respect to changes in the underlying's price. Speed can be used when evaluating delta-hedged and gamma hedged portfolios.
l)Zomma measures the rate of change in gamma with respect to changes in implied volatility . Zomma can be used to evaluate the effectiveness of a gamma-hedged portfolio.
m)Color, aka "gamma decay", measures the rate of change of gamma over time. This can also be used to evaluate the effectiveness of a gamma-hedged portfolio.
n)Ultima measures the rate of change in vomma with respect to implied volatility .
o)Probability of Touch, is not a Greek, but a metric that I included, which tells you the probability of price touching your strike price before expiry.
3) Implied Volatility:
This is the market's forecast of future volatility . Implied volatility is directionless, it cannot be used to forecast future direction. All it tells you is the forecast for future volatility.
How to use this indicator:
1st. Input the strike price of your option. If you input a strike that is more than 3 standard deviations away from the current price, the model will return a value of n/a.
2nd. Input the current risk-free rate.(Including this is optional, because the risk-free rate is so small, you can just leave this number at zero.)
3rd. Input the time until expiry. You can enter this in terms of days, hours, and minutes.
4th.Input the chart time frame you are using in terms of minutes. For example if you're using the 1min time frame input 1, 4 hr time frame input 480, daily time frame input 1440, etc.
5th. Pick what style of option you want data for, European Vanilla or Binary.
6th. Pick what type of option you want data for, Long Call or Long Put.
7th . Finally, pick which Greek you want displayed from the drop-down list.
*Remember the Option price presented, and the Greeks presented, are theoretical in nature, and not based upon actual option prices. Also, remember the Black-Scholes model is just a model based upon various parameters, it is not an actual representation of reality, only a theoretical one.
*Note 1. If you choose binary, only data for Long Binary Calls will be presented. All of the Greeks for Long Binary Calls are available, except for rho and vera because they are negligible.
*Note 2. Unlike vanilla european options, the delta of a binary option cannot be used to approximate the probability of the option expiring in-the-money. For binary options, if you want to approximate the probability of the binary option expiring in-the-money, use the price. The price of a binary option can be used to approximate its probability of expiring in-the-money. So if a binary option has a price of $40, then it has approximately a 40% chance of expiring in-the-money.
*Note 3. As time goes on you will have to update the expiry, this model does not do that automatically. So for example, if you originally have an option with 30 days to expiry, tomorrow you would have to manually update that to 29 days, then the next day manually update the expiry to 28, and so on and so forth.
There are various formulas that you can use to calculate the Greeks. I specifically chose the formulations included in this indicator because the Greeks that it presents are the closest to actual options data. I compared the Greeks given by this indicator to brokerage option data on a variety of asset classes from equity index future options to FX options and more. Because the indicator does not use actual option prices, its Greeks do not match the brokerage data exactly, but are close enough.
I may try to make future updates that include data for Long Binary Puts, American Options, Asian Options, etc.
ค้นหาในสคริปต์สำหรับ "implied"
Black-Scholes Model and Greeks for European OptionsThe Black-Scholes model is a mathematical model used for pricing options. From this model you can derive the theoretical fair value of a European option (an option where you have to wait until expiry to exercise). Additionally, you can derive various risk parameters called Greeks. This indicator includes three types of data: Theoretical Option Price (blue), the Greeks (green), and implied volatility (red); their values are presented in that order.
1) Theoretical Option Price:
This first value gives only the theoretical fair value of an option with a given strike based on the Black-Scholes framework. Remember this is a model and does not reflect actual option prices, just the theoretical price based on the Black-Scholes model and its parameters and assumptions.
2)Greeks (all of the Greeks included in this indicator are listed below):
a)Delta is the rate of change of the theoretical option price   with respect to the change in the underlying's price. This can also be used to approximate the probability of your option expiring in the money. For example, if you have an option with a delta of 0.62, then it has about a 62% chance of expiring in-the-money. This number runs from 0 to 1 for Calls, and 0 to -1 for Puts. 
b)Gamma is the rate of change of delta with respect to the change in the underlying's price. 
c)Theta, aka "time decay", is the rate of change in the theoretical option price with respect to the change in time. Theta tells you how much an option will lose its value day by day.
d)Vega is the rate of change in the theoretical option price with respect to change in implied volatility.
e)Rho is the rate of change in the theoretical option price with respect to change in the risk-free rate. Rho is rarely used because it is the parameter that options are least effected by, it is more useful for longer term options, like LEAPs.
f)Vanna is the sensitivity of delta to changes in implied volatility. Vanna is useful for checking the effectiveness of delta-hedged and vega-hedged portfolios. 
g)Charm, aka "delta decay", is the instantaneous rate of change of delta over time. Charm is useful for monitoring delta-hedged positions. 
h)Vomma measures the sensitivity of vega to changes in implied volatility. 
i)Veta measures the rate of change in vega with respect to time. 
j)Vera measures the rate of change of rho with respect to implied volatility.
k)Speed measures the rate of change in gamma with respect to changes in the underlying's price. Speed can be used when evaluating delta-hedged and gamma hedged portfolios.
l)Zomma measures the rate of change in gamma with respect to changes in implied volatility. Zomma can be used to evaluate the effectiveness of a gamma-hedged portfolio.
m)Color, aka "gamma decay", measures the rate of change of gamma over time. This can also be used to evaluate the effectiveness of a gamma-hedged portfolio.
n)Ultima measures the rate of change in vomma with respect to implied volatility.
o)Probability of Touch, is not a Greek, but a metric that I included, which tells you the probability of price touching your strike price before expiry.
3) Implied Volatility:
This is the market's forecast of future volatility. Implied volatility is directionless, it cannot be used to forecast future direction. All it tells you is the forecast for future volatility.
How to use this indicator:
1st. Input the strike price of your option. If you input a strike that is more than 3 standard deviations away from the current price, the model will return a value of n/a.
2nd. Input the current risk-free rate.(Including this is optional, because the risk-free rate is so small, you can just leave this number at zero.)
3rd. Input the time until expiry. You can enter this in terms of days, hours, and minutes.
4th.Input the chart time frame you are using in terms of minutes. For example if you're using the 1min time frame input 1, 4 hr time frame input 480, daily time frame input 1440, etc.
5th. Pick what type of option you want data for, Long Call or Long Put.
6th. Finally, pick which Greek you want displayed from the drop-down list.
*Remember the Option price presented, and the Greeks presented, are theoretical in nature, and not based upon actual option prices. Also, remember the Black-Scholes model is just a model based upon various parameters, it is not an actual representation of reality, only a theoretical one.
Mean Reversion Trading With IV Metrics (By MC) - Mobile FriendlyThis script is a comprehensive toolkit for traders who want to combine price mean reversion analysis with advanced volatility metrics, including Implied Volatility Rank (IVR), Implied/“Fair” Volatility projections, and real-time market volatility indicators. It is optimized for both desktop and mobile use, providing a detailed statistics table directly on the chart, and is suitable for stocks, ETFs, indices, and even paired asset analysis.
 Key Features & How They Work Together 
 1. Mean Reversion Probability & Z-Score 
 
 Mean Reversion Analysis: Calculates z-scores and statistical probabilities that the asset’s price will revert to its mean, using customizable lookback windows (e.g., 10-60 bars). This helps traders spot potentially overbought or oversold conditions.
 Strong & Moderate Signals: Highlights strong and moderate reversion opportunities based on user-defined probability thresholds, providing clear visual cues for timing entries and exits.
 
 2. Paired Asset Correlation 
 
 Pairs Trading Support: Allows comparison of two symbols (e.g., SPY vs TLT). It computes the ratio, rolling mean, standard deviation, and correlation, helping traders identify divergence/convergence opportunities in pairs trading.
 
 3. Volatility Metrics & Projections 
 
 Historical & Implied Volatility: Estimates implied volatility (IV) using historical price data, calculates IVR (the asset’s IV relative to its own history), and provides user-customized percentile bands (e.g., 20th/80th percentiles).
 
 
 Fair IV Calculation: Offers three methods to compute “fair” volatility:
 Market-Aware (relative to VIX/SPX HV)
 SMA of historical volatility
 SMA of VIX Traders can choose the method that best fits current market conditions. 
 Future Projections: Projects IV, “Fair” IV, and IVR for a user-defined future period, giving insight into potential volatility trends.
 
 4. Implied Move Range 
 
 Implied Move Calculation: Shows the expected price range (upper/lower bounds) for the forecast period based on the current IV, making risk management and target setting more objective.
 Dynamic Labels: Automatically updates labels with the latest projected moves and bounds, keeping traders informed in real time.
 
 5. Market Volatility Dashboard 
 
 Broad Market Indicators: Displays real-time values and daily changes for VIX, VIX1D, VVIX, MOVE (bond volatility), GVZ (gold volatility), and OVX (oil volatility). Color-coded thresholds help traders gauge market stress across asset classes.
 Correlation to SPY: Shows how closely the asset moves with SPY, aiding in diversification and hedging decisions.
 
 6. Performance Metrics 
 
 Daily Move Analysis: Tracks today’s price move (absolute and percentage), average rises/falls, and the percentage of green/red days over a custom period.
 Trade Quality Assessment: Ranks trade opportunities (High/Moderate/Low/Very Low) based on mean reversion probability.
 
 7. Highly Customizable Table 
 
 Mobile Friendly: The stats table can be placed anywhere on the chart, toggled between compact/full/extra modes, and resized for readability on any device.
 Visual Cues: Color coding and dynamic labels make interpretation easy and fast.
 
 8. Alert Conditions 
 
 Built-in alerts for strong/moderate mean reversion, IV crossing above/below “Fair” IV, allowing proactive trade management.
 
 9. VIX-Based Expected Move Bands 
 
 Optionally plots ±1, 2, 3 standard deviation bands using VIX-based expected move, helping to visualize potential price extremes.
 
 How These Features Help Traders 
 
 Unified Trading Dashboard:  All key mean reversion and volatility insights are available at a glance, reducing the need to switch between multiple indicators or screens.
 Informed Entries & Exits:  By combining mean reversion probabilities, IV projections, and market volatility, traders can time trades more confidently and avoid false signals.
 Risk Management:  The implied move bounds and volatility levels support realistic stop-loss and target setting, adapting dynamically to market conditions.
 Cross-Asset Awareness:  Market-wide volatility metrics and asset correlation to SPY provide context, helping traders avoid surprises from macro shocks.
 Pairs Trading: Direct support for ratio and correlation analysis streamlines pairs strategies.
 Customization & Clarity:  The flexible UI and color-coded stats make the tool accessible for both beginners and advanced users.
 
 Mean Reversion, Correlation value & interpretation: 
 For Meant Reversion % Probability: 
Lookback Period to use:
| Trading Horizon | Lookback Period (Length) | Rationale |
| 5–10 days | 10–20 bars | More sensitive, good for quick reversals |
| 10–20 days | 20–30 bars | Standard for short swing |
| 20–40 days | 40–60 bars | More stable mean for longer swing |
 Interpretation Guide: 
Only consider trades if Correlation ≥ 0.6 or Reversion % ≥ 75%.
Avoid trades with Reversion % < 20%.
Correlation and Reversion % together form a powerful trade quality filter.
| Reversion % | Correlation | Signal Strength | Action |
| ≥ 75% | ≥ 0.4 | High Probability | Consider full position |
| ≥ 50% | ≥ 0.6 | Moderate Probability | Trade with standard size |
| ≥ 75% | < 0.4 | Uncorrelated Edge | Trade small or hedge carefully |
| < 50% | Any | Weak | Avoid |
| Any | < 0.3 | Low Coherence | Avoid unless extreme Reversion |
| Correlation Value | Interpretation |
| +1.0 | Perfect positive correlation (price of both move in the same direction)|
| +0.7 to +0.9 | Strong positive correlation |
| +0.4 to +0.6 | Moderate positive correlation |
| 0 | No correlation (independent) |
| -0.4 to -0.6 | Moderate negative correlation |
| -0.7 to -0.9 | Strong negative correlation |
| -1.0 | Perfect negative correlation (price both move in the opposite direction)|
 Summary: 
This script empowers traders to navigate markets with a robust, data-driven approach, seamlessly blending mean reversion analytics with deep volatility insight—all in a mobile-friendly, customizable dashboard.
 Disclaimer 
This tool is for informational and educational purposes only. It does not provide financial advice or trading signals. Always do your own research and consult a professional before making investment decisions.
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.
Sigma-Level1-Sigma-Level Indicator (for 28 FX Pairs)
This TradingView indicator calculates and visualizes the 1-sigma price projection range for the current FX pair, based on implied volatility (IV) and a user-defined reference price.
🔧 User Inputs
1. Implied Volatility (IV) Selection
You can choose which volatility term to apply:
ON (Overnight)
1W (1 Week)
1M (1 Month)
Each currency pair uses manually entered IV values (in %), grouped by base currency (USD, EUR, GBP, etc.).
 www.investing.com 
2. Base Price Selection
You can define the price level used as the anchor for the sigma projection:
CurrentPrice — live market price
YesterdayClose — close of the previous day
LastHourClose — close of the last 1-hour candle
LastFriday — weekly close from last Friday
LastMonthClose — close of the previous monthly candle
LastYearClose — close of the previous yearly candle
These values are retrieved using the appropriate timeframe (D, W, M, 12M, or 60 for hourly).
📐 How the Calculation Works
The indicator calculates the 1σ range using this formula:
1σ Range = basePrice × (IV / √N) / 100
Where:
basePrice is the selected anchor price.
IV is the selected implied volatility for the current pair.
N is the number of periods per year, depending on the IV term:
√252 for ON (trading days)
√52 for 1W (weeks)
√12 for 1M (months)
The upper and lower bands are then:
1σ Up = basePrice + range
1σ Down = basePrice - range
These bands are plotted only during the current calendar week.
🖼️ Visual Output
Green Line: 1σ Upper Boundary
Red Line: 1σ Lower Boundary
Labels show the exact 1σ values at the most recent bar
⚠️ Disclaimer
This indicator is for informational and analytical purposes only. It does not constitute financial advice, a trading signal, or a guarantee of future performance. Always perform your own research and consult with a qualified financial advisor before making trading decisions.
Ichimoku Z-Score Stochastic Oscillator with Kumo Depth Analysis---
 Ichimoku Z-Score Stochastic Oscillator with Kumo Depth Analysis 
---
 Script Overview 
Welcome to the Advanced Ichimoku Z-Score Stochastic Oscillator with Kumo Depth Analysis. This unique strategy is designed to provide a comprehensive, multi-timeframe trading view by leveraging the Ichimoku Cloud, Z-Score, Stochastic Oscillator, and an innovative implied volatility measure – the Kumo Depth. By integrating these powerful tools into one script, traders can make more informed decisions by considering trend strength, volatility, and volume in one holistic view.
 Rationale & Strategy 
The script was created with the rationale that trading decisions should not only be based on price action and volume, but also on market trend strength and implied volatility. The script integrates these various elements:
 
  The Ichimoku Cloud, a versatile indicator that provides support and resistance levels, trend direction, and momentum all at once.
  The Z-Score, a statistical measurement of a value's relationship to the mean (average) of a group of values.
  The Stochastic Oscillator, a momentum indicator that uses support and resistance levels to determine probable trend reversals.
  The Kumo Depth Analysis, an innovative measure of implied volatility and market trend strength derived from the thickness of the Ichimoku Cloud.
 
 How It Works 
This script works by providing visual buy and sell signals based on the confluence of the aforementioned tools.
 
   Ichimoku Cloud and Z-Score:  The script first calculates the Ichimoku Cloud lines for both a higher and lower timeframe and measures how much current prices deviate from the cloud using Z-Score.
   Stochastic Oscillator:  This Z-Score is then inputted into a Stochastic Oscillator, thus giving the oscillator a more normalized range.
   Kumo Depth Analysis:  Simultaneously, the thickness of the Ichimoku Cloud (Kumo) is calculated as an implied volatility indicator. This depth is normalized and used as a filter to ensure we are trading in a market with substantial trend strength.
   Signals:  Buy and sell signals are triggered based on the crossover and crossunder of the Stochastic Oscillator lines. Signals are then filtered based on their location relative to the Ichimoku Cloud (price should be above the cloud for buy signals and below for sell signals) and the normalized Kumo Depth.
 
 How to Use 
 
   Signal Types:  The script provides both strong and weak signals. Strong signals are accompanied by high volume, while weak signals are not. Strong buy signals are indicated with a green triangle at the top, strong sell signals with a red triangle at the bottom. Weak signals are shown as blue and yellow circles, respectively.
   Trend Strength:  The trend strength is shown by the normalized Kumo Depth. The greater the Kumo Depth, the stronger the trend.
   Timeframes:  You can customize the timeframes used for the calculations in the input settings.
   Adjustments:  Users can adjust parameters such as the Ichimoku settings, Stochastic Oscillator settings, timeframes, and Kumo Depth settings to suit their trading style and the characteristics of the asset they are trading.
 
This script is a complete trading strategy tool providing multi-timeframe, trend-following, and volume-based signals. It's best suited for traders who understand the concepts of trend trading, stochastic oscillators, and volatility measures and want to incorporate them all into one powerful, comprehensive trading strategy.
Boyle Trinomial Options Pricing Model [Loxx]Boyle Trinomial Options Pricing Model   is an options pricing indicator that builds an N-order trinomial tree to price American and European options. This is different form the Binomial model in that the Binomial assumes prices can only go up and down wheres the Trinomial model assumes prices can go up, down, or sideways (shoutout to the "crab" market enjoyers). This method also allows for dividend adjustment. 
 The Trinomial Tree via VinegarHill Finance Labs 
A two-jump process for the asset price over each discrete time step was developed in the binomial lattice. Boyle expanded this frame of reference and explored the feasibility of option valuation by allowing for an extra jump in the stochastic process. In keeping with Black Scholes, Boyle examined an asset (S) with a lognormal distribution of returns. Over a small time interval, this distribution can be approximated by a three-point jump process in such a way that the expected return on the asset is the riskless rate, and the variance of the discrete distribution is equal to the variance of the corresponding lognormal distribution. The three point jump process was introduced by Phelim Boyle (1986) as a trinomial tree to price options and the effect has been momentous in the finance literature. Perhaps shamrock mythology or the well-known ballad associated with Brendan Behan inspired the Boyle insight to include a third jump in lattice valuation. His trinomial paper has spawned a huge amount of ground breaking research. In the trinomial model, the asset price S is assumed to jump uS or mS or dS after one time period (dt = T/n), where u > m > d. Joshi (2008) point out that the trinomial model is characterized by the following five parameters: (1) the probability of an up move pu, (2) the probability of an down move pd, (3) the multiplier on the stock price for an up move u, (4) the multiplier on the stock price for a middle move m, (5) the multiplier on the stock price for a down move d. A recombining tree is computationally more efficient so we require: 
ud = m*m
M = exp (r∆t),
V = exp (σ 2∆t),
dt or ∆t = T/N
where where N is the total number of steps of a trinomial tree. For a tree to be risk-neutral, the mean and variance across each time steps must be asymptotically correct. Boyle (1986) chose the parameters to be:
m = 1, u = exp(λσ√ ∆t), d = 1/u
pu =( md − M(m + d) + (M^2)*V )/ (u − d)(u − m) ,
pd =( um − M(u + m) + (M^2)*V )/ (u − d)(m − d)
Boyle suggested that the choice of value for λ should exceed 1 and the best results were obtained when λ is approximately 1.20. One approach to constructing trinomial trees is to develop two steps of a binomial in combination as a single step of a trinomial tree. This can be engineered with many binomials CRR(1979), JR(1979) and Tian (1993) where the volatility is constant.
 Further reading:  
 A Lattice Framework for Option Pricing with Two State 
 Trinomial tree via wikipedia 
 Inputs 
 
 Spot price: select from 33 different types of price inputs
 Calculation Steps: how many iterations to be used in the Trinomial model. In practice, this number would be anywhere from 5000 to 15000, for our purposes here, this is limited to 220. 
 Strike Price: the strike price of the option you're wishing to model
 Market Price: this is the market price of the option; choose, last, bid, or ask to see different results
 Historical Volatility Period: the input period for historical volatility ; historical volatility isn't used in the Trinomial model, this is to serve as a comparison, even though historical volatility is from price movement of the underlying asset where as implied  volatility is the volatility of the option
 Historical Volatility Type: choose from various types of implied volatility , search my indicators for details on each of these
 Option Base Currency: this is to calculate the risk-free rate, this is used if you wish to automatically calculate the risk-free rate instead of using the manual input. this uses the 10 year bold yield of the corresponding country
 % Manual Risk-free Rate: here you can manually enter the risk-free rate
 Use manual input for Risk-free Rate? : choose manual or automatic for risk-free rate
 % Manual Yearly Dividend Yield: here you can manually enter the yearly dividend yield
 Adjust for Dividends?: choose if you even want to use use dividends
 Automatically Calculate Yearly Dividend Yield? choose if you want to use automatic vs manual dividend yield calculation
 Time Now Type: choose how you want to calculate time right now, see the tool tip
 Days in Year: choose how many days in the year, 365 for all days, 252 for trading days, etc
 Hours Per Day: how many hours per day? 24, 8 working hours, or 6.5 trading hours
 Expiry date settings: here you can specify the exact time the option expires
 
 Included 
 
 Option pricing panel
 Loxx's Expanded Source Types
 
 Related indicators  
Implied Volatility Estimator using Black Scholes   
  
Cox-Ross-Rubinstein Binomial Tree Options Pricing Model   
 
HV/IV Options IndicatorThe Options HV/IV indicator helps in comparing the Scripts Historic Volatility with Implied Volatility (provided by user). The Indicator creates 5 zones, starting from the bottom
Zone 1 - Very Cheap
Zone 2 - Cheap
Zone 3 - Fair
Zone 4 - Expensive
Zone 5 - Very Expensive
The location of the Implied Volatility (Blue line) in the corresponding zone helps in understanding the options pricing as very cheap, cheap, fair, expensive or very expensive. This analysis helps in choosing the correct option strategy when planning options trades.
  
Use the link below to obtain access to this indicator.
 IV/HV ratio 1.0 [dime]This script compares the implied volatility to the historic volatility as a ratio.  
The plot indicates how high the current implied volatility for the next 30 days is relative to the actual volatility realized over the set period.   This is most useful for options traders as it may show when the premiums paid on options are over valued relative to the historic risk. 
The default is set to one year (252 bars) however any number of bars can be set for the lookback period for HV. 
The default is set to VIX for the IV on SPX or SPY but other CBOE implied volatility indexes may be used.  For /CL you have OVX/HV and for /GC you have GVX/HV.
Note that the CBOE data for these indexes may be delayed and updated EOD
and may not be suitable for intraday information. (Future versions of this script may be developed to provide a realtime intraday study. ) 
There is a list of many volatility indexes from CBOE listed at:
www.cboe.com
(Some may not yet be available on Tradingview)
 RVX Russell 2000 
 VXN  NASDAQ 
 VXO  S&P 100 
 VXD  DJIA 
 GVX Gold 
 OVX  OIL
 VIX3M  3-Month  
 VIX6M	S&P 500 6-Month  
 VIX1Y	1-Year  
 VXEFA	Cboe EFA ETF 
 VXEEM	Cboe Emerging Markets ETF   
 VXFXI	Cboe China ETF   
 VXEWZ	Cboe Brazil ETF  
 VXSLV	Cboe Silver ETF 
 VXGDX	Cboe Gold Miners ETF 
 VXXLE	Cboe Energy Sector ETF 
 EUVIX	FX Euro 
 JYVIX	FX Yen 
 BPVIX	FX British Pound 
 EVZ	Cboe EuroCurrency ETF Volatility Index
 Amazon VXAZN
 Apple VXAPL
 Goldman Sachs  VXGS
 Google VXGOG
 IBM VXIBM
vol_premiaThis script shows the volatility risk premium for several instruments. The premium is simply "IV30 - RV20". Although Tradingview doesn't provide options prices, CBOE publishes 30-day implied volatilities for many instruments (most of which are VIX variations). CBOE calculates these in a standard way, weighting at- and out-of-the-money IVs for options that expire in 30 days, on average. For realized volatility, I used the standard deviation of log returns. Since there are twenty trading periods in 30 calendar days, IV30 can be compared to RV20. The "premium" is the difference, which reflects market participants' expectation for how much upcoming volatility will over- or under-shoot recent volatility.
The script loads pretty slow since there are lots of symbols, so feel free to delete the ones you don't care about. Hopefully the code is straightforward enough. I won't list the meaning of every symbols here, since I might change them later, but you can type them into tradingview for data, and read about their volatility index on CBOE's website. Some of the more well-known ones are:
ES: S&P futures, which I prefer to the SPX index). Its implied volatility is VIX.
USO: the oil ETF representing WTI future prices. Its IV is OVX.
GDX: the gold miner's ETF, which is usually more volatile than gold. Its IV is VXGDX.
FXI: a china ETF, whose volatility is VXFXI.
And so on. In addition to the premium, the "percentile" column shows where this premium ranks among the previous 252 trading days. 100 = the highest premium, 0 = the lowest premium.
IV/HV Ratio's [Nic]IV is implied volatility
HV is historic realized volatility
Seneca teaches that we often suffer more in our minds than in reality, and the same is true with the stock market. This indicator can help identify when people are over paying for implied volatility relative to real volatility . This means that short sellers are over paying for puts and can be squeezed into covering their positions, resulting in a massive rally.
The indicator can track this spread over many time frames, when the short time frame is much higher than the lower time frames, consider it a signal-of-interest.
historical volatility by flashThe script is made to help to determine  OPTIONS  volatility.
The Script is showing the Historical volatility of any stock for its last 1 year data.
Historical volatility is important to know how stock can perform in panic days.
Historical volatility is best used with Implied volatility.
 How to Interpret the Script or How to use it? 
The Script show 5 parts the lowermost is lowest HV in last year & the highest part shows highest volatility in the past 1 year.
Use this on a   DAILY CHART  only.
Now Take the IV (implied volatility of stock)  and put that figure in between the HV and check in which part current IV resides. based on that you can determine how OPTIONS premium or how much it  INFLATED  or  DEFLATED .
IV Rank & IV PercentileThis indicator is meant to be a substitute for Implied Volatility Rank and Percentile for traders who do not have access to readily available options data. This indicator is based on the William's VixFix which is an indicator that mirrors the VIX, which charts the implied volatility of the SPX. The great thing about the VixFix is that it can be applied to any security, not just the SPX.
IV Rank is calculated by taking the highest  and lowest values over the past however many periods you choose, and seeing what percentage of the way between those values the current IV value is. For example if over the past 5 periods the highest IV value was 30 and the lowest IV value was 10, and the current is 20; then the IV Rank would be 50% because 20 is 50% of the way between 10 & 30.
IV Percentile is calculated by looking at all of the past values, not just the highest and lowest, and seeing how many of those values were below the current. For example lets say over the past five periods the IV values were : 30,10,11,15, & 17; while the current IV value is 20. As stated before the IV Rank would be 50%, while the IV Percentile would be 80%, given that 4/5 of the values were below the current IV value of 20.
IV Rank and IV Percentile are often wrongly used interchangeably, but as shown here they are very different. Most people use IV Rank as their main options tool; while IV percentile is a great way to give IV Rank context. Whichever you choose to use, or even both, does not really matter as long as you use either one or both consistently.
IV Rank and IV Percentile are mainly used in this way: when IVR/IVP <50, buy options, when IVR/IVP >50 sell options. The reason that you buy options when IVR/IVP is low is because IV is mean reverting, so you would expect IV to eventually start increasing towards the mean, causing prices to move. The reason you would sell options when IVR/IVP is high is because IV is mean reverting and you would expect IV to decrease towards the mean, causing prices to move sideways.
In this script there are two lines, one denoting IVR and one denoting IVP. IVR is the line which is green when it's above 50 and red when below 50. IVP is the line which is aqua when above 50 and orange when below 50.
SPX Implied Probability of closing above/belowThis is a recreation of the work done by Michael Rechenthin aka "Dr.Data" from Tastytrade back in 2016 (this indicator is for  SP:SPX  only)
You can watch the episode where "Dr.Data", Tom and Tony go over this concept on the following link:
 www.tastytrade.com 
The following are my personal additions:
- ability to choose between  TVC:VIX  and  NASDAQ:VOLI  as the IV input
- ability to choose between 252 and 365 for the number of days
Note that I’m displaying 4 decimal places (#.####) to be as accurate as possible but sometimes you will see 0% or 100% displayed which means that more decimal places are needed (0% could be 0.00005% or 100% could be 99.99995%).
VWAP Implied Volatility BandsThis script takes the built in VWAP function and creates bands using various Volatility Indexes from the CBOE.  The script plots the bands at desired multiples, as well as the closing value of the prior day's first set of bands. Users can choose from the following: 
VIX(ES), VXN(NQ), RVX(RTY), OVX(CL), GVX(GC), SIV(ZS), CIV(ZC), TYVIX(ZN), EUVIX(EURUSD), BPVIX(GBPUSD)
Upon selecting the desired volatility index, users must change the multiplier to fit the underlying product since the indexes are all calculated differently. 
The goal with this script was to use market generated information (IV) to highlight potential trade locations.
Bitcoin IV C/FIllustrating Cap-Floor bands based on statistical calculations using the implied volatility of Bitcoin. 
Calculation criteria can be chosen in range 1day-365days.
Chobotaru Indicator V1Now can be used by everyone.
 Chobotaru Indicator has two functions: 
1. Probability cloud, giving the probability of stock or future to move to a certain price.
2. Help traders understand where to take profit and where to put a stop-loss.
You don’t need knowledge about options trading, this indicator is for all traders/investors.
 What does the indicator do? 
The indicator is based on the partial differential equations from the mathematical model of options, the Black-Scholes model. Using these equations and market parameters the indicator shows on the chart the probability that the stock/future will touch a certain price until a specific date.
 How the indicator does it? 
The algorithm solves the partial differential equations using the following values:
 Instrument price  - The current price of the stock or futures contract
 The interest rate  – default zero – can be found by searching in google: “U.S. Department of the treasury daily yield curve rates”, Use the 3-month value. This value has a low impact on the model so you only need to update it when there is a major change in the percentile. (Example, in January 2021 the 3 months “risk-free rate” is 0.08, you can enter 0 in the indicator.
 Days to expire (minus trading holidays)  – You need to choose an option and take from it the other values that are needed. We recommend taking options that close to 30 days, but it is the user choice.
Example: On the 22 of January 2021, PLTR has an option that has 35 days left. The option will expire on the 26 of February 2021, if there are trading holidays like in this case, the user needs to subtract them, on the 15 of February we have Washington's Birthday, the input is 35-1=34.
 Implied volatility  - Annualized asset price volatility , specific as a positive decimal number. IV 10% => input 0.1, you can find it in the option chain, if you don’t know what it is, you can ask your broker where you can find it on your trading platform. For example, the IV of PLTR on the 22 of January 2021 is 120.67% the input is 1.2067
 Date  – Entering the date of entry.
 How the indicator helps traders and how to use it? 
After you enter the inputs correctly, you will see colorful lines, each line representing the probability for the price to touch there in the current market conditions until a specific date.
To see what percentage each color represents in the indicator press “style”. For example, red lines are a 50% chance for the price to touch there in the chosen period.
It also helps the trader to see what range the stock is expected to move and what range is not probable in this period (according to the options prices).
As you can see, the probability cloud is expanding. This is because as time passes, the probabilities of reaching far away prices are increasing.
Note: this indicator may not work on IPO
Chobotaru IndicatorChobotaru Indicator has two functions:
1. Probability cloud, giving the probability of stock or future to move to a certain price.
2. Help traders understand where to take profit and where to put a stop-loss.
You don’t need knowledge about options trading, this indicator is for all traders/investors.
 What does the indicator do? 
The indicator is based on the partial differential equations from the mathematical model of options, the Black-Scholes model. Using these equations and market parameters the indicator shows on the chart the probability that the stock/future will touch a certain price until a specific date.
 How the indicator does it? 
The algorithm solves the partial differential equations using the following values:
 Instrument price  - The current price of the stock or futures contract
 The interest rate  – default zero – can be found by searching in google:  “U.S. Department of the treasury daily yield curve rates”, Use the 3-month value. This value has a low impact on the model so you only need to update it when there is a major change in the percentile. (Example, in January 2021 the 3 months “risk-free rate” is 0.08, you can enter 0 in the indicator.
 Days to expire (minus trading holidays)  – You need to choose an option and take from it the other values that are needed. We recommend taking options that close to 30 days, but it is the user choice.
Example: On the 22 of January 2021, PLTR has an option that has 35 days left. The option will expire on the 26 of February 2021, if there are trading holidays like in this case, the user needs to subtract them, on the 15 of February we have Washington's Birthday, the input is 35-1=34.
 Implied volatility  - Annualized asset price volatility, specific as a positive decimal number. IV 10% => input 0.1, you can find it in the option chain, if you don’t know what it is, you can ask your broker where you can find it on your trading platform. For example, the IV of PLTR on the 22 of January 2021 is 120.67% the input is 1.2067
 Date  – Entering the date of entry. 
 How the indicator helps traders and how to use it? 
After you enter the inputs correctly, you will see colorful lines, each line representing the probability for the price to touch there in the current market conditions until a specific date. 
To see what percentage each color represents in the indicator press “style”. For example, red lines are a 50% chance for the price to touch there in the chosen period.
It also helps the trader to see what range the stock is expected to move and what range is not probable in this period (according to the options prices).
As you can see, the probability cloud is expanding. This is because as time passes, the probabilities of reaching far away prices are increasing.
 How to access the indicator? 
Use the link below to obtain access to the indicator
Note: this indicator may not work on IPO
Imminence of volatilityWork in progress.
Simple oscillator that takes in implied volatilities at two different timescales for the same security, to determine whether the market expects the next crash to be imminent or "in a few months from now". 
Best combined with other IV/VIX-based indicators and visual inspection of the IV charts, but still gives some decent information at a glance.
SPY Expected Move by VIXThis indicator shows 1 and 2 standard deviation price move from the VWAP based on VIX. Implied Volatility (IV) is being used extensively in the Option world to project the Expected Move for the underlying instrument. VIX is used as a proxy for SPY's IV for 30 days. 
This indicator is meaningful only for SPY but can be used in any other instrument which has a strong correlation to SPY.
IVR = implied volatility rank for volatility productsuse this indicator on VOLATILITY products such as OVX, VIX, GVX .... (search for "volatility")
Dealar VIX Implied Range + Retracement LevelsThis Implied range Is derived by the VIX(1 sd annual +/- Implied move.)
This Indicator plots the daily Implied range, A lot of quantitative trading firms/ MM firms hedge their delta & gamma exposure around the Implied range(prop calc). I have added retracement levels as well, so you have more pivot levels. 
Enjoy!
vol_rangesThis script shows three measures of volatility:
historical (hv): realized volatility of the recent past
median (mv): a long run average of realized volatility
implied (iv): a user-defined volatility
Historical and median volatility are based on the EWMA, rather than standard deviation, method of calculating volatility. Since Tradingview's built in ema function uses a window, the "window" parameter determines how much historical data is used to calculate these volatility measures. E.g. 30 on a daily chart means the previous 30 days.
The plots above and below historical candles show past projections based on these measures. The "periods to expiration" dictates how far the projection extends. At 30 periods to expiration (default), the plot will indicate the one standard deviation range from 30 periods ago. This is calculated by multiplying the volatility measure by the square root of time. For example, if the historical volatility (hv) was 20% and the window is 30, then the plot is drawn over: close  * 1.2 * sqrt(30/252).
At the most recent candle, this same calculation is simply drawn as a line projecting into the future.
This script is intended to be used with a particular options contract in mind. For example, if the option expires in 15 days and has an implied volatility of 25%, choose 15 for the window and 25 for the implied volatility options. The ranges drawn will reflect the two standard deviation range both in the future (lines) and at any point in the past (plots) for HV (blue), MV (red), and IV (grey).






















