MS VIX Bull ReversalThis script measures the rebound of the implied volatility of the S&P 500 index options from an excessive panic zone. The IV starts a reversion to the mean as soon as profit taking from the hedge begins. The assumption behind it: this rebound indicates at least the beginning of a countermovement, in uptrends the end of the correction and the trend continuation. 
ค้นหาในสคริปต์สำหรับ "implied"
VolatilityDivergenceRedGreen by STTAName: VolatilityDivergenceRedGreen by STTA 
- Underlying and implied volatiliy normally show negative correlated behavior (price rises, vola falls and vice versa)
- This study shows symbols in on candles in chart where Undelying and corresponding vola index show same bahvior for 1,2 or 3 consecutive bars. (price rises and vola rises and vice versa)
- This situation is called Vola Divergence. Red, when prices and vola fall; green, when price and vola rise
- This information can be used to detect possible end of Up/Down-Swings.
- User can configure if rising or falling or both price movements shall be displayed.
- This study can be used with root symbols, which provide corresponding volatility indices.
- supported Root Symbols: SPX, NDQ, DJI, RUT, CL, XLE, GC, SI, EUR, HSI, FXI, EWZ, AMZN, AAPL, GS, GOOG, IBM, DEU40
- in all other symbols, no symbols are displayed.
 Inputs 
- underlying displayed in chart
 Settings/Parameter 
- each Divergence can be switched off/on separately
- output of each displayed symbol can be configured
 Outputs 
- RedDiv1: first bar with rising price and rising volatility index
- GreenDiv1: first bar with falling price and falling volatility index
- RedDiv2: second bar in a row with rising price and rising volatility index
- GreenDiv2: second bar with falling price and falling volatility index
- RedDiv3: third bar in a row with rising price and rising volatility index
- GreenDiv3: third bar in a row with falling price and falling volatility index
Augmented Dickey–Fuller (ADF) mean reversion testThe  augmented Dickey-Fuller test  (ADF) is a statistical test for the tendency of a price series sample to  mean revert .
The current price of a mean-reverting series may tell us something about the next move (as opposed, for example, to a geometric Brownian motion). Thus, the ADF test allows us to spot market inefficiencies and potentially exploit this information in a trading strategy.
Mathematically, the mean reversion property means that the price change in the next time period is proportional to the difference between the average price and the current price. The purpose of the ADF test is to check if this proportionality constant is zero. Accordingly, the ADF  test statistic  is defined as the estimated proportionality constant divided by the corresponding standard error.
In this script, the ADF test is applied in a rolling window with a user-defined lookback length. The calculated values of the ADF test statistic are plotted as a time series. The more negative the test statistic, the stronger the rejection of the hypothesis that there is no mean reversion. If the calculated test statistic is  less than the critical value  calculated at a certain confidence level (90%, 95%, or 99%), then the hypothesis of a mean reversion is accepted (strictly speaking, the opposite hypothesis is rejected).
 Input parameters: 
 
   Source  - The source of the time series being tested.
   Length  - The number of points in the rolling lookback window. The larger sample length makes the ADF test results more reliable.
  Maximum lag - The maximum lag included in the test, that defines the order of an autoregressive process being implied in the model. Generally, a non-zero lag allows taking into account the serial correlation of price changes. When dealing with price data, a good starting point is lag 0 or lag 1.
   Confidence level  - The probability level at which the critical value of the ADF test statistic is calculated. If the test statistic is below the critical value, it is concluded that the sample of the price series is mean-reverting. Confidence level is calculated based on  MacKinnon (2010) .
 Show Infobox - If True, the results calculated for the last price bar are displayed in a table on the left.
 
 More formal background: 
Formally, the ADF test is a test for a  unit root  in an autoregressive process. The model implemented in this script involves a non-zero constant and zero time trend. The zero lag corresponds to the simple case of the AR(1) process, while higher order autoregressive processes AR(p) can be approached by setting the maximum lag of p. The null hypothesis is that there is a unit root, with the alternative that there is no unit root. The presence of unit roots in an autoregressive time series is characteristic for a non-stationary process. Thus, if there is no unit root, the time series sample can be concluded to be stationary, i.e., manifesting the mean-reverting property. 
 A few more comments: 
 
 It should be noted that the ADF test tells us only about the properties of the price series now and in the past. It does not directly say whether the mean-reverting behavior will retain in the future.
 The ADF test results don't directly reveal the direction of the next price move. It only tells wether or not a mean-reverting trading strategy can be potentially applicable at the given moment of time. 
 The ADF test is related to another statistical test, the Hurst exponent. The latter is available on TradingView as implemented by  balipour ,  QuantNomad  and  DonovanWall .
 The ADF test statistics is a negative number. However, it can take positive values, which usually corresponds to trending markets (even though there is no statistical test for this case).
 Rigorously, the hypothesis about the mean reversion is accepted at a given confidence level when the value of the test statistic is below the critical value. However, for practical trading applications, the values which are low enough - but still a bit higher than the critical one - can be still used in making decisions.
 
 Examples: 
The VIX volatility index is known to exhibit mean reversion properties (volatility spikes tend to fade out quickly). Accordingly, the statistics of the ADF test tend to stay below the critical value of 90% for long time periods.
  
