Price-Line Channel - A Friendly Support And Resistance IndicatorIntroduction
Lines are the most widely used figures in technical analysis, this is due to the linear trends that some securities posses (daily log SP500 for example), support and resistances are also responsible for the uses of lines, basically linear support and resistances are made with the assumption that the line connecting two local maximas or minimas will help the user detect a new local maxima or minima when the price will cross the line.
Technical indicators attempting to output lines have always been a concern in technical analysis, the mostly know certainly being the linear regression, however any linear models would fit in this category. In general those indicators always reevaluate their outputs values (repainting), others non repainting indicators returning lines are sometimes to impractical to set-up. This is what has encouraged me to make a simpler indicator based on the framework used in the recursive bands indicator that i published.
The proposed indicator aim to be extremely flexible and easy to use while returning linear support and resistances, an option that allow readjustment is also introduced, thus allowing for a "smarter" indicator.
The Indicator
The indicator return two extremities, the upper one aim to detect resistance points while the lower one aim to detect support points. The length setting control the steepness of the line, with higher values of length involving a lower slope, this make the indicator less reactive and interact with the price less often.
The name "price-line" comes from the fact that the channel is dependent on its own interaction with the price, therefore a breakout methodology can also be used, where price is up-trending when crossing with the upper extremity and down trending when crossing with the lower one.
Readjusted Option
The line steepness can be readjusted based on the market volatility, it make more sense for the line to be more steep when the market is more volatile, thus making it converge faster toward the price, this of course is done at the cost of some linearity. This is achieved by checking the "readjustment" option. The effects can be shown on BTCUSD, below the indicator without the readjusted option :
when the "readjustment" option is checked we have the following results :
The volatile down movement on BTCUSd make the upper extremity converge faster toward the price, this option can be great for volatile markets.
Conclusion
The recursive bands indicator prove to be an excellent framework that allow for the creation of lots of indicators, the proposed indicator is extremely efficient and provide an easy solution for returning linear support and resistances without much drawbacks, the readjusted option allow the indicator to adapt to the market volatility at the cost of linearity.
The performance of the indicator is relative to the motion of the price, however the indicator show signs of returning accurate support and resistances points. I hope the indicator find its use in the community.
Thanks for reading !
Note
Respect the house rules, always request permission before publishing open source code. This is an original work, requesting permission is the least you can do.
Patrones de gráficos
G-Channels - Efficient Calculation Of Upper/Lower ExtremitiesIntroduction
Channels indicators are widely used in technical analysis, they provide lot of information. In general, technical indicators giving upper/lower extremities are calculated by adding/subtracting a volatility component to a central tendency estimator. This is the case with Bollinger bands, using the rolling standard deviation as volatility estimator and the simple moving average as central tendency estimator, or the Keltner channels using the exponential moving average and the average true range.
Lots and lots and lots (i can go on) of those indicators have been made, they only really need a central tendency estimator, which can be obtained from pretty much any filter, however i find interesting to focus on the efficiency of those indicators, therefore i propose a super efficient channel indicator using recursion. The average resulting from the upper/lower extremity of the indicator provide a new efficient filter similar to the average highest/lowest.
The calculation - How Does It Works
Efficiency is often associated to recursion, this would allow us to use past output values as input, so how does the indicator is calculated? Lets look at the upper band calculation :
a := max(src,nz(a(1))) - nz(a(1) - b(1))/length
src is the closing price, a is upper extremity, b is the lower one. Here we only need 3 values, the previous values of a and b and the closing price. Basically a := max(src,nz(a(1))) mean :
if the closing price is greater than the precedent value of a then output the closing price, else output the precedent value of a
therefore a will never be inferior to its precedent value, this is useful for getting the maximum price value in our dataset however its not useful to make an upper band, therefore we subtract this to a correction factor defined as the difference between a and b , this force the upper band to have lower values thus acting like a band without loosing its "upper" property, a similar process is done with the lower band.
Of course we could only use 2 values for making the indicator, thus ending with :
a := max(src,nz(a(1))) - nz(abs(close - a(1))/length
In fact this implementation is the same as the one proposed in my paper "Recursive Bands - A New Indicator For Technical Analysis", its also what i used for making the indicator "Adaptive Trailing Stop", this would be more efficient but i used the difference between the upper and lower extremities for a reason.
The Central tendency Estimator
This is the reason why i didn't implemented a more efficient version. Basically this central tendency estimator is just the average between the upper and lower extremities, it behave like the average of the highest/lowest over length period, its central plot in the Donchian channel indicator. Below is a comparison of both with length = 100 :
But why is our average so "boxy"? The extremities are not boxy, so why the average is sometimes equal to its previous value? Explain!
Its super easy to understand, imagine two lines, if their absolute change is the same and they follow an opposite direction, then their average is constant.
the average of the green and red line is the orange line. If both lines follow the same direction then their average will also follow this direction.
When both extremities follow the same direction, the average will also do the same, when both follow an opposite direction then the average will be equal to its precedent value, this is also due to the fact that both extremities are based on the same correction factor (a-b) , else the average wouldn't act that way, now you understand why i made this choice.
Conclusion
I proposed an efficient implementation of a channel indicator that provide an interesting central tendency estimator. This simple implementation would allow for tons of interesting concepts, some of my indicators use a similar approach and allow for great outputs, you'll see them soon enough. I hope this indicator find its use in the community, remember to ask before using this indicator in a script you want to publish.
Thanks for reading !
If you want to discuss about anime stuff send me a pm but don't do it in the commend section.
Linear Regression Trend ChannelThis is my first public release of indicator code and my PSv4.0 version of "Linear Regression Channel", as it is more commonly known. It replicates TV's built-in "Linear Regression" without the distraction of heavy red/blue fill bleeding into other indicators. We can't fill() line.new() at this time in Pine Script anyways. I entitled it Linear Regression Trend Channel, simply because it seems more accurate as a proper description. I nicely packaged this to the size of an ordinary napkin within 20 lines of compact code, simplifying the math to the most efficient script I could devise that fits in your pocket. This is commonly what my dense intricate code looks like behind the veil, and if you are wondering why there is no notes, that's because the notation is in the variable naming. I excluded Pearson correlation because it doesn't seem very useful to me, and it would comprise of additional lines of code I would rather avoid in this public release. Pearson correlation is included in my invite-only advanced version of "Enhanced Linear Regression Trend Channel", where I have taken Linear Regression Channeling to another level of fully featured novel attainability using this original source code.
Features List Includes:
"Period" adjustment
"Deviation(s)" adjustment
"Extend Method" option to extend or not extend the upper, medial, and lower channeling
Showcased in the chart below is my free to use "Enhanced Schaff Trend Cycle Indicator", having a common appeal to TV users frequently. If you do have any questions or comments regarding this indicator, I will consider your inquiries, thoughts, and ideas presented below in the comments section, when time provides it. As always, "Like" it if you simply just like it with a proper thumbs up, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone!
Kaufman Adaptive BandsIntroduction
Bands are quite efficient in technical analysis, they can provide support and resistance levels, provide breakouts points, trailing stop loss/take profits positions and can show the current market volatility to the user. Most of the time bands are made from a central tendency estimator like a moving average plus/minus a volatility indicator. Therefore bands can be made out of pretty much everything thus allowing for any kind of flavors.
So i propose a band indicator made from a Kaufman adaptive moving average using an estimate of the standard deviation.
Construction
The Kaufman moving average is an exponential averager using the efficiency ratio as smoothing variable, length control the period of kama and in order to provide more smoothness a power parameter has been introduced, higher values of power will return smoother results.
The volatility indicator is made from a biased estimation of the standard deviation by using the square root of the mean of the square minus the square of the mean method, except that we use kama instead of a mean.
The bands are made by adding/subtracting this volatility indicator with kama.
How To Use
The ability of the indicator to adapt to the current market state is what makes him a great tool for avoiding major exposition during ranging market, therefore the indicator will have a greater motion during trending market, or more simply the bands will move during trending markets while staying "flat" during ranging ones. Therefore the indicator might be more suited to breakouts, even if some cases will return what where turning points, this is particularly true during ranging markets.
Of course the efficiency ratio is not an "unbiased" trend metric indicator, it can consider high volatility markets as trending markets. Its one of his downsides.
High values of power will create smoother bands.
When using a low power parameter use an higher mult. In general using a low power value will make the bands move more freely as well as making them closer to each others.
Conclusion
At least the indicator is really nice to the eyes when using high power values, its ability to adapt to the market is a great addition to other more classical bands indicators, i also introduced a volatility estimator based on kama, some might have used the following estimation : kama(abs(price - kama)) which would have created a slower result. A trailing stop might be made from it if i see request about such addition.
If you are curious here are some more images of the indicator performing on different markets. Thanks for reading !
Combo Strategy 123 Reversal & CCI This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The Commodity Channel Index (CCI) is best used with markets that display cyclical or
seasonal characteristics, and is formulated to detect the beginning and ending of these
cycles by incorporating a moving average together with a divisor that reflects both possible
and actual trading ranges. The final index measures the deviation from normal, which indicates
major changes in market trend.
To put it simply, the Commodity Channel Index (CCI) value shows how the instrument is trading
relative to its mean (average) price. When the CCI value is high, it means that the prices are
high compared to the average price; when the CCI value is down, it means that the prices are low
compared to the average price. The CCI value usually does not fall outside the -300 to 300 range
and, in fact, is usually in the -100 to 100 range.
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Strategy 123 Reversal & CCI This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The Commodity Channel Index (CCI) is best used with markets that display cyclical or
seasonal characteristics, and is formulated to detect the beginning and ending of these
cycles by incorporating a moving average together with a divisor that reflects both possible
and actual trading ranges. The final index measures the deviation from normal, which indicates
major changes in market trend.
To put it simply, the Commodity Channel Index (CCI) value shows how the instrument is trading
relative to its mean (average) price. When the CCI value is high, it means that the prices are
high compared to the average price; when the CCI value is down, it means that the prices are low
compared to the average price. The CCI value usually does not fall outside the -300 to 300 range
and, in fact, is usually in the -100 to 100 range.
WARNING:
- For purpose educate only
- This script to change bars colors.
DEMA ATR Channels - New IndicatorA Double Exponential Moving Average (DEMA) with three sets of channel lines each one Average True Range (ATR) apart, above and below the DEMA.
Similar to my "ATR Channels" indicator, but using a DEMA instead of an EMA for the base. In addition, this indicator also plots a fast DEMA as well as a fill between the two. Fully customizable, you can toggle both DEMAs, the fill, and each set of ATR Channels.
ATR channel idea from Kerry Lovvorn as mentioned in Elder's "New Trading for a Living", page 93: "Kerry Lovvorn likes to plot 3 sets of lines around a moving average: at one, two, and three ATRs above and below an EMA . These can be used for setting up entry points and stops, as well as profit targets."
Volume Weighted Donchian ChannelsDonchian channels weighted with volume, they are now closer to the price and can cross it.
Motion To Attraction ChannelsIntroduction
Channels are used a lot on technical-analysis, however most of the them rely on adding/subtracting a volatility indicator to a central tendency indicator, sometimes the central tendency indicator can even be replaced by pure price. A great channel who does not rely on this kind of architecture is the Donchian channels or the quartiles bands. Here i propose a channel similar to the one made by Richard Donchian with some additional abilities.
The Channels
In my indicator, Motion To Attraction mean that the movement of an object a attract an object b , but we can resume this approach by saying that the longer a trend period is, the smaller the distance between each channels, for example if the price create a new highest then the lowest will move toward this new highest, each time coming closer. The philosophy behind this is that the longer a trend is the more probable it is that she will end.
The code reflect it this way :
here the parameter controlling the channel A (upper)
c = change(b) ? nz(c ) + alpha : change(a) ? 0 : nz(c )
this is traduced by : if channel b move then the parameter c become greater, if channel a move then reset the parameter , the parameter d do the same.
c is used to move the channel A, when c < 1 A is closer to the highest, when c = 1 A is in a central tendency point, when c > 1 A is closer to the lowest.
Slaving the Movement
It is possible to have a better control over the channels, this is done by making c and d always equal or lower than 1. Of course it could be another max value selected by the user.
In order to do that add c1 and d1 as parameter with c1 = c > 1 ? 1 : c , same with d1 but replace c by d.
Its safer to do this but i prefer how the channels act the other way, i will consider implementing this option in the future.
Conclusion
This channel indicator does not rely on past data thanks to recursion. The alpha variable at the start can also be adaptive, this let you make the channels adaptive even if such idea can add non desired results. Low length values can create effects where the lower channel can be greater than the higher one, this can be fixed directly in the code or using the method highlighted in the Slaving the Movement part.
RSI ATR ChannelDraws a channel based on ATR (Average True Range) and RSI. Detects band touches and colors the background appropriately.
Trend Follower With Help of Donchian Channels - TFWHDCThis is a simple Day Trade indicator, but can be used for swing and long term trades.
It is based on Donchian Channels to detect trend and point out resistance or support breakouts using arrows.
The bars ared colored when a breakout occurs. When a resistance breakout occurs the current and the next bars are colored green (default) and when a support breakout occurs the current and the next bars are colored red (default). This way this indicator can show if its an uptrend or a downtrend.
I hope this indicator will be useful for many traders!
Thank you!
Keltner Channel Strategy The Keltner Channel, a classic indicator
of technical analysis developed by Chester Keltner in 1960.
The indicator is a bit like Bollinger Bands and Envelopes.
WARNING:
- This script to change bars colors.
Keltner Channel The Keltner Channel, a classic indicator
of technical analysis developed by Chester Keltner in 1960.
The indicator is a bit like Bollinger Bands and Envelopes.
CryptoShadows V1The first Diagonal Support and Resistance indicator. Best for bitcoin and cryptocurrencies
Periodic ChannelThis indicator try to create a channel by summing a re-scaled and readapted sinusoidal wave form to the price mean.
The length parameter control the speed of the sinusoidal wave form, this parameter is not converted to a sine wave period for allowing a better estimation, higher length's work better but feel free to try shorter periods.
The invert parameter invert the sinusoidal wave.
Each bands represent possible return points, the higher the band the higher the probability.
Inverted sin wave exemple
The performance of the indicator is subjective to the main estimation (blue line), select the parameter that best fit the blue line to the price.
Best ragards
OHLC Daily Resolution BandsShout out to nPE- for the idea.
Bands made with stdev from 10 day OHLC.
Keeps resolution to daily, so you can use bands as daily pivots for day trading.
Upper band 1=yesterday close + 0.5 std(ohlc,10)
Upper band 1=yesterday close + 1 std(ohlc,10)
Mid=yesterday close
Lower band 1=yesterday close - 0.5 std(ohlc,10)
Lower band 2=yesterday close - 1 std(ohlc,1
High Low ChannelBasic high and low channels, allows for two high and two low channels of specified lengths.
Use for channel breakout trades, basic idea is to go long when the longer high channel is broken and close when shorter low channel is broken, vice versa for shorts
Feel free to leave me a tip if you like this script: 1MprT7YEEWaM6bUcpD7eeHM3Ht8n3R5jP1