TrendSphere (Zeiierman)█ Overview
TrendSphere is designed to capture and visualize market trends and volatility effectively. It combines various volatility measures and trend analysis techniques, producing dynamic bands and a central trend line on the price chart. Its essence is to offer a real-time, reliable estimate of the underlying linear trend in the price.
█ How It Works
Real-Time Trend Estimation
At its core, TrendSphere is designed to offer instantaneous and accurate insights into the inherent linear trend of asset prices. By continually updating its estimations, it ensures traders are equipped with the most current data. This allows the construction of support and resistance bands around the estimated trend, providing trading opportunities.
Dynamic Bands and Trend Line
TrendSphere plots a central trend line and dynamic bands around it on the price chart. Influenced by volatility, the distance between these elements offers a clear view of market conditions and the strength or weakness of trends. These bands not only depict potential turning points but also offer traders valuable opportunities to trade within the confines of the overarching trend.
Volatility Measures
Traders can select their preferred volatility measure and adjust settings to best fit their analysis needs. The bands and trend line dynamically respond to these selections, offering a tailored view of market conditions.
ATR (Average True Range): Reflects market volatility by evaluating the range between high and low prices.
Historical Volatility: Computes price variability using the standard deviation of log returns.
Bollinger Band Width: Measures the distance between Bollinger Bands, providing another angle on market volatility.
Eliminating Common Complications
One of the standout features of TrendSphere is its ability to determine linear price trends without falling prey to challenges like backpainting or repainting. In layman's terms, this means traders get a more trustworthy and unaltered view of price movements, leading to enhanced decision-making in line with the genuine trajectory of price trends.
█ How to Use
Trend Analysis
Observe the central trend line; its direction indicates the prevailing trend. When the price is above the trend line, it suggests an upward trend, and when it's below, it indicates a downward trend.
Volatility Analysis
Wider bands imply higher market volatility, suggesting larger price swings, while narrower bands indicate lower volatility. Traders can use the bands to identify potential reversal points and overbought/oversold conditions.
Potential Trading Signals (Using Bollinger bandwidth as volatility measure)
Consider buying when the price is above the trend line with narrowing bands, suggesting a strong upward trend.
Consider selling when the price is below the trend line with narrowing bands, indicating a strong downward trend.
█ Settings
Select Volatility Measure
Choose the desired volatility measure: ATR, Historical Volatility, or Bollinger Band Width.
Volatility Scaling Factor
Adjusts the scale of the volatility measure, influencing the width of the bands.
Volatility Strength
Modifies the influence of volatility on the bands, adjusting their responsiveness to volatility changes.
Length
Defines the number of periods used in calculating the selected volatility measure, impacting the stability and responsiveness of the bands.
Trend Sensitivity
Adjusts the sensitivity of the trend component, affecting how quickly it reacts to price changes.
█ Related scripts with the same calculation philosophy
TrendCylinder
Predictive Trend and Structure
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Lineartrend
Deming Linear Regression [wbburgin]Deming regression is a type of linear regression used to model the relationship between two variables when there is variability in both variables. Deming regression provides a solution by simultaneously accounting for the variability in both the independent and dependent variables, resulting in a more accurate estimation of the underlying relationship. In the hard-science fields, where measurements are critically important to judging the conclusions drawn from data, Deming regression can be used to account for measurement error.
Tradingview's default linear regression indicator (the ta.linreg() function) uses least squares linear regression, which is similar but different than Deming regression. In least squares regression, the regression function minimizes the sum of the squared vertical distances between the data points and the fitted line. This method assumes that the errors or variability are only present in the y-values (dependent variable), and that the x-values (independent variable) are measured without error.
In time series data used in trading, Deming regression can be more accurate than least squares regression because the ratio of the variances of the x and y variables is large. X is the bar index, which is an incrementally-increasing function that has little variance, while Y is the price data, which has extremely high variance when compared to the bar index. In such situations, least squares regression can be heavily influenced by outliers or extreme points in the data, whereas Deming regression is more resistant to such influence.
Additionally, if your x-axis uses variable widths - such as renko blocks or other types of non-linear widths - Deming regression might be more effective than least-squares linear regression because it accounts for the variability in your x-values as well. Additionally, if you are creating a machine-learning model that uses linear regression to filter or extrapolate data, this regression method may be more accurate than least squares.
In contrast to least squares regression, Deming regression takes into account the variability or errors in both the x- and y-values. It minimizes the sum of the squared perpendicular distances between the data points and the fitted line, accounting for both the x- and y-variability. This makes Deming regression more robust in both variables than least squares regression.
Leavitt Convolution Slope [CC]The Leavitt Convolution Slope indicator was created by Jay Leavitt (Stocks and Commodities Oct 2019, page 11), who is most well known for creating the Volume-Weighted Average Price indicator. This indicator is very similar to the Leavitt Convolution indicator but the big difference is that it is getting the slope instead of predicting the next Convolution value. I changed quite a few things from the original source code so let me know if you like these changes. I added a normalization function using code from a good friend @loxx that I recommend to leave on but feel free to experiment with it. Last but not least, the unsure levels are essentially acting as a buy or sell threshold. I personally recommend to buy or sell for zero crossovers but another option would be to buy or sell for crossovers using the unsure levels. I have color coded the lines to turn light green for a normal buy signal or dark green for a strong buy signal and light red for a normal sell signal, and dark red for a strong sell signal.
This is another indicator in a series that I'm publishing to fulfill a special request from @ashok1961 so let me know if you ever have any special requests for me.
Leavitt Convolution [CC]The Leavitt Convolution indicator was created by Jay Leavitt (Stocks and Commodities Oct 2019, page 11), who is most well known for creating the Volume-Weighted Average Price indicator. This indicator is very similar to my Leavitt Projection script and I forgot to mention that both of these indicators are actually predictive moving averages. The Leavitt Convolution indicator doubles down on this idea by creating a prediction of the Leavitt Projection which is another prediction for the next bar. Obviously this means that it isn't always correct in its predictions but it does a very good job at predicting big trend changes before they happen. The recommended strategy for how to trade with these indicators is to plot a fast version and a slow version and go long when the fast version crosses over the slow version or to go short when the fast version crosses under the slow version. I have color coded the lines to turn light green for a normal buy signal or dark green for a strong buy signal and light red for a normal sell signal, and dark red for a strong sell signal.
This is another indicator in a series that I'm publishing to fulfill a special request from @ashok1961 so let me know if you ever have any special requests for me.
Leavitt Projection [CC]The Leavitt Projection indicator was created by Jay Leavitt (Stocks and Commodities Oct 2019, page 11), who is most well known for creating the Volume-Weighted Average Price indicator. This indicator is very simple but is also the building block of many other indicators, so I'm starting with the publication of this one. Since this is the first in a series I will be publishing, keep in mind that the concepts introduced in this script will be the same across the entire series. The recommended strategy for how to trade with these indicators is to plot a fast version and a slow version and go long when the fast version crosses over the slow version or to go short when the fast version crosses under the slow version. I have color coded the lines to turn light green for a normal buy signal or dark green for a strong buy signal and light red for a normal sell signal, and dark red for a strong sell signal.
I know many of you have wondered where I have been, and my personal life has become super hectic. I was recently hired full-time by TradingView, and my wife is pregnant with twins, and she is due in a few months. I will do my absolute best to get back to posting scripts regularly, but I will post a bunch today in the meantime to fulfill a special request from one of my loyal followers (@ashok1961).
Linear Regression Relative Strength[image/x/iZvwDWEY/
Relative Strength indicator comparing the current symbol to SPY (or any other benchmark). It may help to pick the right assets to complement the portfolio build around core ETFs such as SPY.
The general idea is to show if the current symbol outperforms or underperforms the benchmark (SPY by default) when bought some certain time ago. Relative performance is displayed as percent and is calculated for three different time ranges - short (1 mo by default), mid (1 quarter), and long (half a year). To smooth the volatility, the script uses linear regression to estimate the trend and takes the start and the end points of the linear regression line to compute the relative strength.
It is important to remember that the script shows the gain relative to SPY (or other selected benchmark), not the asset's gain. Therefore, it may indicate that the asset is profitable, but it still may lose value if SPY is in downtrend.
Therefore, it is crucial to check other indicators before making a decision. In the example above, standard linear regression for one quarter is used to indicate the direction of the trend.
Linear trendSimple way how to use Linear Regression for trading.
What we use:
• Linear Regression
• EMA 200 as a trend filter
Logic:
Firstly we make two different linear regression movings as oscillator. For this we need to subtract slow moving from fast moving, so we get the single moving around zero. This is the green/red line which appears on the chart.
The trade open when LR cross over the threshold. The trade close when LR cross under the threshold below. Crossing over the threshold is the same as faster moving cross over slower moving.
Also we use EMA as a filter. The trades would be only when the price is over than EMA 200.
Linear Regression Channel Breakout StrategyThis strategy is based on LonesomeTheBlue's Linear Regression Channel Indicator. First of all, I would like to thank LonesomeTheBlue. Breaking the Linear Regression Channel to close the candle triggers a Long or Short signal. If the slope of the Linear Regression Channel is positive, it is Short when it breaks out the lower line, and when the slope is negative, it is Long when it breaks out the upper line. The default is optimized for 8-hour candles, and for other hour candles, find the optimal value yourself. Below is a description of LonesomeTheBlue's Linear Regression Channel.
이 전략은 LonesomeTheBlue의 Linear Regression Channel Indicator를 기반으로 만들어졌습니다. 우선 LonesomeTheBlue님께 감사의 말씀을 드립니다. Linear Regression Channel을 돌파하여 봉 마감하면 Long 또는 Short 신호를 트리거합니다. Linear Regression Channel의 기울기가 양인 경우 하단 라인을 돌파하면 Short이고 그 기울기가 음인 경우 상단 라인을 돌파하면 Long입니다. 기본값은 8시간봉에 최적화 되어 있으며, 다른 시간봉은 직접 최적값을 찾아보십시오. 아래는 LonesomeTheBlue의 Linear Regression Channel에 대한 설명을 퍼왔습니다.
________________________________________________
There are several nice Linear Regression Channel scripts in the Public Library. and I tried to make one with some extra features too. This one can check if the Price breaks the channel and it shows where is was broken. Also it checks the momentum of the channel and shows it's increasing/decreasing/equal in a label, shape of the label also changes. The line colors change according to direction.
using the options, you can;
- Set the Source (Close, HL2 etc)
- Set the Channel length
- Set Deviation
- Change Up/Down Line colors
- Show/hide broken channels
- Change line width
meaning of arrows:
⇑ : Uptrend and moment incresing
⇗ : Uptrend and moment decreasing
⇓ : Downtrend and moment incresing
⇘ : Downtrend and moment decreasing
⇒ : No trend
Linear SSL ShortThis script consist of two parts: linear SSL and DEMA. The difference between original SSL and current is that it calculated by linear regression. The logic is simple: when SSL "crossunder" and DEMA is above the price - we get short signal. When price became above DEMA and SSL "crossover" - close short.
Linear trendThis oscillator based on linear regression . By subtracting the slower LMA from the faster LMA we can get a value, which we will further compare with zero. If the resulting difference is greater than 0, then we can assume that the trend is upward. Also by using offset we could increase the expected profit (focusing on backtest data).
You could get access for this script by the link below.
TopTenAlgo 7. Linear Trend Tracking (Without Volume & Coloring)EN:
Dogrusal Trend Takipcisi is used in conjunction with Gosterge Trend. Both indicators are for approval of each other. While the Indicator looks at Logarithmic to prices, It looks at Linear. Although its mathematical function is stuck between two trend lines like Gösterge Trend, the Dogrusal Trend Takipcisi can also be used as the main histogram, the absolute value of the difference between the trend and the down trend line .
If the uptrend line is larger than the downtrend, histogram bars are light green or dark green areas. When the bullish trend line now crosses the down trend line , the bar is dark green. When the up trend line is larger than the down trend line and the up trend line increases, the bars also become dark green. This tendency starts to keep getting stronger. If the bullish trend line is larger than the bearish trend line but decreases, the bars are light green. This is when the bullish trend loses strength, So, Uptrend is weakening.
If the downtrend line is larger than the bullish trend line , a negative occur, and the bars become red or light red. If the bearish trend line has exceeded the bullish trend line or the value is increasing, the bar is in red. If the bearish trend line is larger than the bullish trend line but the value is decreasing, the bars are light red. This comes when the downward trend is losing power. So, Downtrend is weakening. For symbols for which the Volume Indicator cannot be read.
This algorithm is prepared with @Top10Algo ...
TR: Doğrusal Trend Takipçisi Gösterge Trendle ile beraber kullanılır. Her iki göstergede birbirinin onayını almak içindir. Gösterge Trend fiyatlara logaritmik bakarken, Doğrusal Tren Takipçisi Linear bakar. Matematiksel fonsiyonu Gösterge Trend gibi iki trend çizgisi arasına sıkışmış olsada Doğrusal Trend Takipçisi ayrıca ana histogram olarak gösterilen yukarı trend ve aşağı trend çizgisi arasındaki farkın mutlak değerini linear olarak hesaplayarak momentumun gücünü ölçer ve size zayıflayan trendleri haber eder.gösterir.
Yukarı trend çizgisi aşağı trendden büyükse (bu nedenle pozitif hareketi gösterir), histogram çubukları açık yeşil veya koyu yeşil olacaktır. Artış trendi çizgisi şimdi aşağı trend çizgisini geçtiğinde, çubuk koyu yeşil olacaktır. Yukarı trend çizgisi aşağı trend çizgisinden daha büyük olduğunda ve yukarı trend çizgisi arttığında çubuklar da koyu yeşil olur. Bu eğilimin güçlenmeye devam ettiği anlamına geliyor. Yükseliş trendi çizgisi düşüş trendi çizgisinden büyükse ancak azalıyorsa, çubuklar açık yeşil olacaktır. Bu yükseliş eğiliminin güç kaybettiği anlamına gelir.Yani yükseliş trendi zayıflıyordur.
Düşüş trendi çizgisi yükseliş trendi çizgisinden büyükse, olumsuz bir eğilim oluşur ve çubuklar kırmızı veya açık kırmızı olur. Düşüş trendi çizgisi yükseliş trendi çizgisini aştıysa veya değer artıyorsa, çubuk kırmızı olacaktır. Düşüş trendi çizgisi yükseliş trendi çizgisinden büyükse, ancak değer azalıyorsa, çubuklar açık kırmızı olacaktır. Bu düşüş eğiliminin güç kaybettiği anlamına gelir. Yani düşüş trendi zayıflıyordur. Hacim Göstergesinin okunamadığı semboller içindir.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır...
TopTenAlgo 7. Linear Trend Tracking (Include Volume & Coloring)EN:
Dogrusal Trend Takipcisi is used in conjunction with Gosterge Trend. Both indicators are for approval of each other. While the Indicator looks at Logarithmic to prices, It looks at Linear. Although its mathematical function is stuck between two trend lines like Gösterge Trend, the Dogrusal Trend Takipcisi can also be used as the main histogram, the absolute value of the difference between the trend and the down trend line .
If the uptrend line is larger than the downtrend, histogram bars are light green or dark green areas. When the bullish trend line now crosses the down trend line , the bar is dark green. When the up trend line is larger than the down trend line and the up trend line increases, the bars also become dark green. This tendency starts to keep getting stronger. If the bullish trend line is larger than the bearish trend line but decreases, the bars are light green. This is when the bullish trend loses strength, So, Uptrend is weakening.
If the downtrend line is larger than the bullish trend line , a negative occur, and the bars become red or light red. If the bearish trend line has exceeded the bullish trend line or the value is increasing, the bar is in red. If the bearish trend line is larger than the bullish trend line but the value is decreasing, the bars are light red. This comes when the downward trend is losing power. So, Downtrend is weakening.
This algorithm is prepared with @Top10Algo ...
TR: Doğrusal Trend Takipçisi Gösterge Trendle ile beraber kullanılır. Her iki göstergede birbirinin onayını almak içindir. Gösterge Trend fiyatlara logaritmik bakarken, Doğrusal Tren Takipçisi Linear bakar. Matematiksel fonsiyonu Gösterge Trend gibi iki trend çizgisi arasına sıkışmış olsada Doğrusal Trend Takipçisi ayrıca ana histogram olarak gösterilen yukarı trend ve aşağı trend çizgisi arasındaki farkın mutlak değerini linear olarak hesaplayarak momentumun gücünü ölçer ve size zayıflayan trendleri haber eder.gösterir.
Yukarı trend çizgisi aşağı trendden büyükse (bu nedenle pozitif hareketi gösterir), histogram çubukları açık yeşil veya koyu yeşil olacaktır. Artış trendi çizgisi şimdi aşağı trend çizgisini geçtiğinde, çubuk koyu yeşil olacaktır. Yukarı trend çizgisi aşağı trend çizgisinden daha büyük olduğunda ve yukarı trend çizgisi arttığında çubuklar da koyu yeşil olur. Bu eğilimin güçlenmeye devam ettiği anlamına geliyor. Yükseliş trendi çizgisi düşüş trendi çizgisinden büyükse ancak azalıyorsa, çubuklar açık yeşil olacaktır. Bu yükseliş eğiliminin güç kaybettiği anlamına gelir.Yani yükseliş trendi zayıflıyordur.
Düşüş trendi çizgisi yükseliş trendi çizgisinden büyükse, olumsuz bir eğilim oluşur ve çubuklar kırmızı veya açık kırmızı olur. Düşüş trendi çizgisi yükseliş trendi çizgisini aştıysa veya değer artıyorsa, çubuk kırmızı olacaktır. Düşüş trendi çizgisi yükseliş trendi çizgisinden büyükse, ancak değer azalıyorsa, çubuklar açık kırmızı olacaktır. Bu düşüş eğiliminin güç kaybettiği anlamına gelir. Yani düşüş trendi zayıflıyordur.
Bu algoritma @Top10Algo ile beraber hazırlanmıştır...
Linear Regression (All Data)The tool plots a linear regression line using the entire history of an instrument on chart. There are may be issues on intraday timeframes less then 1h. On daily, weekly and monthly charts it works without problem.
If an instrument has a lot of data points, you may not see the line (this is TV feature):
To fix that you need to scroll your chart to the left and find the starting point of the line:
And then do an auto-scroll to the last bar:
Leavitt Convolution & Acceleration by CryptorhythmsLeavitt Projection, Convolution, & Acceleration by Cryptorhythms
Intro
Bringing you another open source Gem this time from the January 2020 Issue of TASC.
Description
In the article in the Oct 2019 TASC issue titled "An interplanetary marriage" author Jay Leavitt describes the evolution process required in strategy design by introducing his Mars strategy. This grew out of concepts presented in his earlier TASC articles such as the stratosphere, moon rocket, and tech emini strategies. This dual indicator uses a linear regression of price data to help derive slope and acceleration information, in turn helping him to identify trends and trend turning points.
Additions
As usual a few useful extras are included such as a rudimentary signaling system, bar coloration by trade state, overbought/oversold areas to assist in algorithmic setups, and more!
👍 We hope you enjoyed this indicator and find it useful! We post free crypto analysis, strategies and indicators regularly. This is our 71st script on Tradingview!
💬Check my Signature for other information
Power Law S/RBerger's article on the Power Law Model for Bitcoin is a compelling read and gives the best evidence so far of the diminishing case for retracing below $3000, of a slowing market on a log-log plot, and reducing but continued volatility.
After seeing it acts as support routinely in the last 10 years, I put together a quick little script that plots his midline curve for Bitcoin. You can change the intercept and slope but will need to do your own calculations for other curves.
I hope you all like it.
LTIThis is a customised indicator which assists us to easily identify strong linear bullish or bearish trends. It gives us the opportunity to enter only the strongest looking trends which results in potentially faster profits.
Enhanced Linear Regression Trend ChannelThis is my PSv4.0 enhanced version of "Linear Regression Channel", as it is more commonly known. I entitled it Enhanced Linear Regression Trend Channel, simply because it seems more accurate as a proper description. However, this is actually a dual linear regression channel all-in-one Swiss army knife, nicely packaged within 104 lines of code. The primary one tracks in real-time, while the secondary, with an enabled "time warp" setting, is displayed monitoring the linear regression channel in the past for comparison, providing fully adjustable tandem tracking capabilities. It seemed like a superb novel idea to me to add this capability for super analytical approaches. The Pearson correlation displays in the rear middle of the primary linear regression trend channel. I did this because during a steep uptrend zoomed in, it often moves off the chart being placed on the bottom and is no longer visible for a while. Additionally, for the second time, I am releasing my "Neon Source" plot feature in a bright stunning yellow corona. Charts these days have so many plots on them, so I devised a unique way to resolve any confusion by emulating neon light. You may still easily use candles with this neon line too, or just simply disable it if you wish.
Features List Includes:
Enable/disable dark background for enhanced visibility
Dual "Source" selections
Dual "Period" adjustments
Dual "Deviation(s)" adjustments
Dual "Time Warp" adjustments
Dual selectable line extension method
"Pearson Correlation" color change selection for enhancing visual acuity amongst other indicators
Secondary "Linear Regression Trend Channel" time warped with enable/disable capability
"Neon Source" has a brightness control with an enable/disable capability
This is not a freely available indicator, FYI. To witness my Pine poetry in action, properly negotiated requests for unlimited access, per indicator, may ONLY be obtained by direct contact with me using TV's "Private Chats" or by "Message" hidden in my member name above. The comments section below is solely just for commenting and other remarks, ideas, compliments, etc... regarding only this indicator, not others. 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. When my indicators achieve more prevalent use by TV members, I will implement more ideas when they present themselves as worthy additions. As always, "Like" it if you simply just like it, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone!
Function for Least Squares Moving AverageThank you to alexgrover for putting me wide to this, after putting up with long conversations and stupid questions. Follow him and behold: www.tradingview.com
What is this?
This is simply the function for a Least Squares Moving Average. You can render this on the chart by using the linreg() function in Pine.
Personally I like to use the slope of the LSMA to help determine what direction to take a trade in, but I'm sure there are other, more exotic ways of using it and, if you know how to get your fingers dirty with Pine, you can create more exotic versions of it by modifying the function provided.
Want to learn?
If you'd like the opportunity to learn Pine but you have difficulty finding resources to guide you, take a look at this rudimentary list: docs.google.com
The list will be updated in the future as more people share the resources that have helped, or continue to help, them. Follow me on Twitter to keep up-to-date with the growing list of resources.
Suggestions or Questions?
Don't even kinda hesitate to forward them to me. My (metaphorical) door is always open.
Linear Regression Cloud [R1984]TradingView Pine script to compare fast vs slow linear regression lines measured in days.
This indicator compares fast and slow linear regression lines, and that's it!
The fast line crossing above the slow line is generally bullish. The fast line crossing below the slow line is generally bearish. The lines and the space between them tend to act as resistance and support relative to the price movement against them.
30 days as the fast line and 60 days as the slow line appear to work well for BTC/USD. Check out multiples of that too: 15/30, 45/90, and 60/120.
Source code available here: github.com