Trendmaster - Crypto Collated Open Interest OscillatorThe Crypto Collated Open Interest Oscillator collates Open Interest for Crypto Futures
Across the Crypto Exchanges and updated on the Daily Timeframe.
This is then smoothed to be actionable when massive Green structure on the oscillator
shows potentially a top before dumping and massive Red structure on the oscillator
M-oscillator
Indicator Cheat ModeThis script looks at the Stoich, the RSI and the MacD and 1 time period previous MacD to determine if bottom has been reached. Use at own discression and performs better on longer timeframes like most osscilators. Try 1 hour and 4 hour, small time frames give more false readings.
Sharpe Ratio v4I'm publishing this indicator freely, because I'd like to get it reviewed by other people. This indicator was written whilst reading the book Systematic Trading by Robert Carver. In this book Carver describes trading rules that use a "dynamic" position size based on something like an evolving Sharpe Ratio . There are only a few other Sharpe indicators on TradingView, but they are either undocumented or use closed source code. You can use the following code as you wish for your own projects.
I'd like to let other people see this work, and let me know where they think this script is wrong, so that I can improve it.
Here's a basic rundown of Sharpe Ratio and its calculation.
SR is defined as: (excess) return minus the risk free rate divided by standard deviation of those returns. (This is where we're uncertain. Is the standard deviation of the returns, or just the closes?) But anyway the calculation itself is pretty simple:
SR = (r – b) ÷ s
Where r is the return of the asset over a certain period.
b is the interest rate of the risk-free asset.
s is the standard deviation of the returns over the same period.
For this indicator to "work" correctly, we're assuming the risk-free rate is 0. In fact, I did not include b at all in the indicator because it would make things too complicated, and go beyond the aim of this work.
To calculate the returns over a certain period, I'm using Rate of Change. Then calculating the standard deviation of those returns is pretty easy because we can use the same lookback period we used for ROC for the StDev calculation, thus:
averageReturn = ta.roc(close, lookbackLength)
stdev = ta.stdev(averageReturn, lookbackLength)
sharpe = (averageReturn / stdev)
Please leave a comment below if you believe this is incorrect. The chart shows a normal ROC indicator for comparison. I've also created a "bands" version of this indicator, which I'm planning to also release. The Keltner channel is just for comparing it with the StDev bands.
Tickers Info ExtensionWith the indicator you can easily evaluate or compare any ticker with the one you choose in the options.
You can choose any of the tickers I provide in the mod options to your liking :
XAU
DXY
BTC
ETH
SPX
NASDAQ
AVG Stable Dominance
AVG Stock Price
Custom
You can also select or create your own ticker if you select the Custom in Mode option.
If the Compare mode is enabled, then the current ticker you are viewing is divided by the ticker selected in the indicator (in the Mode option).
Thus, you create a new pair and can evaluate the strength of this or that asset.
For example, if you have the ticker BTCUSDT open. And the ticker XAU is selected in the Mode option in the indicator. And the Compare mode is also enabled. Then you will get a new BTCUSDT/XAU pair. That means that now you can see the bitcoin/gold ratio. (Same as EUR/USD etc.)
If the Compare option is switched off then you will see the usual ticker you choose in the Mode option. You can also see if there is a correlation between the selected pairs.
Option ' AVG STABLE.D ' = Calculated as: USDT.D + USDC.D + DAI.D
- This is the average domination of the most important Stable Coins
Option ' AVG STOCK Price ' = Calculated as: (DJI + SPX + NDQ) / 3
- This is the average price of the most important Indexes.
Price change scalping short and long strategy indicatorPrice change scalping Short and Long indicator uses a rate of change momentum oscillator to calculate the percent change in price between a period of time. Rate of change calculation takes the current price and compares it to a price of "n" periods while the period of time can be defined by a user. The calculated rate of change value is then compared to the upper threshold and the lower threshold values to determine if a position should be opened. If the threshold is crossed and filtering conditions are met a strategy position will be triggered. Entry, take profit, and stop loss prices are calculated and displayed on the chart as well as positions directions. Once the entry price is crossed, a long or short position is created and once the take profit price is crossed, the stop loss price will begin to trail behind the price action using the close of the previous bar. Once the trailing stop price is crossed, the position is closed. If the entry price is not crossed and the price action crosses the stop level, the trade setup is cancelled. The indicator is enhanced by DCA algorithm which allows to average entry price with safety orders. The script also allows to use Martingale coefficient to increase averaging power
Advantages of this script:
The indicator has custom alert settings for each strategy action
The indicator can be used with 3Commas, Cryptohopper, Alertatron or Zignaly bots
High frequency and low duration of trades
Can be used with short-term timeframes ranging from 5 to 60 minutes
Indicator is sustainable to market slumps due to DCA implementation
Can be used for short and long positions (can be adjusted to long only, short only or both)
Can be applied to any market and quote currency
Easy to configure user interface settings
Built in detailed statistic menu
How to use?
1. Apply the indicator to a trading pair your are interested in using 5 to 60 minutes timeframe chart
2. Configure the indicator: change layer values, order size multiple and take profit/stop loss values according to current market cycle stage
3. Set up a TradingView custom alert using the indicator settings to trigger on a condition you are interested in
4. indicator will send alerts when to enter and when to exit positions which can be applied to your portfolio using external trading platforms
5. Update settings once market conditions are changed using backtests on a monthly period
Smooth OscillatorThis is a an Oscillator based on RSI .
As you can see, entry signal for long is when the indicator and bar color is green and exit when red.
Entry signal for short is when the bar turns red and exit when green.
You should always trade with the trend, this oscillator helps to know where the trend is going, because as the trend is exhausting the plot waves moves to the oversold or overbought area, which can help to know when a reversal is coming.
This is a test version, use under your own discretion and do the proper backtesting.
Please comment your experience.
HPK Crash IndicatorFrom Hari P. Krishnan's book, The Second Leg Down: Strategies for Profiting after a Market Sell-Off :
"We start by specifying the year on year (YoY) change in the index. Next, we calculate the 5 year trailing Z score of the YoY returns. We also calculate the 5 year trailing Z score of 1 month historical volatility for the index, using daily returns. Our crisis warning indicator flashes if both Z scores are above 2. In other words, recent price increases and current volatility need to be at least 2 standard deviations above normal.
It can be seen that this basic implementation is reasonably effective, accepting that the effective sample set is small. A false signal is given in mid-2006, but the signal is quickly washed away. The remaining signals occur fairly close to the point of collapse. The idea that elevated volatility is predictive of danger is not new and underpins many asset allocation schemes. However, Sornette deserves credit for moving away from a largely valuation-based approach to predicting crises to one that relies upon price action itself."
Mansfield Relative Strength (Original Version) by stageanalysisThe Mansfield Relative Strength ( Mansfield RS ) is one of the core components of the Stan Weinstein's Stage Analysis method as discussed in his classic book Stan Weinstein's Secrets for Profiting in Bull and Bear Markets .
The Mansfield RS measures the relative performance of the stock compared to an index such as the S&P 500, or to another stock etc.
However, this should not to be confused with the popular RSI (Relative Strength Index developed J. Welles Wilder), which is a momentum oscillator that measures the speed and change of price movements on a single stock.
The Mansfield RS indicator consists of the Relative Strength comparison line versus the S&P 500 (default universal setting, but can be edited), and the "Zero Line" – which is the 52 week MA of the Relative Strength line, that's been flattened to create the oscillator style.
How to use the Indicator:
Outperforming – Above the Zero Line
When the Relative Strength line crosses above the Zero Line (it's flattened 52 week RS MA), it is outperforming the index or stock that it's comparing against, and so it is showing stronger relative strength.
Underperforming – Below the Zero Line
When the Relative Strength line crosses below the Zero Line (it's flattened 52 week RS MA), it is underperforming the index or stock that it's comparing against, and so it is showing weaker relative strength.
Settings:
When you first add the indicator is has a coloured background, with a green tint for a postive RS score, and a red tint for a negative RS score. However, this can be turned off, or edited in the indicator settings, in the Style tab. So you can change the colors or remove it and just have the RS line and zero line showing. Both of which can also be edited in the settings.
Change the symbol that it compares against. The default is the S&P 500. But for crypto you might want to use Bitcoin for example. Or you might want to compare against competing stocks in the same peer group, or against the industry group or sector. The choice is yours. But the S&P 500 is a universal measure for the Mansfield RS. So I would recommend leaving it on that unless you have a particular reason to change it as mentioned.
MA Length is also an editable setting. This creates the Zero Line. So it will affect the values of the Mansfield RS if you change it. 52 is the default setting, and is set as such for the weekly chart. So I'd recommend not editing it on the weekly chart, but for other timeframes, different settings can be used.
ETS Price Deviation Reversal AreasThis indicator tracks the degree to which price moves away from an average and triggers potential direction changes based on standard deviation levels.
The reason I created this script is because I wanted to see how far price moved away from the moving average in a more clearly defined way than just saying "wow, price is pretty far away from the 9 EMA..." or whichever moving average you were looking at.
Typically when price moves "too far" away from the moving averages, it corrects itself, I think mainly because a lot of people say "wow, price is pretty far away from the 9 EMA..." and then enter a trade. This indicator tries to make it easier to see when that switches around, which could indicate that price will be reversing.
Of course the indicator is not a silver bullet, but I have found it pretty useful and I hope that you do too!
It also tries to avoid giving signals when prices are in a very small range. When the deviation bars contract, the indicator switches to only signal "breakout" type moves to try and limit whipsaw signals.
The smaller dots are spots that could indicate a potentially early reversal, and the larger dots show up a bit later when the reversal is a bit more established. There are also alerts that you can use if you want.
Change this code as you want to, but please let the community know and send me a message if you found something to share! Thanks!
Multi-timeframe Squeeze Mom + ADX and DIsMulti-timeframe Squeeze and ADX
This indicator is designed to be able to get used in combination with others that can lead to a potential help for trading.
The indicator uses colors such us light green, dark green, light red and dark red. Light green and light red to indicate the second half and strongest movement of an upwards and downwards movement, respectively. The same for the first half of an upwards or downwards movement, dark red for the possible start of the upwards movement and dark green ad possible start of the downwards movement.
The indicator is multi-timeframe because the trader can configure within the menu a background timeframe, which plots a squeeze momentum for a different timeframe than the one selected for the main graph. It plots the background timeframe with an area style, while the main squeeze is plotted with a column style. This helps the traders to analyze whether entering a position countering a higher timeframe upwards or downwards squeeze momentum.
It also shows the divergences that occur between the price and the squeeze momentum that can add strength to a potential movement upwards or downwards.
The ADX, DI+ and DI- lines are also added to determine the potential strength of the movement in the monitor (squeeze momentum). If the DI+ is over the DI-, then the strength is likely higher upwards and the opposite for the downwards strength.
Fundamentals
Squeeze momentum: It shows the periods when volatility increases or decreases, in other words, when the market goes from the trend into flat movement and vice versa.
ADX (Average Directional Index): The ADX helps the indicator to estimate the strength of the movement, always considering the DI+ and DI- to not go against the trend strength.
Positive (DI+) and Negative DI (DI-): Both DI+ and DI- measure up and down price movement, in some cases crossovers of these lines can be used as trade signals.
Divergences: Divergence occur when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator (squeeze momentum). Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
Panel
This panel allows the trader to have a summary of the values of the direction and strength of the movement. It has the following characteristics:
It is placed on the right middle side of the chart indicator by the default.
Its colors changes according to the indicator’s values.
The summary box shows the projection for the main squeeze plot and also for the background squeeze plot. If only one is needed, it can be changed on the menu of the indicator.
Summary
From all previously mentioned, it can be stated that the indicator allows users to:
Detect the direction of trends
Detect price and squeeze divergences
Get a table summarizing important values of the indicator to determine the strength of a trend.
[blackcat] L1 Leavitt Convolution SlopeLevel 1
Background
First of all, I would like to thank @ashok1961 for his donation. Second, he made an interesting request: can I write a pine version of LeavittConvSlope.
Function
The indicator uses linear regression of price data to derive slope and acceleration information that helps traders spot trends and turning points. After trying this metric myself, I think it works better with the divergence detector. So I added it. Let me know what you think of this divergence detector.
Remarks
Feedbacks are appreciated.
+ Dynamic Fibo-Donchian ChannelsThis is my second Donchian Channels indicator (and will probably be my last because how many does one really need). This version is different from my other one in that, well, it's 'dynamic' which simply means that it self adjusts based on the same formula that my Ultimate Moving Average does. What does that mean? It just means that the script takes an average of 8 different length, in this case, highest highs and lowest lows. The user doesn't need to pick a lookback/length/period/what-have-you. The indicator does it all itself. This, I think, makes for a very nice baseline or bias indicator to fit within a system that utilizes something like that. I also think it makes for a more accurate gauge of higher highs and lower lows within a timeframe, because honestly what does it mean to make a lower low over 20 periods or 8 periods or 50 periods? I don't know. What I do know is that traditional Donchian Channels never made much sense to me, but this does.
Additionally, I've kept (I guess that's not 'additionally') the fibonacci retracement levels from my other Donchian Channels indicator. These are calculated off the high and the low of the Donchian Channels themselves. You will see that there are only three retracement levels (.786, .705, .382), one of which is not a fib level, but what some people call the 'OTE,' or 'optimal trade entry.'' If you want more info on the OTE just web search it. So, why no .618 or .236? Reason being that the .618 overlaps the .382, and the .236 is extremely close to the .786. This sounds confusing, but the retracement levels I'm using are derived from the high and low, so it was unnecessary to have all five levels from each. I could have just calculated from the high, or just from the low, and used all the levels, but I chose to just calculate three levels from the high and three from the low because that gives a sort of mirror image balance, and that appeals to me, and the utility of the indicator is the same.
The plot lines are all colored, and I've filled certain zones between them. There is a center zone filled between both .382 levels, an upper and lower zon filled between the .786 and either the high or the low, and a zone between the .705 and .785
If you like the colored zones, but don't like the plots because they cause screen compression, turn off the plots under the "style" tab, or much more simply right click on the price scale and click 'scale price chart only.' Voila! No more screen compression due to a moving average or some other annoyance.
Besides that basis being a nice baseline indicator the various fib bands (or just the high and low bands) make for excellent mean reversion extremes in ranging environments.
There are alerts for candle closes across every line.
Below is an image of the indicator at default settings.
Below is an image of the indicator with the center .382 channel turned off.
Below is an image of the indicator with just the .786/.705 channel showing .
Stochastic GuppyDerived from TradingView's built-in Stochastic indicator. Switched from SMA to EMA and applied Guppy (GMMA) indicator short and long term periods.
RSI mid partition color changeWhen RSI is above 50 our default bias is on buy side and when below 50 our bias is on sell side.
Therefore created 2 zones for easy identification.
Kase Peak Oscillator w/ Divergences [Loxx]Kase Peak Oscillator is unique among first derivative or "rate-of-change" indicators in that it statistically evaluates over fifty trend lengths and automatically adapts to both cycle length and volatility. In addition, it replaces the crude linear mathematics of old with logarithmic and exponential models that better reflect the true nature of the market. Kase Peak Oscillator is unique in that it can be applied across multiple time frames and different commodities.
As a hybrid indicator, the Peak Oscillator also generates a trend signal via the crossing of the histogram through the zero line. In addition, the red/green histogram line indicates when the oscillator has reached an extreme condition. When the oscillator reaches this peak and then turns, it means that most of the time the market will turn either at the present extreme, or (more likely) at the following extreme.
This is both a reversal and breakout/breakdown indicator. Crosses above/below zero line can be used for breakouts/breakdowns, while the thick green/red bars can be used to detect reversals
The indicator consists of three indicators:
The PeakOscillator itself is rendered as a gray histogram.
Max is a red/green solid line within the histogram signifying a market extreme.
Yellow line is max peak value of two (by default, you can change this with the deviations input settings) standard deviations of the Peak Oscillator value
White line is the min peak value of two (by default, you can change this with the deviations input settings) standard deviations of the PeakOscillator value
The PeakOscillator is used two ways:
Divergence: Kase Peak Oscillator may be used to generate traditional divergence signals. The difference between it and traditional divergence indicators lies in its accuracy.
PeakOut: The second use is to look for a Peak Out. A Peak Out occurs when the histogram breaks beyond the PeakOut line and then pulls back. A Peak Out through the maximum line will be displayed magenta. A Peak Out, which only extends through the Peak Min line is called a local Peak Out, and is less significant than a normal Peak Out signal. These local Peak Outs are to be relied upon more heavily during sideways or corrective markets. Peak Outs may be based on either the maximum line or the minimum line. Maximum Peak Outs, however, are rarer and thus more significant than minimum Peak Outs. The magnitude of the price move may be greater following the maximum Peak Out, but the likelihood of the break in trend is essentially the same. Thus, our research indicates that we should react equally to a Peak Out in a trendy market and a Peak Min in a choppy or corrective market.
Included:
Bar coloring
Alerts
HMA Slope Variation [Loxx]HMA Slope Variation is an indicator that uses HMA moving average to calculate a slope that is then weighted to derive a signal.
The center line
The center line changes color depending on the value of the:
Slope
Signal line
Threshold
If the value is above a signal line (it is not visible on the chart) and the threshold is greater than the required, then the main trend becomes up. And reversed for the trend down.
Colors and style of the histogram
The colors and style of the histogram will be drawn if the value is at the right side, if the above described trend "agrees" with the value (above is green or below zero is red) and if the High is higher than the previous High or Low is lower than the previous low, then the according type of histogram is drawn.
What is the Hull Moving Average?
The Hull Moving Average ( HMA ) attempts to minimize the lag of a traditional moving average while retaining the smoothness of the moving average line. Developed by Alan Hull in 2005, this indicator makes use of weighted moving averages to prioritize more recent values and greatly reduce lag.
Included
Alets
Signals
Bar coloring
Loxx's Expanded Source Types
T3 Slope Variation [Loxx]T3 Slope Variation is an indicator that uses T3 moving average to calculate a slope that is then weighted to derive a signal.
The center line
The center line changes color depending on the value of the:
Slope
Signal line
Threshold
If the value is above a signal line (it is not visible on the chart) and the threshold is greater than the required, then the main trend becomes up. And reversed for the trend down.
Colors and style of the histogram
The colors and style of the histogram will be drawn if the value is at the right side, if the above described trend "agrees" with the value (above is green or below zero is red) and if the High is higher than the previous High or Low is lower than the previous low, then the according type of histogram is drawn.
What is the T3 moving average?
Better Moving Averages Tim Tillson
November 1, 1998
Tim Tillson is a software project manager at Hewlett-Packard, with degrees in Mathematics and Computer Science. He has privately traded options and equities for 15 years.
Introduction
"Digital filtering includes the process of smoothing, predicting, differentiating, integrating, separation of signals, and removal of noise from a signal. Thus many people who do such things are actually using digital filters without realizing that they are; being unacquainted with the theory, they neither understand what they have done nor the possibilities of what they might have done."
This quote from R. W. Hamming applies to the vast majority of indicators in technical analysis . Moving averages, be they simple, weighted, or exponential, are lowpass filters; low frequency components in the signal pass through with little attenuation, while high frequencies are severely reduced.
"Oscillator" type indicators (such as MACD , Momentum, Relative Strength Index ) are another type of digital filter called a differentiator.
Tushar Chande has observed that many popular oscillators are highly correlated, which is sensible because they are trying to measure the rate of change of the underlying time series, i.e., are trying to be the first and second derivatives we all learned about in Calculus.
We use moving averages (lowpass filters) in technical analysis to remove the random noise from a time series, to discern the underlying trend or to determine prices at which we will take action. A perfect moving average would have two attributes:
It would be smooth, not sensitive to random noise in the underlying time series. Another way of saying this is that its derivative would not spuriously alternate between positive and negative values.
It would not lag behind the time series it is computed from. Lag, of course, produces late buy or sell signals that kill profits.
The only way one can compute a perfect moving average is to have knowledge of the future, and if we had that, we would buy one lottery ticket a week rather than trade!
Having said this, we can still improve on the conventional simple, weighted, or exponential moving averages. Here's how:
Two Interesting Moving Averages
We will examine two benchmark moving averages based on Linear Regression analysis.
In both cases, a Linear Regression line of length n is fitted to price data.
I call the first moving average ILRS, which stands for Integral of Linear Regression Slope. One simply integrates the slope of a linear regression line as it is successively fitted in a moving window of length n across the data, with the constant of integration being a simple moving average of the first n points. Put another way, the derivative of ILRS is the linear regression slope. Note that ILRS is not the same as a SMA ( simple moving average ) of length n, which is actually the midpoint of the linear regression line as it moves across the data.
We can measure the lag of moving averages with respect to a linear trend by computing how they behave when the input is a line with unit slope. Both SMA (n) and ILRS(n) have lag of n/2, but ILRS is much smoother than SMA .
Our second benchmark moving average is well known, called EPMA or End Point Moving Average. It is the endpoint of the linear regression line of length n as it is fitted across the data. EPMA hugs the data more closely than a simple or exponential moving average of the same length. The price we pay for this is that it is much noisier (less smooth) than ILRS, and it also has the annoying property that it overshoots the data when linear trends are present.
However, EPMA has a lag of 0 with respect to linear input! This makes sense because a linear regression line will fit linear input perfectly, and the endpoint of the LR line will be on the input line.
These two moving averages frame the tradeoffs that we are facing. On one extreme we have ILRS, which is very smooth and has considerable phase lag. EPMA has 0 phase lag, but is too noisy and overshoots. We would like to construct a better moving average which is as smooth as ILRS, but runs closer to where EPMA lies, without the overshoot.
A easy way to attempt this is to split the difference, i.e. use (ILRS(n)+EPMA(n))/2. This will give us a moving average (call it IE /2) which runs in between the two, has phase lag of n/4 but still inherits considerable noise from EPMA. IE /2 is inspirational, however. Can we build something that is comparable, but smoother? Figure 1 shows ILRS, EPMA, and IE /2.
Filter Techniques
Any thoughtful student of filter theory (or resolute experimenter) will have noticed that you can improve the smoothness of a filter by running it through itself multiple times, at the cost of increasing phase lag.
There is a complementary technique (called twicing by J.W. Tukey) which can be used to improve phase lag. If L stands for the operation of running data through a low pass filter, then twicing can be described by:
L' = L(time series) + L(time series - L(time series))
That is, we add a moving average of the difference between the input and the moving average to the moving average. This is algebraically equivalent to:
2L-L(L)
This is the Double Exponential Moving Average or DEMA , popularized by Patrick Mulloy in TASAC (January/February 1994).
In our taxonomy, DEMA has some phase lag (although it exponentially approaches 0) and is somewhat noisy, comparable to IE /2 indicator.
We will use these two techniques to construct our better moving average, after we explore the first one a little more closely.
Fixing Overshoot
An n-day EMA has smoothing constant alpha=2/(n+1) and a lag of (n-1)/2.
Thus EMA (3) has lag 1, and EMA (11) has lag 5. Figure 2 shows that, if I am willing to incur 5 days of lag, I get a smoother moving average if I run EMA (3) through itself 5 times than if I just take EMA (11) once.
This suggests that if EPMA and DEMA have 0 or low lag, why not run fast versions (eg DEMA (3)) through themselves many times to achieve a smooth result? The problem is that multiple runs though these filters increase their tendency to overshoot the data, giving an unusable result. This is because the amplitude response of DEMA and EPMA is greater than 1 at certain frequencies, giving a gain of much greater than 1 at these frequencies when run though themselves multiple times. Figure 3 shows DEMA (7) and EPMA(7) run through themselves 3 times. DEMA^3 has serious overshoot, and EPMA^3 is terrible.
The solution to the overshoot problem is to recall what we are doing with twicing:
DEMA (n) = EMA (n) + EMA (time series - EMA (n))
The second term is adding, in effect, a smooth version of the derivative to the EMA to achieve DEMA . The derivative term determines how hot the moving average's response to linear trends will be. We need to simply turn down the volume to achieve our basic building block:
EMA (n) + EMA (time series - EMA (n))*.7;
This is algebraically the same as:
EMA (n)*1.7-EMA( EMA (n))*.7;
I have chosen .7 as my volume factor, but the general formula (which I call "Generalized Dema") is:
GD (n,v) = EMA (n)*(1+v)-EMA( EMA (n))*v,
Where v ranges between 0 and 1. When v=0, GD is just an EMA , and when v=1, GD is DEMA . In between, GD is a cooler DEMA . By using a value for v less than 1 (I like .7), we cure the multiple DEMA overshoot problem, at the cost of accepting some additional phase delay. Now we can run GD through itself multiple times to define a new, smoother moving average T3 that does not overshoot the data:
T3(n) = GD ( GD ( GD (n)))
In filter theory parlance, T3 is a six-pole non-linear Kalman filter. Kalman filters are ones which use the error (in this case (time series - EMA (n)) to correct themselves. In Technical Analysis , these are called Adaptive Moving Averages; they track the time series more aggressively when it is making large moves.
Included
Alets
Signals
Bar coloring
Loxx's Expanded Source Types
Multi HMA Slopes [Loxx]Multi HMA Slopes is an indicator that checks slopes of 5 (different period) Hull Moving Averages and adds them up to show overall trend. To us this, check for color changes from red to green where there is no red if green is larger than red and there is no red when red is larger than green. When red and green both show up, its a sign of chop.
What is the Hull Moving Average?
The Hull Moving Average (HMA) attempts to minimize the lag of a traditional moving average while retaining the smoothness of the moving average line. Developed by Alan Hull in 2005, this indicator makes use of weighted moving averages to prioritize more recent values and greatly reduce lag.
Included
Signals: long, short, continuation long, continuation short.
Alerts
Bar coloring
Loxx's expanded source types
Multi T3 Slopes [Loxx]Multi T3 Slopes is an indicator that checks slopes of 5 (different period) T3 Moving Averages and adds them up to show overall trend. To us this, check for color changes from red to green where there is no red if green is larger than red and there is no red when red is larger than green. When red and green both show up, its a sign of chop.
What is the T3 moving average?
Better Moving Averages Tim Tillson
November 1, 1998
Tim Tillson is a software project manager at Hewlett-Packard, with degrees in Mathematics and Computer Science. He has privately traded options and equities for 15 years.
Introduction
"Digital filtering includes the process of smoothing, predicting, differentiating, integrating, separation of signals, and removal of noise from a signal. Thus many people who do such things are actually using digital filters without realizing that they are; being unacquainted with the theory, they neither understand what they have done nor the possibilities of what they might have done."
This quote from R. W. Hamming applies to the vast majority of indicators in technical analysis . Moving averages, be they simple, weighted, or exponential, are lowpass filters; low frequency components in the signal pass through with little attenuation, while high frequencies are severely reduced.
"Oscillator" type indicators (such as MACD , Momentum, Relative Strength Index ) are another type of digital filter called a differentiator.
Tushar Chande has observed that many popular oscillators are highly correlated, which is sensible because they are trying to measure the rate of change of the underlying time series, i.e., are trying to be the first and second derivatives we all learned about in Calculus.
We use moving averages (lowpass filters) in technical analysis to remove the random noise from a time series, to discern the underlying trend or to determine prices at which we will take action. A perfect moving average would have two attributes:
It would be smooth, not sensitive to random noise in the underlying time series. Another way of saying this is that its derivative would not spuriously alternate between positive and negative values.
It would not lag behind the time series it is computed from. Lag, of course, produces late buy or sell signals that kill profits.
The only way one can compute a perfect moving average is to have knowledge of the future, and if we had that, we would buy one lottery ticket a week rather than trade!
Having said this, we can still improve on the conventional simple, weighted, or exponential moving averages. Here's how:
Two Interesting Moving Averages
We will examine two benchmark moving averages based on Linear Regression analysis.
In both cases, a Linear Regression line of length n is fitted to price data.
I call the first moving average ILRS, which stands for Integral of Linear Regression Slope. One simply integrates the slope of a linear regression line as it is successively fitted in a moving window of length n across the data, with the constant of integration being a simple moving average of the first n points. Put another way, the derivative of ILRS is the linear regression slope. Note that ILRS is not the same as a SMA ( simple moving average ) of length n, which is actually the midpoint of the linear regression line as it moves across the data.
We can measure the lag of moving averages with respect to a linear trend by computing how they behave when the input is a line with unit slope. Both SMA (n) and ILRS(n) have lag of n/2, but ILRS is much smoother than SMA .
Our second benchmark moving average is well known, called EPMA or End Point Moving Average. It is the endpoint of the linear regression line of length n as it is fitted across the data. EPMA hugs the data more closely than a simple or exponential moving average of the same length. The price we pay for this is that it is much noisier (less smooth) than ILRS, and it also has the annoying property that it overshoots the data when linear trends are present.
However, EPMA has a lag of 0 with respect to linear input! This makes sense because a linear regression line will fit linear input perfectly, and the endpoint of the LR line will be on the input line.
These two moving averages frame the tradeoffs that we are facing. On one extreme we have ILRS, which is very smooth and has considerable phase lag. EPMA has 0 phase lag, but is too noisy and overshoots. We would like to construct a better moving average which is as smooth as ILRS, but runs closer to where EPMA lies, without the overshoot.
A easy way to attempt this is to split the difference, i.e. use (ILRS(n)+EPMA(n))/2. This will give us a moving average (call it IE /2) which runs in between the two, has phase lag of n/4 but still inherits considerable noise from EPMA. IE /2 is inspirational, however. Can we build something that is comparable, but smoother? Figure 1 shows ILRS, EPMA, and IE /2.
Filter Techniques
Any thoughtful student of filter theory (or resolute experimenter) will have noticed that you can improve the smoothness of a filter by running it through itself multiple times, at the cost of increasing phase lag.
There is a complementary technique (called twicing by J.W. Tukey) which can be used to improve phase lag. If L stands for the operation of running data through a low pass filter, then twicing can be described by:
L' = L(time series) + L(time series - L(time series))
That is, we add a moving average of the difference between the input and the moving average to the moving average. This is algebraically equivalent to:
2L-L(L)
This is the Double Exponential Moving Average or DEMA , popularized by Patrick Mulloy in TASAC (January/February 1994).
In our taxonomy, DEMA has some phase lag (although it exponentially approaches 0) and is somewhat noisy, comparable to IE /2 indicator.
We will use these two techniques to construct our better moving average, after we explore the first one a little more closely.
Fixing Overshoot
An n-day EMA has smoothing constant alpha=2/(n+1) and a lag of (n-1)/2.
Thus EMA (3) has lag 1, and EMA (11) has lag 5. Figure 2 shows that, if I am willing to incur 5 days of lag, I get a smoother moving average if I run EMA (3) through itself 5 times than if I just take EMA (11) once.
This suggests that if EPMA and DEMA have 0 or low lag, why not run fast versions (eg DEMA (3)) through themselves many times to achieve a smooth result? The problem is that multiple runs though these filters increase their tendency to overshoot the data, giving an unusable result. This is because the amplitude response of DEMA and EPMA is greater than 1 at certain frequencies, giving a gain of much greater than 1 at these frequencies when run though themselves multiple times. Figure 3 shows DEMA (7) and EPMA(7) run through themselves 3 times. DEMA^3 has serious overshoot, and EPMA^3 is terrible.
The solution to the overshoot problem is to recall what we are doing with twicing:
DEMA (n) = EMA (n) + EMA (time series - EMA (n))
The second term is adding, in effect, a smooth version of the derivative to the EMA to achieve DEMA . The derivative term determines how hot the moving average's response to linear trends will be. We need to simply turn down the volume to achieve our basic building block:
EMA (n) + EMA (time series - EMA (n))*.7;
This is algebraically the same as:
EMA (n)*1.7-EMA( EMA (n))*.7;
I have chosen .7 as my volume factor, but the general formula (which I call "Generalized Dema") is:
GD (n,v) = EMA (n)*(1+v)-EMA( EMA (n))*v,
Where v ranges between 0 and 1. When v=0, GD is just an EMA , and when v=1, GD is DEMA . In between, GD is a cooler DEMA . By using a value for v less than 1 (I like .7), we cure the multiple DEMA overshoot problem, at the cost of accepting some additional phase delay. Now we can run GD through itself multiple times to define a new, smoother moving average T3 that does not overshoot the data:
T3(n) = GD ( GD ( GD (n)))
In filter theory parlance, T3 is a six-pole non-linear Kalman filter. Kalman filters are ones which use the error (in this case (time series - EMA (n)) to correct themselves. In Technical Analysis , these are called Adaptive Moving Averages; they track the time series more aggressively when it is making large moves.
Included
Signals: long, short, continuation long, continuation short.
Alerts
Bar coloring
Loxx's expanded source types
Cumulative Delta Volume RSI-8 CandlesThis script combines Cumulative delta volume information and the RSI set to an 8 period look back to show momentum in the market. It is displayed using a color overlay with 3 colors. Green candles indicate positive market momentum along with positive delta and positive price movement. Red candles indicate negative market momentum along with negative delta and negative price movement. Yellow candles indicate possible ranging conditions or the start of a pullback in either direction. There is also a moving average built into the indicator to help with trend direction.
Combined with price action strategies or even simple moving averages this indicator can be used as a powerful confirmation or confluence in any trading system. Works nicely to confirm breakout strategies as well.
Can be used on any market or time frame though for price action strategies it works best on time frames H1 and under.
Zero-line Volatility Quality Index (VQI) [Loxx]Originally volatility quality was invented by Thomas Stridsman, and he uses it in combination of two averages.
This version:
This doesn't use averages for trend estimation, but instead uses the slope of the Volatility quality. In order to lessen the number of signals (which can be enormous if the VQ is not filtered), some versions similar to this are using pips filters. This version is using % ATR (Average True Range) instead. The reason for that is that :
Using fixed pips value as a filter will work on one symbol and will not work on another
Changing time frames will render the filter worthless since the ranges of higher time frames are much greater than those at lower time frames, and, when you set your filter on one time frame and then try it on another, it is almost certain that it will have to be adjusted again
Additionally, this version is made to oscillate around zero line (which makes the potential levels, which are even in the original Stridsman's version doubtful, unnecessary)
Usage:
You can use the color change as signals when using this indicator
T3 PPO [Loxx]T3 PPO is a percentage price oscillator indicator using T3 moving average. This indicator is used to spot reversals. Dark red is upward price exhaustion, dark green is downward price exhaustion.
What is Percentage Price Oscillator (PPO)?
The percentage price oscillator (PPO) is a technical momentum indicator that shows the relationship between two moving averages in percentage terms. The moving averages are a 26-period and 12-period exponential moving average (EMA).
The PPO is used to compare asset performance and volatility, spot divergence that could lead to price reversals, generate trade signals, and help confirm trend direction.
What is the T3 moving average?
Better Moving Averages Tim Tillson
November 1, 1998
Tim Tillson is a software project manager at Hewlett-Packard, with degrees in Mathematics and Computer Science. He has privately traded options and equities for 15 years.
Introduction
"Digital filtering includes the process of smoothing, predicting, differentiating, integrating, separation of signals, and removal of noise from a signal. Thus many people who do such things are actually using digital filters without realizing that they are; being unacquainted with the theory, they neither understand what they have done nor the possibilities of what they might have done."
This quote from R. W. Hamming applies to the vast majority of indicators in technical analysis . Moving averages, be they simple, weighted, or exponential, are lowpass filters; low frequency components in the signal pass through with little attenuation, while high frequencies are severely reduced.
"Oscillator" type indicators (such as MACD , Momentum, Relative Strength Index ) are another type of digital filter called a differentiator.
Tushar Chande has observed that many popular oscillators are highly correlated, which is sensible because they are trying to measure the rate of change of the underlying time series, i.e., are trying to be the first and second derivatives we all learned about in Calculus.
We use moving averages (lowpass filters) in technical analysis to remove the random noise from a time series, to discern the underlying trend or to determine prices at which we will take action. A perfect moving average would have two attributes:
It would be smooth, not sensitive to random noise in the underlying time series. Another way of saying this is that its derivative would not spuriously alternate between positive and negative values.
It would not lag behind the time series it is computed from. Lag, of course, produces late buy or sell signals that kill profits.
The only way one can compute a perfect moving average is to have knowledge of the future, and if we had that, we would buy one lottery ticket a week rather than trade!
Having said this, we can still improve on the conventional simple, weighted, or exponential moving averages. Here's how:
Two Interesting Moving Averages
We will examine two benchmark moving averages based on Linear Regression analysis.
In both cases, a Linear Regression line of length n is fitted to price data.
I call the first moving average ILRS, which stands for Integral of Linear Regression Slope. One simply integrates the slope of a linear regression line as it is successively fitted in a moving window of length n across the data, with the constant of integration being a simple moving average of the first n points. Put another way, the derivative of ILRS is the linear regression slope. Note that ILRS is not the same as a SMA ( simple moving average ) of length n, which is actually the midpoint of the linear regression line as it moves across the data.
We can measure the lag of moving averages with respect to a linear trend by computing how they behave when the input is a line with unit slope. Both SMA (n) and ILRS(n) have lag of n/2, but ILRS is much smoother than SMA .
Our second benchmark moving average is well known, called EPMA or End Point Moving Average. It is the endpoint of the linear regression line of length n as it is fitted across the data. EPMA hugs the data more closely than a simple or exponential moving average of the same length. The price we pay for this is that it is much noisier (less smooth) than ILRS, and it also has the annoying property that it overshoots the data when linear trends are present.
However, EPMA has a lag of 0 with respect to linear input! This makes sense because a linear regression line will fit linear input perfectly, and the endpoint of the LR line will be on the input line.
These two moving averages frame the tradeoffs that we are facing. On one extreme we have ILRS, which is very smooth and has considerable phase lag. EPMA has 0 phase lag, but is too noisy and overshoots. We would like to construct a better moving average which is as smooth as ILRS, but runs closer to where EPMA lies, without the overshoot.
A easy way to attempt this is to split the difference, i.e. use (ILRS(n)+EPMA(n))/2. This will give us a moving average (call it IE /2) which runs in between the two, has phase lag of n/4 but still inherits considerable noise from EPMA. IE /2 is inspirational, however. Can we build something that is comparable, but smoother? Figure 1 shows ILRS, EPMA, and IE /2.
Filter Techniques
Any thoughtful student of filter theory (or resolute experimenter) will have noticed that you can improve the smoothness of a filter by running it through itself multiple times, at the cost of increasing phase lag.
There is a complementary technique (called twicing by J.W. Tukey) which can be used to improve phase lag. If L stands for the operation of running data through a low pass filter, then twicing can be described by:
L' = L(time series) + L(time series - L(time series))
That is, we add a moving average of the difference between the input and the moving average to the moving average. This is algebraically equivalent to:
2L-L(L)
This is the Double Exponential Moving Average or DEMA , popularized by Patrick Mulloy in TASAC (January/February 1994).
In our taxonomy, DEMA has some phase lag (although it exponentially approaches 0) and is somewhat noisy, comparable to IE /2 indicator.
We will use these two techniques to construct our better moving average, after we explore the first one a little more closely.
Fixing Overshoot
An n-day EMA has smoothing constant alpha=2/(n+1) and a lag of (n-1)/2.
Thus EMA (3) has lag 1, and EMA (11) has lag 5. Figure 2 shows that, if I am willing to incur 5 days of lag, I get a smoother moving average if I run EMA (3) through itself 5 times than if I just take EMA (11) once.
This suggests that if EPMA and DEMA have 0 or low lag, why not run fast versions (eg DEMA (3)) through themselves many times to achieve a smooth result? The problem is that multiple runs though these filters increase their tendency to overshoot the data, giving an unusable result. This is because the amplitude response of DEMA and EPMA is greater than 1 at certain frequencies, giving a gain of much greater than 1 at these frequencies when run though themselves multiple times. Figure 3 shows DEMA (7) and EPMA(7) run through themselves 3 times. DEMA^3 has serious overshoot, and EPMA^3 is terrible.
The solution to the overshoot problem is to recall what we are doing with twicing:
DEMA (n) = EMA (n) + EMA (time series - EMA (n))
The second term is adding, in effect, a smooth version of the derivative to the EMA to achieve DEMA . The derivative term determines how hot the moving average's response to linear trends will be. We need to simply turn down the volume to achieve our basic building block:
EMA (n) + EMA (time series - EMA (n))*.7;
This is algebraically the same as:
EMA (n)*1.7-EMA( EMA (n))*.7;
I have chosen .7 as my volume factor, but the general formula (which I call "Generalized Dema") is:
GD (n,v) = EMA (n)*(1+v)-EMA( EMA (n))*v,
Where v ranges between 0 and 1. When v=0, GD is just an EMA , and when v=1, GD is DEMA . In between, GD is a cooler DEMA . By using a value for v less than 1 (I like .7), we cure the multiple DEMA overshoot problem, at the cost of accepting some additional phase delay. Now we can run GD through itself multiple times to define a new, smoother moving average T3 that does not overshoot the data:
T3(n) = GD ( GD ( GD (n)))
In filter theory parlance, T3 is a six-pole non-linear Kalman filter. Kalman filters are ones which use the error (in this case (time series - EMA (n)) to correct themselves. In Technical Analysis , these are called Adaptive Moving Averages; they track the time series more aggressively when it is making large moves.
QQE of Parabolic-Weighted Velocity [Loxx]QQE of Parabolic-Weighted Velocity is a QQE indicator that takes as its input parabolic-weighted velocity calculation. This version can help in determining trend. Adjust the calculating period to your trading style: longer - to trend traders, shorter - for scalping.
What is Qualitative Quantitative Estimation (QQE)?
The Qualitative Quantitative Estimation (QQE) indicator works like a smoother version of the popular Relative Strength Index ( RSI ) indicator. QQE expands on RSI by adding two volatility based trailing stop lines. These trailing stop lines are composed of a fast and a slow moving Average True Range (ATR).
There are many indicators for many purposes. Some of them are complex and some are comparatively easy to handle. The QQE indicator is a really useful analytical tool and one of the most accurate indicators. It offers numerous strategies for using the buy and sell signals. Essentially, it can help detect trend reversal and enter the trade at the most optimal positions.
Included:
Loxx's Expanded Source Types
Alerts
Signals
Bar coloring