The opposite case is presented by BTCUSD. During the same time range, the bitcoin price showed strong momentum - the moves away from the mean did not follow by the counter-move immediately, even vice versa. This is reflected by the ADF test statistic that consistently stayed above the critical value (and even above 0). Thus, using a mean reversion strategy would likely lead to losses.
 
TradingGroundhog - Strategy & Fractal V1#-- Public Strategy - No Repaint - Fractals -- Short term 
Here I come with another script, more simple than Wavetrend V1. You will love it. 
 #-- Synopsis -- 
Another simple idea, on a small time frame (15 min) we buy when the opening price goes below a Bottom fractals and sell when it goes over a Top fractals, but as this script do not use Wavetrends. You should stop by your self to use the script during long lasting downtrends. 
I developed the strategy using BTC /EUR 3 MIN BINANCE but it can be applied to many other cryptos, I don't know for forex or others. You can use it for short term (to a month of uptrend) and automated trading.
 #-- Graph reading -- 
And now, how to read it ?
Fractals:
 
 Yellow Flags occur when the opening price goes below a Bottom fractal , it means Buy.
 White Flags appear when the opening price goes over a Top fractal , it means Sell.
 
 #-- Parameters -- 
 *** Parameters have been intensively optimized using 10 cryptocurrency markets in order to have potent efficiency for each of them. I would recommend to only change the Can Be touch parameter. For the others, I don't recommend any modifications. The idea behind the script is to be able to switch between markets without having to optimize parameters, less work, easy to target active crypto and therefor limit the risks. *** 
Can be touch :
 
 'Filter fractals' : Activate or Disable the filtering fractal operation. If Enable, buy during less risky periods. (Activate is often better)
 
Can be touch but not necessary :
 'VolumeMA' : The Volume corrector used by the fractals
 'Extreme window' : The number of price individuals to look for if we want to remove extreme fractals.
 
Not to touch :
 
 'Long Sop Loss (%)' : The minimal difference of price between a Fractal bottom and the opening price to buy.
 
 #-- Time frame -- 
Should be used with the following time frames depending on the necessity:
 
 1 MIN
 3 MIN (Preferred with the parameters set)
 5 MIN
 
 #-- Last words -- 
The script can be set up to send Tradingview signals to 3comma just by adding comment = " " in strategy.close_all() and strategy.entry().
Good trades !
 Disclaimer (As it should always be one to any script)
***
This script is intended for and only to be used for personal purposes only. No such information provided by it constitutes advice or a recommendation for any investment or trading strategy for any specific person. There is no guarantee presented or implied as to the accuracy of specific forecasts, projections, or predictive statements offered by the script. Users of the script agree that its original developer does not take responsibility for any of your investment decisions. Please seek professional advice before trading.
*** 
# Here are the results from the 20rst of September 2021 with 100% of equity on the BTC /EUR 3 Min and with a capital of 10 000 EUR. So almost, one month.
# As I saw, it goes from +30% to more than +160% (the great SHIB) depending on the selected crypto. It may be negative if you spot a downtrend.
TradingGroundhog - Strategy & Wavetrend V2#-- Public Strategy - No Repaint - Fractals - Wavetrend -- 
Here I come with another script, a nice and simple strategy based on fractals and Wavetrends.
 #-- Synopsis -- 
A simple idea, on a small time frame (15 min) we buy when the opening price goes below a Bottom fractals and sell when it goes over a Top fractals, but in order to avoid bad and evil downtrends, we use Wavetrends based on a Daily time frame. From it, Tops and Bottoms are extracted. If the opening price goes above Wavetrend Tops, no trades will be conducted during the day. If the price goes below Wavetrend bottoms, no trades will be executed from 1 to N days, until a new Wavetrend bottom is generated.
I developed the strategy using BTC /EUR 15 MIN BINANCE but it can be applied to many other cryptos, I don't know for forex or others. You can use it for long term and automated trading, I implemented the Wavetrend indicator to do so, or for short term if you have spot a long coming uptrend. Test it, look at its profit and long or short period on your crypto of choice.
 #-- Graph reading -- 
And now, how to read it ?
Wavetrends:
 
 Red Backgrounds are associated to No Trade periods. These periods occur when the price goes below a Wavetrend bottom or above a Wavetrend Top. They are here to limit the loss.
 Blue Gradient lines represent the past Tops. For each bar, only the increasing values of the Wavetrend tops are acquired. Going from light to dark blue based on the age of the Tops. Thus, if on line goes from dark to light, this means the price is approaching a previous Wavetrend top. In the opposite, if it darken, thus the price say 'buy buy' and go dropping.
 Yellow Gradient lines represent the past Bottoms. They are based on the same principe that the blue lines.
 
Fractals:
 
 Yellow Flags occur when the opening price goes below a Bottom fractal , it means Buy.
 White Flags appear when the opening price goes over a Top fractal , it means Sell.
 
 #-- Parameters -- 
 *** Parameters have been intensively optimized using 10 cryptocurrency markets in order to have potent efficiency for each of them. I would recommend to only change the Can Be touch parameter. For the others, I don't recommend any modifications. The idea behind the script is to be able to switch between markets without having to optimize parameters, less work, easy to target active crypto and therefor limit the risks. *** 
Can be touch :
 
 'Combined Smoothness' : The number of open individuals used by the Wavetrend. (6 or 9, often 9 is better but with less volatile crypto it will be 6)
 'Filter fractals' : Activate or Disable the filtering fractal operation. If Enable, buy during less risky periods. (Disable is often better)
 
