Bitcoin Rainbow Logarithmic CurvesThis indicator shows the logarithmic regression curves for BTC and color codes it based on how extended we are from the best fit line (middle).
Regressions
Trend forecasting by c00l75----------- ITALIANO -----------
Questo codice è uno script di previsione del trend creato solo a scopo didattico. Utilizza una media mobile esponenziale (EMA) e una media mobile di Hull (HMA) per calcolare il trend attuale e prevedere il trend futuro. Il codice utilizza anche una regressione lineare per calcolare il trend attuale e un fattore di smorzamento per regolare l’effetto della regressione lineare sulla previsione del trend. Infine il codice disegna due linee tratteggiate per mostrare la previsione del trend per i periodi futuri specificati dall’utente. Se ti piace l'idea mettimi un boost e lascia un commento!
----------- ENGLISH -----------
This code is a trend forecasting script created for educational purposes only. It uses an exponential moving average (EMA) and a Hull moving average (HMA) to calculate the current trend and forecast the future trend. The code also uses a linear regression to calculate the current trend and a damping factor to adjust the effect of the linear regression on the trend prediction. Finally, the code draws two dashed lines to show the trend prediction for future periods specified by the user. If you like the idea please put a boost and leave a comment!
RSI and Stochastic Probability Based Price Target IndicatorHello,
Releasing this beta indicator. It is somewhat experimental but I have had some good success with it so I figured I would share it!
What is it?
This is an indicator that combines RSI and Stochastics with probability levels.
How it works?
This works by applying a regression based analysis on both Stochastics and RSI to attempt to predict a likely close price of the stock.
It also assess the normal distribution range the stock is trading in. With this information it does the following:
2 lines are plotted:
Yellow line: This is the stochastic line. This represents the smoothed version of the stochastic price prediction of the most likely close price.
White Line: This is the RSI line. It represents the smoothed version of the RSI price prediction of the most likely close price.
When the Yellow Line (Stochastic Line) crosses over the White Line (the RSI line), this is a bearish indication. It will signal a bearish cross (red arrow) to signal that some selling or pullback may follow.
IF this bearish cross happens while the stock is trading in a low probability upper zone (anything 13% or less), it will trigger a label to print with a pullback price. The pullback price is the "regression to the mean" assumption price. Its the current mean at the time of the bearish cross.
The inverse is true if it is a bullish cross. If the stock has a bullish cross and is trading in a low probability bearish range, it will print the price target for a regression back to the upward mean.
Additional information:
The indicator also provides a data table. This data table provides you with the current probability range (i.e. whether the stock is trading in the 68% probability zone or the outer 13, 2.1 or 0.1 probability zones), as well as the overall probability of a move up or down.
It also provides the next bull and bear targets. These are calculated based on the next probability zone located immediately above and below the current trading zone of the stock.
Smoothing vs Non-smoothed data:
For those who like to assess RSI and Stochastic for divergences, there is an option in the indicator to un-smooth the stochastic and RSI lines. Doing so looks like this:
Un-smoothing the RSI and stochastic will not affect the analysis or price targets. However it does add some noise to the chart and makes it slightly difficult to check for crosses. But whatever your preference is you can use.
Cross Indicators :
A bearish cross (stochastic crosses above RSI line) is signalled with a red arrow down shape.
A bullish cross (RSI crosses above stochastic line) is signalled with a green arrow up shape.
Labels vs Arrows:
The arrows are lax in their signalling. They will signal at any cross. Thus you are inclined to get false signals.
The labels are programmed to only trigger on high probability setups.
Please keep this in mind when using the indicator!
Warning and disclaimer:
As with all indicators, no indicator is 100% perfect.
This will not replace the need for solid analysis, risk management and planning.
This is also kind of beta in its approach. As such, there are no real rules on how it should be or can be applied rigorously. Thus, its important to exercise caution and not rely on this alone. Do your due diligence before using or applying this indicator to your trading regimen.
As it is kind of different, I am interested in hearing your feedback and experience using it. Let me know your feedback, experiences and suggestions below.
Also, because it does have a lot of moving parts, I have done a tutorial video on its use linked below:
Thanks for checking it out, safe trades everyone and take care!
Trading pirate 2Trading Pirate Regression Candles. This turns regular candle sticks into regression candles. Colors are Gray and Red.
BTC Log High/Low ChartThis indicator calculates the logarithmic values of the high and low prices of BTC based on a mathematical formula and plots them on the chart. The code uses the current time and width of the chart to calculate the logarithmic values of the high and low prices. It defines functions to convert a timestamp to the number of days since January 1st, 2009.
You can use it with BTC Log High/Low:
Correlation AnalysisAs the name suggests, this indicator is a market correlation analysis tool.
It contains two main features:
- The Curve: represents the historic correlation coefficient between the current chart and the “Reference Market” input from the settings menu. It aims to give more depth to the current correlation values found in the second feature.
- The Screener: this second feature displays all correlation coefficient values between the (max) 20 markets inputs. You can use it to create several screeners for several market types (crypto, forex, metals, etc.) or even replicate your current portfolio of investments and gauge the correlation of its components.
Aside from these two previous features, you can visually plot the variation rate from one bar to another along with the covariance coefficient (both used in the correlation calculation). Finally, a simple “signal” moving average can be applied to the correlation coefficient .
I might add alerts to this script or even turn it into a strategy to do some backtesting. Do not hesitate to contact me or comment below if this is something you would be interested in or if you have any suggestions for improvement.
Enjoy!!
Linear Regression Volume ProfileLinear Regression Volume Profile plots the volume profile fixated on the linear regression of the lookback period rather than statically across y = 0. This helps identify potential support and resistance inside of the price channel.
Settings
Linear Regression
Linear Regression Source: the price source in which to sample when calculating the linear regression
Length: the number of bars to sample when calculating the linear regression
Deviation: the number of standard deviations away from the linear regression line to draw the upper and lower bounds
Linear Regression
Rows: the number of rows to divide the linear regression channel into when calculating the volume profile
Show Point of Control: toggle whether or not to plot the level with highest amount of volume
Usage
Similar to the traditional Linear Regression and Volume Profile this indicator is mainly to determine levels of support and resistance. One may interpret a level with high volume (i.e. point of control) to be a potential reversal point.
Details
This indicator first calculates the linear regression of the specified lookback period and, subsequently, the upper and lower bound of the linear regression channel. It then divides this channel by the specified number of rows and sums the volume that occurs in each row. The volume profile is scaled to the min and max volume.
Leveraged Share Conversion IndicatorHello everyone,
Releasing my leveraged share conversion indicator.
I noticed that the option traders have all the fun and resources but the share traders don't really have many resources in terms of adjusting or profits on leveraged and inverse shares. So, I decided to change that this this indicator!
What it does:
In a nut shell, the calculator converts one share to the price of another through the use of a regression based analysis.
There are multiple pre-stored libraries available in the indicator, including IWM, SPY, BTC and QQQ.
However, if the ticker you want to convert is not in one of the pre-defined libraries, you can select "Use Alternative Ticker" and indicate the stock you wish to convert.
Using Libraries:
If the conversion you want is available in one of the libraries, simply select the conversion you would like. For example, if you want to convert SPY to SPXU, select that conversion. The indicator will then launch up the conversion results which it will display in a dashboard to the right and will also display the plotted conversion on a chart (see imagine below:
In the dashboard, the indicator will show you:
a) The conversion result: This is the most likely price based on the analysis
b) The standard error: This is the degree of error within the conversion. This is the basis of the upper and lower bands. In statistics, we can add and subtract the standard error from the likely result to get the "Upper" and "Lower" Confidence levels of assessment. This is just a fancy way of saying the range in which our predicted result will fall. So, for example, in the image above it shows you the price of SPXU is assessed to be around 16$ based on SPY's price. The standard error range is 15-17. This means that, the majority of the time, based on this SPY close price, SPXU should fall between 15-17$ with the most likely result being the 16$ range.
Why is there error?
Because leveraged shares have an inherent decay in them. The degree of decay can be captured utilizing the standard error. So at any given time, the small changes in price fluctuations caused by the fact that the share is leveraged can be assessed and displayed using standard error measurements.
c) The current correlation: This is important! Because if the stocks are not strongly correlated, it tells you there is a problem. In general, a perfect correlation is 1 or -1 (perfectly negative correlation or inverse correlation) and a bad correlation is anything under 0.5 or -0.5. So, for an INVERSE leveraged share, you would expect the correlation to read a negative value. Ideally -1. Because the inverse share is doing the opposite of the underlying (if the underlying goes up, the inverse goes down and vice versa). For a non-inverse leveraged share, the correlation should read a positive value. As the underlying goes up, so too does the leveraged.
Manual Conversion using Library:
If you are using a pre-defined library but want to convert a manual close price, simply select "Enable manual conversion" at the bottom of the settings and then type in the manual close price. If you are converting SPY to SPXU, type in the manual close price of SPY to get the result in SPXU and vice versa.
Using an Alternative Ticker:
If the ticker you want is not available in a pre-defined library (i.e. UDOW, BOIL, APPU, TSLL, etc.), simply select "Use Alternative Ticker" in the settings menu. When you select this, make sure your chart is set to the dominant chart. The "Dominant chart" is the chart of the underlying. So, if you want TSLA to TSLL, be sure you have the TSLA chart open and then set your Alternative Ticker to TSLL or TSLQ.
The process of using an Alternative Ticker remains the same. If you wish to enter a manual close price, simply select "Enable Manual Conversion".
Special Considerations:
The indicator uses 1 hour candles. Thus, please leave your dominant chart set on the 1 hour time frame to avoid confusing the indicator.
The lookback period of the manual conversion is 10, 1 hour candles. As such, the results should not be used to make longer term predictions (i.e. anything over 6 months is pushing the capabilities of a manual conversion but fair game for the pre-defined library conversions which use more longer-term data).
You can technically use the indicator to make assessments between 2 separate equities. For example, the relationship between QQQ and ARKK, SPY and DIA, IWM and SPY, etc. If there is a good enough correlation, you can use it to make predictions of the opposing ticker. For example, if DIA goes to 340, what would SPY likely do? And vice versa.
As always, I have prepared a tutorial and getting started video for your reference:
As always, let me know your questions and requests/recommendations for the indicator below. This indicator is my final reference indicator in my 3 part reference indicator release. I will be going back over the feedback to make improvements based on the suggestions I have received. So please feel free to leave any suggestions here and I will take them into consideration for improvement!
Thank you for checking this out and as always, safe trades!
Linear Regress on Price And VolumeLinear regression is a statistical method used to model the relationship between a dependent variable and one or more independent variables. It assumes a linear relationship between the dependent variable and the independent variable(s) and attempts to fit a straight line that best describes the relationship.
In the context of predicting the price of a stock based on the volume, we can use linear regression to build a model that relates the price of the stock (dependent variable) to the volume (independent variable). The idea is to use lookback period to predict future prices based on the volume.
To build this indicator, we start by collecting data on the price of the stock and the volume over a selected of time or by default 21 days. We then plot the data on a scatter plot with the volume on the x-axis and the price on the y-axis. If there is a clear pattern in the data, we can fit a straight line to the data using a method called least squares regression. The line represents the best linear approximation of the relationship between the price and the volume.
Once we have the line, we can use it to make predictions. For example, if we observe a certain volume, we can use the line to estimate the corresponding price.
It's worth noting that linear regression assumes a linear relationship between the variables. In reality, the relationship between the price and the volume may be more complex, and other factors may also influence the price of the stock. Therefore, while linear regression can be a useful tool, it should be used in conjunction with other methods and should be interpreted with caution.
Distance from the High/Low priceThis indicator shows how far the price is from the Top and Bottom over a set period of time.
The basic purpose of this indicator is to quickly compare how many symbols have risen over a certain period of time.
For example,
For example, let's say I want to see what the maximum increase is from the December, and how much it's currently down from there.
Then, let's set the "Length" to approximately 1500 and check it from December 18th.
So now you can see that bitcoin is up to about 44%, and it's down 6.9% from its peak.
-----
For the second example, let's say I want to see what the maximum increase in ALPHA is and how far it is currently from that maximum.
So, as you can see in the chart above, the maximum increase over the period was about 120%, and now it's down by 22.8%.
-----
In addition, if you check 'Retracement' in the indicator setting, you can see the ratio of the currently located returns based on Top and Bottom.
--------------------------------------------------------
이 지표는, 특정 기간동안 여러개의 symbol들이 얼마만큼의 상승을 했는지 빠르게 비교하기 위해 만들었습니다.
위에 첨부한 사진을 기준으로 말씀드리겠습니다.
2022년 12월 말부터 올라온 상승의 최대폭이 얼마인지, 그리고 그 최대 상승으로부터 현재 얼마나 떨어졌는지를 확인하고 싶은 상황이라고 하겠습니다.
그렇다면 'Length'를 대략 1500으로 설정하여 12월 18일부터 확인해보겠습니다.
그러면 비트코인은 최대 약 44%만큼 상승하였고, 현재 최고점으로부터 6.9% 떨어진 상황이라는 것을 확인할 수 있습니다.
---
두 번째 예시로, ALPHA의 최대 상승폭이 얼마인지, 그리고 그 최댓값으로부터 현재 얼마만큼 떨어져 있는 상황인지를 확인하고 싶다고 가정해보겠습니다.
그렇다면 위의 차트에서 보이는 바와 같이, 해당 기간동안 최대 상승폭이 약 120%였고, 현재 그 최댓값으로부터 22.8%정도 하락한 상황이라는 것을 확인할 수 있습니다.
---
번외로, 지표 설정에서 'Retracement'를 체크하시면, Top과 Bottom을 기준으로 현재 위치한 되돌림의 비율을 확인할 수 있습니다.
Premium Linear Regression - The Quant ScienceThis script calculates the average deviation of the source data from the linear regression. When used with the indicator, it can plot the data line and display various pieces of information, including the maximum average dispersion around the linear regression.
The code includes various user configurations, allowing for the specification of the start and end dates of the period for which to calculate linear regression, the length of the period to use for the calculation, and the data source to use.
The indicator is designed for multi-timeframe use and to facilitate analysis for traders who use regression models in their analysis. It displays a green linear regression line when the price is above the line and a red line when the price is below. The indicator also highlights areas of dispersion around the regression using circles, with bullish areas shown in green and bearish areas shown in red.
XYZ Super Fibonacci Channel Cluster
Simple setups
Just input two different ema, X and Y.
Multiple = input Phi factor (ex: 0.38 , 0.618 , 1.618 , 3.14)
Usage
Grouping movements into channels to identify trend acceleration and deceleration
Example usability in the BTC/USD trading pair (timeframe = 1D) =>
Input Setups
Source = hlc3
Multiplier = 2
X Ema = 13
Y Ema = 21
How to identify acceleration and deceleration?
H_1 to H_2 => Bullish but no acceleration (because at same top level border).
H_2 to H_3 => Bullish with acceleration (go up to another top level border).
H_3 to H_4 / H_4 to H_5 => Bullish deceleration (because drop to another top level border).
L_1 to L_2 => Bearish signal (because fall below EMA-super and touch the bottom border of Super Channel).
L_2 to L_3 => Bearish acceleration (drop to another bottom level border).
L_3 to L_4 => Bearish deceleration (go up to another bottom level border).
Pivot and Price DiscoveryA Population Sampled linear regression model that provides additional detail about the distribution moments (skew, kurtosis, variance and mean) as well as providing indicators that track when a pivot has enough momentum to trade on as well as expected ranges of future price action based on Std Devs.
For the momentum lines -- red indicates that there has been a reducing pivot with momentum, this continues as a grey line for continuation, and will be cancelled when an increasing pivot with momentum is encountered.
Forward looking trend triangle captures the +/- stated standard deviation from the latest bar_index over 2 periods. Movements that trace outside of this can be considered a precursor to an upcoming pivot, and by analyzing skewness and kurtosis, the probability of an upcoming pivot should be better understood.
I have really only looked at this for timescales greater than 5 minutes. Adjust the lookback length accordingly when moving to different timescales:
For example, 1 hr at 10m timescale will be a lookback length of 6 which is too low for accurate analysis, so keep the lookback length appropriate for the timescales being used.
Also realize that trade volume will skew the deviations and regression if you are including data outside of regular trading hours (futures are different, but also experience volume sensitivity -- I maylook into accounting for this in future versions.)
© TheGeeBee
Machine Learning: Lorentzian Classification█ OVERVIEW
A Lorentzian Distance Classifier (LDC) is a Machine Learning classification algorithm capable of categorizing historical data from a multi-dimensional feature space. This indicator demonstrates how Lorentzian Classification can also be used to predict the direction of future price movements when used as the distance metric for a novel implementation of an Approximate Nearest Neighbors (ANN) algorithm.
█ BACKGROUND
In physics, Lorentzian space is perhaps best known for its role in describing the curvature of space-time in Einstein's theory of General Relativity (2). Interestingly, however, this abstract concept from theoretical physics also has tangible real-world applications in trading.
Recently, it was hypothesized that Lorentzian space was also well-suited for analyzing time-series data (4), (5). This hypothesis has been supported by several empirical studies that demonstrate that Lorentzian distance is more robust to outliers and noise than the more commonly used Euclidean distance (1), (3), (6). Furthermore, Lorentzian distance was also shown to outperform dozens of other highly regarded distance metrics, including Manhattan distance, Bhattacharyya similarity, and Cosine similarity (1), (3). Outside of Dynamic Time Warping based approaches, which are unfortunately too computationally intensive for PineScript at this time, the Lorentzian Distance metric consistently scores the highest mean accuracy over a wide variety of time series data sets (1).
Euclidean distance is commonly used as the default distance metric for NN-based search algorithms, but it may not always be the best choice when dealing with financial market data. This is because financial market data can be significantly impacted by proximity to major world events such as FOMC Meetings and Black Swan events. This event-based distortion of market data can be framed as similar to the gravitational warping caused by a massive object on the space-time continuum. For financial markets, the analogous continuum that experiences warping can be referred to as "price-time".
Below is a side-by-side comparison of how neighborhoods of similar historical points appear in three-dimensional Euclidean Space and Lorentzian Space:
This figure demonstrates how Lorentzian space can better accommodate the warping of price-time since the Lorentzian distance function compresses the Euclidean neighborhood in such a way that the new neighborhood distribution in Lorentzian space tends to cluster around each of the major feature axes in addition to the origin itself. This means that, even though some nearest neighbors will be the same regardless of the distance metric used, Lorentzian space will also allow for the consideration of historical points that would otherwise never be considered with a Euclidean distance metric.
Intuitively, the advantage inherent in the Lorentzian distance metric makes sense. For example, it is logical that the price action that occurs in the hours after Chairman Powell finishes delivering a speech would resemble at least some of the previous times when he finished delivering a speech. This may be true regardless of other factors, such as whether or not the market was overbought or oversold at the time or if the macro conditions were more bullish or bearish overall. These historical reference points are extremely valuable for predictive models, yet the Euclidean distance metric would miss these neighbors entirely, often in favor of irrelevant data points from the day before the event. By using Lorentzian distance as a metric, the ML model is instead able to consider the warping of price-time caused by the event and, ultimately, transcend the temporal bias imposed on it by the time series.
For more information on the implementation details of the Approximate Nearest Neighbors (ANN) algorithm used in this indicator, please refer to the detailed comments in the source code.
█ HOW TO USE
Below is an explanatory breakdown of the different parts of this indicator as it appears in the interface:
Below is an explanation of the different settings for this indicator:
General Settings:
Source - This has a default value of "hlc3" and is used to control the input data source.
Neighbors Count - This has a default value of 8, a minimum value of 1, a maximum value of 100, and a step of 1. It is used to control the number of neighbors to consider.
Max Bars Back - This has a default value of 2000.
Feature Count - This has a default value of 5, a minimum value of 2, and a maximum value of 5. It controls the number of features to use for ML predictions.
Color Compression - This has a default value of 1, a minimum value of 1, and a maximum value of 10. It is used to control the compression factor for adjusting the intensity of the color scale.
Show Exits - This has a default value of false. It controls whether to show the exit threshold on the chart.
Use Dynamic Exits - This has a default value of false. It is used to control whether to attempt to let profits ride by dynamically adjusting the exit threshold based on kernel regression.
Feature Engineering Settings:
Note: The Feature Engineering section is for fine-tuning the features used for ML predictions. The default values are optimized for the 4H to 12H timeframes for most charts, but they should also work reasonably well for other timeframes. By default, the model can support features that accept two parameters (Parameter A and Parameter B, respectively). Even though there are only 4 features provided by default, the same feature with different settings counts as two separate features. If the feature only accepts one parameter, then the second parameter will default to EMA-based smoothing with a default value of 1. These features represent the most effective combination I have encountered in my testing, but additional features may be added as additional options in the future.
Feature 1 - This has a default value of "RSI" and options are: "RSI", "WT", "CCI", "ADX".
Feature 2 - This has a default value of "WT" and options are: "RSI", "WT", "CCI", "ADX".
Feature 3 - This has a default value of "CCI" and options are: "RSI", "WT", "CCI", "ADX".
Feature 4 - This has a default value of "ADX" and options are: "RSI", "WT", "CCI", "ADX".
Feature 5 - This has a default value of "RSI" and options are: "RSI", "WT", "CCI", "ADX".
Filters Settings:
Use Volatility Filter - This has a default value of true. It is used to control whether to use the volatility filter.
Use Regime Filter - This has a default value of true. It is used to control whether to use the trend detection filter.
Use ADX Filter - This has a default value of false. It is used to control whether to use the ADX filter.
Regime Threshold - This has a default value of -0.1, a minimum value of -10, a maximum value of 10, and a step of 0.1. It is used to control the Regime Detection filter for detecting Trending/Ranging markets.
ADX Threshold - This has a default value of 20, a minimum value of 0, a maximum value of 100, and a step of 1. It is used to control the threshold for detecting Trending/Ranging markets.
Kernel Regression Settings:
Trade with Kernel - This has a default value of true. It is used to control whether to trade with the kernel.
Show Kernel Estimate - This has a default value of true. It is used to control whether to show the kernel estimate.
Lookback Window - This has a default value of 8 and a minimum value of 3. It is used to control the number of bars used for the estimation. Recommended range: 3-50
Relative Weighting - This has a default value of 8 and a step size of 0.25. It is used to control the relative weighting of time frames. Recommended range: 0.25-25
Start Regression at Bar - This has a default value of 25. It is used to control the bar index on which to start regression. Recommended range: 0-25
Display Settings:
Show Bar Colors - This has a default value of true. It is used to control whether to show the bar colors.
Show Bar Prediction Values - This has a default value of true. It controls whether to show the ML model's evaluation of each bar as an integer.
Use ATR Offset - This has a default value of false. It controls whether to use the ATR offset instead of the bar prediction offset.
Bar Prediction Offset - This has a default value of 0 and a minimum value of 0. It is used to control the offset of the bar predictions as a percentage from the bar high or close.
Backtesting Settings:
Show Backtest Results - This has a default value of true. It is used to control whether to display the win rate of the given configuration.
█ WORKS CITED
(1) R. Giusti and G. E. A. P. A. Batista, "An Empirical Comparison of Dissimilarity Measures for Time Series Classification," 2013 Brazilian Conference on Intelligent Systems, Oct. 2013, DOI: 10.1109/bracis.2013.22.
(2) Y. Kerimbekov, H. Ş. Bilge, and H. H. Uğurlu, "The use of Lorentzian distance metric in classification problems," Pattern Recognition Letters, vol. 84, 170–176, Dec. 2016, DOI: 10.1016/j.patrec.2016.09.006.
(3) A. Bagnall, A. Bostrom, J. Large, and J. Lines, "The Great Time Series Classification Bake Off: An Experimental Evaluation of Recently Proposed Algorithms." ResearchGate, Feb. 04, 2016.
(4) H. Ş. Bilge, Yerzhan Kerimbekov, and Hasan Hüseyin Uğurlu, "A new classification method by using Lorentzian distance metric," ResearchGate, Sep. 02, 2015.
(5) Y. Kerimbekov and H. Şakir Bilge, "Lorentzian Distance Classifier for Multiple Features," Proceedings of the 6th International Conference on Pattern Recognition Applications and Methods, 2017, DOI: 10.5220/0006197004930501.
(6) V. Surya Prasath et al., "Effects of Distance Measure Choice on KNN Classifier Performance - A Review." .
█ ACKNOWLEDGEMENTS
@veryfid - For many invaluable insights, discussions, and advice that helped to shape this project.
@capissimo - For open sourcing his interesting ideas regarding various KNN implementations in PineScript, several of which helped inspire my original undertaking of this project.
@RikkiTavi - For many invaluable physics-related conversations and for his helping me develop a mechanism for visualizing various distance algorithms in 3D using JavaScript
@jlaurel - For invaluable literature recommendations that helped me to understand the underlying subject matter of this project.
@annutara - For help in beta-testing this indicator and for sharing many helpful ideas and insights early on in its development.
@jasontaylor7 - For helping to beta-test this indicator and for many helpful conversations that helped to shape my backtesting workflow
@meddymarkusvanhala - For helping to beta-test this indicator
@dlbnext - For incredibly detailed backtesting testing of this indicator and for sharing numerous ideas on how the user experience could be improved.
Ac Full Scalping 1.0These unified indicators are used for a 5-minute scalping strategy.
We regularly look for the RSI to be overbought and the price to be outside the bollinger bands as the main analysis.
This serves as a search protocol, to then analyze the price action by visually assisting us with 4 exponential moving averages to see wear or breakout of a move.
It also adds the distance from the price close to the 10-period exponential moving average, developed in two modes where you can mark a background color where the event occurs, or you can choose a shadow that is drawn from the exponential moving average to the closing price.
These two modes can be activated or deactivated so that each person can choose the most visually comfortable way to observe that distance, it is recommended to use one at a time and not both at the same time.
The distance indicator can also be used to change the distance percentage. The percentage as a minimum value admits 0.50%, but it is recommended to use it above 0.80% to make the analysis more effective.
People can also change colors of exponential moving averages, but it is not recommended, and the period cannot be changed to keep the analysis more specific.
The RSI indicator should be added separately, as it is used to see overbought values and divergences.
The other indicators are unified but can be turned on or off for better analysis.
As a summary, what is sought with this type of unified indicators is the attrition, break or retracement in 5-minute time frame to open only short trades.
Back to the FutureHallo, very simple indicator in order to view trends
we have two linear regressions
one is the regular one that we know at length 100
the other one is lagging or past linear which is shorter at length 30
the basic idea is that when we combine both we can see trend of the current and the past linear when they cross each other and from this we can make signals.
Assuming that past shorter trend has the value of resistance or threshold values, so cross of current linear of those points can show if the trend is to buy or to sell by signals seen in the arrows .
So past and present mix and give us the future.
need to solve issue when market goes sideways but it easy to see how the trend look by the signals .
past linear seen in concave lines the current is the other one.
signals of positive trends are arrow up green or blue. negative trend red or orange arrow down
R Squared - MomentumThis little oscillator just returns the R Squared Value of current price action.
It is designed to show trend direction momentum. Great for confluence!
Market Crashes/Chart Timeframes HighlightThis extremely helpful indicator allows you to highlight 7 custom date-based timeframes on your charts.
The default dates selected are what I consider to be the most significant 7 most recent market declines, including and since the 87 flash crash.
Note: The default dates are approximate but good enough to highlight the key timeframes of these pullbacks/crashes/corrections.
It's simple to use and does exactly what it should.
I created this indicator to make it easier when looking at the overall story of a chart. I found it helpful to highlight these areas to see how a market or equity has responded during these significant market pullbacks.
The highlight alone I’ve found helpful, and it becomes more powerful if you combine it with your own trusted trade system.
Also, to get the most out of using the default dates it’s important to understand the narrative behind each pullback/crash. Here’s the list of what I consider significant pullbacks:
Black Monday - Oct 87
1990s Recession - Jul 90 to Mar 91
Dot Com Bubble - 2000 to 2002 or so
Real Estate 2008 Crisis - I choose 2007-2009 to cover full insider knowledge and aftermath
2016 - 2018 - This isn't seen as a pullback, but I have it as significant because in many markets and equities, this was an almost equal percentage pullback as 2008. See Notes below
2020 Crash - Covid-19 and related shenanigans pullback
April 2021 to August 2022 - I believe we are in a current SHORT cycle so I've highlighted April 2021 as the start of what might be the start of a major decline testing Dot Com or lower levels.
A few notes on the above.
You'll find on most of the pullbacks listed above most equities and related markets behave similarly or have similar patterns.
The 2016-18 pullback is the most difficult to track. For instance, GE in this timeframe had a -80% decline, whereas BA depending on how you want to measure it had a 50-110% gain.
Correlated ATR Bands | AdulariHow do I use it?
Never use this indicator as standalone trading signal, it should be used as confluence.
It is highly recommended to use this indicator on the 15m timeframe and above, try experimenting with the inverse feature and multipliers as well.
When the price is above the moving average this shows the bullish trend is strong.
When the price is below the moving average this shows the bearish trend is strong.
When the moving average is purple, the trend is bullish , when it is gray, the trend is bearish.
When price is above the upper band this may indicate a bearish reversal.
When price is below the lower band this may indicate a bullish reversal.
Features:
Purple line for bullish trend and gray line for bearish trend.
Custom formula combining an ATR and Hull MA to clearly indicate trend strength and direction.
Unique approach to moving averages and bands by taking the average of 2 types of MA's combined with custom ATR's, then multiplying these by correlation factors.
Bands to indicate possible trend reversals when price crosses them.
How does it work?
1 — ATR value is calculated, then the correlation between the source and ATR is calculated.
2 — Final value is calculated using the following formula:
correlation * atr + (1 - correlation) * nz(atr , atr)
3 — Moving average is calculated with the following formula:
ta.hma((1-(correlation/100*(1+weight/10)))*(ta.sma(source+value, smoothing)+ta.sma(source-value,smoothing))/2,flength)
4 — Bands calculation using multipliers.
Correlated ATR MA | AdulariHow do I use it?
Never use this indicator as standalone trading signal, it should be used as confluence.
When the price is above the moving average this shows the bullish trend is strong.
When the price is below the moving average this shows the bearish trend is strong.
When the moving average is purple, the trend is bullish, when it is gray, the trend is bearish.
Features:
Purple line for bullish trend and gray line for bearish trend.
Custom formula combining an ATR and Hull MA to clearly indicate trend strength and direction.
Unique approach to moving averages by taking the average of 3 types of MA's combined with custom ATR's.
How does it work?
1 — ATR value is calculated, then the correlation between the source and ATR is calculated.
2 — Signal value is calculated from the difference between the previous source and ATR values.
3 — Final value is being calculated using the following formula:
cor * target + (1 - cor) * nz(atr , target)
4 — Moving average is calculated by getting the average of 3 values: a normal HMA, HMA plus final value, and HMA minus final value.
WaveTrend 3D█ OVERVIEW
WaveTrend 3D (WT3D) is a novel implementation of the famous WaveTrend (WT) indicator and has been completely redesigned from the ground up to address some of the inherent shortcomings associated with the traditional WT algorithm.
█ BACKGROUND
The WaveTrend (WT) indicator has become a widely popular tool for traders in recent years. WT was first ported to PineScript in 2014 by the user @LazyBear, and since then, it has ascended to become one of the Top 5 most popular scripts on TradingView.
The WT algorithm appears to have origins in a lesser-known proprietary algorithm called Trading Channel Index (TCI), created by AIQ Systems in 1986 as an integral part of their commercial software suite, TradingExpert Pro. The software’s reference manual states that “TCI identifies changes in price direction” and is “an adaptation of Donald R. Lambert’s Commodity Channel Index (CCI)”, which was introduced to the world six years earlier in 1980. Interestingly, a vestige of this early beginning can still be seen in the source code of LazyBear’s script, where the final EMA calculation is stored in an intermediate variable called “tci” in the code.
█ IMPLEMENTATION DETAILS
WaveTrend 3D is an alternative implementation of WaveTrend that directly addresses some of the known shortcomings of the indicator, including its unbounded extremes, susceptibility to whipsaw, and lack of insight into other timeframes.
In the canonical WT approach, an exponential moving average (EMA) for a given lookback window is used to assess the variability between price and two other EMAs relative to a second lookback window. Since the difference between the average price and its associated EMA is essentially unbounded, an arbitrary scaling factor of 0.015 is typically applied as a crude form of rescaling but still fails to capture 20-30% of values between the range of -100 to 100. Additionally, the trigger signal for the final EMA (i.e., TCI) crossover-based oscillator is a four-bar simple moving average (SMA), which further contributes to the net lag accumulated by the consecutive EMA calculations in the previous steps.
The core idea behind WT3D is to replace the EMA-based crossover system with modern Digital Signal Processing techniques. By assuming that price action adheres approximately to a Gaussian distribution, it is possible to sidestep the scaling nightmare associated with unbounded price differentials of the original WaveTrend method by focusing instead on the alteration of the underlying Probability Distribution Function (PDF) of the input series. Furthermore, using a signal processing filter such as a Butterworth Filter, we can eliminate the need for consecutive exponential moving averages along with the associated lag they bring.
Ideally, it is convenient to have the resulting probability distribution oscillate between the values of -1 and 1, with the zero line serving as a median. With this objective in mind, it is possible to borrow a common technique from the field of Machine Learning that uses a sigmoid-like activation function to transform our data set of interest. One such function is the hyperbolic tangent function (tanh), which is often used as an activation function in the hidden layers of neural networks due to its unique property of ensuring the values stay between -1 and 1. By taking the first-order derivative of our input series and normalizing it using the quadratic mean, the tanh function performs a high-quality redistribution of the input signal into the desired range of -1 to 1. Finally, using a dual-pole filter such as the Butterworth Filter popularized by John Ehlers, excessive market noise can be filtered out, leaving behind a crisp moving average with minimal lag.
Furthermore, WT3D expands upon the original functionality of WT by providing:
First-class support for multi-timeframe (MTF) analysis
Kernel-based regression for trend reversal confirmation
Various options for signal smoothing and transformation
A unique mode for visualizing an input series as a symmetrical, three-dimensional waveform useful for pattern identification and cycle-related analysis
█ SETTINGS
This is a summary of the settings used in the script listed in roughly the order in which they appear. By default, all default colors are from Google's TensorFlow framework and are considered to be colorblind safe.
Source: The input series. Usually, it is the close or average price, but it can be any series.
Use Mirror: Whether to display a mirror image of the source series; for visualizing the series as a 3D waveform similar to a soundwave.
Use EMA: Whether to use an exponential moving average of the input series.
EMA Length: The length of the exponential moving average.
Use COG: Whether to use the center of gravity of the input series.
COG Length: The length of the center of gravity.
Speed to Emphasize: The target speed to emphasize.
Width: The width of the emphasized line.
Display Kernel Moving Average: Whether to display the kernel moving average of the signal. Like PCA, an unsupervised Machine Learning technique whereby neighboring vectors are projected onto the Principal Component.
Display Kernel Signal: Whether to display the kernel estimator for the emphasized line. Like the Kernel MA, it can show underlying shifts in bias within a more significant trend by the colors reflected on the ribbon itself.
Show Oscillator Lines: Whether to show the oscillator lines.
Offset: The offset of the emphasized oscillator plots.
Fast Length: The length scale factor for the fast oscillator.
Fast Smoothing: The smoothing scale factor for the fast oscillator.
Normal Length: The length scale factor for the normal oscillator.
Normal Smoothing: The smoothing scale factor for the normal frequency.
Slow Length: The length scale factor for the slow oscillator.
Slow Smoothing: The smoothing scale factor for the slow frequency.
Divergence Threshold: The number of bars for the divergence to be considered significant.
Trigger Wave Percent Size: How big the current wave should be relative to the previous wave.
Background Area Transparency Factor: Transparency factor for the background area.
Foreground Area Transparency Factor: Transparency factor for the foreground area.
Background Line Transparency Factor: Transparency factor for the background line.
Foreground Line Transparency Factor: Transparency factor for the foreground line.
Custom Transparency: Transparency of the custom colors.
Total Gradient Steps: The maximum amount of steps supported for a gradient calculation is 256.
Fast Bullish Color: The color of the fast bullish line.
Normal Bullish Color: The color of the normal bullish line.
Slow Bullish Color: The color of the slow bullish line.
Fast Bearish Color: The color of the fast bearish line.
Normal Bearish Color: The color of the normal bearish line.
Slow Bearish Color: The color of the slow bearish line.
Bullish Divergence Signals: The color of the bullish divergence signals.
Bearish Divergence Signals: The color of the bearish divergence signals.
█ ACKNOWLEDGEMENTS
@LazyBear - For authoring the original WaveTrend port on TradingView
@PineCoders - For the beautiful color gradient framework used in this indicator
@veryfid - For the inspiration of using mirrored signals for cycle analysis and using multiple lookback windows as proxies for other timeframes
Nadaraya-Watson: Envelope (Non-Repainting)Due to popular request, this is an envelope implementation of my non-repainting Nadaraya-Watson indicator using the Rational Quadratic Kernel. For more information on this implementation, please refer to the original indicator located here:
What is an Envelope?
In technical analysis, an "envelope" typically refers to a pair of upper and lower bounds that surrounds price action to help characterize extreme overbought and oversold conditions. Envelopes are often derived from a simple moving average (SMA) and are placed at a predefined distance above and below the SMA from which they were generated. However, envelopes do not necessarily need to be derived from a moving average; they can be derived from any estimator, including a kernel estimator such as Nadaraya-Watson.
How to use this indicator?
Overall, this indicator offers a high degree of flexibility, and the location of the envelope's bands can be adjusted by (1) tweaking the parameters for the Rational Quadratic Kernel and (2) adjusting the lookback window for the custom ATR calculation. In a trending market, it is often helpful to use the Nadaraya-Watson estimate line as a floating SR and/or reversal zone. In a ranging market, it is often more convenient to use the two Upper Bands and two Lower Bands as reversal zones.
How are the Upper and Lower bounds calculated?
In this indicator, the Rational Quadratic (RQ) Kernel estimates the price value at each bar in a user-defined lookback window. From this estimation, the upper and lower bounds of the envelope are calculated based on a custom ATR calculated from the kernel estimations for the high, low, and close series, respectively. These calculations are then scaled against a user-defined multiplier, which can be used to further customize the Upper and Lower bounds for a given chart.
How to use Kernel Estimations like this for other indicators?
Kernel Functions are highly underrated, and when calibrated correctly, they have the potential to provide more value than any mundane moving average. For those interested in using non-repainting Kernel Estimations for technical analysis, I have written a Kernel Functions library that makes it easy to access various well-known kernel functions quickly. The Rational Quadratic Kernel is used in this implementation, but one can conveniently swap out other kernels from the library by modifying only a single line of code. For more details and usage examples, please refer to the Kernel Functions library located here:
[MAD] Fibonacci retracementThis is just a Fibonacci Retracement tool with some interactive information based on the actual closing price
How to use:
add the script,
input left bottom with the 1st click,
input top with the 2nd click
Informations you can see than:
Fiblevel (Price) %till_this_point = pricedifference
additional:
Bottom of the fib
Range Up in % + Price-Range
Range Down in %
you can shift the comma with the decimal functions for trading shitcoins as example
if looking into the past, level/price will follow, liveinfo using the close is than hidden
what will follow:
reverse
log/linear
autogrow when range will be wicked
maybe alerts on levels... have to think about how to capture correctly