Crypto Performance Index1. The Crypto Performance Index (CPI) estimates the price appreciation of a crypto asset relative to the overall crypto market performance. The indicator is calculated using a Sharpe Ratio principle enhanced with time-domain normalization and cumulative parametrization.
2. The CPI is based on the idea that the performance of an asset should be evaluated not only in terms of its absolute price movement, but also in terms of its risk-adjusted returns compared to the broader market. The Sharpe Ratio, which takes into account both the asset's return and its volatility, is a commonly used measure of risk-adjusted performance.
3. The CPI takes the Sharpe Ratio principle further by incorporating a time-domain normalization technique that adjusts for differences in volatility across different time periods. The cumulative parametrization ensures that the CPI considers the overall performance of the asset over a specified period of time.
4. To use the indicator, select a timeframe and set the standard deviation period (default is 20). The CPI line can be compared against various market benchmarks, including the total crypto market cap (white line), altcoins total market cap (blue line), low-cap altcoins (without ETH), and Bitcoin.
5. An upward slope of the CPI line indicates strong price performance of an asset, with a relatively high chance for the asset to continue growing faster than the market in the future. Conversely, a downward slope of the CPI line indicates weak price performance of an asset, with a relatively high chance for the asset to depreciate in price with respect to the rest of the market in the future.
6. Overall, the CPI provides a comprehensive measure of an asset's price performance, taking into account both its absolute return and its risk-adjusted return relative to the broader market. This makes it a valuable tool for investors looking to evaluate the performance of their crypto holdings and make informed decisions about buying, selling, or holding assets.
Regressions
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!!
Capital Line PackThe Capital Line Pack ( CLP ) indicator is a technical analysis tool that is designed to help traders and investors identify potential buying and selling opportunities in financial markets by using, inter alia, kernel regression methodoliges. It is a standalone indicator that can be placed on top of price chart displaying the Base MA, Capital Line and standard deviation bands.
The Capital Line is calculated based on volatility, measured by a z-scores* of a selected price source and a moving average (Base MA). The Base MA serves as the foundation for the Capital Line calculation and plays a critical role in determining its behavior and responsiveness to price movements. By selecting different types of moving averages as the Base MA, traders can adjust the sensitivity of the Capital Line to changes in market conditions, which can impact the signals generated by the indicator. The Base MA can be set at the user's choice including: SMA, EMA, Volume Weighted Moving Average (VWMA), Kernel Regression MA, HEMA, DEMA, T3.
For example, if a trader selects a EMA as the Base MA, the Capital Line will respond more quickly to changes in price compared to a more smoothed moving average, like a Volume Weighted Moving Average (VWMA) or Kernel Regression MA. This means that the Capital Line will be more sensitive to short-term price fluctuations with a EMA as the Base MA, while a VWMA or Kernel Regression MA will be less reactive to short-term price movements and more focused on longer-term trends.
Therefore, the choice of Base MA can have a significant impact on the behavior of the Capital Line, and traders need to select the most appropriate Base MA that suits their trading strategy and risk management preferences.
*The z-scores are calculated by comparing the current price to the average price over a certain period of time, and then dividing the difference by the standard deviation of the prices over that same period of time.
The Bands are calculated by adding and subtracting a standard deviation from the Base MA.
Bands help identify the volatility of the market, and when the bands are narrow, it suggests that the market is in a range-bound or flat period.
Indicator incorporates trade signals (labels and alerts). The method by which signals are generated can be selected by the user from several options:
Cap line color switch: Turning blue when it rises and red when it starts to fall.
Cap Line crosses the Base MA: This can be useful when the Base MA is weighted, for example, by volume, and the Cap Line Bandwidth and Relative weighting are set to small values.
Price crosses the Base MA: This is a popular and widely-used method that can provide reliable signals during trending market conditions. However, it may generate false signals during range-bound or flat market conditions.
Crossing of secondary MAs which can be selected in the indicator settings: This method provides traders with more flexibility and control over the signals generated by the indicator, but it may also be more complex and require more advanced technical analysis skills.
One of the standout features of our indicator is the ability to choose from several different style themes:
Pro
Modern
and Stealth
The "Pro" and "Modern" themes offer a clean and visually appealing display, while the "Stealth" theme is perfect for traders who want to focus on the price action or other indicators. The "Stealth" theme shades all the elements of the indicator while still keeping them in the field of visibility, allowing traders to concentrate on the most important aspects of their charts.
In addition to its trade signals, alerts, labels, and customizable themes, the indicator also offers several trend highlighting options to help traders visually backtest their trades. These options include candle coloring, background coloring, and highlighting with a histogram.
The candle coloring feature allows traders to customize the color of the candlesticks on their chart based on the direction of the trend. For example, bullish candles could be colored in teal, while bearish candles could be colored purple etc. This can make it easier for traders to identify trend movements and backtest their strategy.
The background coloring feature works similarly to the candle coloring feature, but it applies a color to the background of the chart rather than the candlesticks. This can be a useful way to highlight trends on the chart without obscuring the price action.
The histogram highlighting feature displays a histogram on the chart to show the difference between the upper and lower bands. This can be a useful way to visualize the strength of the trend and backtest trades based on the histogram readings.
NB! Remember, it is important to have a solid trading plan in place and to properly manage risk when trading.
Some traders may, depending upon customized settings, use the Capital Line as a capital risk management feature in trading. Our Capital Line indicator can be a useful tool, but it should not be the only factor considered when making trade decisions.
Lorentzian ML [Sublime Traders]Lorentzian ML
Context: The whole idea of this indicator is to use the Lorentzian Classifier (a popular machine learning model suited for analyzing data in a time series) , add some oscillators and filter them with volume averages in order to get precise swing move indications.
The Lorentzian ML indicator uses the Lorenzian Classifier (LDC) algorithm that takes into account the Commodity Channel Index (CCI) and Relative Strength Index (RSI) signals as raw material to provide buy and sell signals. The indicator is accompanied by take profit , stop loss and entry lines based on the Average True Range (ATR).
Features:
1. Lorentzian Classifier:
Uses the difference between the current and previous values of CCI and RSI to generate buy and sell signals.
The classifier threshold can be adjusted using the input parameter.
2. ATR-based Take Profit Line:
A horizontal take profit line is plotted when buy or sell signals occur.
The line is based on the ATR value and a user-defined multiplier.
3. VMA filtering
Using the simple switches: Scalper, Swing or Holder , the users can easily filter the frequency of the signals in addition to the lookback and threshold filters. This will affect the used VMA lines that use data gathered from multiple timeframes.
Visual Representation:
The indicator plots green candles for buy signals and red candles for sell signals.
Buy and sell labels are displayed on the chart to mark the points where signals occur.
The ATR-based take profit line is displayed in a user-defined color and line width.
Visual representation of the VMA lines : Red - bearish , Blue - uncertain , Green - bullish
Changes and features to come
Fix "holder" switch on sell side that sometimes bugs the whole chart.
Add more intuitive filtering methods.
Add two more oscillators to the Lorentzian pool.
Create switches for Lorentzian source.
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.
Triple Quadratic Regression - Supplementary UnderlayThis indicator is supplementary to our Triple Quadratic Regression overlaid indicator (which includes three step lines - a fast (fuchsia), a medium (yellow), and a slow (blue) quadratic regression line to help the user obtain a clearer picture of current trends).
Quadratic regression is better suited to determining (and predicting) trend than linear regression ; y = ax^2 + bx + c is better to use than a simple y = ax + b. Calculating the regression involves five summation equations that utilize the bar index (x1), the price source (defaulted to ohlc4), the desired lengths, and the square of x1. Determining the coefficient values requires an additional step that factors in the simple moving average of the source, bar index, and the squared bar index.
Instead of overlaying the three quadratic regression lines themselves, this underlaid indicator is used to show the normalized (-1 to +1) values of ax^2 and bx. The color of the lines and histogram match the associated lines on our overlaid indicator. Here, the solid fuchsia line is the fast QR's normalized ax^2 value, the solid yellow line is the mid QR's normalized ax^2 value, and the solid blue line is the slow QR's normalized ax^2 value. The histograms reflect the normalized bx values. In addition to these, the momentum of the ax^2 values was calculated and represented as a dotted line of the same colors.
Bar color is influenced by the values of ax^2 and bx of the fast and medium length regressions. If ax^2 and bx for both the fast and medium lengths are above 0, the bar color is green. If they are both under 0, the bar color is red. Otherwise, bars are colored gray.
When combined with our overlaid Triple Quadratic Regression indicator and the Triple Quadratic Regression Macro Score strategy (part of the LeafAlgo Premium Macro Strategies) to gather all of the information possible, your chart should look like this:
Triple Quadratic Regression (w/ Normalized Value Table)This indicator draws three step lines - a fast (fuchsia), a medium (yellow), and a slow (blue) quadratic regression line to help the user obtain a clearer picture of current trends. Quadratic regression is better suited to determining (and predicting) trend than linear regression; y = ax^2 + bx + c is better to use than a simple y = ax + b. Calculating the regression involves five summation equations that utilize the bar index (x1), the price source (defaulted to ohlc4), the desired lengths, and the square of x1. Determining the coefficient values requires an additional step that factors in the simple moving average of the source, bar index, and the squared bar index.
In addition to the plotted lines, a change in bar color and a table were added. The bar color is influenced by the values of ax^2 and bx of the fast and medium length regressions. If ax^2 and bx for both the fast and medium lengths are above 0, the bar color is green. If they are both under 0, the bar color is red. Otherwise, bars are colored gray. In the table, located at the bottom of the chart (but can be moved), the ax^2 and bx values for each regression length are shown. The option to view normalized (scale of -1 to +1) values or the standard values is included in the indicator settings menu. By default, the normalized values are shown.
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.
Investments/swing trading strategy for different assetsStop worrying about catching the lowest price, it's almost impossible!: with this trend-following strategy and protection from bearish phases, you will know how to enter the market properly to obtain benefits in the long term.
Backtesting context: 1899-11-01 to 2023-02-16 of SPX by Tvc. Commissions: 0.05% for each entry, 0.05% for each exit. Risk per trade: 2.5% of the total account
For this strategy, 5 indicators are used:
One Ema of 200 periods
Atr Stop loss indicator from Gatherio
Squeeze momentum indicator from LazyBear
Moving average convergence/divergence or Macd
Relative strength index or Rsi
Trade conditions:
There are three type of entries, one of them depends if we want to trade against a bearish trend or not.
---If we keep Against trend option deactivated, the rules for two type of entries are:---
First type of entry:
With the next rules, we will be able to entry in a pull back situation:
Squeeze momentum is under 0 line (red)
Close is above 200 Ema and close is higher than the past close
Histogram from macd is under 0 line and is higher than the past one
Once these rules are met, we enter into a buy position. Stop loss will be determined by atr stop loss (white point) and break even(blue point) by a risk/reward ratio of 1:1.
For closing this position: Squeeze momentum crosses over 0 and, until squeeze momentum crosses under 0, we close the position. Otherwise, we would have closed the position due to break even or stop loss.
Second type of entry:
With the next rules, we will not lose a possible bullish movement:
Close is above 200 Ema
Squeeze momentum crosses under 0 line
Once these rules are met, we enter into a buy position. Stop loss will be determined by atr stop loss (white point) and break even(blue point) by a risk/reward ratio of 1:1.
Like in the past type of entry, for closing this position: Squeeze momentum crosses over 0 and, until squeeze momentum crosses under 0, we close the position. Otherwise, we would have closed the position due to break even or stop loss.
---If we keep Against trend option activated, the rules are the same as the ones above, but with one more type of entry. This is more useful in weekly timeframes, but could also be used in daily time frame:---
Third type of entry:
Close is under 200 Ema
Squeeze momentum crosses under 0 line
Once these rules are met, we enter into a buy position. Stop loss will be determined by atr stop loss (white point) and break even(blue point) by a risk/reward ratio of 1:1.
Like in the past type of entries, for closing this position: Squeeze momentum crosses over 0 and, until squeeze momentum crosses under 0, we close the position. Otherwise, we would have closed the position due to break even or stop loss.
Risk management
For calculating the amount of the position you will use just a small percent of your initial capital for the strategy and you will use the atr stop loss for this.
Example: You have 1000 usd and you just want to risk 2,5% of your account, there is a buy signal at price of 4,000 usd. The stop loss price from atr stop loss is 3,900. You calculate the distance in percent between 4,000 and 3,900. In this case, that distance would be of 2.50%. Then, you calculate your position by this way: (initial or current capital * risk per trade of your account) / (stop loss distance).
Using these values on the formula: (1000*2,5%)/(2,5%) = 1000usd. It means, you have to use 1000 usd for risking 2.5% of your account.
We will use this risk management for applying compound interest.
In settings, with position amount calculator, you can enter the amount in usd of your account and the amount in percentage for risking per trade of the account. You will see this value in green color in the upper left corner that shows the amount in usd to use for risking the specific percentage of your account.
Script functions
Inside of settings, you will find some utilities for display atr stop loss, break evens, positions, signals, indicators, etc.
You will find the settings for risk management at the end of the script if you want to change something. But rebember, do not change values from indicators, the idea is to not over optimize the strategy.
If you want to change the initial capital for backtest the strategy, go to properties, and also enter the commisions of your exchange and slippage for more realistic results.
If you activate break even using rsi, when rsi crosses under overbought zone break even will be activated. This can work in some assets.
---Important: In risk managment you can find an option called "Use leverage ?", activate this if you want to backtest using leverage, which means that in case of not having enough money for risking the % determined by you of your account using your initial capital, you will use leverage for using the enough amount for risking that % of your acount in a buy position. Otherwise, the amount will be limited by your initial/current capital---
Some things to consider
USE UNDER YOUR OWN RISK. PAST RESULTS DO NOT REPRESENT THE FUTURE.
DEPENDING OF % ACCOUNT RISK PER TRADE, YOU COULD REQUIRE LEVERAGE FOR OPEN SOME POSITIONS, SO PLEASE, BE CAREFULL AND USE CORRECTLY THE RISK MANAGEMENT
Do not forget to change commissions and other parameters related with back testing results!
Some assets and timeframes where the strategy has also worked:
BTCUSD : 4H, 1D, W
SPX (US500) : 4H, 1D, W
GOLD : 1D, W
SILVER : 1D, W
ETHUSD : 4H, 1D
DXY : 1D
AAPL : 4H, 1D, W
AMZN : 4H, 1D, W
META : 4H, 1D, W
(and others stocks)
BANKNIFTY : 4H, 1D, W
DAX : 1D, W
RUT : 1D, W
HSI : 1D, W
NI225 : 1D, W
USDCOP : 1D, W
Z Pack BollingerOur new "Z Pack" indicator is a modified version of the traditional Bollinger Bands indicator, with a bunch of additional features what makes it a powerful tool that allows traders to make informed decisions based on the market's volatility and short-term trend.
The z-score of the Bollinger Bands indicator is a measure of how many standard deviations the current price is away from the moving average. This provides a more normalized view of the price action, which can be especially useful in identifying potential trend changes. In this form of indicator it is much easier to notice the most extreme deviations from the mean.
One of the main advantages of using this indicator is that it can help traders identify market conditions that are unusually far away from the mean, which can be indicative of a potential trend reversal or that, with sustained momentum a new trend may be about to begin.
Another advantage of the Z-Score Bollinger Bands indicator is that it can help traders identify when a market is trending. This is because when the Z-score is consistently high or low, it can indicate that a trend is in progress or that a trend may be reversing, respectively.
As for the additional features with which we have charged this indicator, there are many of them and they will be explained now.
Capital line
"Capital line" is based on a kernel regression of z score value over time.
The kernel regression is a non-parametric method that allows to estimate the underlying probability density function of a random variable and this way provides a smooth representation of the data. By using this method, the "Сapital line" is able to react to market changes much faster than traditional methods and gives traders a more accurate representation of the short-term trend.
Also we have developed a filter that reduces the number of false signals (you can toggle it in the settings). It is also possible to enable the display of only the capital line to focus only on it.
Divergence search
One of the unique features of the indicator is its ability to search for divergence between the z score and the price. A divergence occurs when the indicator and the price are moving in opposite directions, indicating a potential trend reversal. This allows traders to identify potential market turning points and make informed decisions.
It is possible to search for divergence on a Z-score, although it is not a common practice. In technical analysis, divergence is a method of comparing the movement of an asset's price with an indicator, such as an oscillator, in order to identify potential trend reversals. The same concept of divergence can be applied to a Z-score by comparing the movement of a value's Z-score to the underlying data, for example, by comparing the change in Z-score to the change in the underlying price of a stock. However, this is not a widely used approach and requires thoughtful analysis, but according to our observations, it provides quite important information about the potential exhaustion of the current trend.
By combining the z-score with the price, traders can look for divergences that might not be as obvious when looking at the indicator or the price alone. For example, if the z-score is trending higher while the price is trending lower, this could indicate a potential bullish reversal. Similarly, if the z-score is trending lower while the price is trending higher, this could indicate a potential bearish reversal.
Price Labels
The labels indicating the price of an asset that corresponds to a specific level of the standard deviation are a useful feature for traders because it allows them to quickly identify key levels of support and resistance. By placing limit orders at these levels, traders can potentially enter or exit trades at more favorable prices. This can help to improve the risk-reward ratio of their trades, as well as potentially increase the chances of a profitable outcome. Additionally, having these labels readily available can save traders time in identifying key levels of support and resistance, allowing them to focus on other aspects of their trading strategy.
Additionally, there is an option to analyze the previous volatility of the instrument for a specified time period. If the instrument has crossed the maximum standard deviation level at least once during the specified time period, a separate dashed line will be drawn on the z score chart, demonstrating how volatile the instrument is in the context of the specified time period. This is known as Extreme Mode.
The feature of analyzing the previous volatility of an instrument using the z score indicator can be beneficial for traders in a number of ways. One major advantage is that it allows traders to quickly assess the historical volatility of an instrument and compare it to current volatility levels. This can be useful for determining if an instrument is currently experiencing unusually high or low volatility, which can in turn inform trading decisions.
Another advantage of this feature is that it allows traders to quickly identify key levels of volatility that have been historically significant for the instrument. For example, if an instrument has frequently crossed the maximum deviation level during a specified time period, a trader may choose to place limit orders at that level in anticipation of the instrument reaching it again in the future.
The ability to see the price at a particular moment in time when the price breaks through the 4th(selectable) level of the z score can be an advantage for traders as it allows them to quickly identify key price levels and potentially place limit orders at those levels. This feature can be useful for traders who want to take advantage of market volatility or for those who want to set stop-loss or take-profit levels.
Additionally, the feature can be useful for identifying key levels of support and resistance, as well as for identifying potential entry and exit points for trades. By having the ability to quickly identify these key levels, traders can make more informed decisions about their trades and potentially increase their chances of success in the market.
Alerts
The "Z pack" indicator also includes an advanced, customisable alerting system, with alerts for z level touches, zero crossings, changes in the direction of the capital line, and confirmed or potential divergence. It allows them to stay informed of key developments in the market in real-time and take action accordingly.
For example, if the indicator generates an alert for a z level touch, a trader can place a market order at that level knowing that the price has reached a significant level of volatility. Similarly, an alert for a zero crossing (up/down) can indicate a change in trend, and a trader can use this information to adjust their strategy accordingly.
The alerts of confirmed or potential divergence can be especially useful for identifying potential turning points in the market and make decisions based on that.
NB! Remember, it is important to have a solid trading plan in place and to properly manage risk when trading. Our custom indicator can be a useful tool, but it should not be the only factor considered when making trade decisions.
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.