Wavetrend Moving Average (WTMA) [Loxx]Wavetrend Moving Average (WTMA) is a Wavetrend indicator morphed into a moving average. Use this indicator as you would any other moving average.
What is the Wavetrend indicator?
Wavetrend's original name was TCI created by the The Trading Center. The TCI (Trading Channel Index) displays the ratio between the average daily price and the smoothed averaged value of the average daily price.
You can read about TCI here: tradingcenter.org
How do you morph Wavetrend into a moving average?
1. Calculate Wavetrend
2. Normalize Wavetrend from a range of -1 to 1 to a range of 0 to 1
3. Find high/low values of X bars back of Wavetrend,
4. Subtract high from low to find the simple range of Wavetrend
5. Calculate upper and lower boundaries
6. Calculate the HL2 of using these new boundaries
Included:
Bar coloring
Signals
Alerts
Loxx's Expanded Source Types
Jalur dan Saluran
Possible RSI [Loxx]Possible RSI is a normalized, variety second-pass normalized, Variety RSI with Dynamic Zones and optionl High-Pass IIR digital filtering of source price input. This indicator includes 7 types of RSI.
High-Pass Fitler (optional)
The Ehlers Highpass Filter is a technical analysis tool developed by John F. Ehlers. Based on aerospace analog filters, this filter aims at reducing noise from price data. Ehlers Highpass Filter eliminates wave components with periods longer than a certain value. This reduces lag and makes the oscialltor zero mean. This turns the RSI output into something more similar to Stochasitc RSI where it repsonds to price very quickly.
First Normalization Pass
RSI (Relative Strength Index) is already normalized. Hence, making a normalized RSI seems like a nonsense... if it was not for the "flattening" property of RSI. RSI tends to be flatter and flatter as we increase the calculating period--to the extent that it becomes unusable for levels trading if we increase calculating periods anywhere over the broadly recommended period 8 for RSI. In order to make that (calculating period) have less impact to significant levels usage of RSI trading style in this version a sort of a "raw stochastic" (min/max) normalization is applied.
Second-Pass Variety Normalization Pass
There are three options to choose from:
1. Gaussian (Fisher Transform), this is the default: The Fisher Transform is a function created by John F. Ehlers that converts prices into a Gaussian normal distribution. The normaliztion helps highlights when prices have moved to an extreme, based on recent prices. This may help in spotting turning points in the price of an asset. It also helps show the trend and isolate the price waves within a trend.
2. Softmax: The softmax function, also known as softargmax: or normalized exponential function, converts a vector of K real numbers into a probability distribution of K possible outcomes. It is a generalization of the logistic function to multiple dimensions, and used in multinomial logistic regression. The softmax function is often used as the last activation function of a neural network to normalize the output of a network to a probability distribution over predicted output classes, based on Luce's choice axiom.
3. Regular Normalization (devaitions about the mean): Converts a vector of K real numbers into a probability distribution of K possible outcomes without using log sigmoidal transformation as is done with Softmax. This is basically Softmax without the last step.
Dynamic Zones
As explained in "Stocks & Commodities V15:7 (306-310): Dynamic Zones by Leo Zamansky, Ph .D., and David Stendahl"
Most indicators use a fixed zone for buy and sell signals. Here’ s a concept based on zones that are responsive to past levels of the indicator.
One approach to active investing employs the use of oscillators to exploit tradable market trends. This investing style follows a very simple form of logic: Enter the market only when an oscillator has moved far above or below traditional trading lev- els. However, these oscillator- driven systems lack the ability to evolve with the market because they use fixed buy and sell zones. Traders typically use one set of buy and sell zones for a bull market and substantially different zones for a bear market. And therein lies the problem.
Once traders begin introducing their market opinions into trading equations, by changing the zones, they negate the system’s mechanical nature. The objective is to have a system automatically define its own buy and sell zones and thereby profitably trade in any market — bull or bear. Dynamic zones offer a solution to the problem of fixed buy and sell zones for any oscillator-driven system.
An indicator’s extreme levels can be quantified using statistical methods. These extreme levels are calculated for a certain period and serve as the buy and sell zones for a trading system. The repetition of this statistical process for every value of the indicator creates values that become the dynamic zones. The zones are calculated in such a way that the probability of the indicator value rising above, or falling below, the dynamic zones is equal to a given probability input set by the trader.
To better understand dynamic zones, let's first describe them mathematically and then explain their use. The dynamic zones definition:
Find V such that:
For dynamic zone buy: P{X <= V}=P1
For dynamic zone sell: P{X >= V}=P2
where P1 and P2 are the probabilities set by the trader, X is the value of the indicator for the selected period and V represents the value of the dynamic zone.
The probability input P1 and P2 can be adjusted by the trader to encompass as much or as little data as the trader would like. The smaller the probability, the fewer data values above and below the dynamic zones. This translates into a wider range between the buy and sell zones. If a 10% probability is used for P1 and P2, only those data values that make up the top 10% and bottom 10% for an indicator are used in the construction of the zones. Of the values, 80% will fall between the two extreme levels. Because dynamic zone levels are penetrated so infrequently, when this happens, traders know that the market has truly moved into overbought or oversold territory.
Calculating the Dynamic Zones
The algorithm for the dynamic zones is a series of steps. First, decide the value of the lookback period t. Next, decide the value of the probability Pbuy for buy zone and value of the probability Psell for the sell zone.
For i=1, to the last lookback period, build the distribution f(x) of the price during the lookback period i. Then find the value Vi1 such that the probability of the price less than or equal to Vi1 during the lookback period i is equal to Pbuy. Find the value Vi2 such that the probability of the price greater or equal to Vi2 during the lookback period i is equal to Psell. The sequence of Vi1 for all periods gives the buy zone. The sequence of Vi2 for all periods gives the sell zone.
In the algorithm description, we have: Build the distribution f(x) of the price during the lookback period i. The distribution here is empirical namely, how many times a given value of x appeared during the lookback period. The problem is to find such x that the probability of a price being greater or equal to x will be equal to a probability selected by the user. Probability is the area under the distribution curve. The task is to find such value of x that the area under the distribution curve to the right of x will be equal to the probability selected by the user. That x is the dynamic zone.
7 Types of RSI
See here to understand which RSI types are included:
Included:
Bar coloring
4 signal types
Alerts
Loxx's Expanded Source Types
Loxx's Variety RSI
Loxx's Dynamic Zones
Bollinger Pair TradeNYSE:MA-1.6*NYSE:V
Revision: 1
Author: @ozdemirtrading
Revision 2 Considerations :
- Simplify and clean up plotting
Disclaimer: This strategy is currently working on the 5M chart. Change the length input to accommodate your needs.
For the backtesting of more than 3 months, you may need to upgrade your membership.
Description:
The general idea of the strategy is very straightforward: it takes positions according to the lower and upper Bollinger bands.
But I am mainly using this strategy for pair trading stocks. Do not forget that you will get better results if you trade with cointegrated pairs.
Bollinger band: Moving average & standard deviation are calculated based on 20 bars on the 1H chart (approx 240 bars on a 5m chart). X-day moving averages (20 days as default) are also used in the background in some of the exit strategy choices.
You can define position entry levels as the multipliers of standard deviation (for exp: mult2 as 2 * standard deviation).
There are 4 choices for the exit strategy:
SMA: Exit when touches simple moving average (SMA)
SKP: Skip SMA and do not stop if moving towards 20D SMA, and exit if it touches the other side of the band
SKPXDSMA: Skip SMA if moving towards 20D SMA, and exit if it touches 20D SMA
NoExit: Exit if it touches the upper & lower band only.
Options:
- Strategy hard stop: if trade loss reaches a point defined as a percent of the initial capital. Stop taking new positions. (not recommended for pair trade)
- Loss per trade: close position if the loss is at a defined level but keeps watching for new positions.
- Enable expected profit for trade (expected profit is calculated as the distance to SMA) (recommended for pair trade)
- Enable VIX threshold for the following options: (recommended for volatile periods)
- Stop trading if VIX for the previous day closes above the threshold
- Reverse active trade direction if VIX for the previous day is above the threshold
- Take reverse positions (assuming the Bollinger band is going to expand) for all trades
Backtesting:
Close positions after a defined interval: mark this if you want the close the final trade for backtesting purposes. Unmark it to get live signals.
Use custom interval: Backtest specific time periods.
Other Options:
- Use EMA: use an exponential moving average for the calculations instead of simple moving average
- Not against XDSMA: do not take a position against 20D SMA (if X is selected as 20) (recommended for pairs with a clear trend)
- Not in XDSMA 1 DEV: do not take a position in 20D SMA 1*standart deviation band (recommended if you need to decrease # of trades and increase profit for trade)
- Not in XDSMA 2 DEV: do not take a position in 20D SMA 2*standart deviation band
Session management:
- Not in session: Session start and end times can be defined here. If you do not want to trade in certain time intervals, mark that session.(helps to reduce slippage and get more realistic backtest results)
HHLL Strategy This is simple Highest high and Lowest low strategy.
Buy when break HH+offset
Sell when break LL+offset
Offset = (HH-LL)/2
Moving Average ChannelThe Moving Average Channel (MAC) is a concept developed by Jake Bernstein, Speaker at Wealth365®, where the 10 period SMA of the High and the 8 period SMA of the Low are plotted to create a channel. As the channel begins expanding, the current trend is getting stronger. However, when the expansion is too large, the trend may make a pullback to the channel (upper or lower), which act as support and resistance lines. This concept is the foundation for the Expansion Contraction Indicator (XC) developed by Brian Latta, Author of “The Book on Trading”.
Roger & Satchell Estimator Historical Volatility Bands [Loxx]Roger & Satchell Estimator Historical Volatility Bands are constructed using:
Average as the middle line.
Upper and lower bands using theRoger & Satchell Estimator Historical Volatility Bands for bands calculation.
What is Roger & Satchell Estimator Historical Volatility?
The Rogers–Satchell estimator does not handle opening jumps; therefore, it underestimates the volatility. It accurately explains the volatility portion that can be attributed entirely to a trend in the price evolution. Rogers and Satchell try to embody the frequency of price observations in the model in order to overcome the drawback. They claim that the corrected estimator outperforms the uncorrected one in a study based on simulated data.
RSEHV = sqrt((Z/n) * sum((log(high/close)*log(high/open)) + (log(low/close)*log(low/open))))
The color of the middle line, unlike the bands colors, has 3 colors. When colors of the bands are the same, then the middle line has the same color, otherwise it's white.
Included
Alerts
Signals
Loxx's Expanded Source Types
Bar coloring
Garman-Klass-Yang-Zhang Historical Volatility Bands [Loxx]Garman-Klass-Yang-Zhang Historical Volatility Bands are constructed using:
Average as the middle line.
Upper and lower bands using the Garman-Klass-Yang-Zhang Historical Volatility Bands for bands calculation.
What is Garman-Klass-Yang-Zhang Historical Volatility?
Yang and Zhang derived an extension to the Garman Klass historical volatility estimator that allows for opening jumps. It assumes Brownian motion with zero drift. This is currently the preferred version of open-high-low-close volatility estimator for zero drift and has an efficiency of 8 times the classic close-to-close estimator. Note that when the drift is nonzero, but instead relative large to the volatility, this estimator will tend to overestimate the volatility. The Garman-Klass-Yang-Zhang Historical Volatility calculation is as follows:
GKYZHV = sqrt((Z/n) * sum((log(open(k)/close(k-1)))^2 + (0.5*(log(high(k)/low(k)))^2) - (2*log(2) - 1)*(log(close(k)/open(2:end)))^2))
The color of the middle line, unlike the bands colors, has 3 colors. When colors of the bands are the same, then the middle line has the same color, otherwise it's white.
Included
Alerts
Signals
Loxx's Expanded Source Types
Bar coloring
Related Indicators
Garman & Klass Estimator Historical Volatility Bands
Garman & Klass Estimator Historical Volatility Bands [Loxx]Garman & Klass Estimator Historical Volatility Bands are constructed using:
Average as the middle line.
Upper and lower bands using the Garman & Klass Estimator Historical Volatility (instead of "regular" Historical Volatility ) for bands calculation.
What is Garman & Klaus Historical Volatility?
Garman Klass is a volatility estimator that incorporates open, low, high, and close prices of a security. The Garman and Klass estimator for estimating historical volatility assumes Brownian motion with zero drift and no opening jumps (i.e. the opening = close of the previous period). This estimator is 7.4 times more efficient than the close-to-close estimator. Garman-Klass volatility extends Parkinson's volatility by taking into account the opening and closing price. As markets are most active during the opening and closing of a trading session, it makes volatility estimation more accurate. Garman and Klass also assumed that the process of price change is a process of continuous diffusion (geometric Brownian motion). However, this assumption has several drawbacks. The method is not robust for opening jumps in price and trend movements. Despite its drawbacks, the Garman-Klass estimator is still more effective than the basic formula since it takes into account not only the price at the beginning and end of the time interval but also intraday price extremums.
The Garman & Klass Estimator is as follows:
GKE = sqrt((Z/n)* sum((0.5*(log(high./low)).^2) - (2*log(2) - 1).*(log(close./open)).^2))
The color of the middle line, unlike the bands colors, has 3 colors. When colors of the bands are the same, then the middle line has the same color, otherwise it's white.
Included
Alerts
Signals
Loxx's Expanded Source Types
Bar coloring
Related indicators:
Parkinson's Historical Volatility Bands
High/Low Historical Volatility Bands [Loxx]High/Low Historical Volatility Bands are constructed using:
Average as the middle line.
Upper and lower bands using the Historical Volatility high/low (instead of "regular" Historical Volatility) for bands calculation.
What is Historical Volatility?
Historical Volatility (HV) is a statistical measure of the dispersion of returns for a given security or market index over a given period of time. Generally, this measure is calculated by determining the average deviation from the average price of a financial instrument in the given time period. Using standard deviation is the most common, but not the only, way to calculate Historical Volatility .
The higher the Historical Volatility value, the riskier the security. However, that is not necessarily a bad result as risk works both ways - bullish and bearish , i.e: Historical Volatility is not a directional indicator and should not be used as other directional indicators are used. Use to to determine the rising and falling price change volatility .
SH is stock's High price in t day.
SL is stock's Low price in t day.
High/Low Return (xt^HL) is calculated as the natural logarithm of the ratio of a stock's High price to stock's Low price.
Return:
And Parkinson's number: 1 / (4 * math.log(2)) * 252 / n * Σ (n, t =1) {math.log(Ht/Lt)^2}
An important use of the Parkinson's number is the assessment of the distribution prices during the day as well as a better understanding of the market dynamics. Comparing the Parkinson's number and periodically sampled volatility helps traders understand the tendency towards mean reversion in the market as well as the distribution of stop-losses.
The color of the middle line, unlike the bands colors, has 3 colors. When colors of the bands are the same, then the middle line has the same color, otherwise it's white.
Included
Alerts
Signals
Loxx's Expanded Source Types
Bar coloring
Related indicators:
Parkinson's Historical Volatility Bands
Historical Volatility Bands
Parkinson's Historical Volatility Bands [Loxx]Parkinson's Historical Volatility Bands are constructed using:
Average as the middle line.
Upper and lower bands using the Parkinson's historical volatility (instead of "regular" Historical Volatility) for bands calculation.
What is Parkinson's Historical Volatility?
The Parkinson's number, or High Low Range Volatility developed by the physicist, Michael Parkinson in 1980, aims to estimate the Volatility of returns for a random walk using the High and Low in any particular period. IVolatility.com calculates daily Parkinson values. Prices are observed on a fixed time interval: n = 10, 20, 30, 60, 90, 120, 150, 180 days.
SH is stock's High price in t day.
SL is stock's Low price in t day.
High/Low Return (xt^HL) is calculated as the natural logarithm of the ratio of a stock's High price to stock's Low price.
Return:
And Parkinson's number: 1 / (4 * math.log(2)) * 252 / n * Σ (n, t =1) {math.log(Ht/Lt)^2}
An important use of the Parkinson's number is the assessment of the distribution prices during the day as well as a better understanding of the market dynamics. Comparing the Parkinson's number and periodically sampled volatility helps traders understand the tendency towards mean reversion in the market as well as the distribution of stop-losses.
The color of the middle line, unlike the bands colors, has 3 colors. When colors of the bands are the same, then the middle line has the same color, otherwise it's white.
Included
Alerts
Signals
Loxx's Expanded Source Types
Bar coloring
Historical Volatility Bands [Loxx]Historical Volatility Bands are constructed using:
Average as the middle line.
Upper and lower bands using the Historical Volatility for bands calculation.
What is Historical Volatility?
Historical Volatility (HV) is a statistical measure of the dispersion of returns for a given security or market index over a given period of time. Generally, this measure is calculated by determining the average deviation from the average price of a financial instrument in the given time period. Using standard deviation is the most common, but not the only, way to calculate Historical Volatility.
The higher the Historical Volatility value, the riskier the security. However, that is not necessarily a bad result as risk works both ways - bullish and bearish, i.e: Historical Volatility is not a directional indicator and should not be used as other directional indicators are used. Use to to determine the rising and falling price change volatility.
The color of the middle line, unlike the bands colors, has 3 colors. When colors of the bands are the same, then the middle line has the same color, otherwise it's white.
Included
Alerts
Signals
Loxx's Expanded Source Types
Bar coloring
FDI-Adaptive Supertrend w/ Floating Levels [Loxx]FDI-Adaptive Supertrend w/ Floating Levels is a Fractal Dimension Index adaptive Supertrend indicator. This allows Supertrend to better adaptive to volatility of the market. This also includes floating levels that act as support and resistance, stop loss or take profit, or indication of market reversal. Additional signal types will be added in the future based on these floating levels.
What is the Fractal Dimension Index?
The goal of the fractal dimension index is to determine whether the market is trending or in a trading range. It does not measure the direction of the trend. A value less than 1.5 indicates that the price series is persistent or that the market is trending. Lower values of the FDI indicate a stronger trend. A value greater than 1.5 indicates that the market is in a trading range and is acting in a more random fashion.
What is the Supertrend?
Supertrend indicator was created by Olivier Seban to work on different time frames. It works for futures , forex, and equities. It is used in 15 minutes, hourly, weekly, and daily charts . Based on the parameters of multiplier and period, the indicator normally uses 3 for multiplier and 7 for the ATR period as default values. Average True Range is represented by the number of days while the multiplier is the value by which the range is multiplied.
Included:
Bar coloring
Alerts
Signals
Opening Range Breakout with Price TargetsJust publishing a version of the script amitgandhinz already created, which is amazing.
Added fib levels that amitgandhinz already started but commented out
Added mid point that is often found effective as a starting point, SL, etc
Digital Nivesh: Triveni SangamTriveni Sangam is the concept explained by Indian Youtuber NK Sir.
It is basically the convergence of the three indicators based on which trade can be taken , once the convergence breaksout.
For more explanation u can watch his channel.
Price ProfileThe indicator shows number of candles present in the horizontal box areas for the given time window. You can set up:
1) Start time
2) Stop time
3) Number of horizontal bars
ATR Trend Bands [Misu]█ This indicator shows an upper and lower band based on price action and ATR (Average True Range)
The average true range (ATR) is a market volatility indicator used in technical analysis.
█ Usages:
The purpose of this indicator is to identify changes in trends and price action.
It is mainly used to identify breaking points and trend reversals.
But it can also be used to show resistance or support levels.
█ Features:
> Buy & Sell Alerts
> Buy & Sell Labels
> Color Bars
> Show Bands
█ Parameters:
Length: Length is used to calculate ATR.
Atr Multiplier: A factor used to balance the impact of the ATR on the Trend Bands calculation.
Supertrend B&SSuperTrend is one of the most common ATR based trailing stop indicators.
In this version you can change the ATR calculation method from the settings. Default method is RMA, when the alternative method is SMA .
The indicator is easy to use and gives an accurate reading about an ongoing trend. It is constructed with two parameters, namely period and multiplier. The default values used while constructing a superindicator are 10 for average true range or trading period and three for its multiplier.
The average true range (ATR) plays an important role in 'Supertrend' as the indicator uses ATR to calculate its value. The ATR indicator signals the degree of price volatility .
The buy and sell signals are generated when the indicator starts plotting either on top of the closing price or below the closing price. A buy signal is generated when the ‘Supertrend’ closes above the price and a sell signal is generated when it closes below the closing price.
It also suggests that the trend is shifting from descending mode to ascending mode. Contrary to this, when a ‘Supertrend’ closes above the price, it generates a sell signal as the colour of the indicator changes into red.
A ‘Supertrend’ indicator can be used on equities, futures or forex, or even crypto markets and also on daily, weekly and hourly charts as well, but generally, it fails in a sideways-moving market.
INEVITRADE Pro +INEVITRADE Pro + is an augmented version of standard Relative Strength Index ( RSI ) enhanced with a EMA cloud and some momentum background highlights & Strength Vs. Bitcoin as an added integration.
OB EmaCross + BBThis is my setup and the way I like to trade.
It is based in an EMA cross ( 9 x 21) and the Bollinger Bands without the central Moving Average.
I prefer to use the EMA cross in the middle of the bands.
It is also possible to activate "Colored Bars" to paint the candles according to the EMA cross: green if the candles are above both EMAs, white when at least one of them are in between EMAs and red if they are both below EMAs.
My operational works like this:
- Buy when price is above EMAs
- Sell when price is belos EMAs
Of course, I use BB to give me the direction of the trend and I only enter in a trade when the price is in the same trend of the BB.
I avoid trades when the bands are getting narrowed.
I hope you enjoy my indicator and let me know if you have any suggestion! ;)
The Killer Whale - Multiple Keltner Channels by JoeFinally, after centuries of pain and suffering, the good townsfolk of TradingView have been given a single Keltner Channel indicator that will grant them FREE access to MORE THAN ONE Keltner Channel.
With "The Killer Whale" indicator, Joe has once again saved all the peasants—those who cannot add 10,000 indicators to our charts—from the dirty tyrants who arrogantly rule over us with disdain.
And, now, not only can you have more than one Keltner Channel with this single indicator, but you can have UP TO FOUR! For FREE!
Yes, I know, it seems too good to be true. But, install and enjoy your newfound freedom!
Options:
Keltner Channel length and source
Multiplication Factor for each channel
SMA or EMA
ATR Length
Border and fill colors for each channel
Now, go, therefore, and Keltner to your heart's content. May The Killer Whale be with your charts forever!
Variety N-Tuple Moving Averages w/ Variety Stepping [Loxx]Variety N-Tuple Moving Averages w/ Variety Stepping is a moving average indicator that allows you to create 1- 30 tuple moving average types; i.e., Double-MA, Triple-MA, Quadruple-MA, Quintuple-MA, ... N-tuple-MA. This version contains 2 different moving average types. For example, using "50" as the depth will give you Quinquagintuple Moving Average. If you'd like to find the name of the moving average type you create with the depth input with this indicator, you can find a list of tuples here: Tuples extrapolated
Due to the coding required to adapt a moving average to fit into this indicator, additional moving average types will be added as they are created to fit into this unique use case. Since this is a work in process, there will be many future updates of this indicator. For now, you can choose from either EMA or RMA.
This indicator is also considered one of the top 10 forex indicators. See details here: forex-station.com
Additionally, this indicator is a computationally faster, more streamlined version of the following indicators with the addition of 6 stepping functions and 6 different bands/channels types.
STD-Stepped, Variety N-Tuple Moving Averages
STD-Stepped, Variety N-Tuple Moving Averages is the standard deviation stepped/filtered indicator of the following indicator
Last but not least, a big shoutout to @lejmer for his help in formulating a looping solution for this streamlined version. this indicator is speedy even at 50 orders deep. You can find his scripts here: www.tradingview.com
How this works
Step 1: Run factorial calculation on the depth value,
Step 2: Calculate weights of nested moving averages
factorial(depth) / (factorial(depth - k) * factorial(k); where depth is the depth and k is the weight position
Examples of coefficient outputs:
6 Depth: 6 15 20 15 6
7 Depth: 7 21 35 35 21 7
8 Depth: 8 28 56 70 56 28 8
9 Depth: 9 36 34 84 126 126 84 36 9
10 Depth: 10 45 120 210 252 210 120 45 10
11 Depth: 11 55 165 330 462 462 330 165 55 11
12 Depth: 12 66 220 495 792 924 792 495 220 66 12
13 Depth: 13 78 286 715 1287 1716 1716 1287 715 286 78 13
Step 3: Apply coefficient to each moving average
For QEMA, which is 5 depth EMA , the calculation is as follows
ema1 = ta. ema ( src , length)
ema2 = ta. ema (ema1, length)
ema3 = ta. ema (ema2, length)
ema4 = ta. ema (ema3, length)
ema5 = ta. ema (ema4, length)
In this new streamlined version, these MA calculations are packed into an array inside loop so Pine doesn't have to keep all possible series information in memory. This is handled with the following code:
temp = array.get(workarr, k + 1) + alpha * (array.get(workarr, k) - array.get(workarr, k + 1))
array.set(workarr, k + 1, temp)
After we pack the array, we apply the coefficients to derive the NTMA:
qema = 5 * ema1 - 10 * ema2 + 10 * ema3 - 5 * ema4 + ema5
Stepping calculations
First off, you can filter by both price and/or MA output. Both price and MA output can be filtered/stepped in their own way. You'll see two selectors in the input settings. Default is ATR ATR. Here's how stepping works in simple terms: if the price/MA output doesn't move by X deviations, then revert to the price/MA output one bar back.
ATR
The average true range (ATR) is a technical analysis indicator, introduced by market technician J. Welles Wilder Jr. in his book New Concepts in Technical Trading Systems, that measures market volatility by decomposing the entire range of an asset price for that period.
Standard Deviation
Standard deviation is a statistic that measures the dispersion of a dataset relative to its mean and is calculated as the square root of the variance. The standard deviation is calculated as the square root of variance by determining each data point's deviation relative to the mean. If the data points are further from the mean, there is a higher deviation within the data set; thus, the more spread out the data, the higher the standard deviation.
Adaptive Deviation
By definition, the Standard Deviation (STD, also represented by the Greek letter sigma σ or the Latin letter s) is a measure that is used to quantify the amount of variation or dispersion of a set of data values. In technical analysis we usually use it to measure the level of current volatility .
Standard Deviation is based on Simple Moving Average calculation for mean value. This version of standard deviation uses the properties of EMA to calculate what can be called a new type of deviation, and since it is based on EMA , we can call it EMA deviation. And added to that, Perry Kaufman's efficiency ratio is used to make it adaptive (since all EMA type calculations are nearly perfect for adapting).
The difference when compared to standard is significant--not just because of EMA usage, but the efficiency ratio makes it a "bit more logical" in very volatile market conditions.
See how this compares to Standard Devaition here:
Adaptive Deviation
Median Absolute Deviation
The median absolute deviation is a measure of statistical dispersion. Moreover, the MAD is a robust statistic, being more resilient to outliers in a data set than the standard deviation. In the standard deviation, the distances from the mean are squared, so large deviations are weighted more heavily, and thus outliers can heavily influence it. In the MAD, the deviations of a small number of outliers are irrelevant.
Because the MAD is a more robust estimator of scale than the sample variance or standard deviation, it works better with distributions without a mean or variance, such as the Cauchy distribution.
For this indicator, I used a manual recreation of the quantile function in Pine Script. This is so users have a full inside view into how this is calculated.
Efficiency-Ratio Adaptive ATR
Average True Range (ATR) is widely used indicator in many occasions for technical analysis . It is calculated as the RMA of true range. This version adds a "twist": it uses Perry Kaufman's Efficiency Ratio to calculate adaptive true range
See how this compares to ATR here:
ER-Adaptive ATR
Mean Absolute Deviation
The mean absolute deviation (MAD) is a measure of variability that indicates the average distance between observations and their mean. MAD uses the original units of the data, which simplifies interpretation. Larger values signify that the data points spread out further from the average. Conversely, lower values correspond to data points bunching closer to it. The mean absolute deviation is also known as the mean deviation and average absolute deviation.
This definition of the mean absolute deviation sounds similar to the standard deviation (SD). While both measure variability, they have different calculations. In recent years, some proponents of MAD have suggested that it replace the SD as the primary measure because it is a simpler concept that better fits real life.
For Pine Coders, this is equivalent of using ta.dev()
Bands/Channels
See the information above for how bands/channels are calculated. After the one of the above deviations is calculated, the channels are calculated as output +/- deviation * multiplier
Signals
Green is uptrend, red is downtrend, yellow "L" signal is Long, fuchsia "S" signal is short.
Included:
Alerts
Loxx's Expanded Source Types
Bar coloring
Signals
6 bands/channels types
6 stepping types
Related indicators
3-Pole Super Smoother w/ EMA-Deviation-Corrected Stepping
STD-Stepped Fast Cosine Transform Moving Average
ATR-Stepped PDF MA