Can be touch but not necessary :
 
 'VolumeMA' : The Volume corrector used by the fractals
 'Extreme window' : The number of price individuals to look for if we want to remove extreme fractals.
 
Not to touch :
 
 'Limit_candle to look on' : Number of candles to use to compute the Wavetrend Tops and Bottoms.
 'Length top bottom drawn' : Size of the lines
 'Long Sop Loss (%)' : The minimal difference of price between a Fractal bottom and the opening price to buy.
 
 #-- Time frame -- 
Should be used with the following time frames depending on the necessity:
 
 1 MIN
 3 MIN (Interesting for short term profit, may need some parameter ajustements)
 5 MIN
 15 MIN (Preferred for long term profit, the script was developed on it)
 
 #-- Last words -- 
The script can be set up to send Tradingview signals to 3comma just by adding comment = " " in strategy.close_all() and strategy.entry().
Good trades !
 Disclaimer (As it should always be one to any script)
***
This script is intended for and only to be used for personal purposes only. No such information provided by it constitutes advice or a recommendation for any investment or trading strategy for any specific person. There is no guarantee presented or implied as to the accuracy of specific forecasts, projections, or predictive statements offered by the script. Users of the script agree that its original developer does not take responsibility for any of your investment decisions. Please seek professional advice before trading.
*** 
# Here are the results from the 1rst of July 2021 with 100% of equity on the BTC /EUR 15 Min and with a capital of 1 000 EUR.
# As I saw, it goes from +20% to more than +100% depending on the selected crypto. Sometimes it's negative but it's quite rare on crypto using the EUR.
TradingGroundhog - Fundamental Analysis - Multiple RSI Ema(Script Available Version of my previous  Fundamental Analysis - Multiple RSI Ema )
As the number of crypto currencies is expanding, we need to find the one which will boom in the next months, weeks or even days.
Therefore, I present to you a Fundamental Analysis tool based on RSI built in order to compare the RSI between the diverse cryptocurrencies.
When cryptocurrencies start to trend, become active, minable and especially "buyable", people are investing their money into them.
As a result,the Daily RSI rises and the price of the crypto in question increases steadily.
With "Fundamental Analysis - Multiple RSI EMA" you can :
Follow up to 20 RSI from different exchanges at the same time.
Find easily Increasing/Decreasing RSI as the lines get transparent if their RSI decrease.
You can also select market with high potential of booming as :
Booming Market : 60 < Daily RSI <= 100 (Strong green background)
Potent Market : 55 < Daily RSI <= 60 (Light green background)
Sleepy Market : 50 < Daily RSI <= 55 (Light red background)
Dying Market : 0 < Daily RSI <= 50 (Strong red background)
Futur booming crypto will go from the Potent Market to the Booming Market
Can be used with the following time frames depending on the necessity:
4H
Daily (Preferred)
Weekly
Monthly
Good trades !
Disclaimer (As it should always be one to any script)
***
This script is intended for and only to be used for personal purposes only. No such information provided by it constitutes advice or a recommendation for any investment or trading strategy for any specific person. There is no guarantee presented or implied as to the accuracy of specific forecasts, projections, or predictive statements offered by the script. Users of the script agree that its original developer does not take responsibility for any of your investment decisions. Please seek professional advice before trading.
***
Realtime 5D Profile [LucF]█  OVERVIEW 
This indicator displays a realtime profile that can be configured to visualize five dimensions: volume, price, time, activity and age. For each price level in a bar or timeframe, you can display total or delta volume or ticks. The tick count measures activity on a level. The thickness of each level's line indicates its age, which helps you identify the most recent levels.
█  WARNING 
The indicator only works in real time. Contrary to TradingView's line of  volume profile indicators , it does not show anything on historical bars or closed markets, and it cannot display volume information if none exists for the data feed the chart is using. A realtime indicator such as this one only displays information accumulated while it is running on a chart. The information it calculates cannot be saved on charts, nor can it be recalculated from historical bars. If you refresh the chart, or the script must re-execute for some reason, as when you change inputs, the accumulated information will be lost.
Because "Realtime 5D Profile" requires time to accumulate information on the chart, it will be most useful to traders working on small timeframes who trade only one instrument and do not frequently change their chart's symbol or timeframe. Traders working on higher timeframes or constantly changing charts will be better served by TradingView's volume profiles. Before using this indicator, please see the "Limitations" section further down for other important information.
█  HOW TO USE IT 
Load the indicator on an active chart (see  here  if you don't know how).
The default configuration displays:
 • A double-sided volume profile showing at what price levels activity has occurred.
 • The left side shows "down" volume, the right side shows "up" volume.
 • The value corresponding to each level is displayed.
 • The width of lines reflects their relative value.
 • The thickness of lines reflects their age. Four thicknesses are used, with the thicker lines being the most recent.
 • The total value of down/up values for the profile appears at the top.
To understand how to use profiles in your trading, please research the subject. Searches on "volume profile" or "market profile" will yield many useful results. I provide you with tools — I do not teach trading. To understand more about this indicator, read on. If you choose not to do so, please don't ask me to answer questions that are already answered here, nor to make videos; I don't.
█  CONCEPTS 
 Delta calculations 
Volume is slotted in up or down slots depending on whether the price of each new chart update is higher or lower than the previous update's price. When price does not move between chart updates, the last known direction is used. In a perfect world, Pine scripts would have access to bid and ask levels, as this would allow us to know for sure if market orders are being filled on upticks (at the ask) or downticks (at the bid). Comparing the price of successive chart updates provides the most precise way to calculate volume delta on TradingView, but it is still a compromise. Order books are in constant movement; in some cases, order cancellations can cause sudden movements of both the bid and ask levels such that the next chart update can occur on an uptick at a lower price than the previous one (or vice versa). While this update's volume should be slotted in the up slot because a buy market order was filled, it will erroneously be slotted in the down slot because the price of the chart's update is lower than that of the previous one. Luckily, these conditions are relatively rare, so they should not adversely affect calculations.
 Levels 
A  profile  is a tool that displays information organized by price levels. You can select the maximum quantity of levels this indicator displays by using the script's "Levels" input. If the profile's height is small enough for level increments to be less than the symbol's tick size, a smaller quantity of levels is used until the profile's height grows sufficiently to allow your specified quantity of levels to be displayed. The exact position of levels is not tethered to the symbol's tick increments. Activity for one level is that which happens on either side of the level, halfway between its higher or lower levels. The lowest/highest levels in the profile thus appear higher/lower than the profile's low/high limits, which are determined by the lowest/highest points reached by price during the profile's life.
 Level Values and Length 
The profile's vertical structure is dynamic. As the profile's height changes with the price range, it is rebalanced and the price points of its levels may be recalculated. When this happens, past updates will be redistributed among the new profile's levels, and the level values may thus change. The new levels where updates are slotted will of course always be near past ones, but keep this fluidity in mind when watching level values evolve.
The profile's horizontal structure is also dynamic. The maximum length of level lines is controlled by the "Maximum line length" input value. This maximum length is always used for the largest level value in the profile, and the length of other levels is determined by their value  relative  to that maximum.
 Updates  vs  Ticks 
Strictly speaking, a  tick  is the record of a transaction between two parties. On TradingView, these are detected on seconds charts. On other charts, ticks are aggregated to form a chart  update . I use the broader "update" term when it names both events. Note that, confusingly,  tick  is also used to name an instrument's minimal price increment.
 Volume Quality 
If you use volume, it's important to understand its nature and quality, as it varies with sectors and instruments. My  Volume X-ray  indicator is one way you can appraise the quality of an instrument's intraday volume.
█  FEATURES 
 Double-Sided Profiles 
When you choose one of the first two configuration selections in the "Configuration" field's dropdown menu, you are asking the indicator to display a  double-sided  profile, i.e., where the down values appear on the left and the up ones on the right. In this mode, the formatting options in the top section of inputs apply to  both  sides of the profile.
 Single-Sided Profiles 
The six other selections down the "Configuration" field's dropdown menu select  single-sided  profiles, where one side aggregates the up/down values for either volume or ticks. In this mode, the formatting options in the top section of inputs apply to the  left  profile. The ones in the following "Right format" section apply to the  right  profile.
 Calculation Mode 
The "Calculation" input field allows the selection of one of two modes which applies to single-sided profiles only. Values can represent the simple total of volume or ticks at each level, or their delta. The mode has no effect when a double-sided profile is used because then, the total is represented by the sum of the left and right sides. Note that when totals are selected, all levels appear in the up color.
 Age 
The age of each level is always displayed as one of four line thicknesses. Thicker lines are used for the youngest levels. The age of levels is determined by averaging the times of the updates composing that level. When viewing double-sided profiles, the age of each side is calculated independently, which entails you can have a down level on the left side of the profile appear thinner than its corresponding up side level line on the right side because the updates composing the up side are more recent. When calculating the age of single-sided profiles, the age of the up/down values aggregated to calculate the side are averaged. Since they may be different, the averaged level ages will not be as responsive as when using a double-sided profile configuration, where the age of levels on each side is calculated independently and follows price action more closely. Moreover, when displaying two single-sided profiles (volume on one side and ticks on the other), the age of both sides will match because they are calculated from the same realtime updates.
 Profile Resets 
The profile can reset on timeframes or trend changes. The usual timeframe selections are available, including the chart's, in which case the profile will reset on each new chart bar. One of two trend detection logics can be used: Supertrend or the one used by  LazyBear  in his  Weis Wave indicator . Settings for the trend logics are in the bottommost section of the inputs, where you can also control the display of trend changes and states. Note that the "Timeframe" field's setting also applies to the trend detection mechanism. Whatever the timeframe used for trend detection, its logic will not repaint.
 Format 
Formatting a profile for charts is often a challenge for traders, and this one is no exception. Varying zoom factors on your chart and the frequency of profile resets will require different profile formats. You can achieve a reasonable variety of effects by playing with the following input fields:
 • "Resets on" controls how frequently new profiles are drawn. Spacing out profiles between bars can help make them more usable.
 • "Levels" determines the maximum quantity of levels displayed.
 • "Offset" allows you to shift the profile horizontally.
 • "Profile size" affects the global size of the profile.
 • Another "Size" field provides control over the size of the totals displayed above the profile.
 • "Maximum line length" controls how far away from the center of the bar the lines will stretch left and right. 
 Colors 
The color and brightness of levels and totals always allows you to determine the winning side between up and down values. On double-sided profiles, each side is always of one color, since the left side is down values and the right side, up values. However, the losing side is colored with half its brightness, so the emphasis is put on the winning side. When there is no winner, the toned-down version of each color is used for both sides. Single-sided profiles use the up and down colors in full brightness on the same side. Which one is used reflects the winning side.
 Candles 
The indicator can color candle bodies and borders independently. If you choose to do so, you may want to disable the chart's bars by using the eye icon near the symbol's name.
 Tooltips 
A tooltip showing the value of each level is available. If they do not appear when hovering over levels, select the indicator by clicking on its chart name. This should get the tooltips working.
 Data Window 
As usual, I provide key values in the Data Window, so you can track them. If you compare total realtime volumes for the profile and the built-in "Volume" indicator, you may see variations at some points. They are due to the different mechanisms running each program. In my experience, the values from the built-in don't always update as often as those of the profile, but they eventually catch up.
█  LIMITATIONS 
 • The levels do not appear exactly at the position they are calculated. They are positioned slightly lower than their actual price levels.
 • Drawing a 20-level double-sided profile with totals requires 42 labels. The script will only display the last 500 labels, 
  so the number of levels you choose affects how many past profiles will remain visible.
 • The script is quite taxing, which will sometimes make the chart's tab less responsive.
 • When you first load the indicator on a chart, it will begin calculating from that moment; it will not take into account prior chart activity.
 • If you let the script run long enough when using profile reset criteria that make profiles last for a long time, the script will eventually run out of memory, 
  as it will be tracking unmanageable amounts of chart updates. I don't know the exact quantity of updates that will cause this, 
  but the script can handle upwards of 60K updates per profile, which should last 1D except on the most active markets. You can follow the number of updates in the Data Window.
 • The indicator's nature makes it more useful at very small timeframes, typically in the sub 15min realm.
 • The Weis Wave trend detection used here has nothing to do with how David Weis detects trend changes. 
  LazyBear's version was a port of a port, so we are a few generations removed from the Weis technique, which uses reversals by a price unit.
  I believe the version used here is useful nonetheless because it complements Supertrend rather well.
█  NOTES 
The aggregated view that volume and tick profiles calculate for traders is a good example of one of the most useful things software can do for traders: look at things from a methodical, mathematical perspective, and present results in a meaningful way. Profiles are powerful because, if the volume data they use is of good enough quality, they tell us what levels are important for traders, regardless of the nature or rationality of the methods traders have used to determine those levels. Profiles don't care whether traders use the news, fundamentals, Fib numbers, pivots, or the phases of the moon to find "their" levels. They don't attempt to forecast or explain markets. They show us real stuff containing zero uncertainty, i.e., what HAS happened. I like this.
The indicator's "VPAA" chart name represents four of the five dimensions the indicator displays: volume, price, activity and age. The time dimension is implied by the fact it's a profile — and I couldn't find a proper place for a "T" in there )
I have not included alerts in the script. I may do so in the future.
For the moment, I have no plans to write a profile indicator that works on historical bars. TradingView's volume profiles already do that, and they run much faster than Pine versions could, so I don't see the point in spending efforts on a poor ersatz.
 For Pine Coders 
 • The script uses labels that draw varying quantities of characters to break the limitation constraining other Pine plots/lines to bar boundaries.
 • The code's structure was optimized for performance. When it was feasible, global arrays, "input" and other variables were used from functions, 
  sacrificing function readability and portability for speed. Code was also repeated in some places, to avoid the overhead of frequent function calls in high-traffic areas.
 • I wrote my script using the revised recommendations in the  Style Guide  from the Pine v5 User Manual.
█  THANKS 
 • To  Duyck  for his function that sorts an array while keeping it in synch with another array. 
  The `sortTwoArrays()` function in my script is derived from the  Pine Wizard 's code.
 • To the one and only Maestro,  RicardoSantos , the creative volcano who worked hard to write a function to produce fixed-width, figure space-padded numeric values. 
  A change in design made the function unnecessary in this script, but I am grateful to you nonetheless.
 • To  midtownskr8guy , another Pine Wizard who is also a wizard with colors. I use the colors from his  Pine Color Magic and Chart Theme Simulator  constantly.
 • Finally, thanks to users of my earlier "Delta Volume" scripts. Comments and discussions with them encouraged me to persist in figuring out how to achieve what this indicator does.
Kaufman's Efficiency Ratio Strategy [KL]I recently published an indicator called "Kaufman's Efficiency Ratio Indicator". In the description of that script, I hypothesized about how the Efficiency Ratio could be applied to identify bullish moves in instances where price had already gone up steeply, but rests for a while, allowing for entry in expectation that price will continually rise. I decided to test out this idea with Pinescript.
 About Kaufman's Efficiency Ratio ("ER") 
ER was developed by a systematic trader by the name of Perry J. Kaufman.
 Formula 
The formula is:
= A divided by B,
where:
 
   A  = Current closing price minus the closing price at the start of the lookback period
   B  = Sum of differences between closing prices (in absolute terms) of consecutive bars over the lookback period
 
 How this strategy enters a trade (Long): 
- code:  entry_signal_long = ER > 0 and ER_is_mid 
- meaning: when ER is positive, strategy assumes price has risen. Usually ER value begins high (red), and unless it is a false move, then it should stay positive. This strategy will patiently wait until ER drops to medium (yellow), and then place a trade. 
- how low/medium/high is dynamically determined: Refer to the description of my other script("Kaufman's Efficiency Ratio Indicator") for details. Trying to keep this as short as possible.
 How this strategy exits a trade (Long): 
- when price hits stop limit; stop limit is based on low of bars, trails upward based on ATR
- included a feature called "tightening TSL", which tries to reduce the stop-buffer during periods of high volatility implied by ER (very experimental, opening the floor for suggestions on how this can be improved)
CryptoSignalScanner - MACD Multiple Time FramesDESCRIPTION:
After receiving some multiple request to provide a MACD indicator that displays multiple timeframes at the same time I created this simple script.
You can use this script for free and adjust it as much you like.
With this script you can plot 6 MACD lines & 6 Signal lines.
• Current Timeframe MACD Line
• Current Timeframe Signal Line
• 15 minute candle MACD Line
• 15 minute candle Signal Line
• 30 minute candle MACD Line
• 30 minute candle Signal Line
• 1 hour candle MACD Line
• 1 hour candle Signal Line
• 2 hour candle MACD Line
• 2 hour candle Signal Line
• 4 hour candle MACD Line
• 4 hour candle Signal Line
HOW TO USE:
• When multiple MACD lines on an uptrend are grouped together it is time to SELL.
• When multiple MACD lines on a downtrend are grouped together it is time to BUY.
• The higher to length of the MACD lines the stronger the BUY/SELL signal.
FEATURES:
• You can show/hide the preferred MACD lines.
• You can show/hide the preferred Signal lines.
How MACD works
The MACD indicator is generated by subtracting two exponential moving averages (EMAs) to create the main line (MACD line), which is then used to calculate another EMA that represents the signal line. In addition, there is the MACD histogram, which is calculated based on the differences between those two lines. The histogram, along with the other two lines, fluctuates above and below a center line, which is also known as the zero line.
The MACD indicator consists of three elements moving around the zero line:
• The MACD line. By default the MACD line is calculated by subtracting the 26-day EMA from the 12-day EMA.
   MACD line = 12d EMA - 26d EMA
• The signal line. By default the signal line is calculated from a 9-day EMA of the MACD line.
   Signal line = 9d EMA of MACD line
• Histogram. The histogram is nothing more than a visual record of the relative movements of the MACD line and the signal line.
   It is simply calculated as: MACD line - signal line
REMARKS:
• This advice is NOT financial advice.
• We do not provide personal investment advice and we are not a qualified licensed investment advisor.
• All information found here, including any ideas, opinions, views, predictions, forecasts, commentaries, suggestions, or stock picks, expressed or implied herein, are for informational, entertainment or educational purposes only and should not be construed as personal investment advice.
• We will not and cannot be held liable for any actions you take as a result of anything you read here.
• We only provide this information to help you make a better decision.
• While the information provided is believed to be accurate, it may include errors or inaccuracies.
Good Luck,
SEOCO
Volume using Candle RangeAnother way of finding out a rough estimate of the volume or how much bulls or bears were in control using only the range of the candlesticks in relation to the closing price. If the close is in the higher range zone then the volume is said to have been positive, if the close is in the lower range zone then the volume is said to have been negative. The close is compared to the midpoint of the candle to see how far from the midpoint the close was.
The columns bars show how far each candlestick's close price is to the midpoint of its high and low. It's possible for the column bar to be a different color than the candlestick itself if the close was above or below the midpoint. An average line is shown that takes the average of a given length amount of column bars. There is an option to show the absolute value only of the columns and the average line.
This is based on an idea I found about candlestick range bars implying volume. This is an attempt to put that theory into practice and to see if there's any truth to it. It's not exactly volume and may not always look like it, and it does not show how many trades took place but instead tries to use price in relation to the high and low range.
[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.
MOVE/VXTLT CorrelationMany know of the VIX for equity trading. Yet, many are unaware that there is the same kind of volatility measure for trading bonds, called the MOVE Index.
"The Merrill Lynch Option Volatility Estimate (MOVE) Index is a yield curve weighted index of the normalized implied volatility on 1-month Treasury options which are weighted on the 2, 5, 10, and 30 year contracts."
With this script one can see the the correlation and divergences between bonds and its volatility measure to make educated decisions in trading or hedging.
The idea of this script comes from NicTheMajestic.  
GBTC holdings USD market valueThis script estimates GBTC bitcoins per share, rather than hardcoding as in other scripts. Its result is an estimate of GBTC holdings USD market value.
Per share bitcoin estimates are adjusted by 2.0% / 365 per day from 2019 year end holdings. Calendar year 2019 ending bitcoins and shares were 261,192 bitcoins and 269,445,300 shares. From the 2019 Form 10-K: 'The Trust’s only ordinary recurring expense is the Sponsor’s Fee. The Sponsor’s Fee accrues daily in U.S. dollars at an annual rate of 2.0% of the Bitcoin Holdings.. The Sponsor’s Fee is payable in Bitcoins to the Sponsor monthly in arrears.'
No attempt is made to account for leap years.
Per share bitcoin estimate is converted to USD market value by multiplying by the simple average BTCUSD price at Coinbase and Bitstamp. Grayscale uses the TradeBlock XBX index, a volume weighted average of Coinbase Pro, Kraken, LMAX Digital and Bitstamp prices.
Spot checks vs archive.org captures of daily bitcoins per share and the chart on Grayscale's site:
 
 The estimate for market close January 22 2021 is 0.00094899 bitcoins per share, the published datum on Grayscale's web site was 0.00094898. The estimate matches at 20:30 rather than at 16:00.
The estimate for December 31 2018 is 0.000988965 vs a published 0.00098895.
The estimate for December 29 2017 market value is $14.58 vs $14.65.
The estimate for December 30 2016 market value is $0.99 vs $0.98.
The estimate for January 4 2016 market value is $0.46 vs $0.45.
 No estimates before 2016.
The default style is to draw a blue line with two thirds transparency outside market hours and for first/last minutes of trading, switching to daily or greater periodicity hides this.
 No warranty is expressed or implied , I am not a lawyer, etc etc etc.
 This is not investing advice .  Always do your own due diligence .
Normalized Volatility IndicatorFrom an article by Rajesh Kayakkal:
"Early bear phase signals can help you get out of the market before it turns down. This indicator tells you how.
There are many ways to identify the trend of a financial market, the most common being the 200-day exponential moving average (Ema). When price is trending down below the 200-day Ema, the market is believed to be in a bear phase. If the market is trending up above the 200-day Ema, it is considered to be in a bull phase.
Since every indicator fails at times, I wanted to find other indicators to confirm a trend. In my quest for another indicator to determine the trend for the financial markets, I found the Cboe Volatility Index (Vix) to be a good indicator of the market direction. The Vix is calculated from the weighted average of the implied volatilities of various options on the Standard & Poor’s 500 index futures.
J. Welles Wilder’s average true range can also give an indication of the financial market trends; that is, when the market is in a bull phase, the average true range narrows, and when it is in a bear phase, the average true range expands. The normalized volatility indicator (Nvi) is based on this behavior.
Normalized volatility indicator (Nvi)
Average true range (Atr) varies depending on time. But how do we determine the phase of the financial market with Atr? Perhaps some type of ratio could give us a clue. A ratio presents a relationship of a quantity with respect to another. I did some research based on a ratio of the 64-day average true range and the end-of-day value of equity indexes such as the Standard & Poor’s 500 (Spx). I selected the 64-day period since it is close to the average number of trading days in a quarter. The ratio of the 64-day average true range and closing price does discount seasonal variations in the average true range and gives a single number that can be used to compare volatility of an instrument across many decades. I call this ratio the normalized volatility indicator.
I found an interesting correlation between Nvi and cycles of major equity market indexes. The formula for the Nvi is:
Nvi = 64 - Day average true range/End-of-day price * 100
The NVI gave advanced signals before the cyclical bear phase of SPX commenced in October 2000 and was almost on the spot with the bull phase that began in 2003 and the current secular bear market cycle, which started in November 2007."
Includes options to show inverse NVI and change the ATR length and smoothing. 
Volatility Rainbow [Nic]What is this 
The volatility rainbow tracks divergences in a security and its volatility index. This can be used to identify periods of heightened implied (future) risk.
 About Volatility 
The volatility is calculated by looking at put / call ratios. When VIX goes up it means that puts are outpacing calls. This is a bearish signal.
 About Correlation 
When the security goes up while the VIX goes up, the divergence on the plot will increase and turn a color. This should be a warning.
 Colors
 
RED - DIA
BLUE - SPX
GREEN - IWM
GOLD - GLD
YELLOW - QQQ
ORANGE - TLT
White- VVIX
 Related  
Volatility Prism [Nic]What is this 
The volatility rainbow tracks divergences in a security and its volatility index. This can be used to identify periods of heightened implied (future) risk.
 About Volatility 
The volatility is calculated by looking at put / call ratios. When VIX goes up it means that puts are outpacing calls. This is a bearish signal.
 About Correlation 
When the security goes up while the VIX goes up, the divergence on the plot will increase and turn a color. This should be a warning.
 Volatility Rainbow 
This is a similar indicator, but this one merges all signals into a single line.
VIX MTF MomentumSweet little momentum gadget to track the VIX Index.
What is the VIX?
The CBOE S&P 500 Volatility Index (VIX) is known as the 'Fear Index' which can  measure how worried traders are that the S&P 500 might suddenly drop within the next 30 days.
When the VIX starts moving higher, it is telling you that traders are getting nervous. When the VIX starts moving lower, it is telling you that traders are gaining confidence.
VIX calculation?
The Chicago Board of Options Exchange Market Volatility Index (VIX) is a measure of implied volatility (Of the S&P 500 securities options), based on the prices of a basket of S&P 500 Index options with 30 days to expiration.
How to use: 
If VIX Momentum is above 0 (RED) traders are getting nervous.
If VIX Momentum is below 0 (GREEN) traders are gaining confidence.
Follow to get updates and new scripts: www.tradingview.com
Risk RangeThis indicator creates risk ranges using implied volatility (VIX) or historical volatility, skewness ( Cboe SKEW or estimate ) and kurtosis. 
Realized Variables for Options ComparisonThese variables can be used in comparison with the implied volatility of options.
Variables:
 Realized Volatility  
 mathematical notation lowercase 'sigma' 
 Realized Variance  
 mathematical notation lowercase 'sigma' squared 
 Realized Beta  
 mathematical notation lowercase 'beta' 
Timeframes:
Yearly = 250 or 365
Quarterly = 50 or 90
Monthly = 20 or 30
 Important Note: 
 Options Contract Expiry = barmerge.lookahead_on  
"Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their opening time. This merge strategy can lead to undesirable effect of getting data from "future" on calculation on history. This is unacceptable in backtesting strategies, but can be useful in indicators."
 [ All other timeframes barmerge.lookahead is disabled. 
CryptoSignalScanner - Advanced Moving Averages - Cross & RainbowDESCRIPTION:
With this script you can plot 6 moving averages.
You can decide which Moving Average you want to show or hide.
For every plot you can decide to display the Simple Moving Average ( SMA ) or Exponential Moving Average ( EMA ).
It provides CrossOver and CrossUnder labels when loading the script. Those labels you can show or hide.
You have the possibility to show or hide the rainbow colors. This rainbow function gives you a clear view of the current trend.
HOW TO USE:
• When one Moving Average crosses above another Moving Average it signals an uptrend.
• When one Moving Average crosses below another Moving Average it signals a downtrend.
• The higher to length of the Moving Average the stronger the trend.
FEATURES:
• You can show/hide the preferred Moving Averages.
• You can set the length, type and source for every Moving Average.
• You can show/hide the rainbow colors.
• You can show/hide the CrossUp labels.
• You can show/hide the CrossDown labels.
• You can set alerts for every Moving Average.
• Etc...
DEFAULT SETTINGS:
• MA1 => EMA5
• MA2 => EMA10
• MA3 => EMA20
• MA4 => SMA50
• MA5 => SMA100
• MA6 => SMA200
Simple Moving Average vs. Exponential Moving Average:
SMA and EMA are calculated differently. The exponential moving average ( EMA ) focuses more on recent prices than on a long series of data points, as the simple moving average required.
The calculation makes the EMA quicker to react to price changes and the SMA react slower. That is the main difference between the two.
One is not necessarily better than another. It comes down to personal preference. Plot an EMA and SMA of the same length on a chart and see which one helps you make better trading decisions.
Moving Average Trading Strategies:
The first strategy is a price crossover, when the price crosses above or below a moving average, it signals a potential change in trend.
The second strategy applies when one moving averages crosses another moving average.
• When the short-term MA crosses above the long-term MA, it signals a buy signal.
• When the short-term MA crosses below the long-term MA, it signals a sell signal.
REMARKS:
• This advice is NOT financial advice.
• We do not provide personal investment advice and we are not a qualified licensed investment advisor.
• All information found here, including any ideas, opinions, views, predictions, forecasts, commentaries, suggestions, or stock picks, expressed or implied herein, are for informational, entertainment or educational purposes only and should not be construed as personal investment advice.
• We will not and cannot be held liable for any actions you take as a result of anything you read here.
• We only provide this information to help you make a better decision.
• While the information provided is believed to be accurate, it may include errors or inaccuracies.
If you like this script please donate some coins to share your appreciation.
Good Luck,
SEOCO
Volatility SkewThis indicator measure the historical skew of actual volatility for an individual security.  It measure the volatility of up moves versus down moves over the period and gives a ratio.  When the indicator is greater than one, it indicators that volatility is greater to the upside, when it is below 1 it indicates that volatility is skewed to the downside.
This is not comparable to the SKEW index, since that measures the implied volatility across option strikes, rather than using historical volatility.
Roofing Filter [DW]This is an experimental study built on the concept of using roofing filters on price data proposed by John Ehlers.
Roofing filters are a type of bandpass filter conventionally used in HF radio receivers in the first IF stage to limit the frequency spectrum passed on to later stages in the receiver.
The goal in applying roofing filters to a price signal is to simultaneously attenuate high frequency noise and low frequency distortion to pass an oscillating signal with a nearly zero mean for analysis and/or further calculation.
In this study, there are three filter types to choose from:
 -> Ehlers Roofing Filter, which passes data through a 2 pole high pass filter, then through a Super Smoother filter.
 -> Gaussian Roofing Filter, which passes data through a 2 pole Gaussian high pass filter, then through a 2 pole Gaussian low pass filter.
 -> Butterworth Roofing Filter, which passes data through a 2 pole Butterworth high pass filter, then through a 2 pole Butterworth low pass filter.
Each filter type has different amplitude and delay characteristics, so play around with each type and see which response suits your needs best.
There is an option to normalize the scale of the output as well. The normalization process in this script is computed by comparing positive and negative outputs to the filter's moving RMS value.
The resulting oscillator can be fed through numerous conventional indicators including Stochastic Oscillator, RSI, CCI, etc. to generate smoother, less distorted indicators for a clearer view of turning points.
Alternatively, it can also act as an indicator itself, as implied by the corresponding color scheme included in the script.
Although roofing filters are not conventionally used in the analysis of market data, applying such spectral analysis techniques may prove to be quite useful for the design of more efficient indicators and more reliable predictions.
Multiple Rate Of ChangeConvergence of Multiple period Rates of Change near the Zero line shows contraction in volatility.
Soon we can expect expansion in volatility.
Ideal strategy would be to buy ATM Straddles when different period ROCs converge near Zero line.
(Also check implied volatility of options before going for this strategy)






















