adaptive_mfi
█ Description
Money flow an indexed value-based price and volume for the specified input length (lookback period). In summary, a momentum indicator that attempt to measure the flow of money (identify buying/selling pressure) through the asset within a specified period of time. MFI will oscillate between 0 to 100, oftentimes comprehend the analysis with oversold (20) or overbought (80) level, and a divergence that spotted to signaling a further change in trend/direction. As similar to many other indicators that use length (commonly a fixed value) as an input parameter, can be optimized by applied an adaptive filter (Ehlers), to solve the measuring cycle period. In this indicator, the adaptive measure of dominant cycle as an input parameter for the lookback period/n, will be applied to the money flow index.
█ Money Flow Index
mfi = 100 - (100/(1 + money_flow_ratio))
where:
n = int(dominant_cycle)
money_flow_ratio = n positive raw_money_flow / n negative raw_money_flow
raw_money_flow = typical_price * volume
typical_price = hlc3
█ Feature
The indicator will have a specified default parameter of: hp_period = 48; source = ohlc4
Horizontal line indicates positive/negative money flow
MFI Color Scheme: Solid; Normalized
Adaptive
Donchian Volatility Indicator - Adaptive Channel WidthThis indicator is designed to help traders assess and analyze market volatility. By calculating the width of the Donchian channels, it provides valuable insights into the range of price movements over a specified period. This indicator helps traders identify periods of high and low volatility, enabling them to make more informed trading decisions.
The indicator is based on the concept of Donchian channels, which consist of the highest high and lowest low over a specified lookback period. The channel width is calculated as the difference between the upper and lower channels. A wider channel indicates higher volatility, suggesting potentially larger price movements and increased trading opportunities. On the other hand, a narrower channel suggests lower volatility, indicating a relatively calmer market environment with potentially fewer trading opportunities.
The adaptive aspect of the indicator refers to its ability to adjust the width of the channels dynamically based on market conditions. The indicator calculates the width of the channels using the Average True Range (ATR) indicator, which measures the average range of price movements over a specified period. By multiplying the ATR value with the user-defined ATR multiplier, the indicator adapts the width of the channels to reflect the current level of volatility. During periods of higher volatility, the channels expand to accommodate larger price movements, providing a broader range for assessing volatility. Conversely, during periods of lower volatility, the channels contract, reflecting the narrower price ranges and signaling a decrease in volatility. This adaptive nature allows traders to have a flexible and responsive measure of volatility, ensuring that the indicator reflects the current market conditions accurately.
To provide further insights, the indicator includes a signal line. The signal line is derived from the channel width and is calculated as a simple moving average over a specified signal period. This signal line acts as a reference level, allowing traders to compare the current channel width with the average width over a given time frame. By assessing whether the current channel width is above or below the signal line, traders can gain additional context on the volatility level in the market.
The colors used in the Donchian Volatility Indicator - Adaptive Channel Width play a vital role in visualizing the volatility levels:
-- Lime Color : When the channel width is above the signal line, it is colored lime. This color signifies that volatility has entered the market, indicating potentially higher price movements and increased trading opportunities. Traders can pay closer attention to the lime-colored channel width as it may suggest favorable conditions for trend-following or breakout trading strategies.
-- Fuchsia Color : When the channel width is below the signal line, it is colored fuchsia. This color represents relatively low volatility, suggesting a calmer market environment with potentially fewer trading opportunities. Traders may consider adjusting their strategies during periods of low volatility, such as employing range-bound or mean-reversion strategies.
-- Aqua Color : The signal line is represented by the aqua color. This color allows traders to easily identify the signal line amidst the channel width. The aqua color provides a visual reference for the average channel width and helps traders assess whether the current width is above or below this average.
The Donchian Volatility Indicator - Adaptive Channel Width has several practical applications for traders:
-- Volatility Assessment : Traders can use this indicator to assess the level of volatility in the market. By observing the width of the Donchian channels and comparing it to the signal line, they can determine whether the current volatility is relatively high or low. This information helps traders set appropriate expectations and adjust their trading strategies accordingly.
-- Breakout Trading : Wide channel widths may indicate an increased likelihood of price breakouts. Traders can use the Donchian Volatility Indicator - Adaptive Channel Width to identify potential breakout opportunities. When the channel width exceeds the signal line, it suggests a higher probability of significant price movements, potentially signaling a breakout. Traders may consider entering trades in the direction of the breakout.
-- Risk Management : The indicator can assist in setting appropriate stop-loss levels based on the current volatility. During periods of high volatility (lime-colored channel width), wider stop-loss orders may be warranted to account for larger price swings. Conversely, during periods of low volatility (fuchsia-colored channel width), narrower stop-loss orders may be appropriate to limit risk in a more range-bound market.
While the Donchian Volatility Indicator - Adaptive Channel Width is a valuable tool, it is important to consider its limitations:
-- Lagging Indicator : The indicator relies on historical price data, making it a lagging indicator. It provides insights based on past price movements and may not capture sudden changes or shifts in volatility. Traders should be aware that the indicator may not generate real-time signals and should be used in conjunction with other indicators and analysis tools.
-- False Signals : Like any technical indicator, the Donchian Volatility Indicator - Adaptive Channel Width is not immune to generating false signals. Traders should exercise caution and use additional analysis to confirm the signals generated by the indicator. Considering the broader market context and employing risk management techniques can help mitigate the impact of false signals.
-- Market Conditions : Market conditions can vary, and volatility levels can differ across different assets and timeframes. Traders should adapt their strategies and consider other market factors when interpreting the signals provided by the indicator. It is crucial to avoid relying solely on the indicator and to incorporate a comprehensive analysis of the market environment.
In conclusion, this indicator is a powerful tool for assessing market volatility. By examining the width of the Donchian channels and comparing it to the signal line, traders can gain insights into the level of volatility and adjust their trading strategies accordingly. The color-coded representation of the channel width and signal line allows for easy visualization and interpretation of the volatility dynamics. Traders should utilize this indicator as part of a broader trading approach, incorporating other technical analysis tools and considering market conditions for a comprehensive assessment of market volatility.
Adaptive Mean Reversion IndicatorThe Adaptive Mean Reversion Indicator is a tool for identifying mean reversion trading opportunities in the market. The indicator employs a dynamic approach by adapting its parameters based on the detected market regime, ensuring optimal performance in different market conditions.
To determine the market regime, the indicator utilizes a volatility threshold. By comparing the average true range (ATR) over a 14-period to the specified threshold, it determines whether the market is trending or ranging. This information is crucial as it sets the foundation for parameter optimization.
The parameter optimization process is an essential step in the indicator's calculation. It dynamically adjusts the lookback period and threshold level based on the identified market regime. In trending markets, a longer lookback period and higher threshold level are chosen to capture extended trends. In ranging markets, a shorter lookback period and lower threshold level are used to identify mean reversion opportunities within a narrower price range.
The mean reversion calculation lies at the core of this indicator. It starts with computing the mean value using the simple moving average (SMA) over the selected lookback period. This represents the average price level. The deviation is then determined by calculating the standard deviation of the closing prices over the same lookback period. The upper and lower bands are derived by adding and subtracting the threshold level multiplied by the deviation from the mean, respectively. These bands serve as dynamic levels that define potential overbought and oversold areas.
In real-time, the indicator's adaptability shines through. If the market is trending, the adaptive mean is set to the calculated mean value. The adaptive upper and lower bands are adjusted by scaling the threshold level with a factor of 0.75. This adjustment allows the indicator to be less sensitive to minor price fluctuations during trending periods, providing more robust mean reversion signals. In ranging market conditions, the regular mean, upper band, and lower band are used as they are more suited to capture mean reversion within a confined price range.
The signal generation component of the indicator identifies potential trading opportunities based on the relationship between the current close price and the adaptive upper and lower bands. If the close price is above the adaptive upper band, it suggests a potential short entry opportunity (-1). Conversely, if the close price is below the adaptive lower band, it indicates a potential long entry opportunity (1). When the close price is within the range defined by the adaptive upper and lower bands, no clear trading signal is generated (0).
To further strengthen the quality of signals, the indicator introduces a confluence condition based on the RSI. When the RSI exceeds the threshold levels of 70 or falls below the threshold level of 30, it indicates a strong momentum condition. By incorporating this confluence condition, the indicator ensures that mean reversion signals align with the prevailing market momentum. It reduces the likelihood of false signals and provides traders with added confidence when entering trades.
The indicator offers alert conditions to notify traders of potential trading opportunities. Alert conditions are set to trigger when a potential long entry signal (1) or a potential short entry signal (-1) aligns with the confluence condition. These alerts allow traders to stay informed about favorable mean reversion setups, even when they are not actively monitoring the charts. By leveraging alerts, traders can efficiently manage their time and take advantage of market opportunities.
To enhance visual interpretation, the indicator incorporates background coloration that provides valuable insights into the prevailing market conditions. When the indicator generates a potential short entry signal (-1) that aligns with the confluence condition, the background color is set to lime. This color suggests a bullish trend that is potentially reaching an exhaustion point and about to revert downwards. Similarly, when the indicator generates a potential long entry signal (1) that aligns with the confluence condition, the background color is set to fuchsia. This color represents a bearish trend that is potentially reaching an exhaustion point and about to revert upwards. By employing background coloration, the indicator enables traders to quickly identify market conditions that may offer mean reversion opportunities with a directional bias.
The indicator further enhances visual clarity by incorporating bar coloring that aligns with the prevailing market conditions and signals. When the indicator generates a potential short entry signal (-1) that aligns with the confluence condition, the bar color is set to lime. This color signifies a bullish trend that is potentially reaching an exhaustion point, indicating a high probability of a downward reversion. Conversely, when the indicator generates a potential long entry signal (1) that aligns with the confluence condition, the bar color is set to fuchsia. This color represents a bearish trend that is potentially reaching an exhaustion point, indicating a high probability of an upward reversion. By using distinct bar colors, the indicator provides traders with a clear visual distinction between bullish and bearish trends, facilitating easier identification of mean reversion opportunities within the context of the broader trend.
While the "Adaptive Mean Reversion Indicator" offers a robust framework for identifying mean reversion opportunities, it's important to remember that no indicator is foolproof. Traders should exercise caution and employ risk management strategies. Additionally, it is recommended to use this indicator in conjunction with other technical analysis tools and fundamental factors to make well-informed trading decisions. Regular backtesting and refinement of the indicator's parameters are crucial to ensure its effectiveness in different market conditions.
Volume-Weighted RSI with Adaptive SmoothingThis indicator is designed to provide traders with insights into the relative strength of a security by incorporating volume-weighted elements, effectively combining the concepts of Relative Strength Index (RSI) and volume-weighted averages to generate meaningful trading signals.
The indicator calculates the traditional RSI, which measures the speed and change of price movements, as well as the volume-weighted RSI, which considers the influence of trading volume on price action. It then applies adaptive smoothing to the volume-weighted RSI, allowing for customization of the smoothing process. The resulting smoothed volume-weighted RSI is plotted alongside the original RSI, providing traders with a comprehensive view of the price strength dynamics.
The line coloration in this indicator is designed to provide visual cues about the relationship between the RSI and the volume-weighted RSI. When the RSI line is above or equal to the volume-weighted RSI line, it suggests a potentially bullish condition with positive market momentum. In such cases, the line is colored lime. Conversely, when the RSI line (fuchsia) is below the volume-weighted RSI line, it indicates a potentially bearish condition with negative market momentum. The line color is set to fuchsia. By observing the line color, traders can quickly assess the relative strength between the RSI and the volume-weighted RSI, aiding their decision-making process.
The bar color and background color further enhance the visual interpretation of the indicator. The bar color reflects the RSI's relationship with the volume-weighted RSI and the predefined thresholds. If the RSI line is above both the volume-weighted RSI line and the overbought threshold (70), the bar color is set to lime, indicating a potentially overbought condition. Conversely, if the RSI line is below both the volume-weighted RSI line and the oversold threshold (30), the bar color is set to fuchsia, suggesting a potentially oversold condition. When the RSI line is between these two thresholds, the bar color is set to yellow, indicating a neutral or intermediate state. The background color, displayed with a semi-transparent shade, provides additional context by reflecting the prevailing market conditions. It turns lime if the volume-weighted RSI is above the overbought threshold, fuchsia if below the oversold threshold, and yellow if it falls between these two thresholds. This coloration scheme aids traders in quickly assessing market conditions and potential trading opportunities.
Calculations:
-- RSI Calculation : The traditional RSI is calculated based on the price movements of the asset. The up and down movements are determined, and exponential moving averages are used to smooth the values. The RSI value ranges from 0 to 100, with levels above 70 indicating overbought conditions and levels below 30 indicating oversold conditions.
-- Volume-Weighted RSI Calculation : The volume-weighted RSI incorporates the trading volume of the asset into the calculations. The closing price is multiplied by the corresponding volume, and the average is taken over a specific length. The up and down movements are smoothed using exponential moving averages to generate the volume-weighted RSI value.
-- Adaptive Smoothing : The indicator offers an adaptive smoothing option, allowing traders to customize the smoothing process of the volume-weighted RSI. By adjusting the smoothing length, traders can fine-tune the responsiveness of the indicator to changes in market conditions. Smoothing helps reduce noise and enhances the clarity of the signals.
Interpretation:
The indicator provides two main components for interpretation:
-- RSI : The traditional RSI reflects the price momentum and potential overbought or oversold conditions. Traders can look for RSI values above 70 as potential overbought signals, suggesting a possible price reversal or correction. Conversely, RSI values below 30 indicate potential oversold signals, indicating a potential price rebound or rally.
-- Volume-Weighted RSI : The volume-weighted RSI incorporates trading volume, which provides insights into the strength of price movements. When the volume-weighted RSI is above the traditional RSI, it suggests that the buying pressure supported by higher volume is stronger, potentially indicating a more reliable trend. Conversely, when the volume-weighted RSI is below the traditional RSI, it suggests that the selling pressure supported by higher volume is stronger, potentially indicating a more significant price reversal.
Potential Strategies:
-- Overbought and Oversold Signals : Traders can utilize the RSI component of the indicator to identify overbought and oversold conditions. A potential strategy is to consider taking short positions when the RSI is above 70 and long positions when the RSI is below 30. These levels can act as dynamic support and resistance areas, indicating possible price reversals.
-- Confirmation with Volume : Traders can use the volume-weighted RSI as a confirmation tool to validate price movements. When the volume-weighted RSI is above the traditional RSI, it may provide additional confirmation for long positions, suggesting stronger buying pressure. Conversely, when the volume-weighted RSI is below the traditional RSI, it may provide confirmation for short positions, indicating stronger selling pressure.
-- Trend Reversal Strategy : Watch for the volume-weighted RSI to reach extreme levels above 70 (overbought) or below 30 (oversold). Look for a reversal signal where the RSI line (green or fuchsia) crosses below or above the volume-weighted RSI line. Enter a trade when the reversal signal occurs, and the RSI line changes color. Exit the trade when the RSI line crosses back in the opposite direction or reaches the opposite extreme level.
-- Divergence Strategy : Compare the direction of the RSI line (green or fuchsia) with the volume-weighted RSI line. A bullish divergence occurs when the RSI line makes higher lows while the volume-weighted RSI line makes lower lows. A bearish divergence occurs when the RSI line makes lower highs while the volume-weighted RSI line makes higher highs. Once a divergence is identified, wait for the RSI line to cross above or below the volume-weighted RSI line as confirmation of a potential trend reversal. Consider using additional indicators or price action analysis to time the entry more accurately. Use stop-loss orders and profit targets to manage risk and secure profits.
-- Trend Continuation Strategy : Assess the overall trend direction by observing the RSI line's position relative to the volume-weighted RSI line. When the RSI line consistently stays above the volume-weighted RSI line, it indicates a bullish trend, while the opposite suggests a bearish trend. Look for temporary pullbacks within the ongoing trend where the RSI line (green or fuchsia) touches or crosses the volume-weighted RSI line. Enter trades in the direction of the dominant trend when the RSI line crosses back in the trend direction. Exit the trade when the RSI line starts to deviate significantly from the volume-weighted RSI line or when the trend shows signs of weakening through other technical or fundamental factors.
Limitations:
-- False Signals : Like any indicator, the "Volume-Weighted RSI with Adaptive Smoothing" may produce false signals, especially during periods of low liquidity or choppy market conditions. Traders should exercise caution and consider using additional confirmation indicators or tools to validate the signals generated by this indicator.
-- Lagging Nature : The indicator relies on historical price data and volume to calculate the RSI and volume-weighted RSI. As a result, the signals provided may have a certain degree of lag compared to real-time price action. Traders should be aware of this inherent lag and consider combining the indicator with other timely indicators to enhance the accuracy of their trading decisions.
-- Parameter Sensitivity : The indicator's effectiveness can be influenced by the choice of parameters, such as the length of the RSI, smoothing length, and adaptive smoothing option. Different market conditions may require adjustments to these parameters to optimize performance. Traders are encouraged to conduct thorough testing and analysis to determine the most suitable parameter values for their specific trading strategies and preferences.
-- Market Conditions : The indicator's performance may vary depending on the prevailing market conditions. It is essential to understand that no indicator can guarantee accurate predictions or consistently profitable trades. Traders should consider the broader market context, fundamental factors, and other technical indicators to complement the insights provided by the "Volume-Weighted RSI with Adaptive Smoothing" indicator.
-- Subjectivity : Interpretation of the indicator's signals involves subjective judgment. Traders may have varying interpretations of overbought and oversold levels, as well as the significance of the volume-weighted RSI in relation to the traditional RSI. It is crucial to combine the indicator with personal analysis and trading experience to make informed trading decisions.
Remember, no single indicator can provide foolproof trading signals. The "Volume-Weighted RSI with Adaptive Smoothing" indicator serves as a valuable tool for analyzing price strength and volume dynamics. It can assist traders in identifying potential entry and exit points, validating trends, and managing risk. However, it should be used as part of a comprehensive trading strategy that considers multiple factors and indicators to increase the likelihood of successful trades.
Non Adaptive Moving Average - Quan DaoThis Non-Adaptive Moving Average (NAMA) is my origin work. It came from the issues that I always face when using existing famous MA like EMA or RMA:
- What length should I choose for the MA for this security?
- Is there a length that works for multiple timeframes?
- Is there a length that works for multiple securities in multiple markets?
Choosing the right length for an MA is a tedious and boring work and is very subjective. One day in early 2023, I decided to create a new MA that will not be dependant a lot (non-adaptive) on the length of it, to make my life a little bit easier. The idea came from the formula of EMA and RMA:
ma = alpha * src + (1 - alpha) * ma
in which,
alpha = 1 / length for RMA
alpha = 2 / (length + 1) for EMA
I decided to use a constant alpha for the formula, which happened to be: 1.618 / 100 (i.e., golden ratio / 100)
This NAMA is using the length in the start only, after running for a while the MA value will be the same for every value of its length, which resolves good my 3 questions above.
The application of this NAMA is wide, I think.
- It can be used like a normal MA but you don't have to choose its length anymore.
- It can be used like EMA in DEMA, TEMA (I called it DNAMA, TNAMA)
- It can be used in calculating some famous indicators (RSI, TR, ...) so that these indicators will not be dependant on the length as well
In this example script, I included an EMA (in blue color) as well so that you can see how the EMA changes and NAMA stays the same when changing the value of its Length.
Benner-Fibonacci Reversal Points [CC]This is an original script based on a very old idea called the Benner Theory from the Civil War times. Benner discovered a pattern in pig iron prices (no clue what those are), and this turned out to be a parallel idea to indicators based on Fibonacci numbers. Because a year is 365 days (nearly 377, which is a Fibonacci number), made up of 52 weeks (nearly 55, which is another Fibonacci number), or 12 months (nearly 13, which is another Fibonacci number), Benner theorized that he could find both past and future turning points in the market by using a pattern he found. He discovered that peaks in prices seemed to follow a pattern of 8-9-10, meaning that after a recent peak, it would be 8 bars until the next peak, 9 bars until after that peak for the next, and 10 bars until the following peak. For past peaks, he would just need to reverse this pattern, and so the previous peak would be 10 bars before the most current peak, 9 bars before that peak, and 8 bars before the previous one, and these patterns seemed to repeat. For troughs, he found a pattern of 16,18,20 which follows the same logic, and this idea also seemed to work on long-term peaks and troughs as well.
This is my version of the Benner theory and the major difference between my version and his is that he would manually select a year or date and either work backwards or forwards from that point. I chose to go with an adaptive version that will automatically detect those points and plot those past and future points. I have included several options such as allowing the algorithm to be calculated in reverse which seems to work well for Crypto for some reason. I also have both short and long term options to only show one or both if you choose and of course the option to enable repainting or leave it disabled.
Big thanks to @HeWhoMustNotBeNamed and @RicardoSantos for helping me fix some bugs in my code and for @kerpiciwuasile for suggesting this idea in the first place.
Endpointed SSA of Price [Loxx]The Endpointed SSA of Price: A Comprehensive Tool for Market Analysis and Decision-Making
The financial markets present sophisticated challenges for traders and investors as they navigate the complexities of market behavior. To effectively interpret and capitalize on these complexities, it is crucial to employ powerful analytical tools that can reveal hidden patterns and trends. One such tool is the Endpointed SSA of Price, which combines the strengths of Caterpillar Singular Spectrum Analysis, a sophisticated time series decomposition method, with insights from the fields of economics, artificial intelligence, and machine learning.
The Endpointed SSA of Price has its roots in the interdisciplinary fusion of mathematical techniques, economic understanding, and advancements in artificial intelligence. This unique combination allows for a versatile and reliable tool that can aid traders and investors in making informed decisions based on comprehensive market analysis.
The Endpointed SSA of Price is not only valuable for experienced traders but also serves as a useful resource for those new to the financial markets. By providing a deeper understanding of market forces, this innovative indicator equips users with the knowledge and confidence to better assess risks and opportunities in their financial pursuits.
█ Exploring Caterpillar SSA: Applications in AI, Machine Learning, and Finance
Caterpillar SSA (Singular Spectrum Analysis) is a non-parametric method for time series analysis and signal processing. It is based on a combination of principles from classical time series analysis, multivariate statistics, and the theory of random processes. The method was initially developed in the early 1990s by a group of Russian mathematicians, including Golyandina, Nekrutkin, and Zhigljavsky.
Background Information:
SSA is an advanced technique for decomposing time series data into a sum of interpretable components, such as trend, seasonality, and noise. This decomposition allows for a better understanding of the underlying structure of the data and facilitates forecasting, smoothing, and anomaly detection. Caterpillar SSA is a particular implementation of SSA that has proven to be computationally efficient and effective for handling large datasets.
Uses in AI and Machine Learning:
In recent years, Caterpillar SSA has found applications in various fields of artificial intelligence (AI) and machine learning. Some of these applications include:
1. Feature extraction: Caterpillar SSA can be used to extract meaningful features from time series data, which can then serve as inputs for machine learning models. These features can help improve the performance of various models, such as regression, classification, and clustering algorithms.
2. Dimensionality reduction: Caterpillar SSA can be employed as a dimensionality reduction technique, similar to Principal Component Analysis (PCA). It helps identify the most significant components of a high-dimensional dataset, reducing the computational complexity and mitigating the "curse of dimensionality" in machine learning tasks.
3. Anomaly detection: The decomposition of a time series into interpretable components through Caterpillar SSA can help in identifying unusual patterns or outliers in the data. Machine learning models trained on these decomposed components can detect anomalies more effectively, as the noise component is separated from the signal.
4. Forecasting: Caterpillar SSA has been used in combination with machine learning techniques, such as neural networks, to improve forecasting accuracy. By decomposing a time series into its underlying components, machine learning models can better capture the trends and seasonality in the data, resulting in more accurate predictions.
Application in Financial Markets and Economics:
Caterpillar SSA has been employed in various domains within financial markets and economics. Some notable applications include:
1. Stock price analysis: Caterpillar SSA can be used to analyze and forecast stock prices by decomposing them into trend, seasonal, and noise components. This decomposition can help traders and investors better understand market dynamics, detect potential turning points, and make more informed decisions.
2. Economic indicators: Caterpillar SSA has been used to analyze and forecast economic indicators, such as GDP, inflation, and unemployment rates. By decomposing these time series, researchers can better understand the underlying factors driving economic fluctuations and develop more accurate forecasting models.
3. Portfolio optimization: By applying Caterpillar SSA to financial time series data, portfolio managers can better understand the relationships between different assets and make more informed decisions regarding asset allocation and risk management.
Application in the Indicator:
In the given indicator, Caterpillar SSA is applied to a financial time series (price data) to smooth the series and detect significant trends or turning points. The method is used to decompose the price data into a set number of components, which are then combined to generate a smoothed signal. This signal can help traders and investors identify potential entry and exit points for their trades.
The indicator applies the Caterpillar SSA method by first constructing the trajectory matrix using the price data, then computing the singular value decomposition (SVD) of the matrix, and finally reconstructing the time series using a selected number of components. The reconstructed series serves as a smoothed version of the original price data, highlighting significant trends and turning points. The indicator can be customized by adjusting the lag, number of computations, and number of components used in the reconstruction process. By fine-tuning these parameters, traders and investors can optimize the indicator to better match their specific trading style and risk tolerance.
Caterpillar SSA is versatile and can be applied to various types of financial instruments, such as stocks, bonds, commodities, and currencies. It can also be combined with other technical analysis tools or indicators to create a comprehensive trading system. For example, a trader might use Caterpillar SSA to identify the primary trend in a market and then employ additional indicators, such as moving averages or RSI, to confirm the trend and generate trading signals.
In summary, Caterpillar SSA is a powerful time series analysis technique that has found applications in AI and machine learning, as well as financial markets and economics. By decomposing a time series into interpretable components, Caterpillar SSA enables better understanding of the underlying structure of the data, facilitating forecasting, smoothing, and anomaly detection. In the context of financial trading, the technique is used to analyze price data, detect significant trends or turning points, and inform trading decisions.
█ Input Parameters
This indicator takes several inputs that affect its signal output. These inputs can be classified into three categories: Basic Settings, UI Options, and Computation Parameters.
Source: This input represents the source of price data, which is typically the closing price of an asset. The user can select other price data, such as opening price, high price, or low price. The selected price data is then utilized in the Caterpillar SSA calculation process.
Lag: The lag input determines the window size used for the time series decomposition. A higher lag value implies that the SSA algorithm will consider a longer range of historical data when extracting the underlying trend and components. This parameter is crucial, as it directly impacts the resulting smoothed series and the quality of extracted components.
Number of Computations: This input, denoted as 'ncomp,' specifies the number of eigencomponents to be considered in the reconstruction of the time series. A smaller value results in a smoother output signal, while a higher value retains more details in the series, potentially capturing short-term fluctuations.
SSA Period Normalization: This input is used to normalize the SSA period, which adjusts the significance of each eigencomponent to the overall signal. It helps in making the algorithm adaptive to different timeframes and market conditions.
Number of Bars: This input specifies the number of bars to be processed by the algorithm. It controls the range of data used for calculations and directly affects the computation time and the output signal.
Number of Bars to Render: This input sets the number of bars to be plotted on the chart. A higher value slows down the computation but provides a more comprehensive view of the indicator's performance over a longer period. This value controls how far back the indicator is rendered.
Color bars: This boolean input determines whether the bars should be colored according to the signal's direction. If set to true, the bars are colored using the defined colors, which visually indicate the trend direction.
Show signals: This boolean input controls the display of buy and sell signals on the chart. If set to true, the indicator plots shapes (triangles) to represent long and short trade signals.
Static Computation Parameters:
The indicator also includes several internal parameters that affect the Caterpillar SSA algorithm, such as Maxncomp, MaxLag, and MaxArrayLength. These parameters set the maximum allowed values for the number of computations, the lag, and the array length, ensuring that the calculations remain within reasonable limits and do not consume excessive computational resources.
█ A Note on Endpionted, Non-repainting Indicators
An endpointed indicator is one that does not recalculate or repaint its past values based on new incoming data. In other words, the indicator's previous signals remain the same even as new price data is added. This is an important feature because it ensures that the signals generated by the indicator are reliable and accurate, even after the fact.
When an indicator is non-repainting or endpointed, it means that the trader can have confidence in the signals being generated, knowing that they will not change as new data comes in. This allows traders to make informed decisions based on historical signals, without the fear of the signals being invalidated in the future.
In the case of the Endpointed SSA of Price, this non-repainting property is particularly valuable because it allows traders to identify trend changes and reversals with a high degree of accuracy, which can be used to inform trading decisions. This can be especially important in volatile markets where quick decisions need to be made.
Adaptive Price Channel StrategyThis strategy is an adaptive price channel strategy based on the Average True Range (ATR) indicator and the Average Directional Index (ADX). It aims to identify sideways markets and trends in the price movements and make trades accordingly.
The strategy uses a length parameter for the ATR and ADX indicators, which determines the length of the calculation for these indicators. The strategy also uses an ATR multiplier, which is multiplied by the ATR to determine the upper and lower bounds of the price channel.
The first step of the strategy is to calculate the highest high (HH) and lowest low (LL) over the specified length. The ATR is also calculated over the same length. Then the strategy calculates the positive directional indicator (+DI) and negative directional indicator (-DI) based on the up and down moves in the price, and uses these to calculate the ADX.
If the ADX is less than 25, the market is considered to be in a sideways phase. In this case, if the price closes above the upper bound of the price channel (HH - ATR multiplier * ATR), the strategy enters a long position, and if the price closes below the lower bound of the price channel (LL + ATR multiplier * ATR), the strategy enters a short position.
If the ADX is greater than or equal to 25 and the +DI is greater than the -DI, the market is considered to be in a bullish phase. In this case, if the price closes above the upper bound of the price channel, the strategy enters a long position. If the ADX is greater than or equal to 25 and the +DI is less than the -DI, the market is considered to be in a bearish phase. In this case, if the price closes below the lower bound of the price channel, the strategy enters a short position.
The strategy exits a position after a certain number of bars have passed since the entry, as specified by the exit_length input.
In summary, this strategy attempts to trade in accordance with the prevailing market conditions by identifying sideways markets and trends and making trades based on price movements within a dynamically-adjusted price channel.
This strategy takes a read on the market and either takes a channel strategy or trades volatility based on current trend. Works well on 2, 3 ,4, 12 hour for BTC. It’s my first attempt and creating a strategy. I am very interested in constructive criticism. I will look into better risk management, maybe a trailing stop loss. Other suggestions welcome. This is my first attempt at a strategy.
Here are the settings I used.
Inputs
Length 20
Exit 10
ATR 3.2
Dates I picked when I got into Crypto
Properties
Capital 1000
Order size 2 Contracts
Pyramiding 1
Commission .05
STD-Filtered Jurik Volty Adaptive TEMA [Loxx]The STD-Filtered Jurik Volty Adaptive TEMA is an advanced moving average overlay indicator that incorporates adaptive period inputs from Jurik Volty into a Triple Exponential Moving Average (TEMA). The resulting value is further refined using a standard deviation filter to minimize noise. This adaptation aims to develop a faster TEMA that leads the standard, non-adaptive TEMA. However, during periods of low volatility, the output may be noisy, so a standard deviation filter is employed to decrease choppiness, yielding a highly responsive TEMA without the noise typically caused by low market volatility.
█ What is Jurik Volty?
Jurik Volty calculates the price volatility and relative price volatility factor.
The Jurik smoothing includes 3 stages:
1st stage - Preliminary smoothing by adaptive EMA
2nd stage - One more preliminary smoothing by Kalman filter
3rd stage - Final smoothing by unique Jurik adaptive filter
Here's a breakdown of the code:
1. volty(float src, int len) => defines a function called volty that takes two arguments: src, which represents the source price data (like close price), and len, which represents the length or period for calculating the indicator.
2. int avgLen = 65 sets the length for the Simple Moving Average (SMA) to 65.
3. Various variables are initialized like volty, voltya, bsmax, bsmin, and vsum.
4. len1 is calculated as math.max(math.log(math.sqrt(0.5 * (len-1))) / math.log(2.0) + 2.0, 0); this expression involves some mathematical transformations based on the len input. The purpose is to create a dynamic factor that will be used later in the calculations.
5. pow1 is calculated as math.max(len1 - 2.0, 0.5); this variable is another dynamic factor used in further calculations.
6. del1 and del2 represent the differences between the current src value and the previous values of bsmax and bsmin, respectively.
7. volty is assigned a value based on a conditional expression, which checks whether the absolute value of del1 is greater than the absolute value of del2. This step is essential for determining the direction and magnitude of the price change.
8. vsum is updated based on the previous value and the difference between the current and previous volty values.
9. The Simple Moving Average (SMA) of vsum is calculated with the length avgLen and assigned to avg.
10. Variables dVolty, pow2, len2, and Kv are calculated using various mathematical transformations based on previously calculated variables. These variables are used to adjust the Jurik Volty indicator based on the observed volatility.
11. The bsmax and bsmin variables are updated based on the calculated Kv value and the direction of the price change.
12. inally, the temp variable is calculated as the ratio of avolty to vsum. This value represents the Jurik Volty indicator's output and can be used to analyze the market trends and potential reversals.
Jurik Volty can be used to identify periods of high or low volatility and to spot potential trade setups based on price behavior near the volatility bands.
█ What is the Triple Exponential Moving Average?
The Triple Exponential Moving Average (TEMA) is a technical indicator used by traders and investors to identify trends and price reversals in financial markets. It is a more advanced and responsive version of the Exponential Moving Average (EMA). TEMA was developed by Patrick Mulloy and introduced in the January 1994 issue of Technical Analysis of Stocks & Commodities magazine. The aim of TEMA is to minimize the lag associated with single and double exponential moving averages while also filtering out market noise, thus providing a smoother, more accurate representation of the market trend.
To understand TEMA, let's first briefly review the EMA.
Exponential Moving Average (EMA):
EMA is a weighted moving average that gives more importance to recent price data. The formula for EMA is:
EMA_t = (Price_t * α) + (EMA_(t-1) * (1 - α))
Where:
EMA_t: EMA at time t
Price_t: Price at time t
α: Smoothing factor (α = 2 / (N + 1))
N: Length of the moving average period
EMA_(t-1): EMA at time t-1
Triple Exponential Moving Average (TEMA):
Triple Exponential Moving Average (TEMA):
TEMA combines three exponential moving averages to provide a more accurate and responsive trend indicator. The formula for TEMA is:
TEMA = 3 * EMA_1 - 3 * EMA_2 + EMA_3
Where:
EMA_1: The first EMA of the price data
EMA_2: The EMA of EMA_1
EMA_3: The EMA of EMA_2
Here are the steps to calculate TEMA:
1. Choose the length of the moving average period (N).
2. Calculate the smoothing factor α (α = 2 / (N + 1)).
3. Calculate the first EMA (EMA_1) using the price data and the smoothing factor α.
4. Calculate the second EMA (EMA_2) using the values of EMA_1 and the same smoothing factor α.
5. Calculate the third EMA (EMA_3) using the values of EMA_2 and the same smoothing factor α.
5. Finally, compute the TEMA using the formula: TEMA = 3 * EMA_1 - 3 * EMA_2 + EMA_3
The Triple Exponential Moving Average, with its combination of three EMAs, helps to reduce the lag and filter out market noise more effectively than a single or double EMA. It is particularly useful for short-term traders who require a responsive indicator to capture rapid price changes. Keep in mind, however, that TEMA is still a lagging indicator, and as with any technical analysis tool, it should be used in conjunction with other indicators and analysis methods to make well-informed trading decisions.
Extras
Signals
Alerts
Bar coloring
Loxx's Expanded Source Types (see below):
Adaptive Candlestick Pattern Recognition System█ INTRODUCTION
Nearly three years in the making, intermittently worked on in the few spare hours of weekends and time off, this is a passion project I undertook to flesh out my skills as a computer programmer. This script currently recognizes 85 different candlestick patterns ranging from one to five candles in length. It also performs statistical analysis on those patterns to determine prior performance and changes the coloration of those patterns based on that performance. In searching TradingView's script library for scripts similar to this one, I had found a handful. However, when I reviewed the ones which were open source, I did not see many that truly captured the power of PineScrypt or leveraged the way it works to create efficient and reliable code; one of the main driving factors for releasing this 5,000+ line behemoth open sourced.
Please take the time to review this description and source code to utilize this script to its fullest potential.
█ CONCEPTS
This script covers the following topics: Candlestick Theory, Trend Direction, Higher Timeframes, Price Analysis, Statistic Analysis, and Code Design.
Candlestick Theory - This script focuses solely on the concept of Candlestick Theory: arrangements of candlesticks may form certain patterns that can potentially influence the future price action of assets which experience those patterns. A full list of patterns (grouped by pattern length) will be in its own section of this description. This script contains two modes of operation for identifying candlestick patterns, 'CLASSIC' and 'BREAKOUT'.
CLASSIC: In this mode, candlestick patterns will be identified whenever they appear. The user has a wide variety of inputs to manipulate that can change how certain patterns are identified and even enable alerts to notify themselves when these patterns appear. Each pattern selected to appear will have their Profit or Loss (P/L) calculated starting from the first candle open succeeding the pattern to a candle close specified some number of candles ahead. These P/L calculations are then collected for each pattern, and split among partitions of prior price action of the asset the script is currently applied to (more on that in Higher Timeframes ).
BREAKOUT: In this mode, P/L calculations are held off until a breakout direction has been confirmed. The user may specify the number of candles ahead of a pattern's appearance (from one to five) that a pattern has to confirm a breakout in either an upward or downward direction. A breakout is constituted when there is a candle following the appearance of the pattern that closes above/at the highest high of the pattern, or below/at its lowest low. Only then will percent return calculations be performed for the pattern that's been identified, and these percent returns are broken up not only by the partition they had appeared in but also by the breakout direction itself. Patterns which do not breakout in either direction will be ignored, along with having their labels deleted.
In both of these modes, patterns may be overridden. Overrides occur when a smaller pattern has been detected and ends up becoming one (or more) of the candles of a larger pattern. A key example of this would be the Bearish Engulfing and the Three Outside Down patterns. A Three Outside Down necessitates a Bearish Engulfing as the first two candles in it, while the third candle closes lower. When a pattern is overridden, the return for that pattern will no longer be tracked. Overrides will not occur if the tail end of a larger pattern occurs at the beginning of a smaller pattern (Ex: a Bullish Engulfing occurs on the third candle of a Three Outside Down and the candle immediately following that pattern, the Three Outside Down pattern will not be overridden).
Important Functionality Note: These patterns are only searched for at the most recently closed candle, not on the currently closing candle, which creates an offset of one for this script's execution. (SEE LIMITATIONS)
Trend Direction - Many of the patterns require a trend direction prior to their appearance. Noting TradingView's own publication of candlestick patterns, I utilize a similar method for determining trend direction. Moving Averages are used to determine which trend is currently taking place for candlestick patterns to be sought out. The user has access to two Moving Averages which they may individually modify the following for each: Moving Average type (list of 9), their length, width, source values, and all variables associated with two special Moving Averages (Least Squares and Arnaud Legoux).
There are 3 settings for these Moving Averages, the first two switch between the two Moving Averages, and the third uses both. When using individual Moving Averages, the user may select a 'price point' to compare against the Moving Average (default is close). This price point is compared to the Moving Average at the candles prior to the appearance of candle patterns. Meaning: The close compared to the Moving Average two candles behind determines the trend direction used for Candlestick Analysis of one candle patterns; three candles behind for two candle patterns and so on. If the selected price point is above the Moving Average, then the current trend is an 'uptrend', 'downtrend' otherwise.
The third setting using both Moving Averages will compare the lengths of each, and trend direction is determined by the shorter Moving Average compared to the longer one. If the shorter Moving Average is above the longer, then the current trend is an 'uptrend', 'downtrend' otherwise. If the lengths of the Moving Averages are the same, or both Moving Averages are Symmetrical, then MA1 will be used by default. (SEE LIMITATIONS)
Higher Timeframes - This script employs the use of Higher Timeframes with a few request.security calls. The purpose of these calls is strictly for the partitioning of an asset's chart, splitting the returns of patterns into three separate groups. The four inputs in control of this partitioning split the chart based on: A given resolution to grab values from, the length of time in that resolution, and 'Upper' and 'Lower Limits' which split the trading range provided by that length of time in that resolution that forms three separate groups. The default values for these four inputs will partition the current chart by the yearly high-low range where: the 'Upper' partition is the top 20% of that trading range, the 'Middle' partition is 80% to 33% of the trading range, and the 'Lower' partition covers the trading range within 33% of the yearly low.
Patterns which are identified by this script will have their returns grouped together based on which partition they had appeared in. For example, a Bullish Engulfing which occurs within a third of the yearly low will have its return placed separately from a Bullish Engulfing that occurred within 20% of the yearly high. The idea is that certain patterns may perform better or worse depending on when they had occurred during an asset's trading range.
Price Analysis - Price Analysis is a major part of this script's functionality as it can fundamentally change how patterns are shown to the user. The settings related to Price Analysis include setting the number of candles ahead of a pattern's appearance to determine the return of that pattern. In 'BREAKOUT' mode, an additional setting allows the user to specify where the P/L calculation will begin for a pattern that had appeared and confirmed. (SEE LIMITATIONS)
The calculation for percent returns of patterns is illustrated with the following pseudo-code (CLASSIC mode, this is a simplified version of the actual code):
type patternObj
int ID
int partition
type returnsArray
float returns
// No pattern found = na returned
patternObj TEST_VAL = f_FindPattern()
priorTestVal = TEST_VAL
if not na( priorTestVal )
pnlMatrixRow = priorTestVal.ID
pnlMatrixCol = priorTestVal.partition
matrixReturn = matrix.get(PERCENT_RETURNS, pnlMatrixRow, pnlMatrixCol)
percentReturn = ( (close - open ) / open ) * 100%
array.push(matrixReturn.returns, percentReturn)
Statistic Analysis - This script uses Pine's built-in array functions to conduct the Statistic Analysis for patterns. When a pattern is found and its P/L calculation is complete, its return is added to a 'Return Array' User-Defined-Type that contains numerous fields which retain information on a pattern's prior performance. The actual UDT is as follows:
type returnArray
float returns = na
int size = 0
float avg = 0
float median = 0
float stdDev = 0
int polarities = na
All values within this UDT will be updated when a return is added to it (some based on user input). The array.avg , array.median and array.stdev will be ran and saved into their respective fields after a return is placed in the 'returns' array. The 'polarities' integer array is what will be changed based on user input. The user specifies two different percentages that declare 'Positive' and 'Negative' returns for patterns. When a pattern returns above, below, or in between these two values, different indices of this array will be incremented to reflect the kind of return that pattern had just experienced.
These values (plus the full name, partition the pattern occurred in, and a 95% confidence interval of expected returns) will be displayed to the user on the tooltip of the labels that identify patterns. Simply scroll over the pattern label to view each of these values.
Code Design - Overall this script is as much of an art piece as it is functional. Its design features numerous depictions of ASCII Art that illustrate what is being attempted by the functions that identify patterns, and an incalculable amount of time was spent rewriting portions of code to improve its efficiency. Admittedly, this final version is nearly 1,000 lines shorter than a previous version (one which took nearly 30 seconds after compilation to run, and didn't do nearly half of what this version does). The use of UDTs, especially the 'patternObj' one crafted and redesigned from the Hikkake Hunter 2.0 I published last month, played a significant role in making this script run efficiently. There is a slight rigidity in some of this code mainly around pattern IDs which are responsible for displaying the abbreviation for patterns (as well as the full names under the tooltips, and the matrix row position for holding returns), as each is hard-coded to correspond to that pattern.
However, one thing I would like to mention is the extensive use of global variables for pattern detection. Many scripts I had looked over for ideas on how to identify candlestick patterns had the same idea; break the pattern into a set of logical 'true/false' statements derived from historically referencing candle OHLC values. Some scripts which identified upwards of 20 to 30 patterns would reference Pine's built-in OHLC values for each pattern individually, potentially requesting information from TradingView's servers numerous times that could easily be saved into a variable for re-use and only requested once per candle (what this script does).
█ FEATURES
This script features a massive amount of switches, options, floating point values, detection settings, and methods for identifying/tailoring pattern appearances. All modifiable inputs for patterns are grouped together based on the number of candles they contain. Other inputs (like those for statistics settings and coloration) are grouped separately and presented in a way I believe makes the most sense.
Not mentioned above is the coloration settings. One of the aims of this script was to make patterns visually signify their behavior to the user when they are identified. Each pattern has its own collection of returns which are analyzed and compared to the inputs of the user. The user may choose the colors for bullish, neutral, and bearish patterns. They may also choose the minimum number of patterns needed to occur before assigning a color to that pattern based on its behavior; a color for patterns that have not met this minimum number of occurrences yet, and a color for patterns that are still processing in BREAKOUT mode.
There are also an additional three settings which alter the color scheme for patterns: Statistic Point-of-Reference, Adaptive coloring, and Hard Limiting. The Statistic Point-of-Reference decides which value (average or median) will be compared against the 'Negative' and 'Positive Return Tolerance'(s) to guide the coloration of the patterns (or for Adaptive Coloring, the generation of a color gradient).
Adaptive Coloring will have this script produce a gradient that patterns will be colored along. The more bullish or bearish a pattern is, the further along the gradient those patterns will be colored starting from the 'Neutral' color (hard lined at the value of 0%: values above this will be colored bullish, bearish otherwise). When Adaptive Coloring is enabled, this script will request the highest and lowest values (these being the Statistic Point-of-Reference) from the matrix containing all returns and rewrite global variables tied to the negative and positive return tolerances. This means that all patterns identified will be compared with each other to determine bullish/bearishness in Adaptive Coloring.
Hard Limiting will prevent these global variables from being rewritten, so patterns whose Statistic Point-of-Reference exceed the return tolerances will be fully colored the bullish or bearish colors instead of a generated gradient color. (SEE LIMITATIONS)
Apart from the Candle Detection Modes (CLASSIC and BREAKOUT), there's an additional two inputs which modify how this script behaves grouped under a "MASTER DETECTION SETTINGS" tab. These two "Pattern Detection Settings" are 'SWITCHBOARD' and 'TARGET MODE'.
SWITCHBOARD: Every single pattern has a switch that is associated with its detection. When a switch is enabled, the code which searches for that pattern will be run. With the Pattern Detection Setting set to this, all patterns that have their switches enabled will be sought out and shown.
TARGET MODE: There is an additional setting which operates on top of 'SWITCHBOARD' that singles out an individual pattern the user specifies through a drop down list. The names of every pattern recognized by this script will be present along with an identifier that shows the number of candles in that pattern (Ex: " (# candles)"). All patterns enabled in the switchboard will still have their returns measured, but only the pattern selected from the "Target Pattern" list will be shown. (SEE LIMITATIONS)
The vast majority of other features are held in the one, two, and three candle pattern sections.
For one-candle patterns, there are:
3 — Settings related to defining 'Tall' candles:
The number of candles to sample for previous candle-size averages.
The type of comparison done for 'Tall' Candles: Settings are 'RANGE' and 'BODY'.
The 'Tolerance' for tall candles, specifying what percent of the 'average' size candles must exceed to be considered 'Tall'.
When 'Tall Candle Setting' is set to RANGE, the high-low ranges are what the current candle range will be compared against to determine if a candle is 'Tall'. Otherwise the candle bodies (absolute value of the close - open) will be compared instead. (SEE LIMITATIONS)
Hammer Tolerance - How large a 'discarded wick' may be before it disqualifies a candle from being a 'Hammer'.
Discarded wicks are compared to the size of the Hammer's candle body and are dependent upon the body's center position. Hammer bodies closer to the high of the candle will have the upper wick used as its 'discarded wick', otherwise the lower wick is used.
9 — Doji Settings, some pulled from an old Doji Hunter I made a while back:
Doji Tolerance - How large the body of a candle may be compared to the range to be considered a 'Doji'.
Ignore N/S Dojis - Turns off Trend Direction for non-special Dojis.
GS/DF Doji Settings - 2 Inputs that enable and specify how large wicks that typically disqualify Dojis from being 'Gravestone' or 'Dragonfly' Dojis may be.
4 Settings related to 'Long Wick Doji' candles detailed below.
A Tolerance for 'Rickshaw Man' Dojis specifying how close the center of the body must be to the range to be valid.
The 4 settings the user may modify for 'Long Legged' Dojis are: A Sample Base for determining the previous average of wicks, a Sample Length specifying how far back to look for these averages, a Behavior Setting to define how 'Long Legged' Dojis are recognized, and a tolerance to specify how large in comparison to the prior wicks a Doji's wicks must be to be considered 'Long Legged'.
The 'Sample Base' list has two settings:
RANGE: The wicks of prior candles are compared to their candle ranges and the 'wick averages' will be what the average percent of ranges were in the sample.
WICKS: The size of the wicks themselves are averaged and returned for comparing against the current wicks of a Doji.
The 'Behavior' list has three settings:
ONE: Only one wick length needs to exceed the average by the tolerance for a Doji to be considered 'Long Legged'.
BOTH: Both wick lengths need to exceed the average of the tolerance of their respective wicks (upper wicks are compared to upper wicks, lower wicks compared to lower) to be considered 'Long Legged'.
AVG: Both wicks and the averages of the previous wicks are added together, divided by two, and compared. If the 'average' of the current wicks exceeds this combined average of prior wicks by the tolerance, then this would constitute a valid 'Long Legged' Doji. (For Dojis in general - SEE LIMITATIONS)
The final input is one related to candle patterns which require a Marubozu candle in them. The two settings for this input are 'INCLUSIVE' and 'EXCLUSIVE'. If INCLUSIVE is selected, any opening/closing variant of Marubozu candles will be allowed in the patterns that require them.
For two-candle patterns, there are:
2 — Settings which define 'Engulfing' parameters:
Engulfing Setting - Two options, RANGE or BODY which sets up how one candle may 'engulf' the previous.
Inclusive Engulfing - Boolean which enables if 'engulfing' candles can be equal to the values needed to 'engulf' the prior candle.
For the 'Engulfing Setting':
RANGE: If the second candle's high-low range completely covers the high-low range of the prior candle, this is recognized as 'engulfing'.
BODY: If the second candle's open-close completely covers the open-close of the previous candle, this is recognized as 'engulfing'. (SEE LIMITATIONS)
4 — Booleans specifying different settings for a few patterns:
One which allows for 'opens within body' patterns to let the second candle's open/close values match the prior candles' open/close.
One which forces 'Kicking' patterns to have a gap if the Marubozu setting is set to 'INCLUSIVE'.
And Two which dictate if the individual candles in 'Stomach' patterns need to be 'Tall'.
8 — Floating point values which affect 11 different patterns:
One which determines the distance the close of the first candle in a 'Hammer Inverted' pattern must be to the low to be considered valid.
One which affects how close the opens/closes need to be for all 'Lines' patterns (Bull/Bear Meeting/Separating Lines).
One that allows some leeway with the 'Matching Low' pattern (gives a small range the second candle close may be within instead of needing to match the previous close).
Three tolerances for On Neck/In Neck patterns (2 and 1 respectively).
A tolerance for the Thrusting pattern which give a range the close the second candle may be between the midpoint and close of the first to be considered 'valid'.
A tolerance for the two Tweezers patterns that specifies how close the highs and lows of the patterns need to be to each other to be 'valid'.
The first On Neck tolerance specifies how large the lower wick of the first candle may be (as a % of that candle's range) before the pattern is invalidated. The second tolerance specifies how far up the lower wick to the close the second candle's close may be for this pattern. The third tolerance for the In Neck pattern determines how far into the body of the first candle the second may close to be 'valid'.
For the remaining patterns (3, 4, and 5 candles), there are:
3 — Settings for the Deliberation pattern:
A boolean which forces the open of the third candle to gap above the close of the second.
A tolerance which changes the proximity of the third candle's open to the second candle's close in this pattern.
A tolerance that sets the maximum size the third candle may be compared to the average of the first two candles.
One boolean value for the Two Crows patterns (standard and Upside Gapping) that forces the first two candles in the patterns to completely gap if disabled (candle 1's close < candle 2's low).
10 — Floating point values for the remaining patterns:
One tolerance for defining how much the size of each candle in the Identical Black Crows pattern may deviate from the average of themselves to be considered valid.
One tolerance for setting how close the opens/closes of certain three candle patterns may be to each other's opens/closes.*
Three floating point values that affect the Three Stars in the South pattern.
One tolerance for the Side-by-Side patterns - looks at the second and third candle closes.
One tolerance for the Stick Sandwich pattern - looks at the first and third candle closes.
A floating value that sizes the Concealing Baby Swallow pattern's 3rd candle wick.
Two values for the Ladder Bottom pattern which define a range that the third candle's wick size may be.
* This affects the Three Black Crows (non-identical) and Three White Soldiers patterns, each require the opens and closes of every candle to be near each other.
The first tolerance of the Three Stars in the South pattern affects the first candle body's center position, and defines where it must be above to be considered valid. The second tolerance specifies how close the second candle must be to this same position, as well as the deviation the ratio the candle body to its range may be in comparison to the first candle. The third restricts how large the second candle range may be in comparison to the first (prevents this pattern from being recognized if the second candle is similar to the first but larger).
The last two floating point values define upper and lower limits to the wick size of a Ladder Bottom's fourth candle to be considered valid.
█ HOW TO USE
While there are many moving parts to this script, I attempted to set the default values with what I believed may help identify the most patterns within reasonable definitions. When this script is applied to a chart, the Candle Detection Mode (along with the BREAKOUT settings) and all candle switches must be confirmed before patterns are displayed. All switches are on by default, so this gives the user an opportunity to pick which patterns to identify first before playing around in the settings.
All of the settings/inputs described above are meant for experimentation. I encourage the user to tweak these values at will to find which set ups work best for whichever charts they decide to apply these patterns to.
Refer to the patterns themselves during experimentation. The statistic information provided on the tooltips of the patterns are meant to help guide input decisions. The breadth of candlestick theory is deep, and this was an attempt at capturing what I could in its sea of information.
█ LIMITATIONS
DISCLAIMER: While it may seem a bit paradoxical that this script aims to use past performance to potentially measure future results, past performance is not indicative of future results . Markets are highly adaptive and often unpredictable. This script is meant as an informational tool to show how patterns may behave. There is no guarantee that confidence intervals (or any other metric measured with this script) are accurate to the performance of patterns; caution must be exercised with all patterns identified regardless of how much information regarding prior performance is available.
Candlestick Theory - In the name, Candlestick Theory is a theory , and all theories come with their own limits. Some patterns identified by this script may be completely useless/unprofitable/unpredictable regardless of whatever combination of settings are used to identify them. However, if I truly believed this theory had no merit, this script would not exist. It is important to understand that this is a tool meant to be utilized with an array of others to procure positive (or negative, looking at you, short sellers ) results when navigating the complex world of finance.
To address the functionality note however, this script has an offset of 1 by default. Patterns will not be identified on the currently closing candle, only on the candle which has most recently closed. Attempting to have this script do both (offset by one or identify on close) lead to more trouble than it was worth. I personally just want users to be aware that patterns will not be identified immediately when they appear.
Trend Direction - Moving Averages - There is a small quirk with how MA settings will be adjusted if the user inputs two moving averages of the same length when the "MA Setting" is set to 'BOTH'. If Moving Averages have the same length, this script will default to only using MA 1 regardless of if the types of Moving Averages are different . I will experiment in the future to alleviate/reduce this restriction.
Price Analysis - BREAKOUT mode - With how identifying patterns with a look-ahead confirmation works, the percent returns for patterns that break out in either direction will be calculated on the same candle regardless of if P/L Offset is set to 'FROM CONFIRMATION' or 'FROM APPEARANCE'. This same issue is present in the Hikkake Hunter script mentioned earlier. This does not mean the P/L calculations are incorrect , the offset for the calculation is set by the number of candles required to confirm the pattern if 'FROM APPEARANCE' is selected. It just means that these two different P/L calculations will complete at the same time independent of the setting that's been selected.
Adaptive Coloring/Hard Limiting - Hard Limiting is only used with Adaptive Coloring and has no effect outside of it. If Hard Limiting is used, it is recommended to increase the 'Positive' and 'Negative' return tolerance values as a pattern's bullish/bearishness may be disproportionately represented with the gradient generated under a hard limit.
TARGET MODE - This mode will break rules regarding patterns that are overridden on purpose. If a pattern selected in TARGET mode would have otherwise been absorbed by a larger pattern, it will have that pattern's percent return calculated; potentially leading to duplicate returns being included in the matrix of all returns recognized by this script.
'Tall' Candle Setting - This is a wide-reaching setting, as approximately 30 different patterns or so rely on defining 'Tall' candles. Changing how 'Tall' candles are defined whether by the tolerance value those candles need to exceed or by the values of the candle used for the baseline comparison (RANGE/BODY) can wildly affect how this script functions under certain conditions. Refer to the tooltip of these settings for more information on which specific patterns are affected by this.
Doji Settings - There are roughly 10 or so two to three candle patterns which have Dojis as a part of them. If all Dojis are disabled, it will prevent some of these larger patterns from being recognized. This is a dependency issue that I may address in the future.
'Engulfing' Setting - Functionally, the two 'Engulfing' settings are quite different. Because of this, the 'RANGE' setting may cause certain patterns that would otherwise be valid under textbook and online references/definitions to not be recognized as such (like the Upside Gap Two Crows or Three Outside down).
█ PATTERN LIST
This script recognizes 85 patterns upon initial release. I am open to adding additional patterns to it in the future and any comments/suggestions are appreciated. It recognizes:
15 — 1 Candle Patterns
4 Hammer type patterns: Regular Hammer, Takuri Line, Shooting Star, and Hanging Man
9 Doji Candles: Regular Dojis, Northern/Southern Dojis, Gravestone/Dragonfly Dojis, Gapping Up/Down Dojis, and Long-Legged/Rickshaw Man Dojis
White/Black Long Days
32 — 2 Candle Patterns
4 Engulfing type patterns: Bullish/Bearish Engulfing and Last Engulfing Top/Bottom
Dark Cloud Cover
Bullish/Bearish Doji Star patterns
Hammer Inverted
Bullish/Bearish Haramis + Cross variants
Homing Pigeon
Bullish/Bearish Kicking
4 Lines type patterns: Bullish/Bearish Meeting/Separating Lines
Matching Low
On/In Neck patterns
Piercing pattern
Shooting Star (2 Lines)
Above/Below Stomach patterns
Thrusting
Tweezers Top/Bottom patterns
Two Black Gapping
Rising/Falling Window patterns
29 — 3 Candle Patterns
Bullish/Bearish Abandoned Baby patterns
Advance Block
Collapsing Doji Star
Deliberation
Upside/Downside Gap Three Methods patterns
Three Inside/Outside Up/Down patterns (4 total)
Bullish/Bearish Side-by-Side patterns
Morning/Evening Star patterns + Doji variants
Stick Sandwich
Downside/Upside Tasuki Gap patterns
Three Black Crows + Identical variation
Three White Soldiers
Three Stars in the South
Bullish/Bearish Tri-Star patterns
Two Crows + Upside Gap variant
Unique Three River Bottom
3 — 4 Candle Patterns
Concealing Baby Swallow
Bullish/Bearish Three Line Strike patterns
6 — 5 Candle Patterns
Bullish/Bearish Breakaway patterns
Ladder Bottom
Mat Hold
Rising/Falling Three Methods patterns
█ WORKS CITED
Because of the amount of time needed to complete this script, I am unable to provide exact dates for when some of these references were used. I will also not provide every single reference, as citing a reference for each individual pattern and the place it was reviewed would lead to a bibliography larger than this script and its description combined. There were five major resources I used when building this script, one book, two websites (for various different reasons including patterns, moving averages, and various other articles of information), various scripts from TradingView's public library (including TradingView's own source code for *all* candle patterns ), and PineScrypt's reference manual.
Bulkowski, Thomas N. Encyclopedia of Candlestick Patterns . Hoboken, New Jersey: John Wiley & Sons Inc., 2008. E-book (google books).
Various. Numerous webpages. CandleScanner . 2023. online. Accessed 2020 - 2023.
Various. Numerous webpages. Investopedia . 2023. online. Accessed 2020 - 2023.
█ AKNOWLEDGEMENTS
I want to take the time here to thank all of my friends and family, both online and in real life, for the support they've given me over the last few years in this endeavor. My pets who tried their hardest to keep me from completing it. And work for the grit to continue pushing through until this script's completion.
This belongs to me just as much as it does anyone else. Whether you are an institutional trader, gold bug hedging against the dollar, retail ape who got in on a squeeze, or just parents trying to grow their retirement/save for the kids. This belongs to everyone.
Private Beta for new features to be tested can be found here .
Vires In Numeris
Adaptive Fusion ADX VortexIntroduction
The Adaptive Fusion ADX DI Vortex Indicator is a powerful tool designed to help traders identify trend strength and potential trend reversals in the market. This indicator uses a combination of technical analysis (TA) and mathematical concepts to provide accurate and reliable signals.
Features
The Adaptive Fusion ADX DI Vortex Indicator has several features that make it a powerful tool for traders. The Fusion Mode combines the Vortex Indicator and the ADX DI indicator to provide a more accurate picture of the market. The Hurst Exponent Filter helps to filter out choppy markets (inspired by balipour). Additionally, the indicator can be customized with various inputs and settings to suit individual trading strategies.
Signals
The enterLong signal is generated when the algorithm detects that it's a good time to buy a stock or other asset. This signal is based on certain conditions such as the values of technical indicators like ADX, Vortex, and Fusion. For example, if the ADX value is above a certain threshold and there is a crossover between the plus and minus lines of the ADX indicator, then the algorithm will generate an enterLong signal.
Similarly, the enterShort signal is generated when the algorithm detects that it's a good time to sell a stock or other asset. This signal is also based on certain conditions such as the values of technical indicators like ADX, Vortex, and Fusion. For example, if the ADX value is above a certain threshold and there is a crossunder between the plus and minus lines of the ADX indicator, then the algorithm will generate an enterShort signal.
The exitLong and exitShort signals are generated when the algorithm detects that it's a good time to close a long or short position, respectively. These signals are also based on certain conditions such as the values of technical indicators like ADX, Vortex, and Fusion. For example, if the ADX value crosses above a certain threshold or there is a crossover between the minus and plus lines of the ADX indicator, then the algorithm will generate an exitLong signal.
Usage
Traders can use this indicator in a variety of ways, depending on their trading strategy and style. Short-term traders may use it to identify short-term trends and potential trade opportunities, while long-term traders may use it to identify long-term trends and potential investment opportunities. The indicator can also be used to confirm other technical indicators or trading signals. Personally, I prefer to use it for short-term trades.
Strengths
One of the strengths of the Adaptive Fusion ADX DI Vortex Indicator is its accuracy and reliability. The indicator uses a combination of TA and mathematical concepts to provide accurate and reliable signals, helping traders make informed trading decisions. It is also versatile and can be used in a variety of trading strategies.
Weaknesses
While this indicator has many strengths, it also has some weaknesses. One of the weaknesses is that it can generate false signals in choppy or sideways markets. Additionally, the indicator may lag behind the market, making it less effective in fast-moving markets. That's a reason why I included the Hurst Exponent Filter and special smoothing.
Concepts
The Adaptive ADX DI Vortex Indicator with Fusion Mode and Hurst Filter is based on several key concepts. The Average Directional Index (ADX) is used to measure trend strength, while the Vortex Indicator is used to identify trend reversals. The Hurst Exponent is used to filter out noise and provide a more accurate picture of the market.
In conclusion, the Adaptive Fusion ADX DI Vortex Indicator is a versatile and powerful tool for traders. By combining technical analysis and mathematical concepts, this indicator provides accurate and reliable signals for identifying trend strength and potential trend reversals. While it has some weaknesses, its many strengths and features make it a valuable addition to any trader's toolbox.
---
Credits to:
▪️@cheatcountry – Hann Window Smoohing
▪️@loxx – VHF and T3
▪️@balipour – Hurst Exponent Filter
ATR-Stepped, Another New Adaptive Moving Average [Loxx]ATR-Filtered, Another New Adaptive Moving Average is a modification of @cheatcountry's "Another New Adaptive Moving Average " shown below
I've added AT- stepped filtering. This is a standard ATR filter that works by requiring movement by XX multiple of ATR before registering a trend flip. I've also included Loxx's Expanded Source Types. You can read about those here:
From @cheatcountry on A New Adaptive Moving Average
The New Adaptive Moving Average was created by Scott Cong (Stocks and Commodities Mar 2023) and this is a companion indicator to my previous script
This indicator still works off of the same concept as before with effort vs results but this indicator takes a slightly different approach and instead defines results as the absolute difference between the closing price and a closing price x bars ago. As you can see in my chart example, this indicator works great to stay with the current trend and provides either a stop loss or take profit target depending on which direction you are going in. As always, I use darker colors to show stronger signals and lighter colors to show normal signals. Buy when the line turns green and sell when it turns red.
Included
Alerts
Signals
Loxx's Expanded Source Types
PA-Adaptive T3 Loxxer [Loxx]PA-Adaptive T3 Loxxer is a Loxxer indicator that is Phase Accumulation Cycle adaptive and uses T3 moving average for smoothing instead of the typical SMA or EMA . this allows for smoother signals by reducing noise.
What is Loxxer?
The Loxxer indicator is a technical analysis tool that compares the most recent maximum and minimum prices to the previous period's equivalent price to measure the demand of the underlying asset.
What is the Phase Accumulation Cycle?
The phase accumulation method of computing the dominant cycle is perhaps the easiest to comprehend. In this technique, we measure the phase at each sample by taking the arctangent of the ratio of the quadrature component to the in-phase component. A delta phase is generated by taking the difference of the phase between successive samples. At each sample we can then look backwards, adding up the delta phases.When the sum of the delta phases reaches 360 degrees, we must have passed through one full cycle, on average.The process is repeated for each new sample.
The phase accumulation method of cycle measurement always uses one full cycle’s worth of historical data.This is both an advantage and a disadvantage.The advantage is the lag in obtaining the answer scales directly with the cycle period.That is, the measurement of a short cycle period has less lag than the measurement of a longer cycle period. However, the number of samples used in making the measurement means the averaging period is variable with cycle period. longer averaging reduces the noise level compared to the signal.Therefore, shorter cycle periods necessarily have a higher out- put signal-to-noise ratio.
Included
Bar coloring
Signals
Alerts
Loxx's Expanded Source Types
Divergences
Another New Adaptive Moving Average [CC]The New Adaptive Moving Average was created by Scott Cong (Stocks and Commodities Mar 2023) and this is a companion indicator to my previous script . This indicator still works off of the same concept as before with effort vs results but this indicator takes a slightly different approach and instead defines results as the absolute difference between the closing price and a closing price x bars ago. As you can see in my chart example, this indicator works great to stay with the current trend and provides either a stop loss or take profit target depending on which direction you are going in. As always, I use darker colors to show stronger signals and lighter colors to show normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicator scripts you would like to see me publish!
A New Adaptive Moving Average [CC]The New Adaptive Moving Average was created by Scott Cong (Stocks and Commodities Mar 2023) and his idea was to focus on the Adaptive Moving Average created by Perry Kaufman and to try to improve it by introducing a concept of effort vs results. In this case the effort would be the total range of the underlying price action since each bar is essentially a war of the bulls vs the bears. The result would be the total range of the close so we are looking for the highest close and lowest close in that same time period. This gives us an alpha that we can use to plug into the Kaufman Adaptive Moving Average algorithm which gives us a brand new indicator that can hug the price just enough to allow us to ride the stock up or down. I have color coded it to be darker colors when it is a strong signal and lighter colors when it is a normal signal. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Tailored-Custom Hamonic Patterns█ OVERVIEW
We have included by default 3 known Patterns. The Bat, the Butterfly and the Gartley. But have you ever wondered how effective other,
not yet known models could be? Don't ask yourself the question anymore, it's time to find out for yourself! You have the option to customize
your own Patterns with the Backtesting tool and set Retracement Ratios and Targets for your own Patterns. In addition to this, in order to determine
the Trend at a glance and make Pattern detection more efficient, we have linked the calculation of Patterns to Bands of several types to choose
from (Bollinger, Keltner, Donchian) that you can select from a drop-down menu in the settings and play with the Multiplier
and the Adaptive Length of the Patterns to see how it affects the success rate in the Backtesting table.
█ HOW DOES IT WORK?
- Harmonic Patterns
-Pattern Names, Colors, Style etc… Everything is customizable.
-Dynamic Adaptative Length with Min/Max Length.
- XAB/ABC Ratio
-Min/Max XAB/ABC Configurable Ratio for each Pattern to create your own Patterns.
(This is really the particular option of this Indicator, because it allows you to be able to Backtest in real time
after having played at configuring your own Ratios)
- Bands
-Contrary to the original logic of the HeWhoMustNotBeNamed script, here when the price breaks out of the upper Bands
(example, Bollinger band, Keltner Channel or Donchian Channel) , with a predetermined Minimum and Maximum Length and Multiplier, we can consider
the Trend to be Bearish (and not Bullish) and similarly when the price breaks down in the lower band, we can consider the Trend
to be Bullish (not Bearish) . We have also added the middle line of the Channels (which can be useful for 'Scalper' type Traders.
-The Length of the Bands Filter is directly related to the Dynamic Length of the Patterns.
-You can use a drop-down menu to select from the following Bands Filters :
SMA, EMA, HMA, RMA, WMA, VWMA, HIGH/LOW, LINREG, MEDIAN.
-Sticky and Adaptive Bands options has been included.
- Projections
-BD/CD Projection Ratio configurable for each Pattern.
(Projections are visible as Dotted Lines which we can choose to Extend or not)
- Targets
-Target, PRZ and Stop Levels are set to optimal values based on individual Patterns. (The PRZ Level corresponds to point D
of the detected Pattern so its value should always be 0) but you can change the Targets value (defined in %) as you wish.
Again here, you have the option to fully configure the Style and Extend the Lines or not.
- Backtesting Table
-As said previously, with the possibility of testing the Success Rate of each of the 3 Customizable Patterns,
this option is part of the logic of this Indicator.
- Alerts
-We originally believe that this Indicator does not even need Alerts. But we still decided to include at least one Alert
that you can set for when a new Pattern is detected.
█ NOTES
Thanks to HeWhoMustNotBeNamed for his permission to reuse some part of his zigzag scripts.
Remember to only make a decision once you are sure of your analysis. Good trading sessions to everyone and don't forget,
risk management remains the most important!
VHF Adaptive Linear Regression KAMAIntroduction
Heyo, in this indicator I decided to add VHF adaptivness, linear regression and smoothing to a KAMA in order to squeeze all out of it.
KAMA:
Developed by Perry Kaufman, Kaufman's Adaptive Moving Average (KAMA) is a moving average designed to account for market noise or volatility. KAMA will closely follow prices when the price swings are relatively small and the noise is low. KAMA will adjust when the price swings widen and follow prices from a greater distance. This trend-following indicator can be used to identify the overall trend, time turning points and filter price movements.
VHF:
Vertical Horizontal Filter (VHF) was created by Adam White to identify trending and ranging markets. VHF measures the level of trend activity, similar to ADX DI. Vertical Horizontal Filter does not, itself, generate trading signals, but determines whether signals are taken from trend or momentum indicators. Using this trend information, one is then able to derive an average cycle length.
Linear Regression Curve:
A line that best fits the prices specified over a user-defined time period.
This is very good to eliminate bad crosses of KAMA and the pric.
Usage
You can use this indicator on every timeframe I think. I mostly tested it on 1 min, 5 min and 15 min.
Signals
Enter Long -> crossover(close, kama) and crossover(kama, kama )
Enter Short -> crossunder(close, kama) and crossunder(kama, kama )
Thanks for checking this out!
--
Credits to
▪️@cheatcountry – Hann Window Smoohing
▪️@loxx – VHF and T3
▪️@LucF – Gradient
Adaptive RSI/Stochastic (ARSIS)As a trader, one of the most important aspects of technical analysis is identifying the dominant cycle of the market. The dominant cycle, also known as the market's "heartbeat," can provide valuable information on the current market trend and potential future price movements. One way to measure the dominant cycle is through the use of the MESA Adaptation - MAMA Cycle function, which is a part of the Dominant Cycle Estimators library.
I have developed an "Adaptive RSI/Stochastic" indicator that incorporates the MAMA Cycle function to provide more accurate and reliable signals. The indicator uses the MAMA Cycle function to calculate the period of the data, which is then used as a parameter in the calculation of the RSI and Stochastic indicators. By adapting the calculation of these indicators to the dominant cycle of the market, the resulting signals are more in tune with the current market conditions and can provide a more accurate representation of the current trend.
The MAMA Cycle function is a powerful tool that utilizes advanced mathematical techniques to accurately calculate the dominant cycle of the market. It takes into account the dynamic nature of the market and adapts the calculation of the period to the current conditions. The result is a more accurate and reliable measurement of the market's dominant cycle, which can be used to improve the performance of other indicators and trading strategies.
In conclusion, the Adaptive RSI/Stochastic indicator that I have developed, which incorporates the MAMA Cycle function, is a valuable tool for any trader looking to improve their technical analysis. By adapting the calculation of the RSI and Stochastic indicators to the dominant cycle of the market, the resulting signals are more in tune with the current market conditions and can provide a more accurate representation of the current trend.
Huge thank you to @lastguru for making this possible!
Elliot Wave Helper Table█ OVERVIEW
This indicator is intend to be helper to help Elliot Wave user to properly Elliot Wave tools according to correct degree such as 12345 or ABCWXY. The abbreviation changes according to timeframe.
█ FEATURES
1. Abbreviation degree adaptive to timeframe. Eg : Subminutte for 1 minute chart, etc.
2. Works for custom timeframe. Eg : Subminutte for 1 to 4 minute chart, etc.
3. Show reference table if necessary.
█ REFERENCE
Adaptive Elliot Wave Degree Chart
█ EXAMPLES / USAGES
Dynamic Array Table (versatile display methods)Library "datTable"
Dynamic Array Table.... Configurable Shape/Size Table from Arrays
Allows for any data in any size combination of arrays to join together
with:
all possible orientations!
filling all cells contiguously and/or flipping at boundaries
vertical or horizontal rotation
x/y axis direction swapping
all types array inputs for data.
please notify of any bugs. thanks
init(_posit)
Get Table (otional gapping cells)
Parameters:
_posit : String or Int (1-9 3x3 grid L to R)
Returns: Table
coords()
Req'd coords Seperate for VARIP table, non-varip coords
add
Add arrays to display table. coords reset each calc
uses displaytable object, string titles, and color optional array, and second line optional data array.
Musashi_Katana=== Musashi-Katana ===
This tool was designed to fit my particular trading style and personal theories about the "Alchemy of the markets" and ''Harmonic Structure'.
Context
When following a Technical approach to to surf the markets, there are teachings that must be understood before reaching a confort-zone, this usually happen the possible worst way by constant experimentation, it hurts.
Here few technical hints:
- Align High timeframes with lower timeframes:
This simple concept relax a lot complexity of finding of a trend bias. Musashi-Katana allows you to use technical indicator corresponding to specific timeframes, like daily weekly or yearly. They wont change when you change the chart's timeframe, its very useful as you know where you're standing in the long term, Its quite relaxing.
- Use volume:
The constant usage of volume will allow you to sync with the market's breathing. This shows you the mass of money flowing into and out of the market, is key if you want to understand momentum. This tool can help here, as it have multi-period vwaps. You can use yearly, monthly for swing trading, and even weekly if you enjoy scalping.
Useful stuff:
- You have access to baselines, AMA and Kijun-sen with the possibility of adding ATR bands.
- AMAs come as two lines strategies for different approaches, fast medium or slow.
- You can experiment with normal and multi timeframe moving averages and other trend tools.
Final Note
If used correctly Musashi-Katana is a very powerful tool, which makes no sense as there is no correct usage. Don't add everything at the same time, experiment, combine stuff, every market is different.
Backtest every possible strategy before using it, see what works and doesn't. This gives you a lot of peace, specially while you're at the tip of the spear surfing the markets
--> I personally use this in combination with 'Musashi_Slasher (Mometum+Volatility)', as it gives me volatility and momentum in a very precise way.
Adaptive VWAP Stdev BandsIntroduction
Heyo, here are some adaptive VWAP Standard Deviation Bands with nice colors.
I used Ehlers dominant cycle theories and ZLSMA smoothing to create this indicator.
You can choose between different algorithms to determine the dominant cycle and this will be used as reset period.
Everytime bar_index can be divided through the dominant cycle length and the result is zero VWAP resets if have chosen an adaptive mode in the settings.
The other reset event you can use is just a simple time-based event, e.g. reset every day.
Usage
I think people buy/sell when it reaches extreme zones.
Enjoy!
---
Credits to:
@SandroTurriate - VWAP Stdev Bands
@blackcat1402 - Dominant Cycle Analysis
@DasanC - Dominant Cycle Analysis
@veryfid - ZLSMA
(Sry, too lazy for linking)
I took parts of their code. Ty guys for your work! Just awesome.
Adaptive Fisherized CMFIntroduction
Heyo, here I made a normalized Chaikin Money Flow (CMF) indicator with Inverse Fisher Transform (IFT) and some smoothing techniques.
I had to normalize the indicator in order to fit it to the IFT range (-1 -> 1).
Moreover, the good old adaptive mode is also included in this indicator. It uses Ehlers superb dominant cycle techniques.
It also has divergence detection, several options for individualisation and doesn't repaint.
Usage
www.investopedia.com
Signals
CMF above 0 => bullish market
CMF below 0 => bearish market
(You can also use the inner bands instead of the zero line, to make these signals more precise)
Bullish regular/hidden divergence => long
Bearish regular/hidden divergence => short
Enjoy guys!
PS: I really would like to hear some feedback of you.