TASC 2022.08 Trading The Fear Index█ OVERVIEW
TASC's August 2022 edition of Traders' Tips includes an article by Markos Katsanos titled "Trading The Fear Index". This script implements a trading strategy called the “daily long/short trading system for volatility ETFs” presented in this article.
█ CONCEPTS
This long-term strategy aims to capitalize on stock market volatility by using exchange-traded funds (ETFs or ETNs) linked to the VIX index.
The strategy rules (see below) are based on a combination of the movement of the Cboe VIX index, the readings of the stochastic oscillator applied to the SPY ETF relative to the VIX, and a custom indicator presented in the article and called the correlation trend . Thus, they are not based on the price movement of the traded ETF itself, but rather on the movement of the VIX and of the S&P 500 index. This allows the strategy to capture most of the spikes in volatility while profiting from the long-term time decay of the traded ETFs.
█ STRATEGY RULES
Long rules
Rising volatility: The VIX should rise by more than 50% in the last 6 days.
Trend: The correlation trend of the VIX should be 0.8 or higher and also higher than yesterday's value.
VIX-SPY relative position: The 25-day and 10-day VIX stochastics should be above the 25-day and 10-day SPY stochastics respectively. In addition, the 10-day stochastic of the VIX should be above its yesterday's value.
Long positions are closed if the 10-day stochastic of the SPY rises above the 10-day stochastic of the VIX or falls below the yesterday's value.
Short rules
Declining volatility: The VIX should drop over 20% in the last 6 days and should be down during the last 3 days.
VIX threshold: The VIX should spend less than 35% of time below 15.
VIX-SPY relative position: The 10-day VIX stochastic should be below the 10-day SPY stochastic. In addition, the 10-day SPY stochastic should be higher than the yesterday's value.
Long positions are closed if the first two Long rules are triggered (Rising volatility and Trend).
The script allows you to display the readings of the indicators used in the strategy rules in the form of oscillator time series (as in the preview chart) and/or in the form of a table.
Tasc
TASC 2022.07 Pairs Rotation With Ehlers Loops█ OVERVIEW
TASC's July 2022 edition of Traders' Tips includes an article by John Ehlers titled "Pairs Rotation With Ehlers Loops". This is the code that implements the Ehlers Loops applied to pairs rotation trading.
█ CONCEPTS
John Ehlers developed Ehlers loops as a tool to visualize the performance of one data stream versus another. Initially, he used this tool to chart price versus volume. However, Ehlers loops proved to be suitable for determining the timing of the pairs rotation strategy . This strategy works by having a long position in only one of two securities, depending on which one is considered stronger at a given time.
When the prices of two securities (filtered and scaled with a standard deviation for consistent presentation) are plotted against each other, the curvature and direction of rotation on the chart can help guide decisions on long positions. For example, when plotting a stock versus a referenced symbol, a vertical upward movement while rotating clockwise is a sign of going long the stock. Similarly, a horizontal movement to the right while rotating counterclockwise is the sign to go long the reference. A higher probability of a reversal is expected when the price moves more than one or two standard deviations.
█ CALCULATIONS
The script uses the following steps to calculate the Ehlers Loops:
The price data of both securities in the pair are individually filtered using identical high-pass and SuperSmoother filters. This results in two band-limited data streams, having a nominally zero mean. The input parameters Low-Pass Period and High-Pass Period control the filter bandwidth and thus can modify the shape of the Ehlers Loops.
Subsequently, the filtered data streams are scaled in terms of standard deviation by dividing each of them by their root-mean-square (RMS) values. These data streams are plotted as zero-mean oscillators.
Finally, the scaled data streams are displayed one against another for the selected time interval (defined by the input parameter Loop Segments ). In the resulting scatterplot, the thicker line corresponds to the later data points. The fluctuations of the filtered price data of the chart symbol are plotted along the y -axis, and the price changes of the referenced symbol are shown along the x -axis.
TASC 2022.06 Ehlers Loops█ OVERVIEW
TASC's June 2022 edition Traders' Tips includes an article by John Ehlers titled "Ehlers Loops. Part 1". This is the code implementing the price-volume Ehlers Loops he introduced in the publication.
█ CONCEPTS
John Ehlers developed Ehlers loops as a tool to visualize the performance of one data stream versus another, both filtered and scaled. In this article, the author applies his concept to exploit and/or dispel the dogmatic principles of reliable price-volume relationships.
The script offers two different ways to visualize Ehlers Loops:
Oscillators (default option)
In this implementation, filtered and scaled volume is plotted along with filtered and scaled price as zero-mean oscillators. Observation of the relative direction of volume and price oscillators can be discretionarily used to interpret and predict market conditions. For example, it is generally assumed that an increase in volume and an increase in price define a bullish condition. Similarly, decreasing volume and increasing price are generally considered bearish. A decrease in volume and a decrease in price is considered a bullish condition. The increase in volume and decrease in price is often thought to be bearish.
Scatterplot
This Crocker-style visualization displays filtered and scaled price against filtered and scaled volume for the selected timespan. Fluctuations in volume are plotted along the x -axis, while price changes along the y -axis. This way of visualizing the Ehlers Loop allows you to analyze the curvature and directional path of the price in relation to volume, offering a different comparative perspective. The boundaries of the price and volume scale on the Ehlers Loop Crocker-chart are presented in standard deviations. Deviations can be used to predict possible future price or volume fluctuations. The expected probability of potential reversals is 68%, 95% and 99.7% at one, two and three standard deviations, respectively.
█ CALCULATIONS
The following steps are used to build an Ehlers Loop:
• Both price and volume are filtered to be band-limited signals. This is done by applying the high-pass Butterworth filter in combination with the low-pass SuperSmooth filter.
The cutoff wavelengths of the high-pass and low-pass filters are defined by the input parameters HPPeriod and LPPeriod , respectively.
These values change the appearance of the Ehlers Loops and can be customized to your trading style.
• The filtered price and volume time series are then scaled in terms of standard deviation by dividing each by their root-mean-square values.
• The resultant price and volume data are plotted as zero-mean oscillators or as a scatterplot.
TASC 2022.05 Relative Strength Exponential Moving Average█ OVERVIEW
TASC's May 2022 edition Traders' Tips includes the "Relative Strength Moving Averages" article authored by Vitali Apirine. This is the code implementing the Relative Strength Exponential Moving Average (RS EMA) indicator introduced in this publication.
█ CONCEPTS
RS EMA is an adaptive trend-following indicator with reduced lag characteristics. By design, this was made possible by harnessing the relative strength of price. It operates in a similar fashion to a traditional EMA, but it has an improved response to price fluctuations. In a trading strategy, RS EMA can be used in conjunction with an EMA of the same length to identify the overall trend (see the preview chart). Alternatively, RS EMAs with different lengths can define turning points and filter price movements.
RS EMA is an adaptive trend-following indicator with reduced lag characteristics. By design, this was made possible by harnessing the relative strength of price. It operates in a similar fashion to a traditional EMA, but it has an improved response to price fluctuations.
█ CALCULATIONS
The following steps are used in the calculation process:
• Calculate the relative strength (RS) of a given length.
• Multiply RS by a chosen coefficient (multiplier) to adapt the EMA filtering the original time series. Calculate the EMA of the resulting time series.
The author recommends RS EMA(10,10,10) as typical settings, where the first parameter is the EMA length, the second parameter is the RS length, and the third parameter is the RS multiplier. Other values may be substituted depending on your trading style and goals.
TASC 2022.04 S&P500 Hybrid Seasonal System█ OVERVIEW
TASC's April 2022 edition of Traders' Tips includes the "Sell In May? Stock Market Seasonality" article authored by Markos Katsanos. This is the code implementing the "Hybrid Seasonal System" from the article.
█ CONCEPTS
In his article, Markos Katsanos takes an updated look at the "Sell in May" adage by reviewing recent historical data for seasonal equity market tendencies. The author explores the development of a trading strategy (a set of buy and sell rules) based on this research.
He starts from the enhanced buy & hold system featured in his July 2021 TASC article, and adds additional technical conditions. These include volatility conditions ( VIX and ATR ) plus the "Volume Flow Indicator" (VFI), which is a custom money flow indicator that Katsanos introduced in his June 2004 TASC article. He provides an example of a trading system that others can test for themselves and modify as they see fit. The author notes that the system could likely be improved further by adding money management conditions (such as a stop-loss), or by adding more technical conditions not considered in the scope of this article.
█ CALCULATIONS
The entry and exit rules that constitute the trading system are defined below. The critical values of VIX, ATR and VFI (specified below) used in the calculations were determined by optimization for a daily chart of the SPY ETF . By default, the strategy only allows long entries. However, the script offers the possibility to initiate short entries upon exiting long trades through the "Long Only" toggle in the script's inputs.
Long Entry Rules
• Seasonal: The seasonal trade is initiated on the first business day October at the open.
• Volatility: In case of high volatility, that is if the VIX is above 60% or the 15-day ATR was above 90% over the past 25 days, the seasonal trade is deferred until later in the month or year, when the volatility subsides.
Exit/Short Entry Rules
• Seasonal: The exit/short signal is triggered on the first business day of August at the open.
• Volatility: The exit/short signal is triggered if VIX is above 120 % (i.e. 2 times the corresponding threshold parameter).
• Money flow (VFI): The exit/short signal is triggered if the VFI crosses under a critical value (-20) while its 10-day moving average is pointing down.
Join TradingView!
TASC 2022.03 Relative Strength Volatility-Adjusted EMA█ OVERVIEW
TASC's March 2022 edition of Traders' Tips includes the "Relative Strength Moving Averages - Part 3: The Relative Strength Volatility-Adjusted Exponential Moving Average" article authored by Vitali Apirine. This is the code that implements the "RS VolatAdj EMA" from the article.
█ CONCEPTS
In a three-part article series, Vitaly Apirine examines ways to filter price movements and define turning points by applying the Relative Strength concept to exponential moving averages . The resulting indicator is more responsive and is intended to account for the relative strength of volatility .
█ CALCULATIONS
The calculation process uses the following steps:
Select an appropriate volatility index (in our case it is VIX ).
Calculate up day volatility (UV) smoothed by a 10-day EMA.
Calculate down day volatility (DV) smoothed by a 10-day EMA.
Take the absolute value of the difference between UV and DV and divide by the sum of UV and DV. This is the Volatility Strength we need.
Calculate a MLTP constant - the weighting multiplier for an exponential moving average.
Combine Volatility Strength and MLTP to create an exponential moving average on current price data.
Join TradingView!
TASC 2022.02 Ehlers' Elegant Oscillator█ OVERVIEW
TASC's February 2022 edition of Traders' Tips includes the "Inverse Fisher Transform Redux — An Elegant Oscillator" article authored by John Ehlers. This is the code implementing the "Elegant Oscillator" from the article.
█ CONCEPTS
By applying the inverse Fisher transform to a waveform with a nominal Gaussian probability distribution using root mean square ( RMS ) scaling and smoothing the result, John Ehlers creates an oscillator that swings between -1 and 1.
█ CALCULATIONS
The calculation process uses the following steps:
• Compute the 2-bar difference of closing prices.
• Calculate the root mean square (RMS) of the differences.
• Scale the differences using the computed RMS.
• Apply the inverse Fisher transform to the scaled values.
• Smooth the transformed data with the SuperSmoother filter.
Join TradingView!
TASC 2022.01 Improved RSI w/Hann█ OVERVIEW
TASC's January 2022 edition Traders' Tips includes the "(Yet Another Improved) RSI Enhanced With Hann Windowing" article authored by John Ehlers. Once again John Ehlers revolutionizes the RSI indicator. This is TradingView's Pine Script code for the indicator.
█ CONCEPTS
By employing a Hann windowed finite impulse response filter ( FIR ), John Ehlers has enhanced the "Relative Strength Indicator" ( RSI ) to provide an improved oscillator with exceptional smoothness.
█ NOTES
Calculations
The method of calculations using "closes up" and "closes down" from Welles Wilder's RSI described in his 1978 book is still inherent to Ehlers enhanced formula. However, a finite impulse response (FIR) Hann windowing technique is employed following the closes up/down calculations instead of the original Wilder infinite impulse response averaging filter. The resulting oscillator waveform is confined between +/-1.0 with a 0.0 centerline regardless of chart interval, as opposed to Wilder's original formulation, which was confined between 0 and 100 with a centerline of 50. On any given trading timeframe, the value of Ehlers' enhanced RSI found above the centerline typically represents an overvalued region, while undervalued regions are typically found below the centerline.
Background
The original RSI indicator was designed by J. Welles Wilder and presented in his "New Concepts in Technical Trading Systems" book published in 1978.
Join TradingView!
TASC 2021.12 Directional Movement w/Hann█ OVERVIEW
Presented here is code for the "Directional Movement w/Hann" indicator originally conceived by John Ehlers. The code is also published in the December 2021 issue of Trader's Tips by Technical Analysis of Stocks & Commodities (TASC) magazine.
Ehlers continues here his exploration of the application of Hann windowing to conventional trading indicators.
█ FEATURES
The rolling length can be modified in the script's inputs, as well as the width of the line.
█ NOTES
Calculations
The calculation starts with the classic definition of PlusDM and MinusDM. These directional movements are summed in an exponential moving average (EMA). Then, this EMA is further smoothed in a finite impulse response (FIR) filter using Hann window coefficients over the calculation period.
Background
The DMI and ADX indicators were designed by J. Welles Wilder and presented in his "New Concepts in Technical Trading Systems" book published in 1978.
Join TradingView!
TASC 2021.11 MADH Moving Average Difference, Hann█ OVERVIEW
Presented here is code for the "Moving Average Difference, Hann" indicator originally conceived by John Ehlers. The code is also published in the November 2021 issue of Trader's Tips by Technical Analysis of Stocks & Commodities (TASC) magazine.
█ CONCEPTS
By employing a Hann windowed finite impulse response filter (FIR), John Ehlers has enhanced the Moving Average Difference (MAD) to provide an oscillator with exceptional smoothness.
Of notable mention, the wave form of MADH resembles Ehlers' "Reverse EMA" Indicator, formerly revealed in the September 2017 issue of TASC. Many variations of the "Reverse EMA" were published in TradingView's Public Library.
█ FEATURES
Three values in the script's "Settings/Inputs" provide control over the oscillators behavior:
• The price source
• A "Short Length" with a default of 8, to manage the lower band edge of the oscillator
• The "Dominant Cycle", originally set at 27, which appears to be a placeholder for an adaptive control mechanism
Two coloring options are provided for the line's fill:
• "ZeroCross", the default, uses the line's position above/below the zero level. This is the mode used in the top version of MADH on this chart.
• "Momentum" uses the line's up/down state, as shown in the bottom version of the indicator on the chart.
█ NOTES
Calculations
The source price is used in two independent Hann windowed FIR filters having two different periods (lengths) of historical observation for calculation, one being a "Short Length" and the other termed "Dominant Cycle". These are then passed to a "rate of change" calculation and then returned by the reusable function. The secret sauce is that a "windowed Hann FIR filter" is superior tp a generic SMA filter, and that ultimately reveals Ehlers' clever enhancement. We'll have to wait and see what ingenuities Ehlers has next to unleash. Stay tuned...
The `madh()` function code was optimized for computational efficiency in Pine, differing visibly from Ehlers' original formula, but yielding the same results as Ehlers' version.
Background
This indicator has a sibling indicator discussed in the "The MAD Indicator, Enhanced" article by Ehlers. MADH is an evolutionary update from the prior MAD indicator code published in the October 2021 issue of TASC.
Sibling Indicators
• Moving Average Difference (MAD)
• Cycle/Trend Analytics
Related Information
• Cycle/Trend Analytics And The MAD Indicator
• The Reverse EMA Indicator
• Hann Window
• ROC
Join TradingView!
TASC 2021.10 - MAD Moving Average DifferencePresented here is code for the "Moving Average Difference" indicator originally conceived by John Ehlers, also referred to as MAD. This is one of TradingView's first code releases published in the October 2021 issue of Trader's Tips by Technical Analysis of Stocks & Commodities (TASC) magazine.
This indicator has a companion indicator that is discussed in the article entitled Cycle/Trend Analytics And The MAD Indicator , authored by John Ehlers. He's providing an innovative double dose of indicator code for the month of October 2021.
John Ehlers generally describes it as a "thinking man's" MACD . MAD has similar, yet distinct, intended operation. For those of you familiar with the MACD indicator operation, you will find MACD adjustments having defaults of 12 and 26, while MAD has comparable adjustments with defaults of 8 and 23. These are intended for adjustment, same as any other oscillator.
The MAD indicator can be basically described as two simple moving averages applied within a "rate of change" (ROC) calculation.
Further Related Information
• SMA
• ROC
Join TradingView!
TASC 2021.10 - Cycle/Trend AnalyticsPresented here is code for the "Cycle/Trend Analytics" indicator originally conceived by John Ehlers. This is another one of TradingView's first code releases published in the October 2021 issue of Trader's Tips by Technical Analysis of Stocks & Commodities (TASC) magazine.
This indicator, referred to as "CTA" in later explanations, has a companion indicator that is discussed in the article entitled MAD Moving Average Difference , authored by John Ehlers. He's providing an innovative double dose of indicator code for the month of October 2021.
Modes of Operation
CTA has two modes defined as "trend" and "cycle". Ehlers' intention from what can be gathered from the article is to portray "the strength of the trend" in trend mode on real data. Cycle mode exhibits the response of the bank of calculations when a hypothetical sine wave is utilized as price. When cycle mode is chosen, two other lines will be displayed that are not shown in trend mode. A more detailed explanation of the indicator's technical functionality and intention can be found in the original Cycle/Trend Analytics And The MAD Indicator article, which requires a subscription.
Computational Functionality
The CTA indicator only has one adjustment in the indicator "Settings" for choice of modes. The default mode of operation is "trend". Trend mode applies raw price data to the bank of plots, while the cycle mode employs a sinusoidal oscillator set to a cycle period of 30 bars. These are passed to multiple SMAs, which are then subtracted from the original source data. The result is a fascinating display of plots embellished with vivid array of gradient color on real data or the hypothetical sine wave.
Related Information
• SMA
• color.rgb()
Join TradingView
Freedom of MovementFreedom of Movement Indicator
---------------------------------------------------------
In “Evidence-Based Support & Resistance” article, author Melvin Dickover introduces two new indicators to help traders note support and resistance areas by identifying supply and demand pools. Here you can find the support-resistance technical indicator called "Freedom of Movement".
The indicator takes into account price-volume behavior in order to detect points where movement of price is suddenly restricted, the possible supply and demand pools. These points are also marked by Defended Price Lines (DPLs).
DPLs are horizontal lines that run across the chart at levels defined by following conditions:
* Overlapping bars: If the indicator spike (i.e., indicator is above 2.0 or a custom value) corresponds to a price bar overlapping the previous one, the previous close can be used as the DPL value.
* Very large bars: If the indicator spike corresponds to a price bar of a large size, use its close price as the DPL value.
* Gapping bars: If the indicator spike corresponds to a price bar gapping from the previous bar, the DPL value will depend on the gap size. Small gaps can be ignored: the author suggests using the previous close as the DPL value. When the gap is big, the close of the latter bar is used instead.
* Clustering spikes: If the indicator spikes come in clusters, use the extreme close or open price of the bar corresponding to the last or next to last spike in cluster.
DPLs can be used as support and resistance levels. In order confirm and refine them, FoM (Freedom of Movement) is used along with the Relative Volume Indicator (RVI), which you can find here:
Clustering spikes provide the strongest DPLs while isolated spikes can be used to confirm and refine those provided by the RVI. Coincidence of spikes of the two indicator can be considered a sign of greater strength of the DPL.
More info:
S&C magazine, April 2014.
[e2] Reflex & TrendflexNew Indicator from John F. Ehlers issued in the February 2020 Technical Analysis of Stocks and Commodities article "Reflex: A New Zero-Lag Indicator"
This indicator includes both studies described in the article and intend to significantly reduce the lag of the signal compared to other oscillators.
Reflex for the cycle component and is more sensitive to major reversals, Trendflex for the trend component.
Pivot Max range as the borders for top and bottom reading of the indicators (the script will plot separate borders for both components) and divergences were added.
Divergence function is the interpretation of built-in divergence script, optimized the code and added option to show real-time divs (without offset), all credits to ...)
daily*tip: I must say that very quickly I began to realize how fragmented and imperfectly modern economic knowledge is and how little can be taken from fundamental science in terms of practical recipes. (c) Andrey Movchans.
stay safe ;)
Apirine Stochastic MACD w/ MA Selection by Cryptorhythms📊 Apirine Stochastic MACD w/ MA Selection by Cryptorhythms
Intro
Had to re-release due to moderation.
This happens to be my first open source indicator, hope you all enjoy it!
Description
This indicated is ported from November 2019 issue of TASC. “The Stochastic MACD Oscillator” in this issue, author Vitali Apirine introduces a new indicator created by combining the stochastic oscillator and the MACD . He describes the new indicator as a momentum oscillator and explains that it allows the trader to define overbought and oversold levels similar to the classic stochastic but based on the MACD .
Options
-You can enable bar coloration for trade state (signal conditions setup in the "long" and "short" variables).
-You can choose histogram or columns for the convergence/divergence display.
-You can turn on/off and adjust the overbought / oversold zones.
-You can choose what type of moving average to use in the calculation from a small selection of options. This gives you more flexibility to adapt the indicator to your needs.
👍 We hope you enjoyed this indicator and find it useful! We post free crypto analysis, strategies and indicators regularly. This is our 70th script on Tradingview!
🤐Check my Signature for other information
[e2] Fourier series Model Of The MarketFourier series Model Of The Market
John F. Ehlers
TASC Jun 2019
Ehlers DSMA by Tim D.The Deviation-Scaled Moving Average from July 2018 TASC. "In “The Deviation-Scaled Moving Average” in this issue, author John Ehlers introduces a new adaptive moving average that has the ability to rapidly adapt to volatility in price movement. The author explains that due to its design, it has minimal lag yet is able to provide considerable smoothing."
Apirine Slow RSI [LazyBear]The slow relative strength index (SRSI) indicator created by Vitali Apirine is a momentum price oscillator similar to RSI in its application and interpretation. Oscillating between 0 and 100, it generates both OB/OS signals and midline (50) cross over signals and divergences.
As author suggests, bullish/bearish divergences generated by SRSI are not as effective during strong trends. To avoid fading an established trend, the system is used in conjunction with a trend confirmation tool like ADX indicator.
You can configure the OB/OS levels, default are 70/30.
More info:
The slow relative strength index, TASC 2015-07
List of my public indicators: bit.ly
List of my app-store indicators: blog.tradingview.com
Indicator: Relative Volume Indicator & Freedom Of MovementRelative Volume Indicator
------------------------------
RVI is a support-resistance technical indicator developed by Melvin E. Dickover. Unlike many conventional support and resistance indicators, the Relative Volume Indicator takes into account price-volume behavior in order to detect the supply and demand pools. These pools are marked by "Defended Price Lines" (DPLs), also introduced by the author.
RVI is usually plotted as a histogram; its bars are highlighted (black, by default) when the volume is unusually large. According to the author, this happens if the indicator value exceeds 2.0, thus signifying that a possible DPL is present.
DPLs are horizontal lines that run across the chart at levels defined by following conditions:
* Overlapping bars: If the indicator spike (i.e., indicator is above 2.0 or a custom value)
corresponds to a price bar overlapping the previous one, the previous close can be used as the
DPL value.
* Very large bars: If the indicator spike corresponds to a price bar of a large size, use its
close price as the DPL value.
* Gapping bars: If the indicator spike corresponds to a price bar gapping from the previous bar,
the DPL value will depend on the gap size. Small gaps can be ignored: the author suggests using
the previous close as the DPL value. When the gap is big, the close of the latter bar is used
instead.
* Clustering spikes: If the indicator spikes come in clusters, use the extreme close or open
price of the bar corresponding to the last or next to last spike in cluster.
DPLs can be used as support and resistance levels. In order confirm and refine them, RVI is used along with the FreedomOfMovement indicator discussed next.
Freedom of Movement Indicator
------------------------------
FOM is a support-resistance technical indicator, also by Melvin E. Dickover. FOM is the ratio of relative effect (relative price change) to the relative effort (normalized volume), expressed in standard deviations. This value is plotted as a histogram; its bars are highlighted (black, by default( when this ratio is unusually high. These highlighted bars, or "spikes", define the positioning of the DPLs.
Suggestions for placing DPLs are the same as for the Relative Volume Indicator discussed above.
Note that clustering spikes provide the strongest DPLs while isolated spikes can be used to confirm and refine those provided by the Relative Volume Indicator. Coincidence of spikes of the two indicator can be considered a sign of greater strength of the DPL.
More info:
S&C magazine, April 2014.
I am still trying these on various instruments to understand the workings more. Don't forget to share what you learn -- any use cases / ideal scenarios / gotchas, would love to hear them all.