SMI Ergodic Indicator/Oscillator▮ Introduction
The Stochastic Momentum Index Ergodic Indicator (SMII) is a technical analysis tool designed to predict trend reversals in the price of an asset.
It functions as a momentum oscillator, measuring the ratio of the smoothed price change to the smoothed absolute price change over a given number of previous periods.
The Ergodic SMI is based on the True Strength Index (TSI) and integrates a signal line, which is an exponential moving average (EMA) of the SMI indicator itself.
It provides a clearer picture of market trends than the traditional stochastic oscillator by incorporating the concept of "ergodicity", which helps remove market noise.
On ther other hand, the Stochastic Momentum Index Ergodic Oscillator (SMIO) is a histogram that measures the difference between TSI and it's signal line.
By default, in TradingView both SMII and SMIO are provided independently.
Here in this script these two indicators are combined, providing a more comprehensive view of price direction and market strength.
▮ Motivation: why another indicator?
The intrinsic value of this indicator lies in the fact that it allows fine adjustments in both calculation parameters, data source and visualization, features that are not present in the standard indicators or similar.
Also, trend lines breakouts and divergences detector were added.
▮ What to look for
When using the indicator, there are a few things to look out for.
First, look at the SMI signal line.
When the line crosses above -40, it is considered a buy signal, while the crossing below +40 is considered a sell signal.
Also, pay attention to divergences between the SMI and the price.
If price is rising but the SMI is showing negative divergence, it could indicate that momentum is waning and a reversal could be in the offing.
Likewise, if price is falling but the SMI is showing positive divergence, this could indicate that momentum is building and a reversal could also be in the offing.
Divergences can be considered in both indicator and/or histogram.
Examples:
▮ Notes
The indicator presented here offers both the "SMII" and the "SMIO", that is, the "Stochastic Momentum Index Ergodic Indicator" together with the "Stochastic Momentum Index Ergodic Oscillator" (histogram), as per the documentation described in reference links.
So it is important to highlight the differences in relation to my other indicator, Stochastic Momentum Index (SMI) Refurbished .
This last one is purely based on the **SMI**, which is implemented using smoothed ratio between the relative range and the high/low range.
Although they may seem the same in some situations, the calculation is actually different. The TSI tends to be more responsive at the expense of being noisier, while the SMI tends to be smoother. Which of these two indicators is best depends on the situation, the context, and the analyst's personal preference.
Please refer to reference links to more info.
▮ References
SMI documentation
SMII documentation
SMIO documentation
TSI
Machine Learning Momentum Oscillator [ChartPrime]The Machine Learning Momentum Oscillator brings together the K-Nearest Neighbors (KNN) algorithm and the predictive strength of the Tactical Sector Indicator (TSI) Momentum. This unique oscillator not only uses the insights from TSI Momentum but also taps into the power of machine learning therefore being designed to give traders a more comprehensive view of market momentum.
At its core, the Machine Learning Momentum Oscillator blends TSI Momentum with the capabilities of the KNN algorithm. Introducing KNN logic allows for better handling of noise in the data set. The TSI Momentum is known for understanding how strong trends are and which direction they're headed, and now, with the added layer of machine learning, we're able to offer a deeper perspective on market trends. This is a fairly classical when it comes to visuals and trading.
Green bars show the trader when the asset is in an uptrend. On the flip side, red bars mean things are heading down, signaling a bearish movement driven by selling pressure. These color cues make it easier to catch the sentiment and direction of the market in a glance.
Yellow boxes are also displayed by the oscillator. These boxes highlight potential turning points or peaks. When the market comes close to these points, they can provide a heads-up about the possibility of changes in momentum or even a trend reversal, helping a trader make informed choices quickly. These can be looked at as possible reversal areas simply put.
Settings:
Users can adjust the number of neighbours in the KNN algorithm and choose the periods they prefer for analysis. This way, the tool becomes a part of a trader's strategy, adapting to different market conditions as they see fit. Users can also adjust the smoothing used by the oscillator via the smoothing input.
Moonhub IndexMoonhub Index combines several popular technical indicators to create an aggregated index that aims to give a clearer overall picture of the market. The index takes into account the current market condition (trending, ranging, or volatile) to adjust its calculations accordingly.
The indicators used in this composite index are:
Hull Moving Average (HMA)
Fisher Transform (FT)
Williams Alligator
Moving Average Convergence Divergence (MACD)
Average True Range (ATR)
On-Balance Volume (OBV)
Money Flow Index (MFI)
Accumulation/Distribution (AD)
Pivot Points
True Strength Index (TSI)
Volume-Weighted Average Price (VWAP)
The script calculates the values of each indicator and then normalizes and weighs them according to predefined weights. The composite index is formed by summing the weighted values of each indicator. The final Moon Index is plotted on the chart, along with several other related lines like the exponential moving averages (EMA) and simple moving averages (SMA) of the index.
This custom index can be used by traders to get a more comprehensive view of the market and make better-informed trading decisions based on the combined insights of multiple indicators.
Consensus Oscillator with ADX (LeafAlgo)This indicator creates a normalized consensus from a set of other indicators -- Chande Momentum Oscillator (CMO), Detrended Price Oscillator (DPO), Momentum (MOM), Rate of Change (RoC), Relative Strength Index (RSI), the True Strength Index (TSI) Value line, Volume Oscillator, and a normalized Z-score.
The consensus is created by giving ranged values to each individual indicator. These individual values are added together, then put through a normalization function to create a 0-100 range. The scoring for each indicator is as follows:
CMO:
- If chandeMO <= -50, then the score is valued at -2
- If chandeMO > -50 and chandeMO <= -25, then the score is valued at -1
- If chandeMO > -25 and chandeMO < 25, then the score is valued at 0
- If chandeMO >= 25 and chandeMO < 50, then the score is valued at 1
- If chandeMO >= 50, then the score is valued at 2
DPO:
- If dpo <= -0.005, then the score is valued at -2
- If dpo > -0.005 and dpo <= -0.0025, then the score is valued at -1
- If dpo > -0.0025 and dpo < 0.0025, then the score is valued at 0
- If dpo >= 0.0025 and dpo < 0.005, then the score is valued at 1
- If dpo >= 0.005, then the score is valued at 2
MOM:
- If mom <= -0.05, then the score is valued at -2
- If mom > -0.05 and mom <= -0.025, then the score is valued at -1
- If mom > -0.025 and mom < 0.025, then the score is valued at 0
- If mom >= 0.025 and mom < 0.05, then the score is valued at 1
- If mom >= 0.05, then the score is valued at 2
ROC:
- If roc <= -20, then the score is valued at -2
- If roc > -20 and roc <= -10, then the score is valued at -1
- If roc > -10 and roc < 10, then the score is valued at 0
- If roc >= 10 and roc < 20, then the score is valued at 1
- If roc >= 20, then the score is valued at 2
RSI:
- If rsi <= 20, then the score is valued at -2
- If rsi > 20 and rsi <= 40, then the score is valued at -1
- If rsi > 40 and rsi < 60, then the score is valued at 0
- If rsi >= 60 and rsi < 80, then the score is valued at 1
- If rsi >= 80, then the score is valued at 2
TSI Value:
- If tsi <= -20, then the score is valued at -2
- If tsi > -20 and tsi <= -10, then the score is valued at -1
- If tsi > -10 and tsi < 10, then the score is valued at 0
- If tsi >= 10 and tsi < 20, then the score is valued at 1
- If tsi >= 20, then the score is valued at 2
Volume Oscillator:
- If vo <= -20, then the score is valued at -2
- If vo > -20 and vo <= -10, then the score is valued at -1
- If vo > -10 and vo < 10, then the score is valued at 0
- If vo >= 10 and vo < 20, then the score is valued at 1
- If vo >= 20, then the score is valued at 2
Normalized (-1 to +1) Z-Score:
- If z_n <= -0.5, then the score is valued at -2
- If z_n > -0.5 and z_n <= -0.25, then the score is valued at -1
- If z_n > -0.25 and z_n < 0.25, then the score is valued at 0
- If z_n >= 0.25 and z_n < 0.5, then the score is valued at 1
- If z_n >= 0.5, then the score is valued at 2
The consensus line is colored depending on the closing value of the line. The color is shown as lime if above 70, a darker green between 55 and 70, yellow between 45 and 55, orange between 30 and 45, and red below 30.
Additionally, there is a normalized ADX line added into the indicator to give further confirmation to trend strength. The normalized ADX line is shown as green if above 40, yellow between 40 and 20, and red below 20.
Horizontal lines have been added at 20/30 and 50/60 as semi-important levels to watch.
GKD-C Blau True Strength Index [Loxx]Giga Kaleidoscope GKD-C Blau True Strength Index is a Confirmation module included in Loxx's "Giga Kaleidoscope Modularized Trading System".
█ Giga Kaleidoscope Modularized Trading System
What is Loxx's "Giga Kaleidoscope Modularized Trading System"?
The Giga Kaleidoscope Modularized Trading System is a trading system built on the philosophy of the NNFX (No Nonsense Forex) algorithmic trading.
What is the NNFX algorithmic trading strategy?
The NNFX (No-Nonsense Forex) trading system is a comprehensive approach to Forex trading that is designed to simplify the process and remove the confusion and complexity that often surrounds trading. The system was developed by a Forex trader who goes by the pseudonym "VP" and has gained a significant following in the Forex community.
The NNFX trading system is based on a set of rules and guidelines that help traders make objective and informed decisions. These rules cover all aspects of trading, including market analysis, trade entry, stop loss placement, and trade management.
Here are the main components of the NNFX trading system:
1. Trading Philosophy: The NNFX trading system is based on the idea that successful trading requires a comprehensive understanding of the market, objective analysis, and strict risk management. The system aims to remove subjective elements from trading and focuses on objective rules and guidelines.
2. Technical Analysis: The NNFX trading system relies heavily on technical analysis and uses a range of indicators to identify high-probability trading opportunities. The system uses a combination of trend-following and mean-reverting strategies to identify trades.
3. Market Structure: The NNFX trading system emphasizes the importance of understanding the market structure, including price action, support and resistance levels, and market cycles. The system uses a range of tools to identify the market structure, including trend lines, channels, and moving averages.
4. Trade Entry: The NNFX trading system has strict rules for trade entry. The system uses a combination of technical indicators to identify high-probability trades, and traders must meet specific criteria to enter a trade.
5. Stop Loss Placement: The NNFX trading system places a significant emphasis on risk management and requires traders to place a stop loss order on every trade. The system uses a combination of technical analysis and market structure to determine the appropriate stop loss level.
6. Trade Management: The NNFX trading system has specific rules for managing open trades. The system aims to minimize risk and maximize profit by using a combination of trailing stops, take profit levels, and position sizing.
Overall, the NNFX trading system is designed to be a straightforward and easy-to-follow approach to Forex trading that can be applied by traders of all skill levels.
Core components of an NNFX algorithmic trading strategy
The NNFX algorithm is built on the principles of trend, momentum, and volatility. There are six core components in the NNFX trading algorithm:
1. Volatility - price volatility; e.g., Average True Range, True Range Double, Close-to-Close, etc.
2. Baseline - a moving average to identify price trend
3. Confirmation 1 - a technical indicator used to identify trends
4. Confirmation 2 - a technical indicator used to identify trends
5. Continuation - a technical indicator used to identify trends
6. Volatility/Volume - a technical indicator used to identify volatility/volume breakouts/breakdown
7. Exit - a technical indicator used to determine when a trend is exhausted
What is Volatility in the NNFX trading system?
In the NNFX (No Nonsense Forex) trading system, ATR (Average True Range) is typically used to measure the volatility of an asset. It is used as a part of the system to help determine the appropriate stop loss and take profit levels for a trade. ATR is calculated by taking the average of the true range values over a specified period.
True range is calculated as the maximum of the following values:
-Current high minus the current low
-Absolute value of the current high minus the previous close
-Absolute value of the current low minus the previous close
ATR is a dynamic indicator that changes with changes in volatility. As volatility increases, the value of ATR increases, and as volatility decreases, the value of ATR decreases. By using ATR in NNFX system, traders can adjust their stop loss and take profit levels according to the volatility of the asset being traded. This helps to ensure that the trade is given enough room to move, while also minimizing potential losses.
Other types of volatility include True Range Double (TRD), Close-to-Close, and Garman-Klass
What is a Baseline indicator?
The baseline is essentially a moving average, and is used to determine the overall direction of the market.
The baseline in the NNFX system is used to filter out trades that are not in line with the long-term trend of the market. The baseline is plotted on the chart along with other indicators, such as the Moving Average (MA), the Relative Strength Index (RSI), and the Average True Range (ATR).
Trades are only taken when the price is in the same direction as the baseline. For example, if the baseline is sloping upwards, only long trades are taken, and if the baseline is sloping downwards, only short trades are taken. This approach helps to ensure that trades are in line with the overall trend of the market, and reduces the risk of entering trades that are likely to fail.
By using a baseline in the NNFX system, traders can have a clear reference point for determining the overall trend of the market, and can make more informed trading decisions. The baseline helps to filter out noise and false signals, and ensures that trades are taken in the direction of the long-term trend.
What is a Confirmation indicator?
Confirmation indicators are technical indicators that are used to confirm the signals generated by primary indicators. Primary indicators are the core indicators used in the NNFX system, such as the Average True Range (ATR), the Moving Average (MA), and the Relative Strength Index (RSI).
The purpose of the confirmation indicators is to reduce false signals and improve the accuracy of the trading system. They are designed to confirm the signals generated by the primary indicators by providing additional information about the strength and direction of the trend.
Some examples of confirmation indicators that may be used in the NNFX system include the Bollinger Bands, the MACD (Moving Average Convergence Divergence), and the MACD Oscillator. These indicators can provide information about the volatility, momentum, and trend strength of the market, and can be used to confirm the signals generated by the primary indicators.
In the NNFX system, confirmation indicators are used in combination with primary indicators and other filters to create a trading system that is robust and reliable. By using multiple indicators to confirm trading signals, the system aims to reduce the risk of false signals and improve the overall profitability of the trades.
What is a Continuation indicator?
In the NNFX (No Nonsense Forex) trading system, a continuation indicator is a technical indicator that is used to confirm a current trend and predict that the trend is likely to continue in the same direction. A continuation indicator is typically used in conjunction with other indicators in the system, such as a baseline indicator, to provide a comprehensive trading strategy.
What is a Volatility/Volume indicator?
Volume indicators, such as the On Balance Volume (OBV), the Chaikin Money Flow (CMF), or the Volume Price Trend (VPT), are used to measure the amount of buying and selling activity in a market. They are based on the trading volume of the market, and can provide information about the strength of the trend. In the NNFX system, volume indicators are used to confirm trading signals generated by the Moving Average and the Relative Strength Index. Volatility indicators include Average Direction Index, Waddah Attar, and Volatility Ratio. In the NNFX trading system, volatility is a proxy for volume and vice versa.
By using volume indicators as confirmation tools, the NNFX trading system aims to reduce the risk of false signals and improve the overall profitability of trades. These indicators can provide additional information about the market that is not captured by the primary indicators, and can help traders to make more informed trading decisions. In addition, volume indicators can be used to identify potential changes in market trends and to confirm the strength of price movements.
What is an Exit indicator?
The exit indicator is used in conjunction with other indicators in the system, such as the Moving Average (MA), the Relative Strength Index (RSI), and the Average True Range (ATR), to provide a comprehensive trading strategy.
The exit indicator in the NNFX system can be any technical indicator that is deemed effective at identifying optimal exit points. Examples of exit indicators that are commonly used include the Parabolic SAR, the Average Directional Index (ADX), and the Chandelier Exit.
The purpose of the exit indicator is to identify when a trend is likely to reverse or when the market conditions have changed, signaling the need to exit a trade. By using an exit indicator, traders can manage their risk and prevent significant losses.
In the NNFX system, the exit indicator is used in conjunction with a stop loss and a take profit order to maximize profits and minimize losses. The stop loss order is used to limit the amount of loss that can be incurred if the trade goes against the trader, while the take profit order is used to lock in profits when the trade is moving in the trader's favor.
Overall, the use of an exit indicator in the NNFX trading system is an important component of a comprehensive trading strategy. It allows traders to manage their risk effectively and improve the profitability of their trades by exiting at the right time.
How does Loxx's GKD (Giga Kaleidoscope Modularized Trading System) implement the NNFX algorithm outlined above?
Loxx's GKD v1.0 system has five types of modules (indicators/strategies). These modules are:
1. GKD-BT - Backtesting module (Volatility, Number 1 in the NNFX algorithm)
2. GKD-B - Baseline module (Baseline and Volatility/Volume, Numbers 1 and 2 in the NNFX algorithm)
3. GKD-C - Confirmation 1/2 and Continuation module (Confirmation 1/2 and Continuation, Numbers 3, 4, and 5 in the NNFX algorithm)
4. GKD-V - Volatility/Volume module (Confirmation 1/2, Number 6 in the NNFX algorithm)
5. GKD-E - Exit module (Exit, Number 7 in the NNFX algorithm)
(additional module types will added in future releases)
Each module interacts with every module by passing data between modules. Data is passed between each module as described below:
GKD-B => GKD-V => GKD-C(1) => GKD-C(2) => GKD-C(Continuation) => GKD-E => GKD-BT
That is, the Baseline indicator passes its data to Volatility/Volume. The Volatility/Volume indicator passes its values to the Confirmation 1 indicator. The Confirmation 1 indicator passes its values to the Confirmation 2 indicator. The Confirmation 2 indicator passes its values to the Continuation indicator. The Continuation indicator passes its values to the Exit indicator, and finally, the Exit indicator passes its values to the Backtest strategy.
This chaining of indicators requires that each module conform to Loxx's GKD protocol, therefore allowing for the testing of every possible combination of technical indicators that make up the six components of the NNFX algorithm.
What does the application of the GKD trading system look like?
Example trading system:
Backtest: Strategy with 1-3 take profits, trailing stop loss, multiple types of PnL volatility, and 2 backtesting styles
Baseline: Hull Moving Average
Volatility/Volume: Hurst Exponent
Confirmation 1: Blau True Strength Index as shown on the chart above
Confirmation 2: Williams Percent Range
Continuation: Fisher Transform
Exit: Rex Oscillator
Each GKD indicator is denoted with a module identifier of either: GKD-BT, GKD-B, GKD-C, GKD-V, or GKD-E. This allows traders to understand to which module each indicator belongs and where each indicator fits into the GKD protocol chain.
Giga Kaleidoscope Modularized Trading System Signals (based on the NNFX algorithm)
Standard Entry
1. GKD-C Confirmation 1 Signal
2. GKD-B Baseline agrees
3. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume agrees
Baseline Entry
1. GKD-B Baseline signal
2. GKD-C Confirmation 1 agrees
3. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume agrees
6. GKD-C Confirmation 1 signal was less than 7 candles prior
Continuation Entry
1. Standard Entry, Baseline Entry, or Pullback; entry triggered previously
2. GKD-B Baseline hasn't crossed since entry signal trigger
3. GKD-C Confirmation Continuation Indicator signals
4. GKD-C Confirmation 1 agrees
5. GKD-B Baseline agrees
6. GKD-C Confirmation 2 agrees
1-Candle Rule Standard Entry
1. GKD-C Confirmation 1 signal
2. GKD-B Baseline agrees
3. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
Next Candle:
1. Price retraced (Long: close < close or Short: close > close )
2. GKD-B Baseline agrees
3. GKD-C Confirmation 1 agrees
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume agrees
1-Candle Rule Baseline Entry
1. GKD-B Baseline signal
2. GKD-C Confirmation 1 agrees
3. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
4. GKD-C Confirmation 1 signal was less than 7 candles prior
Next Candle:
1. Price retraced (Long: close < close or Short: close > close )
2. GKD-B Baseline agrees
3. GKD-C Confirmation 1 agrees
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume Agrees
PullBack Entry
1. GKD-B Baseline signal
2. GKD-C Confirmation 1 agrees
3. Price is beyond 1.0x Volatility of Baseline
Next Candle:
1. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
3. GKD-C Confirmation 1 agrees
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume Agrees
█ GKD-C Blau True Strength Index
What is Blau True Strength Index?
The Blau True Strength Index (TSI) is a technical indicator that measures the strength of a security's trend by comparing the current price to historical price data. The TSI was developed by William Blau, a trader and expert in technical analysis. It is based on the popular Relative Strength Index (RSI) but differs in its calculation method.
The TSI uses two different smoothing techniques to remove noise from the price data and highlight the underlying trend. The first smoothing technique is a double exponential moving average (DEMA) of the price data. This DEMA helps to reduce the impact of short-term price fluctuations on the indicator's readings. The second smoothing technique is a triple exponential moving average (TEMA) of the DEMA values. The TEMA further smooths out the DEMA values and helps to reduce lag.
The Blau TSI can be calculated using the following steps:
1. Calculate the DEMA of the price data using a short-term and a long-term period. The short-term period is usually set to 13 and the long-term period is usually set to 25.
2. Calculate the difference between the short-term DEMA and the long-term DEMA.
3. Calculate the TEMA of the difference calculated in step 2 using a period of 7.
4. Calculate the TSI as a percentage by dividing the TEMA calculated in step 3 by the absolute value of the TEMA calculated in step 3 plus 1, and then multiplying by 100.
The TSI values range from -100 to +100, with readings above +25 indicating a strong uptrend and readings below -25 indicating a strong downtrend. Values between +25 and -25 indicate a weak or sideways trend.
Traders use the Blau TSI to identify trend reversals, confirm trend strength, and generate buy and sell signals. A bullish divergence between the TSI and the price can be a signal to buy, while a bearish divergence can be a signal to sell. Traders also look for crossovers of the TSI with its signal line to generate buy and sell signals.
In summary, the Blau True Strength Index is a technical indicator that measures the strength of a security's trend by comparing the current price to historical price data using two different smoothing techniques. Traders use the TSI to identify trend reversals, confirm trend strength, and generate buy and sell signals.
Requirements
Inputs
Confirmation 1 and Solo Confirmation: GKD-V Volatility / Volume indicator
Confirmation 2: GKD-C Confirmation indicator
Outputs
Confirmation 2 and Solo Confirmation Complex: GKD-E Exit indicator
Confirmation 1: GKD-C Confirmation indicator
Continuation: GKD-E Exit indicator
Solo Confirmation Simple: GKD-BT Backtest strategy
Additional features will be added in future releases.
Stochastic Momentum Index (SMI) Refurbished▮Introduction
Stochastic Momentum Index (SMI) Indicator is a technical indicator used in technical analysis of stocks and other financial instruments.
It was developed by William Blau in 1993 and is considered to be a momentum indicator that can help identify trend reversal points.
Basically, it's a combination of the True Strength Index with a signal line to help identify turning points in the market.
SMI uses the stochastic formula to compare the current closing price of an asset with the maximum and minimum price range over a specific period.
He then compares this ratio to a short-term moving average to create an indicator that oscillates between -100 and +100.
When the SMI is above 0, it is considered positive, indicating that the current price is above the short-term moving average.
When it is below 0, it is considered negative, indicating that the current price is below the short-term moving average.
Traders use the SMI to identify potential trend reversal points.
When the indicator reaches an extreme level above +40 or below -40, a trend reversal is possible.
Furthermore, traders also watch for divergences between the SMI and the asset price to identify potential trading opportunities.
It is important to remember that the SMI is a technical indicator and as such should be used in conjunction with other technical analysis tools to get a complete picture of the market situation.
▮ Improvements
The following features were added:
1. 7 color themes, for TSI, Signal and Histogram.
2. Possibility to customize moving average type for TSI/Signal.
3. Dynamic Zones.
4. Crossing Alerts.
5. Alert points on specific ranges.
5. Coloring of bars according to TSI/Signal/Histogram.
▮ Themes
Examples:
▮ About Dynamic Zones
'Most indicators use a fixed zone for buy and sell signals.
Here's a concept based on zones that are responsive to the past levels of the indicator.'
The concept of Dynamic Zones was described by Leo Zamansky ( Ph .D.) and David Stendahl, in the magazine of Stocks & Commodities V15:7 (306-310).
Basically, a statistical calculation is made to define the extreme levels, delimiting a possible overbought/oversold region.
Given user-defined probabilities, the percentile is calculated using the method of Nearest Rank.
It is calculated by taking the difference between the data point and the number of data points below it, then dividing by the total number of data points in the set.
The result is expressed as a percentage.
This provides a measure of how a particular value compares to other values in a data set, identifying outliers or values that are significantly higher or lower than the rest of the data.
▮ What to look for
1. Divergences/weakening of a trend/reversal:
2. Supports, resistances, pullbacks:
3. Overbought/Oversold Points:
▮ Thanks and Credits
- TradingView and PineCoders: for SMI and Moving Averages
- allanster: for Dynamic Zones
MomentumIndicatorsLibrary "MomentumIndicators"
This is a library of 'Momentum Indicators', also denominated as oscillators.
The purpose of this library is to organize momentum indicators in just one place, making it easy to access.
In addition, it aims to allow customized versions, not being restricted to just the price value.
An example of this use case is the popular Stochastic RSI.
# Indicators:
1. Relative Strength Index (RSI):
Measures the relative strength of recent price gains to recent price losses of an asset.
2. Rate of Change (ROC):
Measures the percentage change in price of an asset over a specified time period.
3. Stochastic Oscillator (Stoch):
Compares the current price of an asset to its price range over a specified time period.
4. True Strength Index (TSI):
Measures the price change, calculating the ratio of the price change (positive or negative) in relation to the
absolute price change.
The values of both are smoothed twice to reduce noise, and the final result is normalized
in a range between 100 and -100.
5. Stochastic Momentum Index (SMI):
Combination of the True Strength Index with a signal line to help identify turning points in the market.
6. Williams Percent Range (Williams %R):
Compares the current price of an asset to its highest high and lowest low over a specified time period.
7. Commodity Channel Index (CCI):
Measures the relationship between an asset's current price and its moving average.
8. Ultimate Oscillator (UO):
Combines three different time periods to help identify possible reversal points.
9. Moving Average Convergence/Divergence (MACD):
Shows the difference between short-term and long-term exponential moving averages.
10. Fisher Transform (FT):
Normalize prices into a Gaussian normal distribution.
11. Inverse Fisher Transform (IFT):
Transform the values of the Fisher Transform into a smaller and more easily interpretable scale is through the
application of an inverse transformation to the hyperbolic tangent function.
This transformation takes the values of the FT, which range from -infinity to +infinity, to a scale limited
between -1 and +1, allowing them to be more easily visualized and compared.
12. Premier Stochastic Oscillator (PSO):
Normalizes the standard stochastic oscillator by applying a five-period double exponential smoothing average of
the %K value, resulting in a symmetric scale of 1 to -1
# Indicators of indicators:
## Stochastic:
1. Stochastic of RSI (Relative Strengh Index)
2. Stochastic of ROC (Rate of Change)
3. Stochastic of UO (Ultimate Oscillator)
4. Stochastic of TSI (True Strengh Index)
5. Stochastic of Williams R%
6. Stochastic of CCI (Commodity Channel Index).
7. Stochastic of MACD (Moving Average Convergence/Divergence)
8. Stochastic of FT (Fisher Transform)
9. Stochastic of Volume
10. Stochastic of MFI (Money Flow Index)
11. Stochastic of On OBV (Balance Volume)
12. Stochastic of PVI (Positive Volume Index)
13. Stochastic of NVI (Negative Volume Index)
14. Stochastic of PVT (Price-Volume Trend)
15. Stochastic of VO (Volume Oscillator)
16. Stochastic of VROC (Volume Rate of Change)
## Inverse Fisher Transform:
1.Inverse Fisher Transform on RSI (Relative Strengh Index)
2.Inverse Fisher Transform on ROC (Rate of Change)
3.Inverse Fisher Transform on UO (Ultimate Oscillator)
4.Inverse Fisher Transform on Stochastic
5.Inverse Fisher Transform on TSI (True Strength Index)
6.Inverse Fisher Transform on CCI (Commodity Channel Index)
7.Inverse Fisher Transform on Fisher Transform (FT)
8.Inverse Fisher Transform on MACD (Moving Average Convergence/Divergence)
9.Inverse Fisher Transfor on Williams R% (Williams Percent Range)
10.Inverse Fisher Transfor on CMF (Chaikin Money Flow)
11.Inverse Fisher Transform on VO (Volume Oscillator)
12.Inverse Fisher Transform on VROC (Volume Rate of Change)
## Stochastic Momentum Index:
1.Stochastic Momentum Index of RSI (Relative Strength Index)
2.Stochastic Momentum Index of ROC (Rate of Change)
3.Stochastic Momentum Index of VROC (Volume Rate of Change)
4.Stochastic Momentum Index of Williams R% (Williams Percent Range)
5.Stochastic Momentum Index of FT (Fisher Transform)
6.Stochastic Momentum Index of CCI (Commodity Channel Index)
7.Stochastic Momentum Index of UO (Ultimate Oscillator)
8.Stochastic Momentum Index of MACD (Moving Average Convergence/Divergence)
9.Stochastic Momentum Index of Volume
10.Stochastic Momentum Index of MFI (Money Flow Index)
11.Stochastic Momentum Index of CMF (Chaikin Money Flow)
12.Stochastic Momentum Index of On Balance Volume (OBV)
13.Stochastic Momentum Index of Price-Volume Trend (PVT)
14.Stochastic Momentum Index of Volume Oscillator (VO)
15.Stochastic Momentum Index of Positive Volume Index (PVI)
16.Stochastic Momentum Index of Negative Volume Index (NVI)
## Relative Strength Index:
1. RSI for Volume
2. RSI for Moving Average
rsi(source, length)
RSI (Relative Strengh Index). Measures the relative strength of recent price gains to recent price losses of an asset.
Parameters:
source : (float) Source of series (close, high, low, etc.)
length : (int) Period of loopback
Returns: (float) Series of RSI
roc(source, length)
ROC (Rate of Change). Measures the percentage change in price of an asset over a specified time period.
Parameters:
source : (float) Source of series (close, high, low, etc.)
length : (int) Period of loopback
Returns: (float) Series of ROC
stoch(kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Stochastic Oscillator. Compares the current price of an asset to its price range over a specified time period.
Parameters:
kLength
kSmoothing : (int) Period for smoothig stochastic
dSmoothing : (int) Period for signal (moving average of stochastic)
maTypeK : (int) Type of Moving Average for Stochastic Oscillator
maTypeD : (int) Type of Moving Average for Stochastic Oscillator Signal
almaOffsetKD : (float) Offset for Arnaud Legoux Moving Average for Oscillator and Signal
almaSigmaKD : (float) Sigma for Arnaud Legoux Moving Average for Oscillator and Signal
lsmaOffSetKD : (int) Offset for Least Squares Moving Average for Oscillator and Signal
Returns: A tuple of Stochastic Oscillator and Moving Average of Stochastic Oscillator
stoch(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Stochastic Oscillator. Customized source. Compares the current price of an asset to its price range over a specified time period.
Parameters:
source : (float) Source of series (close, high, low, etc.)
kLength : (int) Period of loopback to calculate the stochastic
kSmoothing : (int) Period for smoothig stochastic
dSmoothing : (int) Period for signal (moving average of stochastic)
maTypeK : (int) Type of Moving Average for Stochastic Oscillator
maTypeD : (int) Type of Moving Average for Stochastic Oscillator Signal
almaOffsetKD : (float) Offset for Arnaud Legoux Moving Average for Stoch and Signal
almaSigmaKD : (float) Sigma for Arnaud Legoux Moving Average for Stoch and Signal
lsmaOffSetKD : (int) Offset for Least Squares Moving Average for Stoch and Signal
Returns: A tuple of Stochastic Oscillator and Moving Average of Stochastic Oscillator
tsi(source, shortLength, longLength, maType, almaOffset, almaSigma, lsmaOffSet)
TSI (True Strengh Index). Measures the price change, calculating the ratio of the price change (positive or negative) in relation to the absolute price change.
The values of both are smoothed twice to reduce noise, and the final result is normalized in a range between 100 and -100.
Parameters:
source : (float) Source of series (close, high, low, etc.)
shortLength : (int) Short length
longLength : (int) Long length
maType : (int) Type of Moving Average for TSI
almaOffset : (float) Offset for Arnaud Legoux Moving Average
almaSigma : (float) Sigma for Arnaud Legoux Moving Average
lsmaOffSet : (int) Offset for Least Squares Moving Average
Returns: (float) TSI
smi(sourceTSI, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
SMI (Stochastic Momentum Index). A TSI (True Strengh Index) plus a signal line.
Parameters:
sourceTSI : (float) Source of series for TSI (close, high, low, etc.)
shortLengthTSI : (int) Short length for TSI
longLengthTSI : (int) Long length for TSI
maTypeTSI : (int) Type of Moving Average for Signal of TSI
almaOffsetTSI : (float) Offset for Arnaud Legoux Moving Average
almaSigmaTSI : (float) Sigma for Arnaud Legoux Moving Average
lsmaOffSetTSI : (int) Offset for Least Squares Moving Average
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
Returns: A tuple with TSI, signal of TSI and histogram of difference
wpr(source, length)
Williams R% (Williams Percent Range). Compares the current price of an asset to its highest high and lowest low over a specified time period.
Parameters:
source : (float) Source of series (close, high, low, etc.)
length : (int) Period of loopback
Returns: (float) Series of Williams R%
cci(source, length, maType, almaOffset, almaSigma, lsmaOffSet)
CCI (Commodity Channel Index). Measures the relationship between an asset's current price and its moving average.
Parameters:
source : (float) Source of series (close, high, low, etc.)
length : (int) Period of loopback
maType : (int) Type of Moving Average
almaOffset : (float) Offset for Arnaud Legoux Moving Average
almaSigma : (float) Sigma for Arnaud Legoux Moving Average
lsmaOffSet : (int) Offset for Least Squares Moving Average
Returns: (float) Series of CCI
ultimateOscillator(fastLength, middleLength, slowLength)
UO (Ultimate Oscilator). Combines three different time periods to help identify possible reversal points.
Parameters:
fastLength : (int) Fast period of loopback
middleLength : (int) Middle period of loopback
slowLength : (int) Slow period of loopback
Returns: (float) Series of Ultimate Oscilator
ultimateOscillator(source, fastLength, middleLength, slowLength)
UO (Ultimate Oscilator). Customized source. Combines three different time periods to help identify possible reversal points.
Parameters:
source : (float) Source of series (close, high, low, etc.)
fastLength : (int) Fast period of loopback
middleLength : (int) Middle period of loopback
slowLength : (int) Slow period of loopback
Returns: (float) Series of Ultimate Oscilator
macd(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet)
MACD (Moving Average Convergence/Divergence). Shows the difference between short-term and long-term exponential moving averages.
Parameters:
source : (float) Source of series (close, high, low, etc.)
fastLength : (int) Period for fast moving average
slowLength : (int) Period for slow moving average
signalLength : (int) Signal length
maTypeFast : (int) Type of fast moving average
maTypeSlow : (int) Type of slow moving average
maTypeMACD : (int) Type of MACD moving average
almaOffset : (float) Offset for Arnaud Legoux Moving Average
almaSigma : (float) Sigma for Arnaud Legoux Moving Average
lsmaOffSet : (int) Offset for Least Squares Moving Average
Returns: A tuple with MACD, Signal, and Histgram
fisher(length)
Fisher Transform. Normalize prices into a Gaussian normal distribution.
Parameters:
length
Returns: A tuple with Fisher Transform and signal
fisher(source, length)
Fisher Transform. Customized source. Normalize prices into a Gaussian normal distribution.
Parameters:
source : (float) Source of series (close, high, low, etc.)
length
Returns: A tuple with Fisher Transform and signal
inverseFisher(source, length, subtrahend, denominator)
Inverse Fisher Transform.
Transform the values of the Fisher Transform into a smaller and more easily interpretable scale is
through the application of an inverse transformation to the hyperbolic tangent function.
This transformation takes the values of the FT, which range from -infinity to +infinity,
to a scale limited between -1 and +1, allowing them to be more easily visualized and compared.
Parameters:
source : (float) Source of series (close, high, low, etc.)
length : (int) Period for loopback
subtrahend : (int) Denominator. Useful in unbounded indicators. For example, in CCI.
denominator
Returns: (float) Series of Inverse Fisher Transform
premierStoch(length, smoothlen)
Premier Stochastic Oscillator (PSO).
Normalizes the standard stochastic oscillator by applying a five-period double exponential smoothing
average of the %K value, resulting in a symmetric scale of 1 to -1.
Parameters:
length : (int) Period for loopback
smoothlen : (int) Period for smoothing
Returns: (float) Series of PSO
premierStoch(source, smoothlen, subtrahend, denominator)
Premier Stochastic Oscillator (PSO) of custom source.
Normalizes the source by applying a five-period double exponential smoothing average.
Parameters:
source : (float) Source of series (close, high, low, etc.)
smoothlen : (int) Period for smoothing
subtrahend : (int) Denominator. Useful in unbounded indicators. For example, in CCI.
denominator
Returns: (float) Series of PSO
stochRsi(sourceRSI, lengthRSI, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
sourceRSI
lengthRSI
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochRoc(sourceROC, lengthROC, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
sourceROC
lengthROC
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochUO(fastLength, middleLength, slowLength, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
fastLength
middleLength
slowLength
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochTSI(source, shortLength, longLength, maType, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
source
shortLength
longLength
maType
almaOffset
almaSigma
lsmaOffSet
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochWPR(source, length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
source
length
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochCCI(source, length, maType, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
source
length
maType
almaOffset
almaSigma
lsmaOffSet
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochMACD(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
source
fastLength
slowLength
signalLength
maTypeFast
maTypeSlow
maTypeMACD
almaOffset
almaSigma
lsmaOffSet
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochFT(length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
length
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochVolume(kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochMFI(source, length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
source
length
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochOBV(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
source
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochPVI(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
source
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochNVI(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
source
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochPVT(source, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
source
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochVO(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
shortLen
longLen
maType
almaOffset
almaSigma
lsmaOffSet
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
stochVROC(length, kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD)
Parameters:
length
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
iftRSI(sourceRSI, lengthRSI, lengthIFT)
Parameters:
sourceRSI
lengthRSI
lengthIFT
iftROC(sourceROC, lengthROC, lengthIFT)
Parameters:
sourceROC
lengthROC
lengthIFT
iftUO(fastLength, middleLength, slowLength, lengthIFT)
Parameters:
fastLength
middleLength
slowLength
lengthIFT
iftStoch(kLength, kSmoothing, dSmoothing, maTypeK, maTypeD, almaOffsetKD, almaSigmaKD, lsmaOffSetKD, lengthIFT)
Parameters:
kLength
kSmoothing
dSmoothing
maTypeK
maTypeD
almaOffsetKD
almaSigmaKD
lsmaOffSetKD
lengthIFT
iftTSI(source, shortLength, longLength, maType, almaOffset, almaSigma, lsmaOffSet, lengthIFT)
Parameters:
source
shortLength
longLength
maType
almaOffset
almaSigma
lsmaOffSet
lengthIFT
iftCCI(source, length, maType, almaOffset, almaSigma, lsmaOffSet, lengthIFT)
Parameters:
source
length
maType
almaOffset
almaSigma
lsmaOffSet
lengthIFT
iftFisher(length, lengthIFT)
Parameters:
length
lengthIFT
iftMACD(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet, lengthIFT)
Parameters:
source
fastLength
slowLength
signalLength
maTypeFast
maTypeSlow
maTypeMACD
almaOffset
almaSigma
lsmaOffSet
lengthIFT
iftWPR(source, length, lengthIFT)
Parameters:
source
length
lengthIFT
iftMFI(source, length, lengthIFT)
Parameters:
source
length
lengthIFT
iftCMF(length, lengthIFT)
Parameters:
length
lengthIFT
iftVO(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet, lengthIFT)
Parameters:
shortLen
longLen
maType
almaOffset
almaSigma
lsmaOffSet
lengthIFT
iftVROC(length, lengthIFT)
Parameters:
length
lengthIFT
smiRSI(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
length
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiROC(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
length
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiVROC(length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
length
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiWPR(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
length
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiFT(length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
length
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiFT(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
length
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiCCI(source, length, maTypeCCI, almaOffsetCCI, almaSigmaCCI, lsmaOffSetCCI, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
length
maTypeCCI
almaOffsetCCI
almaSigmaCCI
lsmaOffSetCCI
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiUO(fastLength, middleLength, slowLength, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
fastLength
middleLength
slowLength
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiMACD(source, fastLength, slowLength, signalLength, maTypeFast, maTypeSlow, maTypeMACD, almaOffset, almaSigma, lsmaOffSet, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
fastLength
slowLength
signalLength
maTypeFast
maTypeSlow
maTypeMACD
almaOffset
almaSigma
lsmaOffSet
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiVol(shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiMFI(source, length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
length
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiCMF(length, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
length
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiOBV(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiPVT(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiVO(shortLen, longLen, maType, almaOffset, almaSigma, lsmaOffSet, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
shortLen
longLen
maType
almaOffset
almaSigma
lsmaOffSet
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiPVI(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
smiNVI(source, shortLengthTSI, longLengthTSI, maTypeTSI, almaOffsetTSI, almaSigmaTSI, lsmaOffSetTSI, maTypeSignal, smoothingLengthSignal, almaOffsetSignal, almaSigmaSignal, lsmaOffSetSignal)
Parameters:
source
shortLengthTSI
longLengthTSI
maTypeTSI
almaOffsetTSI
almaSigmaTSI
lsmaOffSetTSI
maTypeSignal
smoothingLengthSignal
almaOffsetSignal
almaSigmaSignal
lsmaOffSetSignal
rsiVolume(length)
Parameters:
length
rsiMA(sourceMA, lengthMA, maType, almaOffset, almaSigma, lsmaOffSet, lengthRSI)
Parameters:
sourceMA
lengthMA
maType
almaOffset
almaSigma
lsmaOffSet
lengthRSI
LeafAlgo Premium Macro StrategiesA "macro score", as defined here, is created by giving various weights to different signals and adding them together to get one smooth score. Positive or negative values are assigned to each of the signals depending on if the statement is true or false (e.g. DPO > 0: +1, DPO < 0: -1). This manner of strategy allows for a subset of the available signals to be present at one time as opposed to every technical signal having to be active in order for a long/short signal to trigger.
This strategy contains SIX different macro score strategies -- "Base DFMA", "Base DFMG", "Ichimoku", "TSI", "Donchian DFMA", and "Donchian DFMG". These strategies have the signals and weights pre-determined in the code. The "Base DFMA" strategy is based on our Democratic Fibonacci Moving Average (DFMA) indicator; the "Donchian DFMA" is the same as the base DFMA strategy, but with a signal from our Donchian Cloud Score indicator as added confluence. The "Base DFMG" strategy is based on our Democratic Fibonacci McGinley Dynamics (DFMG) indicator; the "Donchian DFMG" is the same, but with the Donchian Cloud Score as added confluence. The "Ichimoku" strategy is based on the major sub-indicators found within an Ichimoku Cloud in addition to our Donchian Cloud Score. The "TSI" strategy is based on the True Strength Index.
The ability to select your strategy of choice can be found at the top of the strategy settings under "Strategy Options", then in the drop-down menu labeled "Strategy Choice".
The DFMA - Democratic Fibonacci Moving Average - is a separate indicator that we have released that takes 10 different Fibonacci MAs (lengths of 3 to 233, at Fibonacci intervals) and averages them to form the DFMA line. This helps by creating a consensus on the trend based on moving averages alone. Crossovers of the DFMA with the various Fib MA lengths as well as a cross of the price source and these lines can provide adequate long and short signals. In the two DFMA strategies, the heaviest weights have been given to crosses of the DFMA line/Fib MA (233) as well as the crosses of the Fib MA (3)/DFMA. Additionally, there are thresholds for DPO ( Detrended Price Oscillator , above or below 0), CMO ( Chande Momentum Oscillator , above or below 0), Jurik Volatility Bands (above or below 0), and Stoch RSI (above or below 50). These four signals hold a lighter weight than the MA cross signals. The macro score itself ranges between -10 and 10. In addition to the macro score line, a momentum line (sourced by the macro score itself) has been included. A crossover/crossunder of the macro score and the macro momentum line is included into the long/short signal syntax in addition to a threshold for the macro score.
The DFMG - Democratic Fibonacci McGinley Dynamics - is a separate indicator that we have released that takes 10 different Fibonacci McGinley Dynamic liness (lengths of 3 to 233, at Fibonacci intervals) and averages them to form the DFMG line. This helps by creating a consensus on the trend based on moving averages alone. Crossovers of the DFMG with the various Fib MG lengths as well as a cross of the price source and these lines can provide adequate long and short signals. This strategy has the signals and weights pre-determined in the code. Heaviest weights have been given to crosses of the DFMG line/ McGinley (233) as well as the crosses of the McGinley (3)/DFMG. Additionally, there are thresholds for DPO ( Detrended Price Oscillator , above or below 0), CMO ( Chande Momentum Oscillator , above or below 0), Jurik Volatility Bands (above or below 0), and Stoch RSI (above or below 50). These four signals hold a lighter weight than the McGinley cross signals. The macro score itself ranges between -10 and 10. In addition to the macro score line, a momentum line (sourced by the macro score itself) has been included. A crossover/crossunder of the macro score and the macro momentum line is included into the long/short signal syntax in addition to a threshold for the macro score.
For the Ichimoku macro score, five signals were considered and weighted equally:
- Kijun-sen < Ichimoku Source
- Tenkan-sen < Ichimoku Source
- Kijun-sen > Chikou-span
- Tenkan-sen > Kijun-sen
- Senkou Span A > Senkou Span B
In addition to these factors, the Ichimoku strategy utilizes the Donchian Cloud Score in the long and short entry signals. Thus, the Donchian Cloud settings are applicable to this strategy.
For the True Strength Index strategy, the heaviest weights have been given to various TSI signals, including a crossover/crossunder of TSI signal and TSI value, a threshold for the TSI Signal (above or below 0), and a crossover/crossunder of the CMO ( Chande Momentum Oscillator ) and the TSI signal line. Additionally, there are thresholds for DPO ( Detrended Price Oscillator , above or below 0), Jurik Volatility Bands (above or below 0), and Stoch RSI (above or below 50). These three signals hold a lighter weight than the three TSI signals. The macro score itself ranges between -10 and 10. In addition to the macro score line, a momentum line (sourced by the macro score itself) has been included. A crossover/crossunder of the macro score and the macro momentum line is included into the long/short signal syntax in addition to a threshold for the macro score.
The Donchian Cloud Score is derived from a set of 5 Donchian channels (upper, lower, and basis plotted) defaulted to lengths of 25, 50, 100, 150, and 200. A set of conditions associated with the channels aims to determine ranging versus trending markets. Weights are given to these conditions accordingly, then tallied up to determine the "cloud score", ranging between -25 and 25. In general, a ranging market is determined by a cloud score between -10 and 10, while a positive trending market has a score higher than 10 and a negative trending market has a score lower than -10. That said, long and short thresholds similar to the macro score itself are included in the user settings and set to a default of 5 or -5. The cloud score is plotted as a line in the underlay with coloration reflecting ranging or trending markets (green color above the long threshold, gray between the thresholds, and red below the short threshold). The cloud score is incorporated into the strategy syntax for long and short positions in that the score must be above or below the set threshold for a trade to be placed. A breakdown for the Donchian scoring is as follows:
- Broke the 25-length DC (DC(25)) upper band in the previous 3 bars - +1 if true, 0 if false
- Broke the DC(50) upper band in the previous 3 bars - +2 if true, 0 if false
- Broke the DC(100) upper band in the previous 3 bars - +3 if true, 0 if false
- Broke the DC(150) upper band in the previous 3 bars - +4 if true, 0 if false
- Broke the DC(200) upper band in the previous 3 bars - +5 if true, 0 if false
- Broke the DC(25) lower band in the previous 3 bars - -1 if true, 0 if false
- Broke the DC(50) lower band in the previous 3 bars - -2 if true, 0 if false
- Broke the DC(100) lower band in the previous 3 bars - -3 if true, 0 if false
- Broke the DC(150) lower band in the previous 3 bars - -4 if true, 0 if false
- Broke the DC(200) lower band in the previous 3 bars - -5 if true, 0 if false
- DC(25) basis line above the DC(50) basis line - +1 if true, -1 if false
- DC(25) basis line above the DC(100) basis line - +1 if true, -1 if false
- DC(25)basis line above the DC(150) basis line - +1 if true, -1 if false
- DC(25) basis line above the DC(200) basis line - +1 if true, -1 if false
- DC(50) basis line above the DC(100) basis line - +1 if true, -1 if false
- DC(50) basis line above the DC(150) basis line - +1 if true, -1 if false
- DC(50) basis line above the DC(200) basis line - +1 if true, -1 if false
- DC(100) basis line above the DC(150) basis line - +1 if true, -1 if false
- DC(100) basis line above the DC(200) basis line - +1 if true, -1 if false
- DC(150) basis line above the DC(200) basis line - +1 if true, -1 if false
Thresholds for both the respective macro score and the Donchian Cloud score have been included. Entry signals for each strategy require the score to be >= the respective thresholds for longs and <= the respective thresholds for shorts.
Additionally, a normalized z-score has been included. The z-score does not affect the entry and exit signals, however, it is displayed on the chart in the form of bar coloration. The z-score has been normalized to a range of -1 to +1. A z-score under -0.60 is displayed as a red bar color, a score between -0.60 and -0.2 is displayed as an orange bar color, a score between -0.2 and 0.2 is displayed as a gray bar color, a score between 0.2 and 0.6 is displayed as a lime bar color, and a score over 0.6 is displayed in green.
Data for each respective strategy will be displayed in an overlaid table. This includes the factors that comprise the macro score of choice, the values of each signal that adds up to the macro score, the macro score itself, the value of the momentum line of the macro score, the normalized z-score value, and the Donchian Cloud score (if applicable). Green coloration notes bullish sentiment within the signals or values, gray coloration is neutral, and red coloration notes bearish sentiment.
Take profit, stop loss, and trailing percentages are also included, found at the bottom of the Input tab under “TT and TTP” as well as “Stop Loss”. The take profit and stop loss levels will be reflected as green and red lines respectively on the chart as they occur. Make sure to understand the TP/SL ratio that you desire before use, as the desired hit rate/profitability percentage will be affected accordingly. The option for adding in a trailing stop has also been included, with options to choose between an ATR-based trail or a percentage-based trail. This strategy does NOT guarantee future returns. Apply caution in trading regardless of discretionary or algorithmic. Understand the concepts of risk/reward and the intricacies of each strategy choice before utilizing them in your personal trading.
Profitview/Pineconnector Settings:
If you wish to utilize Profitview’s automation system, find the included “Profitview Settings” under the Input tab of the strategy settings menu. If not, skip this section entirely as it can be left blank. Options will be “OPEN LONG TITLE”, “OPEN SHORT TITLE”, “CLOSE LONG TITLE”, and “CLOSE SHORT TITLE”. If you wished to trade SOL, for example, you would put “SOL LONG”, “SOL SHORT”, “SOL CLOSE LONG”, and “SOL CLOSE SHORT” in these areas. Within your Profitview extension, ensure that your Alerts all match these titles. To set an alert for use with Profitview, go to the “Alerts” tab in TradingView, then create an alert. Make sure that your desired asset and timeframe are currently displayed on your screen when creating the alert. Under the “Condition” option of the alert, select the strategy, then select the expiration time. If using TradingView Premium, this can be open-ended. Otherwise, select your desired expiration time and date. This can be updated whenever desired to ensure the strategy does not expire. Under “Alert actions”, nothing necessarily needs to be selected unless so desired. Leave the “Alert name” option empty. For the “Message”, delete the generated message and replace it with {{strategy.order.alert_message}} and nothing else. If using Pineconnector, follow the same directions for setting up an alert, but use the ",buy,,risk=" syntax as noted in the tooltips.
Any Oscillator Underlay [TTF]We are proud to release a new indicator that has been a while in the making - the Any Oscillator Underlay (AOU) !
Note: There is a lot to discuss regarding this indicator, including its intent and some of how it operates, so please be sure to read this entire description before using this indicator to help ensure you understand both the intent and some limitations with this tool.
Our intent for building this indicator was to accomplish the following:
Combine all of the oscillators that we like to use into a single indicator
Take up a bit less screen space for the underlay indicators for strategies that utilize multiple oscillators
Provide a tool for newer traders to be able to leverage multiple oscillators in a single indicator
Features:
Includes 8 separate, fully-functional indicators combined into one
Ability to easily enable/disable and configure each included indicator independently
Clearly named plots to support user customization of color and styling, as well as manual creation of alerts
Ability to customize sub-indicator title position and color
Ability to customize sub-indicator divider lines style and color
Indicators that are included in this initial release:
TSI
2x RSIs (dubbed the Twin RSI )
Stochastic RSI
Stochastic
Ultimate Oscillator
Awesome Oscillator
MACD
Outback RSI (Color-coding only)
Quick note on OB/OS:
Before we get into covering each included indicator, we first need to cover a core concept for how we're defining OB and OS levels. To help illustrate this, we will use the TSI as an example.
The TSI by default has a mid-point of 0 and a range of -100 to 100. As a result, a common practice is to place lines on the -30 and +30 levels to represent OS and OB zones, respectively. Most people tend to view these levels as distance from the edges/outer bounds or as absolute levels, but we feel a more way to frame the OB/OS concept is to instead define it as distance ("offset") from the mid-line. In keeping with the -30 and +30 levels in our example, the offset in this case would be "30".
Taking this a step further, let's say we decided we wanted an offset of 25. Since the mid-point is 0, we'd then calculate the OB level as 0 + 25 (+25), and the OS level as 0 - 25 (-25).
Now that we've covered the concept of how we approach defining OB and OS levels (based on offset/distance from the mid-line), and since we did apply some transformations, rescaling, and/or repositioning to all of the indicators noted above, we are going to discuss each component indicator to detail both how it was modified from the original to fit the stacked-indicator model, as well as the various major components that the indicator contains.
TSI:
This indicator contains the following major elements:
TSI and TSI Signal Line
Color-coded fill for the TSI/TSI Signal lines
Moving Average for the TSI
TSI Histogram
Mid-line and OB/OS lines
Default TSI fill color coding:
Green : TSI is above the signal line
Red : TSI is below the signal line
Note: The TSI traditionally has a range of -100 to +100 with a mid-point of 0 (range of 200). To fit into our stacking model, we first shrunk the range to 100 (-50 to +50 - cut it in half), then repositioned it to have a mid-point of 50. Since this is the "bottom" of our indicator-stack, no additional repositioning is necessary.
Twin RSI:
This indicator contains the following major elements:
Fast RSI (useful if you want to leverage 2x RSIs as it makes it easier to see the overlaps and crosses - can be disabled if desired)
Slow RSI (primary RSI)
Color-coded fill for the Fast/Slow RSI lines (if Fast RSI is enabled and configured)
Moving Average for the Slow RSI
Mid-line and OB/OS lines
Default Twin RSI fill color coding:
Dark Red : Fast RSI below Slow RSI and Slow RSI below Slow RSI MA
Light Red : Fast RSI below Slow RSI and Slow RSI above Slow RSI MA
Dark Green : Fast RSI above Slow RSI and Slow RSI below Slow RSI MA
Light Green : Fast RSI above Slow RSI and Slow RSI above Slow RSI MA
Note: The RSI naturally has a range of 0 to 100 with a mid-point of 50, so no rescaling or transformation is done on this indicator. The only manipulation done is to properly position it in the indicator-stack based on which other indicators are also enabled.
Stochastic and Stochastic RSI:
These indicators contain the following major elements:
Configurable lengths for the RSI (for the Stochastic RSI only), K, and D values
Configurable base price source
Mid-line and OB/OS lines
Note: The Stochastic and Stochastic RSI both have a normal range of 0 to 100 with a mid-point of 50, so no rescaling or transformations are done on either of these indicators. The only manipulation done is to properly position it in the indicator-stack based on which other indicators are also enabled.
Ultimate Oscillator (UO):
This indicator contains the following major elements:
Configurable lengths for the Fast, Middle, and Slow BP/TR components
Mid-line and OB/OS lines
Moving Average for the UO
Color-coded fill for the UO/UO MA lines (if UO MA is enabled and configured)
Default UO fill color coding:
Green : UO is above the moving average line
Red : UO is below the moving average line
Note: The UO naturally has a range of 0 to 100 with a mid-point of 50, so no rescaling or transformation is done on this indicator. The only manipulation done is to properly position it in the indicator-stack based on which other indicators are also enabled.
Awesome Oscillator (AO):
This indicator contains the following major elements:
Configurable lengths for the Fast and Slow moving averages used in the AO calculation
Configurable price source for the moving averages used in the AO calculation
Mid-line
Option to display the AO as a line or pseudo-histogram
Moving Average for the AO
Color-coded fill for the AO/AO MA lines (if AO MA is enabled and configured)
Default AO fill color coding (Note: Fill was disabled in the image above to improve clarity):
Green : AO is above the moving average line
Red : AO is below the moving average line
Note: The AO is technically has an infinite (unbound) range - -∞ to ∞ - and the effective range is bound to the underlying security price (e.g. BTC will have a wider range than SP500, and SP500 will have a wider range than EUR/USD). We employed some special techniques to rescale this indicator into our desired range of 100 (-50 to 50), and then repositioned it to have a midpoint of 50 (range of 0 to 100) to meet the constraints of our stacking model. We then do one final repositioning to place it in the correct position the indicator-stack based on which other indicators are also enabled. For more details on how we accomplished this, read our section "Binding Infinity" below.
MACD:
This indicator contains the following major elements:
Configurable lengths for the Fast and Slow moving averages used in the MACD calculation
Configurable price source for the moving averages used in the MACD calculation
Configurable length and calculation method for the MACD Signal Line calculation
Mid-line
Note: Like the AO, the MACD also technically has an infinite (unbound) range. We employed the same principles here as we did with the AO to rescale and reposition this indicator as well. For more details on how we accomplished this, read our section "Binding Infinity" below.
Outback RSI (ORSI):
This is a stripped-down version of the Outback RSI indicator (linked above) that only includes the color-coding background (suffice it to say that it was not technically feasible to attempt to rescale the other components in a way that could consistently be clearly seen on-chart). As this component is a bit of a niche/special-purpose sub-indicator, it is disabled by default, and we suggest it remain disabled unless you have some pre-defined strategy that leverages the color-coding element of the Outback RSI that you wish to use.
Binding Infinity - How We Incorporated the AO and MACD (Warning - Math Talk Ahead!)
Note: This applies only to the AO and MACD at time of original publication. If any other indicators are added in the future that also fall into the category of "binding an infinite-range oscillator", we will make that clear in the release notes when that new addition is published.
To help set the stage for this discussion, it's important to note that the broader challenge of "equalizing inputs" is nothing new. In fact, it's a key element in many of the most popular fields of data science, such as AI and Machine Learning. They need to take a diverse set of inputs with a wide variety of ranges and seemingly-random inputs (referred to as "features"), and build a mathematical or computational model in order to work. But, when the raw inputs can vary significantly from one another, there is an inherent need to do some pre-processing to those inputs so that one doesn't overwhelm another simply due to the difference in raw values between them. This is where feature scaling comes into play.
With this in mind, we implemented 2 of the most common methods of Feature Scaling - Min-Max Normalization (which we call "Normalization" in our settings), and Z-Score Normalization (which we call "Standardization" in our settings). Let's take a look at each of those methods as they have been implemented in this script.
Min-Max Normalization (Normalization)
This is one of the most common - and most basic - methods of feature scaling. The basic formula is: y = (x - min)/(max - min) - where x is the current data sample, min is the lowest value in the dataset, and max is the highest value in the dataset. In this transformation, the max would evaluate to 1, and the min would evaluate to 0, and any value in between the min and the max would evaluate somewhere between 0 and 1.
The key benefits of this method are:
It can be used to transform datasets of any range into a new dataset with a consistent and known range (0 to 1).
It has no dependency on the "shape" of the raw input dataset (i.e. does not assume the input dataset can be approximated to a normal distribution).
But there are a couple of "gotchas" with this technique...
First, it assumes the input dataset is complete, or an accurate representation of the population via random sampling. While in most situations this is a valid assumption, in trading indicators we don't really have that luxury as we're often limited in what sample data we can access (i.e. number of historical bars available).
Second, this method is highly sensitive to outliers. Since the crux of this transformation is based on the max-min to define the initial range, a single significant outlier can result in skewing the post-transformation dataset (i.e. major price movement as a reaction to a significant news event).
You can potentially mitigate those 2 "gotchas" by using a mechanism or technique to find and discard outliers (e.g. calculate the mean and standard deviation of the input dataset and discard any raw values more than 5 standard deviations from the mean), but if your most recent datapoint is an "outlier" as defined by that algorithm, processing it using the "scrubbed" dataset would result in that new datapoint being outside the intended range of 0 to 1 (e.g. if the new datapoint is greater than the "scrubbed" max, it's post-transformation value would be greater than 1). Even though this is a bit of an edge-case scenario, it is still sure to happen in live markets processing live data, so it's not an ideal solution in our opinion (which is why we chose not to attempt to discard outliers in this manner).
Z-Score Normalization (Standardization)
This method of rescaling is a bit more complex than the Min-Max Normalization method noted above, but it is also a widely used process. The basic formula is: y = (x – μ) / σ - where x is the current data sample, μ is the mean (average) of the input dataset, and σ is the standard deviation of the input dataset. While this transformation still results in a technically-infinite possible range, the output of this transformation has a 2 very significant properties - the mean (average) of the output dataset has a mean (μ) of 0 and a standard deviation (σ) of 1.
The key benefits of this method are:
As it's based on normalizing the mean and standard deviation of the input dataset instead of a linear range conversion, it is far less susceptible to outliers significantly affecting the result (and in fact has the effect of "squishing" outliers).
It can be used to accurately transform disparate sets of data into a similar range regardless of the original dataset's raw/actual range.
But there are a couple of "gotchas" with this technique as well...
First, it still technically does not do any form of range-binding, so it is still technically unbounded (range -∞ to ∞ with a mid-point of 0).
Second, it implicitly assumes that the raw input dataset to be transformed is normally distributed, which won't always be the case in financial markets.
The first "gotcha" is a bit of an annoyance, but isn't a huge issue as we can apply principles of normal distribution to conceptually limit the range by defining a fixed number of standard deviations from the mean. While this doesn't totally solve the "infinite range" problem (a strong enough sudden move can still break out of our "conceptual range" boundaries), the amount of movement needed to achieve that kind of impact will generally be pretty rare.
The bigger challenge is how to deal with the assumption of the input dataset being normally distributed. While most financial markets (and indicators) do tend towards a normal distribution, they are almost never going to match that distribution exactly. So let's dig a bit deeper into distributions are defined and how things like trending markets can affect them.
Skew (skewness): This is a measure of asymmetry of the bell curve, or put another way, how and in what way the bell curve is disfigured when comparing the 2 halves. The easiest way to visualize this is to draw an imaginary vertical line through the apex of the bell curve, then fold the curve in half along that line. If both halves are exactly the same, the skew is 0 (no skew/perfectly symmetrical) - which is what a normal distribution has (skew = 0). Most financial markets tend to have short, medium, and long-term trends, and these trends will cause the distribution curve to skew in one direction or another. Bullish markets tend to skew to the right (positive), and bearish markets to the left (negative).
Kurtosis: This is a measure of the "tail size" of the bell curve. Another way to state this could be how "flat" or "steep" the bell-shape is. If the bell is steep with a strong drop from the apex (like a steep cliff), it has low kurtosis. If the bell has a shallow, more sweeping drop from the apex (like a tall hill), is has high kurtosis. Translating this to financial markets, kurtosis is generally a metric of volatility as the bell shape is largely defined by the strength and frequency of outliers. This is effectively a measure of volatility - volatile markets tend to have a high level of kurtosis (>3), and stable/consolidating markets tend to have a low level of kurtosis (<3). A normal distribution (our reference), has a kurtosis value of 3.
So to try and bring all that back together, here's a quick recap of the Standardization rescaling method:
The Standardization method has an assumption of a normal distribution of input data by using the mean (average) and standard deviation to handle the transformation
Most financial markets do NOT have a normal distribution (as discussed above), and will have varying degrees of skew and kurtosis
Q: Why are we still favoring the Standardization method over the Normalization method, and how are we accounting for the innate skew and/or kurtosis inherent in most financial markets?
A: Well, since we're only trying to rescale oscillators that by-definition have a midpoint of 0, kurtosis isn't a major concern beyond the affect it has on the post-transformation scaling (specifically, the number of standard deviations from the mean we need to include in our "artificially-bound" range definition).
Q: So that answers the question about kurtosis, but what about skew?
A: So - for skew, the answer is in the formula - specifically the mean (average) element. The standard mean calculation assumes a complete dataset and therefore uses a standard (i.e. simple) average, but we're limited by the data history available to us. So we adapted the transformation formula to leverage a moving average that included a weighting element to it so that it favored recent datapoints more heavily than older ones. By making the average component more adaptive, we gained the effect of reducing the skew element by having the average itself be more responsive to recent movements, which significantly reduces the effect historical outliers have on the dataset as a whole. While this is certainly not a perfect solution, we've found that it serves the purpose of rescaling the MACD and AO to a far more well-defined range while still preserving the oscillator behavior and mid-line exceptionally well.
The most difficult parts to compensate for are periods where markets have low volatility for an extended period of time - to the point where the oscillators are hovering around the 0/midline (in the case of the AO), or when the oscillator and signal lines converge and remain close to each other (in the case of the MACD). It's during these periods where even our best attempt at ensuring accurate mirrored-behavior when compared to the original can still occasionally lead or lag by a candle.
Note: If this is a make-or-break situation for you or your strategy, then we recommend you do not use any of the included indicators that leverage this kind of bounding technique (the AO and MACD at time of publication) and instead use the Trandingview built-in versions!
We know this is a lot to read and digest, so please take your time and feel free to ask questions - we will do our best to answer! And as always, constructive feedback is always welcome!
Multi SMI Ergodic OscillatorThe Multi SMI Ergodic Oscillator (Multi SMIEO) indicator can be used to identify potential buy and sell signals based on the relationship between the TSI and EMA lines.
The script is creating an indicator that plots multiple (3) sets of Time Series Indicator (TSI-Indicator) and Exponential Moving Average (EMA-Signal) lines as a single indicator.
The TSI is a momentum oscillator that helps identify overbought and oversold conditions. It is calculated using the close prices of an asset, a short-term moving average, and a long-term moving average. The script uses three different pairs of input values for the short-term and long-term periods, which can be adjusted by the user.
The EMA is a type of moving average that gives more weight to recent prices. It is calculated by applying a weighting factor to the most recent price, and then adding that weighted value to the previous EMA value. The script uses three different input values for the length of the EMA, which can also be adjusted by the user.
After calculating the TSI and EMA for each set, the script plots them on the same graph, with different colors and widths to differentiate them. The three sets of TSI and EMA lines are plotted to allow the user to compare the results of different periods. The script also plots a horizontal line at zero, which is used as a reference point for the oscillations of the indicator lines.
One way to use this indicator is to look for crossovers between the TSI and the EMA lines. A bullish crossover occurs when the TSI crosses above the EMA. This suggests that the buying pressure is increasing and a potential buy signal is generated. A bearish crossover occurs when the TSI crosses below the EMA. This suggests that the selling pressure is increasing and a potential sell signal is generated.
Some other ways that the indicator can be used include:
1. Identifying trends: The TSI and EMA lines can be used to identify the direction of the trend. An uptrend is present when the TSI and EMA lines are both trending upwards, while a downtrend is present when the TSI and EMA lines are both trending downwards.
2. Overbought and oversold conditions: The TSI can be used to identify overbought and oversold conditions. When the TSI is above the upper limit of the range, the asset is considered overbought and may be due for a price correction. Conversely, when the TSI is below the lower limit of the range, the asset is considered oversold and may be due for a price rebound.
3. Confirming price action: The Multi SMIEO indicator can be used to confirm price action. If a bullish divergence is present, it confirms a potential bullish reversal. If a bearish divergence is present, it confirms a potential bearish reversal.
4. Multiple time frame analysis: By using different periods for the TSI and EMA lines, the indicator can be used to analyze the asset on multiple time frames. It can be useful to compare the results of different periods to get a better understanding of the asset's price movements.
5. Risk management: This indicator can be used as an element of risk management strategy, it can help traders to identify overbought and oversold conditions to set stop loss or take profit levels.
The Multi SMI Ergodic Oscillator (Multi SMIEO) is a versatile indicator that can be used in a number of ways to analyze the price movements of an asset. It can be used to identify potential buy and sell signals, trends, overbought and oversold conditions, and to confirm price action. By using different periods for the TSI and EMA lines, the indicator can also be used to analyze the asset on multiple time frames. However, it is important to remember that indicators are based on historical data, and past performance does not guarantee future results.
It is important to use the indicator as part of a comprehensive trading strategy that includes risk management and other analysis techniques, such as fundamental and technical analysis. It is also important to keep in mind that indicators are not a standalone solution for trading, they should be used in conjunction with other market analysis and research techniques to generate better results.
Lastly, it is important to keep in mind that trading in financial markets comes with a certain level of risk and it is crucial to always have a proper risk management plan in place. Never invest more than you can afford to lose.
Consensus Tables - Oscillators, Multi-MA , DFMA, and IchimokuThis indicator is a series of underlaid tables that determine a consensus value using a simple positive or negative score for a set signal. This consensus value is also shown as a histogram and reflected on the chart's bar colors. There are a total of four different table options to choose from: a set of trend and volume oscillators, a set of 11 moving averages, a set of Fibonacci moving averages and their own consensus line, and a set of Ichimoku-based conditions. The type of table can be chosen from a drop-down menu at the top of the user settings, with settings for each of the table types grouped up respectively.
Oscillator Table:
The Oscillator table consists of the Average Directional Index (ADX) set as a value instead of +/- and is not used in the scoring to gather consensus. Rather, a value of 25 or above is used to confirm the trend regardless of positive or negative. The Chande Momentum Oscillator (CMO), Detrended Price Oscillator (DPO), Momentum, Rate of Change (ROC), Relative Strength Index (RSI), True Strength Index (TSI), and Volume Oscillator are used in the Oscillator table for a consensus value and given a + or - depending on the condition being met. The conditions and weighting are as follows:
-- CMO > or < 0, given a weight of +/- 2
-- DPO > or < 0, given a weight of +/- 2
-- Momentum > or < 0, given a weight of +/- 2
-- ROC > or < 0, given a weight of +/- 2
-- RSI > or < 50, given a weight of +/- 1
-- TSI Value Line > or < 0, given a weight of +/- 1
-- TSI Signal Line > or < 0, given a weight of +/- 1
-- Volume Osc. > or < 0, given a weight of +/- 2
The consensus value is determined by adding these values together and dividing by 13.
Multi-MA Table:
For the Moving Average Ribbon/Multi-MA table the user is able to determine the source, type, and lengths of 11 moving averages. The type selection consists of EMA, DEMA, TEMA, SMA, RMA, VWMA, WMA, SMMA, and a Hull MA. The preset values for the 11 moving averages are 5, 7, 10, 14, 21, 26, 50, 75, 100, 150, and 200. The consensus conditions and weighting are as follows:
-- If MA(1 through 10) < or > the price source, given a weight of +/- 1
-- If MA(11) < or > the price source, given a weight of +/- 2
The consensus value is determined by adding these values together and dividing by 12.
DFMA Table:
The Democratic Fibonacci Moving Average table is derived from our indicator of the same name. The source for the DFMA can be chosen by the user, but the SMA lengths are predetermined in Fibonacci intervals from 3 to 233. The DFMA line itself is determined by finding the average value of these 10 Fibonacci MA lengths. The consensus conditions and weighting are as follows:
-- If Fib. MA (3-233) < or > the source, given a weight of +/- 1
-- If DFMA value < or > the source, given a weight of +/- 2
The consensus value is determined by adding these values together and dividing by 12.
Ichimoku Table:
The Ichimoku table values a handful of conditions using the Tenkan-sen/Conversion Line, Kijun-sen/Base Line, Senkou-span A and B, and the Chikou-span, each of which are given their standard values of 9, 26, 52, and 26, respectively, but can be changed in the user settings if desired. As opposed to the other tables, there are fewer conditions to be met and given values to. All of the conditions are given the same weighting (+/- 1). The conditions are as follows:
-- Kijun-sen < or > the source
-- Tenkan-sen < or > the source
-- Kijun-sen > or < the Chikou-span
-- Tenkan-sen > or < the Kijou-sen
-- Senkou Span A > or < Senkou Span B
The consensus value is determined by dividing the total value by 5.
Overall consensus and overall trend values are given alongside each of these options. The overall consensus value is determined by taking the average of the 4 respective consensus values. Trend values are determined as such:
-- If consensus value >= 0.75, considered a "Strong Buy"
-- If consensus value is between 0.25 and 0.75, considered a "Buy"
-- If consensus value is between 0.25 and -0.25, considered "Neutral"
-- If consensus value is between -0.25 and -0.75, considered a "Sell"
-- If consensus value is <= -0.75, considered a "Strong Sell"
Table colors are set as either green, red, or gray to reflect positive, negative, and neutral sentiment sentiment. Bar colors reflect the consensus value and the determined table trend:
-- If trend for the chosen table is "Strong Buy", bar color is green
-- If trend for the chosen table is "Buy", bar color is lime
-- If trend for the chosen table is "Neutral", bar color is gray
-- If trend for the chosen table is "Sell", bar color is orange
-- If trend for the chosen table is "Strong Sell", bar color is red
MarsMine_PEMTThis indicator uses a total of four indicators, 'ParabolicSAR', 'EMA', 'MACD', and 'TSI', to indicate the direction of the trend as well as the progress signal of the trend.
Basically, the overall trend is analyzed by the 'EMA' and 'TSI' indicators, and the buying trend is displayed in green and the selling trend is displayed in red candlesticks.
An additional buy or sell signal is generated, which analyzes all the 'Parabolic SAR', 'EMA', 'MACD' and 'TSI' indicators to indicate the beginning of a trend that is slightly more accurate than the trend displayed on candlesticks.
-----
해당 지표는 'ParabolicSAR', 'EMA', 'MACD', 'TSI' 총 네 가지 지표를 활용하여 추세의 방향성과 함께 추세의 진행 신호를 알려주는 지표입니다.
기본적으론 전반적인 추세는 'EMA', 'TSI' 지표를 분석하여 매수 추세는 초록색 매도 추세는 빨간색으로 캔들에 표시해 주고 있습니다.
추가적으로 매수 또는 매도 신호가 발생하며, 이 신호는 'Parabolic SAR', 'EMA', 'MACD', 'TSI' 지표 모두를 분석하여 캔들에 표시되는 추세보다 조금 더 정확한 추세의 시작을 표시합니다.
Macro Score -- User-Customized Scores and SignalsA "macro score", as defined here, is created by giving various weights to different signals and adding them together to get one smooth score. Positive or negative values are assigned to each of the signals depending on if the statement is true or false (e.g. DPO > 0: +1, DPO < 0: -1). This manner of strategy allows for a subset of the available signals to be present at one time as opposed to every technical signal having to be active in order for a long/short signal to trigger. This particular strategy allows the user to choose between 18 different signals to be used in scoring as well as allowing the user to determine the individual weights of each score as well as the overall threshold to determine long or short signals. Weights for each score range between 1 and 5, with 5 being the greatest weight. The overall threshold for long or short is dependent on the total possible weights added together (i.e. if your weights total -10 or +10, a threshold within this range must be used).
The macro score itself is printed in an underlay as a white line that goes between the maximum positive and negative values for all weights added together for this strategy. In addition to the macro score line, a green momentum line (sourced by the macro score itself) has been included. A crossover/crossunder of the macro score and the macro momentum line is included into the long/short signal syntax in addition to a threshold for the macro score. The length of the Macro Score's momentum line can be found in the settings.
The current signals to choose from include:
- ADX Threshold - if the Average Directional Index is above a set threshold, signal positive or negative
- CMF Threshold - if the Chaikin Money Flow oscillator is above 0, signal positive; otherwise, signal negative
- CMO > TSI Signal - signal positive if there is a cross of the Chande Momentum Oscillator and the True Strength Index signal line
- CMO Threshold - if the Chande Momentum Oscillator is above 0, signal positive; otherwise, signal negative
- DPO Threshold - if the Detrended Price Oscillator is above 0, signal positive; otherwise, signal negative
- EOM Threshold - if the Ease of Money Oscillator is above 0, signal positive; otherwise, signal negative
- Jurik Threshold - if the Jurik price line (from the Jurik Volatility Bands) is above 0, signal positive; otherwise, signal negative
- MACD Threshold - if the MACD signal line is above 0, signal positive; otherwise, signal negative
- McGinley Cross - a crossover of a fast McGinley Dynamic length line and a slow McGinley Dynamic line signals positive; otherwise, signal negative
- PSAR - if the direction of the PSAR is heading long, signal positive; otherwise, signal negative
- ROC Threshold - if the Rate of Change oscillator is above 0, signal positive; otherwise, signal negative
- RSI Threshold - if the Relative Strength Index is above 50, signal positive; otherwise, signal negative
- Stoch RSI Threshold - if the Stoch RSI is above 50, signal positive; otherwise, signal negative
- Supertrend - if the Supertrend determines long, signal positive; otherwise, signal negative
- TSI Cross - a crossover of the True Strength Index value line and the TSI signal line signals positive; otherwise, signal negative
- TSI Signal Threshold - if the TSI signal line is above 0, signal positive; otherwise, signal negative
- Williams Alligator Cross - if the Williams Alligator lips cross the teeth and jaw, signal positive; otherwise, signal negative
- Williams %R - if the Williams %R is above -50, signal positive; otherwise, signal negative
Take profit, stop loss, and trailing percentages are also included, found at the bottom of the Input tab under “TT and TTP” as well as “Stop Loss”. Make sure to understand the TP/SL ratio that you desire before use, as the desired hit rate/profitability percentage will be affected accordingly. This strategy does NOT guarantee future returns. Apply caution in trading regardless of discretionary or algorithmic. Understand the concepts of risk/reward and the intricacies of each strategy choice before utilizing them in your personal trading.
Profitview Settings:
If you wish to utilize Profitview’s automation system, find the included “Profitview Settings” under the Input tab of the strategy settings menu. If not, skip this section entirely as it can be left blank. Options will be “OPEN LONG TITLE”, “OPEN SHORT TITLE”, “CLOSE LONG TITLE”, and “CLOSE SHORT TITLE”. If you wished to trade SOL, for example, you would put “SOL LONG”, “SOL SHORT”, “SOL CLOSE LONG”, and “SOL CLOSE SHORT” in these areas. Within your Profitview extension, ensure that your Alerts all match these titles. To set an alert for use with Profitview, go to the “Alerts” tab in TradingView, then create an alert. Make sure that your desired asset and timeframe are currently displayed on your screen when creating the alert. Under the “Condition” option of the alert, select the strategy, then select the expiration time. If using TradingView Premium, this can be open-ended. Otherwise, select your desired expiration time and date. This can be updated whenever desired to ensure the strategy does not expire. Under “Alert actions”, nothing necessarily needs to be selected unless so desired. Leave the “Alert name” option empty. For the “Message”, delete the generated message and replace it with {{strategy.order.alert_message}} and nothing else.
Sample setup for SOLUSDT 30M:
- Score 1 - Value 4, PSAR (0.05 start, 0.02 increment, 0.2 max value; sourced open)
- Score 2 - Value 4, Jurik Threshold (JVB Length 25, JVB Smoothing 6, JVB Price Threshold 0)
- Score 3 - Value 5, DPO Threshold (DPO Length 40, uncentered)
- Score 4 - Value 5, CMO Threshold (CMO Length 40, sourced open)
- Score 5 - Value 2, MACD Threshold (Fast Length 12, Slow Length 30, sourced open)
- Macro Length 21
- Long Threshold - -3
- Short Threshold - +3
- Take Profit % - 0.9/0.9
- Trail % - 0.005
- Stop Loss % - 1.4
Sample setup for AVAXUSDT 20M:
- Score 1 - Value 3, TSI Cross (Long Length 25, Short Length 16, Signal Length 17)
- Score 2 - Value 2, TSI Signal Threshold (same settings as the TSI Cross)
- Score 3 - Value 2, Jurik Threshold (JVB Length 20, JVB Smoothing 8, JVB Price Threshold 0)
- Score 4 - Value 2, DPO Threshold (DPO Length 40, uncentered)
- Score 5 - Value 1, Stoch Threshold (K/D 3, RSI (Stoch) Length 10, Stochastic Length 4, sourced open)
- Macro Length 13
- Long Threshold - +5
- Short Threshold - -5
- Take Profit % - 1.2/1.2
- Trail % - 0.005
- Stop Loss % - 1.5
Macro Score - TSI-BasedA "macro score", as defined here, is created by giving various weights to different signals and adding them together to get one smooth score. Positive or negative values are assigned to each of the signals depending on if the statement is true or false (e.g. DPO > 0: +1, DPO < 0: -1). This manner of strategy allows for a subset of the available signals to be present at one time as opposed to every technical signal having to be active in order for a long/short signal to trigger.
This strategy has the signals and weights pre-determined in the code. Heaviest weights have been given to various TSI (True Strength Index) signals, including a crossover/crossunder of TSI signal and TSI value, a threshold for the TSI Signal (above or below 0), and a crossover/crossunder of the CMO (Chande Momentum Oscillator) and the TSI signal line. Additionally, there are thresholds for DPO (Detrended Price Oscillator, above or below 0), Jurik Volatility Bands (above or below 0), and Stoch RSI (above or below 50). These three signals hold a lighter weight than the three TSI signals.
The macro score itself is printed in an underlay as a white line that goes between -10 and 10 for this strategy. In addition to the macro score line, a red momentum line (sourced by the macro score itself) has been included. A crossover/crossunder of the macro score and the macro momentum line is included into the long/short signal syntax in addition to a threshold for the macro score (-6/6).
Take profit, stop loss, and trailing percentages are also included, found at the bottom of the Input tab under “TT and TTP” as well as “Stop Loss”. Make sure to understand the TP/SL ratio that you desire before use, as the desired hit rate/profitability percentage will be affected accordingly. This strategy does NOT guarantee future returns. Apply caution in trading regardless of discretionary or algorithmic. Understand the concepts of risk/reward and the intricacies of each strategy choice before utilizing them in your personal trading.
Profitview Settings:
If you wish to utilize Profitview’s automation system, find the included “Profitview Settings” under the Input tab of the strategy settings menu. If not, skip this section entirely as it can be left blank. Options will be “OPEN LONG TITLE”, “OPEN SHORT TITLE”, “CLOSE LONG TITLE”, and “CLOSE SHORT TITLE”. If you wished to trade SOL, for example, you would put “SOL LONG”, “SOL SHORT”, “SOL CLOSE LONG”, and “SOL CLOSE SHORT” in these areas. Within your Profitview extension, ensure that your Alerts all match these titles. To set an alert for use with Profitview, go to the “Alerts” tab in TradingView, then create an alert. Make sure that your desired asset and timeframe are currently displayed on your screen when creating the alert. Under the “Condition” option of the alert, select the strategy, then select the expiration time. If using TradingView Premium, this can be open-ended. Otherwise, select your desired expiration time and date. This can be updated whenever desired to ensure the strategy does not expire. Under “Alert actions”, nothing necessarily needs to be selected unless so desired. Leave the “Alert name” option empty. For the “Message”, delete the generated message and replace it with {{strategy.order.alert_message}} and nothing else.
Cheat Code's RedemptionWELCOME TO THE CHEAT CODE REDEMPTION PACK!!!!
I want to take a deep dive into what this indicator consists of and how you can use it to improve your trading strategy.
-What does the CCR consist of?
The Oscillator:
The oscillator is a combination of a true strength index sampled from on-balance volume and a regular RSI at default settings. The reason I added the on-balance volume is that it does not tend to remain at overbought or oversold conditions as traditional momentum oscillators do.
The Histogram:
The histogram is copied to a tee from the MACD histogram, the only difference here is that I extended the moving averages to depict a special pairing; the ema55 slow and ema21 fast. I then converted it into another true strength index, as the calculations fit all time frames.
The Divergences:
The divergences of an indicator can be extremely useful in catching scalp opportunities, a DARK RED/GREEN represents a REGULAR divergence, while a SALMON/LIGHT GREEN color represents a HIDDEN divergence.
The moving average:
The moving average built into this indicator is depicted as an aqua or yellow line, when the oscillator is moving in an uptrend, the moving average will appear aqua, when the oscillator is in a downtrend it will appear yellow. Use this as confirmation bias or as the third derivative of market position.
Oscillator Colors:
The Oscillator color is an important thesis of this indicator. When the line is green, it means the market is effectively in an uptrend, when it is red, it means the market is in a downtrend. Use this to prevent longing in a serious downtrend and vice versa.
If you have any questions regarding the indicator(s), feel free to reach out to me in the comments or through Direct Message!!!
Safe Trading, Don't get Rekt
- CheatCode1 <3
Divergence for Many Panel (D4MP+)Divergence for Many Panel (D4MP+)
This Divergence for Many Panel indicator is built upon the realtme divergence drawing code originally authored by LonesomeTheBlue, now in the form of a panel indicator.
The available oscillators, hand picked for their ability to identify high quality divergences currently include:
- Ultimate Oscillator (UO)
- True Strength Index (TSI)
- Money Flow Index (MFI)
- Relative Strength Index (RSI)
- Stochastic RSI
- Time Segmented Volume (TSV)
- Cumulative Delta Volume (CDV)
Note : this list of available oscillators may be added to or altered at a later date.
The indicator includes the following features:
- Ability to select any of the above oscillators
- Optional divergence lines drawn directly onto the oscillator in realtime .
- Configurable alerts to notify you when divergences occur.
- Configurable pivot lookback periods to fine tune the divergences drawn in order to suit different trading styles and timeframes, including the ability to enable automatic adjustment of pivot period per chart timeframe.
- Background colouring option to indicate when the selected oscillator has crossed above or below its centerline.
- Alternate timeframe feature allows you to configure the oscillator to use data from a different timeframe than the chart it is loaded on.
- Oscillator name label, so you can clearly see which oscillator is selected, in the case you have multiple loaded onto a chart.
- Optional adjustable range bands.
- Automatic adjustment of line colours, centerlines and range band levels on a per oscillator basis by default.
- Ability to customise the colours of each of the oscillators.
What is the Ultimate Oscillator ( UO )?
“The Ultimate Oscillator indicator (UO) indicator is a technical analysis tool used to measure momentum across three varying timeframes. The problem with many momentum oscillators is that after a rapid advance or decline in price, they can form false divergence trading signals. For example, after a rapid rise in price, a bearish divergence signal may present itself, however price continues to rise. The ultimate Oscillator attempts to correct this by using multiple timeframes in its calculation as opposed to just one timeframe which is what is used in most other momentum oscillators.”
What is the True Strength Index ( TSI )?
"The true strength index (TSI) is a technical momentum oscillator used to identify trends and reversals. The indicator may be useful for determining overbought and oversold conditions, indicating potential trend direction changes via centerline or signal line crossovers, and warning of trend weakness through divergence."
What is the Money Flow Index ( MFI )?
“The Money Flow Index ( MFI ) is a technical oscillator that uses price and volume data for identifying overbought or oversold signals in an asset. It can also be used to spot divergences which warn of a trend change in price. The oscillator moves between 0 and 100. Unlike conventional oscillators such as the Relative Strength Index ( RSI ), the Money Flow Index incorporates both price and volume data, as opposed to just price. For this reason, some analysts call MFI the volume-weighted RSI .”
What is the Relative Strength Index ( RSI )?
"The relative strength index (RSI) is a momentum indicator used in technical analysis. RSI measures the speed and magnitude of a security's recent price changes to evaluate overvalued or undervalued conditions in the price of that security. The RSI can do more than point to overbought and oversold securities. It can also indicate securities that may be primed for a trend reversal or corrective pullback in price. It can signal when to buy and sell. Traditionally, an RSI reading of 70 or above indicates an overbought situation. A reading of 30 or below indicates an oversold condition. It is also commonly used to identify divergences."
What is the Stochastic RSI (StochRSI)?
"The Stochastic RSI (StochRSI) is an indicator used in technical analysis that ranges between zero and one (or zero and 100 on some charting platforms) and is created by applying the Stochastic oscillator formula to a set of relative strength index (RSI) values rather than to standard price data. Using RSI values within the Stochastic formula gives traders an idea of whether the current RSI value is overbought or oversold. The StochRSI oscillator was developed to take advantage of both momentum indicators in order to create a more sensitive indicator that is attuned to a specific security's historical performance rather than a generalized analysis of price change."
What Is Time Segmented Volume?
"Time segmented volume (TSV) is a technical analysis indicator developed by Worden Brothers Inc. that segments a stock's price and volume according to specific time intervals. The price and volume data is then compared to uncover periods of accumulation (buying) and distribution (selling)."
What is Cumulative Volume Delta ( CDV )?
"The CDV analyses the net buying at market price and net selling at market price. This means, that volume delta is measuring whether it is the buyers or sellers that are more aggressive in taking the current market price. It measures the degree of intent by buyers and sellers, which can be used to indicate who is more dominant. The CDV can be used to help identify possible trends and also divergences"
What are divergences?
Divergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
There are 4 main types of divergence, which are split into 2 categories;
regular divergences and hidden divergences. Regular divergences indicate possible trend reversals, and hidden divergences indicate possible trend continuation.
Regular bullish divergence: An indication of a potential trend reversal, from the current downtrend, to an uptrend.
Regular bearish divergence: An indication of a potential trend reversal, from the current uptrend, to a downtrend.
Hidden bullish divergence: An indication of a potential uptrend continuation.
Hidden bearish divergence: An indication of a potential downtrend continuation.
Setting alerts.
With this indicator you can set alerts to notify you when any/all of the above types of divergences occur, on any chart timeframe you choose.
Configurable pivot periods.
You can adjust the default pivot periods to suit your prefered trading style and timeframe. If you like to trade a shorter time frame, lowering the default lookback values will make the divergences drawn more sensitive to short term price action.
How do traders use divergences in their trading?
A divergence is considered a leading indicator in technical analysis , meaning it has the ability to indicate a potential price move in the short term future.
Hidden bullish and hidden bearish divergences, which indicate a potential continuation of the current trend are sometimes considered a good place for traders to begin, since trend continuation occurs more frequently than reversals, or trend changes.
When trading regular bullish divergences and regular bearish divergences, which are indications of a trend reversal, the probability of it doing so may increase when these occur at a strong support or resistance level . A common mistake new traders make is to get into a regular divergence trade too early, assuming it will immediately reverse, but these can continue to form for some time before the trend eventually changes, by using forms of support or resistance as an added confluence, such as when price reaches a moving average, the success rate when trading these patterns may increase.
Typically, traders will manually draw lines across the swing highs and swing lows of both the price chart and the oscillator to see whether they appear to present a divergence, this indicator will draw them for you, quickly and clearly, and can notify you when they occur.
Disclaimer : This script includes code from several stock indicators by Tradingview as well as the Divergence for Many Indicators v4 by LonesomeTheBlue. With special thanks.
True Strength IndexThe True Strength Index (TSI) is a technical momentum oscillator that can help identify trends and spot reversals. This indicator was developed with about an hour of research, based on the original True Strength Index formula by William Blau. The research material used to create this indicator can be found in the script (released publicly).
Author Notes:
- The zero line is included in this script, since it's a standard feature of the True Strength Index momentum oscillator.
- I did not include support and resistance levels, as I'm still researching the best way to incorporate this, rather than using a simple horizontal line for each.
- The original True Strength Index momentum oscillator utilizes the Exponential Moving Average, but with this release, you have the option to use the Hull Moving Average (as an alternative). Feel free to experiment and adjust the settings to whatever suits your trading style.
- I plan on improving/updating this indicator, but for now, releasing this early version.
* This is being provided as is and the information provided by this script is meant for informational/entertainment purposes only.
True Strength Indicator + Realtime DivergencesTrue Strength Indicator (TSI) + Realtime Divergences + Alerts + Lookback periods.
This version of the True Strength Indicator adds the following 5 additional features to the stock TSI by Tradingview:
- Optional divergence lines drawn directly onto the oscillator in realtime.
- Configurable alerts to notify you when divergences occur, as well as when the TSI and lagline bands crossover one another, when the oscillator begins heading up, or heading down.
- Configurable lookback periods to fine tune the divergences drawn in order to suit different trading styles and timeframes.
- Background colouring option to indicate when the two TSI bands, the TSI line and the TSI lagline, have crossed one another, either moving upwards or downwards, or optionally when the two TSI bands have crossed upwards and an external oscillator, which can be linked via the settings, has crossed above its centerline, and the TSI bands have crossed downwards and the external oscillator has crossed below its centerline.
- Alternate timeframe feature allows you to configure the oscillator to use data from a different timeframe than the chart it is loaded on.
This indicator adds additional features onto the stock TSI by Tradingview, whose core calculations remain unchanged, although this version has different settings as default to suit a shorter time period (it uses 6, 13, 4 by default, whereas the stock TSI typically ships with higher values, e.g. 25, 13, 13). Namely the configurable option to automatically, quickly and clearly draw divergence lines onto the oscillator for you as they occur in realtime. It also has the addition of unique alerts, so you can be notified when divergences occur without spending all day watching the charts. Furthermore, this version of the TSI comes with configurable lookback periods, which can be configured in order to adjust the sensitivity of the divergences, in order to suit shorter or higher timeframe trading approaches.
The True Strength Indicator
Tradingview describes the True Strength Indicator as follows:
“The True Strength Index (TSI) is a momentum oscillator that ranges between limits of -100 and +100 and has a base value of 0. Momentum is positive when the oscillator is positive (pointing to a bullish market bias) and vice versa. It was developed by William Blau and consists of 2 lines: the index line and an exponential moving average of the TSI, called the signal line. Traders may look for any of the following 5 types of conditions: overbought, oversold, centerline crossover, divergence and signal line crossover. The indicator is often used in combination with other signals..”
What are divergences?
Divergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
There are 4 main types of divergence, which are split into 2 categories;
regular divergences and hidden divergences. Regular divergences indicate possible trend reversals, and hidden divergences indicate possible trend continuation.
Regular bullish divergence: An indication of a potential trend reversal, from the current downtrend, to an uptrend.
Regular bearish divergence: An indication of a potential trend reversal, from the current uptrend, to a downtrend.
Hidden bullish divergence: An indication of a potential uptrend continuation.
Hidden bearish divergence: An indication of a potential downtrend continuation.
Setting alerts.
With this indicator you can set alerts to notify you when any/all of the above types of divergences occur, on any chart timeframe you choose.
Configurable lookback values.
You can adjust the default lookback values to suit your prefered trading style and timeframe. If you like to trade a shorter time frame, lowering the default lookback values will make the divergences drawn more sensitive to short term price action.
How do traders use divergences in their trading?
A divergence is considered a leading indicator in technical analysis , meaning it has the ability to indicate a potential price move in the short term future.
Hidden bullish and hidden bearish divergences, which indicate a potential continuation of the current trend are sometimes considered a good place for traders to begin, since trend continuation occurs more frequently than reversals, or trend changes.
When trading regular bullish divergences and regular bearish divergences, which are indications of a trend reversal, the probability of it doing so may increase when these occur at a strong support or resistance level . A common mistake new traders make is to get into a regular divergence trade too early, assuming it will immediately reverse, but these can continue to form for some time before the trend eventually changes, by using forms of support or resistance as an added confluence, such as when price reaches a moving average, the success rate when trading these patterns may increase.
Typically, traders will manually draw lines across the swing highs and swing lows of both the price chart and the oscillator to see whether they appear to present a divergence, this indicator will draw them for you, quickly and clearly, and can notify you when they occur.
Disclaimer: This script includes code from the stock TSI by Tradingview as well as the Divergence for Many Indicators v4 by LonesomeTheBlue
TSI + DivergencesTrue Strength Indicator (TSI) + Divergences + Alerts + Lookback periods.
This version of the True Strength Indicator adds the following 3 additional features to the stock TSI by Tradingview:
- Optional divergence lines drawn directly onto the oscillator.
- Configurable alerts to notify you when divergences occur.
- Configurable lookback periods to fine tune the divergences drawn in order to suit different trading styles and timeframes.
This indicator adds additional features onto the stock TSI by Tradingview, whose core calculations remain unchanged. Namely the configurable option to automatically, quickly and clearly draw divergence lines onto the oscillator for you as they occur, with minimal delay. It also has the addition of unique alerts, so you can be notified when divergences occur without spending all day watching the charts. Furthermore, this version of the TSI comes with configurable lookback periods, which can be configured in order to adjust the sensitivity of the divergences, in order to suit shorter or higher timeframe trading approaches.
The True Strength Indicator
Tradingview describes the True Strength Indicator as follows:
“The True Strength Index (TSI) is a momentum oscillator that ranges between limits of -100 and +100 and has a base value of 0. Momentum is positive when the oscillator is positive (pointing to a bullish market bias) and vice versa. It was developed by William Blau and consists of 2 lines: the index line and an exponential moving average of the TSI, called the signal line. Traders may look for any of the following 5 types of conditions: overbought, oversold, centerline crossover, divergence and signal line crossover. The indicator is often used in combination with other signals..”
What are divergences?
Divergence is when the price of an asset is moving in the opposite direction of a technical indicator, such as an oscillator, or is moving contrary to other data. Divergence warns that the current price trend may be weakening, and in some cases may lead to the price changing direction.
There are 4 main types of divergence, which are split into 2 categories;
regular divergences and hidden divergences. Regular divergences indicate possible trend reversals, and hidden divergences indicate possible trend continuation.
Regular bullish divergence: An indication of a potential trend reversal, from the current downtrend, to an uptrend.
Regular bearish divergence: An indication of a potential trend reversal, from the current uptrend, to a downtrend.
Hidden bullish divergence: An indication of a potential uptrend continuation.
Hidden bearish divergence: An indication of a potential downtrend continuation.
Setting alerts.
With this indicator you can set alerts to notify you when any/all of the above types of divergences occur, on any chart timeframe you choose.
Configurable lookback values.
You can adjust the default lookback values to suit your prefered trading style and timeframe. If you like to trade a shorter time frame, lowering the default lookback values will make the divergences drawn more sensitive to short term price action.
How do traders use divergences in their trading?
A divergence is considered a leading indicator in technical analysis, meaning it has the ability to indicate a potential price move in the short term future.
Hidden bullish and hidden bearish divergences, which indicate a potential continuation of the current trend are sometimes considered a good place for traders to begin, since trend continuation occurs more frequently than reversals, or trend changes.
When trading regular bullish divergences and regular bearish divergences, which are indications of a trend reversal, the probability of it doing so may increase when these occur at a strong support or resistance level. A common mistake new traders make is to get into a regular divergence trade too early, assuming it will immediately reverse, but these can continue to form for some time before the trend eventually changes, by using forms of support or resistance as an added confluence, such as when price reaches a moving average, the success rate when trading these patterns may increase.
Typically, traders will manually draw lines across the swing highs and swing lows of both the price chart and the oscillator to see whether they appear to present a divergence, this indicator will draw them for you, quickly and clearly, and can notify you when they occur.
Disclaimer : This script includes code from the stock TSI by Tradingview as well as the RSI divergence indicator.
RISK managment TOOL not a netive english speakr - soory for spelling problems.
this tool purpse is to help you dtermine postion sizing
it take a trend meeter of your chose and mesure it with the high and low of lookback number (defult is 100 )
you can chose your trend meeter from 'close','VOL', 'MA short' , 'MA long' , 'MACD', 'VOL MA', 'ATR', 'MFI', 'TSI'
with that you can see if you are "overbought" or "oversold " with the highest and lowest of a lookback period
and size acording to that .
the MA box - MAshort and MA long is the same box for the MACD ma for calcs and for the TSI
for long - if in lower band buy +++ if midelle buy +++ if high buy +
for short - if in highr band short +++ if midelle short ++ if low short ++
hope it will help you
for source - comment email and tip.
כלי ניהול הסיכונים הזה נועד להראות לכם את היחס של המתנד הנבחר ביחס לגבוהה והנמוך בבחירת טווח הזמן הנבחר ( דיפולט הוא 100 ימים אחורה ) ובכך לעזור לכם בהחלטת גודל הפוזציה
הכלי נועד לעזור בוויזאולציה של הטרנד לעומת האיתות שאתם מקבלים ביחס לגבוהה או הנמוך של 100 ימים אחורה
אם אתם מתכננים עסקת לונג העדיפות לקנות כאשר הסמן נמצא ברצועה התחתונה ובמקום זה תוכלו להגדיל את הפוזציה ל +++
כאשר הסמן נמצא ברצועה האמצעית אפשר לקנות ++
וכאשר הסמן נמצא למעלה עדיף לשקול את הפוזציה או לקנות +
ההפך לשורט.
לקבלת הקוד אפשר להשאיר מייל בתגובה + טיפ.
תודה ל @daviddtech tnx to
Ultimate Custom ScreenerThis indicator will allow you to make your custom TradingView screener without coding. Add it to the chart, select up to 40 symbols and five indicators, and the screener will do the rest for you. The indicator will form a lovely table with all values and highlighted signals.
The screener is highly customizable, and you can choose its position on the chart, sorting, order of the columns, colors for the tables, and all signals separately. You can easily change parameters for all supported indicators and their signals.
Currently, there are 19 different custom indicators available. Current list of indicators:
Average Directional Index (ADX) - displaying the value of ADX and checking if it's higher than the threshold
Average True Range (ATR) - showing the value of ATR
Awesome Oscillator (AO) - displaying the value of AO and highlighting positive/negative values.
Bollinger Bands (BB) - showing if the price is above/below/in the channel.
Breakout Pivots - Displaying when the price is below/above the most recent pivot low/high.
Commodity Channel Index (CCI) - shows the last CCI value and highlights overbought/oversold values.
Directional Movement Index (DMI) - Up/Down signal (+DI above or below -DI)
Donchian Channel (DC) - showing if the price is above/below/in the channel.
Historical Volatility (HV) - Current value of Historical Volatility
Keltner Channel (KC) - showing if the price is above/below/in the channel.
Moving Average Convergence Divergence (MACD) - Up/Down signal (MACD above / below signal)
Moving Average Crossover (MA Cross) - Displaying MA crosses signals (SMA, EMA, WMA, HMA, VWMA, SMMA, DEMA, VWAP supported)
Moving Average Distance (MA DIST) - Displaying distance to the MA (SMA, EMA, WMA, HMA, VWMA, SMMA, DEMA, VWAP supported)
Price - Displaying the last price for the instrument
Relative Strength Index (RSI) - Displaying the last RSI value and highlighting overbought/oversold values.
Stochastic (STOCH) - Displaying the last Stochastic value and highlighting overbought/oversold values.
Stochastic RSI (STOCH RSI) - Displaying the last Stochastic RSI value and highlighting overbought/oversold values.
SuperTrend - Current state of the SuperTrend.
True Strength Index (TSI) - Displaying the last TSI value and highlighting overbought/oversold values.
We're already working on adding a few more supported indicators. If you have any ideas about the indicators you want to see in our screener, contact us, and we'll consider them.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Multiple Indicator 50EMA Cross AlertsHere’s a screener including Symbol, Price, TSI, and 50 ema cross in a table output.
The 50 Exponential Moving Average is a trend indicator
You can find bullish momentum when the 50 ema crossed over or a bearish momentum when the 50 ema crossed under we are looking to take advantage by trading the reversion of these trends.
True strength index (TSI) is a trend momentum indicator
Readings are bullish when the True Strength Index shows positive values
Readings are bearish when the indicator displays negative values.
When a value is above 20, we look for selling overbought opportunity and when the value is under 20, we look for buying oversold opportunity.
You can select the pair of your choice in the settings.
Make sure to create an alert and choose any alerts then an alert will trigger when a price cross under or cross over the 50 ema for every pair separately.
This allow the user to verify if there is a trade set up or not.
Disclaimer
This post and the script don’t provide any financial advice.
HLC True Strength Indicator (with Vix)HLC True Strength Indicator Volume Weighted with Vix Line by SpreadEagle71
This indicator is a True Strength Indicator with Close, High and Low used together, along with the TSI of the Vix.
The white line is the close. The red line is the lows and the blue is the highs. These are also volume-weighted.
How to Interpret:
1. zero line crosses. If SPY/SPX500 crosses the zero line, then its bullish. If the purple Vix line crosses up, watch out because this is bearish.
2. white/blue/red lines cross purple (Vix). If they cross upwards, this is bullish. If downward, this is bearish. Basically, SPX, ES1!, SPY or even DIA can be used. The security and the Vix should travel in opposite directions and cross the zero-line at the same time. But this is not always the case.
3. Black area infills. These are used between the close and the highs (blue) and the lows(red). Close should not be between these in order to have momentum.
4. Close (white line) leads. Close is the last price so it tends to show where the others (highs and lows) are going. If the close is sagging below a high where the blue lines are on top, this could mean that there is a reversal coming. Same holds true for a white line above a "valley" formed by the blue and red lines; it could mean a reversal to the upside soon.
5. The Black Infill areas as a squeeze or contraction/expansion area. The thinner the black infill areas, the more of a momentum "squeeze" could be present. Wide black infill areas mean increased volatility and what may come next is a reversion to the mean for volatility. See TTM Squeeze Indicator or the Squeeze Momentum Indicator (kudos LazyBear).
Lastly, just remember indicators indicate; they are not magic. :)
SpreadEagle71