[blackcat] L3 CCI-RSI ComboCCI-RSI Combo indicator is a combination indicator that includes CCI and RSI. It uses some parameters to calculate the values of CCI and RSI, and generates corresponding charts based on these values. On the chart, when CCI exceeds 100 or falls below -100, yellow or magenta filling areas are displayed. Additionally, gradient colors are used on the RSI chart to represent different value ranges. Based on the values of CCI and RSI, buying or selling signals can be identified and "B" or "S" labels are displayed at the corresponding positions. It utilizes some technical indicators and logic to generate buying and selling signals, and displays the corresponding labels on the chart.
Here are the main parts of the code:
1. Definition of some variables:
- `N`, `M`, `N1`: Parameters used to calculate CCI and RSI.
- `xcn(cond, len)` and `xex(cond, len)`: Two functions used to calculate the number of times a condition is met.
2. Calculation of CCI (Commodity Channel Index):
- Calculate the CCI value based on the formula `(TYP - ta.sma(TYP, M)) / (0.015 * ta.stdev(TYP, M))`.
- Use the `plot()` function to plot CCI on the chart and set the color based on its value.
3. Calculation of RSI (Relative Strength Index):
- First calculate RSI1 by taking the average of positive differences between closing prices and the average of all absolute differences, and then multiplying by 100.
- Then use the ALMA function to transform RSI1 into a smoother curve.
- Use the `plot()` function to plot RSI on the chart and select gradient colors for shading based on its value.
4. Setting up the gradient color array:
- Create a color array using `array.new_color()` and add a series of color values to it.
5. Generating buying and selling signals based on conditions:
- Use logical operators and technical indicator functions to determine the conditions for buying and selling.
- Use the `label.new()` function to draw the corresponding labels on the chart to represent buying or selling signals.
Centered Oscillators
MADALGO`s Enhanced OBV DivergencesDescription:
MADALGO's Enhanced OBV Divergences indicator is a unique tool designed for traders to visualize the divergences between price action and On Balance Volume (OBV), a fundamental aspect often indicative of underlying strength or weakness in the market. By keenly identifying these divergences, traders are better positioned to anticipate potential trend reversals or trend continuations, making this script an invaluable addition to their technical analysis toolkit.
This script meticulously scans for both regular and hidden bullish/bearish divergences, providing a comprehensive view of market sentiment. The core of this indicator is built around the OBV, which cumulatively adds or subtracts volume based on the price movement per period, thus providing a running total of volume and portraying the force behind the price movements.
The regular divergences are classic indicators of a potential reversal in the current trend, while hidden divergences are often indicative of trend continuation. These divergences are pinpointed based on the relative positions of the OBV and price highs/lows, over customizable lookback periods and within specified lookback ranges.
Features:
Regular and Hidden Divergences: Clearly marked bullish and bearish divergences provide insights into potential market turning points.
On Balance Volume (OBV) Line: Visualize the continuous flow of buying and selling pressure, enabling the identification of accumulation or distribution phases essential for understanding the market's strength or weakness.
Moving Average of OBV: An optional feature to smooth the OBV line, aiding in the identification of the overarching trend.
Dynamic Statistics Label: A floating label provides real-time updates on essential statistics like the Rate of Percentage Change (RPC) of OBV, the last divergences, and bars since the last divergences.
Inputs:
Pivot Lookback Right and Pivot Lookback Left: Define the lookback periods for identifying pivot points in the OBV line.
Max of Lookback Range and Min of Lookback Range: Define the range for considering divergences.
RPC Period: Defines the period for calculating the Rate of Percentage Change of the OBV.
MA Period: Defines the period for the optional moving average of the OBV.
Plot Bullish, Plot Hidden Bullish, Plot Bearish, Plot Hidden Bearish: Toggle visibility of respective divergences.
Plot Moving Average: Toggle visibility of the OBV moving average.
Usage:
Add the script to your TradingView chart.
Tailor the input parameters in the settings panel to align with your analysis requirements.
The divergences, OBV line, and optional moving average will be plotted on your chart, with a dynamic label displaying real-time statistics.
Set up alerts to be notified of identified divergences, enabling timely decision-making.
Alerts:
Regular bullish/bearish divergence in OBV found: Triggered when a regular bullish or bearish divergence is identified.
Hidden bullish/bearish divergence in OBV found: Triggered when a hidden bullish or bearish divergence is identified.
Underlying Concepts:
The OBV Divergences indicator is rooted in the principle that volume precedes price movement. When prices are rising with increased volume, it suggests that buying pressure is prevailing and may lead to continued upward momentum. Conversely, rising prices with decreasing volume might indicate a lack of buying conviction and could signal a potential price reversal. The identification of divergences between price and OBV can therefore serve as a powerful signal for traders. These examples can be seen below in the image
The Moving Average of the OBV further aids in understanding the prevailing trend by smoothing out the OBV line, providing a clearer picture of the market's longer-term momentum. The Rate of Percentage Change (RPC) provides insight into the momentum of volume, offering an additional layer of analysis. Together, these additional features enhance the core OBV analysis, enabling a more nuanced understanding of volume dynamics fundamental for making more informed trading decisions.
License:
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, you can obtain one at Mozilla Public License 2.0.
PCA-Risk IndicatorOBJECTIVE:
The objective of this indicator is to synthesize, via PCA (Principal Component Analysis), several of the most used indicators with in order to simplify the reading of any asset on any timeframe.
It is based on my Bitcoin Risk Long Term indicator, and is the evolution of another indicator that I have not published 'Average Risk Indicator'.
The idea of this indicator is to use statistics, in this case the PCA, to reduce the number of dimensions (indicator) to aggregate them in some synthetic indicators (PCX)
I invite you to dig deeper into the PCA, but that is to try to keep as much information as possible from the raw data. The signal minus the noise.
I realized this indicator a year ago, but I publish it now because I do not see the interest to keep it private.
USAGE:
Unlike the Bitcoin Risk Long Term indicator, it does not make sense to change or disable the input indicators unless you use the 'Average Indicator' function. Because each input is weighted to generate the outputs, the PCX.
I extracted several courses (Bitcoin, Gold, S&P, CAC40) on several timeframes (W, D, 4h, 1h) of Trading view and use the Excel generated for the data on which I played the PCA analysis.
The results:
explained_variance_ratio: 0.55540809 / 0.13021972 / 0.07303142 / 0.03760925
explained_variance: 11.6639671 / 2.73470717 / 1.53371209 / 0.7898212
Interpretation:
Simply put, 55% of the information contained in each indicator can be represented with PC1, +13% with PC2, +7% with PC3, +3% with PC4.
What is important to understand is that PC1, which serves as a thermometer in a way, gives a simple indication of over-buying or over-selling area better than any other indicator.
PC2, difficult to interpret, is more reactive because precedes PC1, but can give false signals.
PC3 and PC4 do not seem relevant to me.
The way I use it is to take PC1 for Risk indicator, and display PC2 with 'Area'. When PC2 turns around and PC1 arrives on extremes, it can be good points to act.
NOTES :
- It is surprising that a simple average of all the indicators gives a fairly relevant result
- With Average indicator as Risk indicator, you can combine the indicators of your choice and see the predictive power with the staining of bars.
- You can add alerts on the levels of your choice on the Risk Indicator
- If you have any idea of adding an indicator, modification, criticism, bug found: share them, it’s appreciated!
---- FR ----
OBJECTIF :
L'objectif de cet indicateur est de synthétiser, via l'ACP (Analyse en Composantes Principales), plusieurs indicateurs parmi les plus utilisés avec afin de simplifier la lecture de n'importe quel actif sur n'importe quel timeframe.
Il est inspiré de mon indicateur 'Bitcoin Risk Long Term indicator', et est l'évolution d'un autre indicateur que je n'ai pas publié 'Average Risk Indicator'.
L'idée de cet indicateur est d'utiliser les statistiques, en l'occurence l'ACP, pour réduire le nombre de dimensions (indicateur) pour les agréger dans quelques indicateurs synthétiques (PCX)
Je vous invite à creuser l'ACP, mais c'est chercher à conserver un maximum d'informations à partir de la donnée brute. Le signal moins le bruit.
J'ai réalisé cet indicateur il y a un an, mais je le publie maintenant car je ne vois pas l'intérêt de le garder privé.
UTILISATION :
Contrairement à 'Bitcoin Risk Long Term indicator', il ne fait pas sens de modifier ou désactiver les indicateurs inputs, sauf si vous utiliser la fonction 'Average Indicator'. Car chaque input est pondéré pour générer les outputs, les PCX.
J'ai extrait plusieurs cours (Bitcoin, Gold, S&P, CAC40) sur plusieurs timeframes (W, D, 4h, 1h) de Trading view et utiliser les Excel généré pour la data sur laquelle j'ai joué l'analyse ACP.
Les résultats :
explained_variance_ratio : 0.55540809 / 0.13021972 / 0.07303142 / 0.03760925
explained_variance : 11.6639671 / 2.73470717 / 1.53371209 / 0.7898212
Interprétation :
Pour faire simple, 55% de l'information contenu dans chaque indicateur peut être représenté avec PC1, +13% avec PC2, +7% avec PC3, +3% avec PC4.
Ce qui faut y comprendre c'est que le PC1, qui sert de thermomètre en quelque sorte, donne une indication simple de zone de sur-achat ou sur-vente mieux que n'importe quel autre indicateur.
PC2, difficile à interpréter, est plus réactif car précède PC1, mais peut donner des faux signaux.
PC3 et PC4 ne me semble pas pertinent.
La manière dont je m'en sert c'est de prendre PC1 pour Risk indicator, et d'afficher PC2 avec 'Region'. Lorsque PC2 se retourne et que PC1 arrive sur des extrêmes, cela peut être des bons points pour agir.
NOTES :
- Il est étonnant de constater qu'une simple moyenne de tous les indicateurs donne un résultat assez pertinent
- Avec Average indicator comme Risk indicator, vous pouvez combiner les indicateurs de vos choix et voir la force prédictive avec la coloration des bars.
- Vous pouvez ajouter des alertes sur les niveaux de votre choix sur le Risk Indicator
- Si vous avez la moindre idée d'ajout d'indicateur, modification, critique, bug trouvé : partagez-les, c'est apprécié !
Heatmap MACD StrategyHello traders
A customer gave me the idea indirectly after I made an update to that script:
Supertrend MTF Heatmap
Important Notes
The backtest results aren't relevant for this educational script publication.
I used realistic backtesting data but didn't look too much into optimizing the results, as this isn't the point of why I'm publishing this script.
I wanted to showcase that any Heatmap script can be converted into a strategy.
The strategy default settings are:
Initial Capital: 100000 USD
Position Size: 1 contract
Commission Percent: 0.075%
Slippage: 1 tick
No margin/leverage used
For example, those are realistic settings for trading CFD indices with low timeframes, but not the best possible settings for all assets/timeframes.
Concept
The Heatmap MACD Strategy allows selecting one MACD in five different timeframes.
You'll get an exit signal whenever one of the 5 MACDs changes direction.
Then, the strategy re-enters whenever all the MACDs are in the same direction again.
It takes:
long trades when all the 5 MACD histograms are bullish
short trades when all the 5 MACD histograms are bearish
You can select the same timeframe multiple times if you don't need five timeframes.
For example, if you only need the 30min, the 1H, and 2H, you can set your timeframes as follow:
30m
30m
30m
1H
2H
Risk Management Features
Nothing too fancy
All the features below are pips-based
Stop-Loss
Trailing Stop-Loss
Stop-Loss to Breakeven after a certain amount of pips has been reached
Take Profit 1st level and closing X% of the trade
Take Profit 2nd level and close the remaining of the trade
What's next?
I'll publish this script's open-source Pineconnector, ProfitView, and AutoView versions for educational purposes.
Thank you
Dave
Triple Ehlers Market StateClear trend identification is an important aspect of finding the right side to trade, another is getting the best buying/selling price on a pullback, retracement or reversal. Triple Ehlers Market State can do both.
Three is always better
Ehlers’ original formulation produces bullish, bearish and trendless signals. The indicator presented here gate stages three correlation cycles of adjustable lengths and degree thresholds, displaying a more refined view of bullish, bearish and trendless markets, in a compact and novel way.
Stick with the default settings, or experiment with the cycle period and threshold angle of each cycle, then choose whether ‘Recent trend weighting’ is included in candle colouring.
John Ehlers is a highly respected trading maths head who may need no introduction here. His idea for Market State was published in TASC June 2020 Traders Tips. The awesome interpretation of Ehlers’ work on which Triple Ehlers Market State’s correlation cycle calculations are based can be found at:
DISCLAIMER: None of this is financial advice.
Crypto Spot/Futures Dominance Indicator with AlertsFutures/Spot Dominance Indicator:
Overview:
The futures/spot dominance indicator is a versatile tool used by traders and analysts to assess the relative strength or dominance of the futures market in relation to the spot (or cash) market for a specific asset. It offers insights into market sentiment, potential arbitrage opportunities, and risk management while incorporating the VWAP indicator for added context.
How It Works:
This indicator automatically detects and adapts to the futures symbol applied to the chart, simplifying the setup for traders. However, it still necessitates manual input of the corresponding spot pair to ensure accuracy.
Automatic Futures Symbol Detection: The indicator starts by automatically detecting the futures symbol on the trading chart, eliminating the need for manual configuration. This ensures that the indicator is applied to the correct futures contract.
Manual Spot Pair Entry: To provide a reliable reference point for the comparison, traders must manually input the corresponding spot symbol via the indicator's inputs. For instance, if the indicator detects the BTCUSDT.P futures symbol, traders would manually enter the BTCUSDT spot symbol.
Gathering Data: The indicator collects historical price data for both the detected futures contract and the manually specified spot symbol. This data includes open, high, low, and close prices, as well as trading volume.
VWAP Calculation: To gain a deeper understanding of price trends and market dynamics, the indicator calculates the VWAP (Volume Weighted Average Price) for both the futures and spot markets. The VWAP places more weight on prices with higher trading volume, offering a weighted average that reflects market consensus.
Premium/Discount Calculation: By subtracting the VWAP of the spot market from the VWAP of the futures market, the indicator quantifies the premium or discount of the futures price concerning the spot price. A positive value indicates a premium, while a negative value suggests a discount.
Plotting: The premium/discount value is displayed as a line on the chart, often alongside moving averages or other smoothing techniques for improved trend analysis.
Alerts: In addition to its analysis capabilities, this indicator now includes alerts to enhance your trading experience. It alerts you in the following scenarios:
Premium Above Average: Notifies you when the premium crosses above the average line.
Premium Below Average: Alerts you when the premium crosses below the average line.
Premium Above Zero: Provides an alert when the premium crosses above the zero line.
Premium Below Zero: Generates an alert when the premium crosses below the zero line.
Benefits of the Futures/Spot Dominance Indicator:
Sentiment Analysis: Traders use the indicator to assess market sentiment. A futures premium might signify bullish sentiment, while a discount could indicate bearish sentiment.
Arbitrage Opportunities: Identifying price discrepancies between futures and spot markets can help traders spot arbitrage opportunities, where they can profit from price differentials.
Risk Management: The indicator assists in evaluating risks associated with futures positions, helping traders manage their exposure effectively.
Trend Confirmation: When used in conjunction with other technical indicators, futures/spot dominance, along with VWAP, can provide additional confirmation of price trends.
Hedging: Investors and corporations use this tool to gauge the effectiveness of hedging strategies based on futures contracts.
Speculative Trading: Traders and investors use the indicator to inform speculative positions, aligning their trades with perceived market strength or weakness.
Insightful Analysis: Futures/spot dominance analysis, enriched by VWAP data, offers insights into market behavior during specific events or changes in economic conditions.
In summary, the futures/spot dominance indicator, with its integration of VWAP and automatic futures symbol detection, provides traders and investors with a comprehensive tool to assess market dynamics. It aids in sentiment analysis, risk management, and trend confirmation while offering potential arbitrage opportunities. The newly added alerts enhance the indicator's functionality, providing timely notifications of key market events. However, it relies on manual input of the corresponding spot pair to ensure precise comparisons between futures and spot markets. It should be used alongside other analysis techniques for a well-rounded view of the market.
Weighted Bulls-Bears Variety Smoothed [Loxx]Weighted Bulls-Bears Variety Smoothed highlights potential buy and sell moments in the market. Users can customize the data source and select their preferred type of moving average for calculations. The resulting visualization is a column-style plot that changes color based on bullish or bearish market conditions. Additionally, the script can color chart bars and provide visual markers to indicate buying ("Long") or selling ("Short") opportunities. Alerts can also be set for these trading signals.
█ Inputs:
Users can choose the source for calculations (e.g., closing price).
They can set periods for calculations and smoothing.
They can select the type of moving average they prefer for smoothing: EMA, FEMA, LWMA, SMA, or SMMA.
█ Weighted Bulls-Bears Calculation:
It determines the highest and lowest prices over a user-defined period.
Then, it calculates the 'bull' and 'bear' values based on these highest and lowest prices. These values are weighted based on their distance from the current price.
█ Extras
Alerts
Signals
Auto Fibo on IndicatorsThis drawing tool aims to draw auto Fibonacci Retracement Levels on desired indicators.
Users can define the target indicator to draw Auto Fibo Lines, from the "settings tab":
There are six commonly used indicators below the charts that can be selected to draw Fibonacci Retracement lines on:
RSI : Relative Strength Index
CCI : Commodity Channel Index
MFI : Money Flow Index
STOCHASTIC : Stochastic Oscillator
CMF : Chaikin Money Flow
CMO : Chande Momentum Oscillator
Fibonacci Retracement Levels will appear automatically after applying the indicator.
The "Auto Fibo on Indicators" tool looks back. It checks the indicator levels for a desired number of bars and then draws the Fibonacci Levels automatically in the right way, considering the final movements of the indicator.
There are five commonly used Fibonacci Levels added between the Highest and Lowest values such as:
%23.6
%38.2
%50 (Not precisely a Fibonacci Level, indeed)
%61.8 (Golden Ratio)
%78.6
Four extra levels can be added from the settings tab by checking their boxes:
%127.2 (adjustable level)
%161.8
%261.8
%361.8
Default lookback bars of Auto Fibo Levels: 144 (which is also a Fibonacci number)
Default Indicator: RSI
Default Indicator length: 14
Default data source: CLOSE
Users can also define and show overbought and oversold levels by unchecking the "Do not Show Indicator Overbought / Oversold Levels?" button from the settings menu.
In technical analysis, Fibonacci Levels on price can guide valuable trading signals for investors.
Levels can be significant support and resistance levels for breakouts and turning points.
This drawing tool aims to follow those necessary levels on indicators to observe critical levels and breakouts.
MACD AreaThis indicator calculates and displays the cumulative area for each region above and below the zero line in the MACD histogram. This area measurement serves as a momentum metric, where larger cumulative areas indicate stronger momentum. Divergences between the area and price can also potentially indicate an impending reversal. For example, when the stock price makes a higher high but the area makes a lower high, the current momentum may be unsustainable.
Double MACD Pattern 1.0This script is designed to assist traders in identifying potential trading signals and trends based on the MACD indicator. Users can adjust the input parameters to fine-tune the indicator to their trading preferences. When specific conditions are met, alerts are generated to notify the user of potential trading opportunities.
Indicator Description:
The script defines a custom indicator that calculates and plots two sets of Moving Average Convergence Divergence (MACD) lines along with their signal lines.
It allows users to configure various parameters for MACD calculation, such as fast and slow lengths for both MACD 1 and MACD 2, as well as signal lengths for both.
Plotting:
The script plots the MACD lines and signal lines for both MACD 1 and MACD 2 on the chart with different colors and line styles.
It also plots a middle line at zero for reference.
Alerts:
The script defines conditions for generating alerts based on MACD crossover and crossunder events for both MACD 1 and MACD 2.
Alerts are generated for the following scenarios:
A long signal is generated when MACD 1 crosses under its signal line while MACD 2 crosses over its signal line.
A short signal is generated when MACD 1 crosses over its signal line while MACD 2 crosses under its signal line.
An up trend signal is generated when MACD 2 crosses over MACD 1.
A down trend signal is generated when MACD 1 crosses over MACD 2.
Alerts are included in the script to notify users of these specific trading signals.
Please note that this script is meant for educational purposes and should be used cautiously in a real trading environment. It's important to have a thorough understanding of technical analysis and risk management when using such indicators in actual trading.
Weighted Oscillator Convergence DivergenceThe Weighted Oscillator Convergence Divergence (WOCD) aims to help traders identify potential trend reversals or momentum shifts in financial markets by calculating and visualizing the difference between a smoothed oscillator (WMA) value and its exponential moving average (EMA) and simple moving average (SMA) counterparts. This indicator is particularly useful for traders who want an alternative perspective on price momentum and divergence.
Key Features:
Inputs:
Length: The user can specify the number of bars to consider for calculations (default is 9).
Smoothing 1: Defines the smoothing factor for the first smoothed value (default is 5).
Smoothing 2: Specifies the smoothing factor for the second smoothed value (default is 7).
Ma Type: There are three types of moving averages you can choose (Wilder, non-lag, Weighted is by default).
Color Settings: Users can customize the indicator's colors for various elements, such as length, smoothing values, and different sections of the histogram.
Calculation:
WOCD calculates the raw oscillator value by subtracting the close price from a 3-period High, Low, Close (HLC3) moving average.
It then applies smoothing to this raw oscillator value using two different methods: exponential moving average (EMA) and simple moving average (SMA) with user-defined smoothing periods.
Histogram Plot:
The indicator plots a histogram based on the difference between the smoothed oscillator and the first smoothed value.
When the histogram is above zero and rising, it is colored according to the "Above Grow" color setting. When it's above zero and falling, it uses the "Fall" color for visualization.
Similarly, when the histogram is below zero and rising, it is colored according to the "Below Grow" color setting, and when it's below zero and falling, it uses the "Fall" color.
Oscillator and Smoothed Values:
The indicator also plots the smoothed oscillator, smoothed value 1 (EMA-based), and smoothed value 2 (SMA-based) on the chart.
Zero Line:
A horizontal line at zero is drawn on the chart for reference.
How to Use the WOCD Indicator:
Trend Identification: Observe the histogram's direction and color. A rising histogram above zero may indicate bullish momentum, while a falling histogram below zero could signal bearish momentum.
Divergence: Look for divergences between price action and the histogram. When the histogram and price move in opposite directions, it can be a potential reversal signal.
Crossovers: Pay attention to crossovers between the smoothed oscillator and its smoothed counterparts (EMA and SMA). These crossovers can indicate changes in trend strength or direction.
Zero Line: The zero line can act as a reference point. Positive histogram values suggest bullish sentiment, while negative values indicate bearish sentiment.
Comparison to MACD Indicator:
The WOCD indicator shares some similarities with the Moving Average Convergence Divergence (MACD) indicator but also has distinct differences:
Similarities:
Both WOCD and MACD are momentum oscillators designed to identify potential trend reversals and divergences.
They use moving averages (EMA in the case of MACD) to smooth the raw oscillator values.
Both indicators provide histogram representations of the difference between the oscillator and its smoothed counterpart.
Differences:
WOCD uses a 3-period High, Low, Close (HLC3) moving average to calculate the raw oscillator value, whereas MACD uses the difference between two exponential moving averages (usually 12-period and 26-period EMAs).
The smoothing in WOCD employs both EMA and SMA, while MACD exclusively uses EMA.
WOCD allows users to customize colors for various elements, enhancing visual clarity.
Momentum ChannelbandsThe "Momentum Channelbands" is indicator that measures and displays an asset's momentum. It includes options to calculate Bollinger Bands and Donchian Channels around the momentum. Users can customize settings for a comprehensive view of momentum-related insights. This tool helps assess trend strength, identify overbought/oversold conditions, and pinpoint highs/lows. It should be used alongside other indicators due to potential lag and false signals.
TASC 2023.10 COT Commercials Indicator█ OVERVIEW
This script implements the COT Commercials Indicator introduced by Alfred François Tagher in an article featured in TASC's October 2023 edition of Traders' Tips . The indicator is designed for use in futures markets and represents a fast stochastic (%K) calculated based on the commercial open interest values of an asset derived from the weekly Commitments Of Traders (COT) report .
█ CONCEPTS
The COT report, issued by the Commodity Futures Trading Commission (CFTC) , presents a breakdown of reportable open interest positions held by various trader groups—commercial, noncommercial, and nonreportable (small traders). Open interest reflects the total number of derivative contracts entered by market participants but not yet settled. Consequently, it can serve as a measure of market activity and liquidity.
The indicator showcased here aims to analyze changes in the reported net values of open interest for commercial traders/hedgers (often referred to as 'smart money', as they deal directly in underlying commodities). The net values are positive when the commercial traders have more long positions than short ones and negative when they hold more short positions than long ones. Positive net values indicate that commercial traders hold more long positions than short ones, while negative values indicate the opposite. Thus, overbought and oversold conditions of the COT Commercials Indicator potentially suggest collective bullish and bearish sentiments, respectively.
█ CALCULATIONS
The calculations involve these steps:
1. Net open interest values are extracted from COT data using the LibraryCOT library provided by TradingView.
2. A fast stochastic indicator (%K) is then applied to normalize these net values.
The script also provides an option of calculating and plotting the indicator curve for noncommercial (speculators) open interest.
Alxuse MACD for tutorialAll abilities of MACD, moreover :
Drawing upper band and lower band & the ability to change values, change colors, turn on/off show.
Crossing MACD line and SIGNAL line in multi timeframe & there are symbols (Circles) with green color (Buy) and red color (Sell) & the ability to change colors, turn on/off show.
Crossing MACD line and SIGNAL line in multi timeframe according to the values of upper band and lower band & there are symbols (Triangles) with green color (Long) and red color (Short) & the ability to change colors, turn on/off show.
The ability used in the alert section and create customized alerts.
To receive valid alerts the replay section , the timeframe of the chart must be the same as the timeframe of the indicator.
MACD (Moving Average Convergence/Divergence)
Definition
MACD is an extremely popular indicator used in technical analysis. MACD can be used to identify aspects of a security's overall trend. Most notably these aspects are momentum, as well as trend direction and duration. What makes MACD so informative is that it is actually the combination of two different types of indicators. First, MACD employs two Moving Averages of varying lengths (which are lagging indicators) to identify trend direction and duration. Then, MACD takes the difference in values between those two Moving Averages (MACD Line) and an EMA of those Moving Averages (Signal Line) and plots that difference between the two lines as a histogram which oscillates above and below a center Zero Line. The histogram is used as a good indication of a security's momentum.
MACD Line is a result of taking a longer term EMA and subtracting it from a shorter term EMA.The most commonly used values are 26 days for the longer term EMA and 12 days for the shorter term EMA, but it is the trader's choice.
The Signal Line.
The Signal Line is an EMA of the MACD Line described in Component 1. The trader can choose what period length EMA to use for the Signal Line however 9 is the most common.
The MACD Histogram.
As time advances, the difference between the MACD Line and Signal Line will continually differ. The MACD histogram takes that difference and plots it into an easily readable histogram. The difference between the two lines oscillates around a Zero Line.
A general interpretation of MACD is that when MACD is positive and the histogram value is increasing, then upside momentum is increasing. When MACD is negative and the histogram value is decreasing, then downside momentum is increasing.
What to look for
The MACD indicator is typically good for identifying three types of basic signals; Signal Line Crossovers, Zero Line Crossovers, and Divergence.
SIGNAL LINE CROSSOVERS
A Signal Line Crossover is the most common signal produced by the MACD. First one must consider that the Signal Line is essentially an indicator of an indicator. The Signal Line is calculating the Moving Average of the MACD Line. Therefore the Signal Line lags behind the MACD line. That being said, on the occasions where the MACD Line crosses above or below the Signal Line, that can signify a potentially strong move.
The strength of the move is what determines the duration of Signal Line Crossover. Understanding and being able to analyze move strength, as well as being able to recognize false signals, is a skill that comes with experience.
The first type of Signal Line Crossover to examine is the Bullish Signal Line Crossover. Bullish Signal Line Crossovers occur when the MACD Line crosses above the Signal Line.
The second type of Signal Line Crossover to examine is the Bearish Signal Line Crossover. Bearish Signal Line Crossovers occur when the MACD Line crosses below the Signal Line.
Zero line crossovers
Zero Line Crossovers have a very similar premise to Signal Line Crossovers. Instead of crossing the Signal Line, Zero Line Crossovers occur when the MACD Line crossed the Zero Line and either becomes positive (above 0) or negative (below 0).
The first type of Zero Line Crossover to examine is the Bullish Zero Line Crossover. Bullish Zero Line Crossovers occur when the MACD Line crosses above the Zero Line and go from negative to positive.
The second type of Zero Line Crossover to examine is the Bearish Zero Line Crossover. Bearish Zero Line Crossovers occur when the MACD Line crosses below the Zero Line and go from positive to negative.
Divergence
Divergence is another signal created by the MACD. Simply put, divergence is when the MACD and actual price are not in agreement.
For example, Bullish Divergence occurs when price records a lower low, but the MACD records a higher low. The movement of price can provide evidence of the current trend, however changes in momentum as evidenced by the MACD can sometimes precede a significant reversal.
Bearish Divergence is, of course, the opposite. Bearish Divergence occurs when price records a higher high while the MACD records a lower high.
Summary
What makes the MACD such a valuable tool for technical analysis is that it is almost like two indicators in one. It can help to identify not just trends, but it can measure momentum as well. It takes two separate lagging indicators and adds the aspect of momentum which is much more active or predictive That kind of versatility is why it has been and is used by trader's and analysts across the entire spectrum of finance.
Despite MACD's obvious attributes, just like with any indicator, the trader or analyst needs to exercise caution. There are just some things that MACD doesn't do well which may tempt a trader regardless. Most notably, traders may be tempted into using MACD as a way to find overbought or oversold conditions. This is not a good idea. Remember, MACD is not bound to a range, so what is considered to be highly positive or negative for one instrument may not translate well to a different instrument.
With sufficient time and experience, almost anybody who wants to analyze chart data should be able to make good use out of the MACD.
The added features to the indicator are made for training, it is advisable to use it with caution in tradings.
Rolling VWAP OscillatorTL;DR - TradingView's Rolling VWAP as centered oscillator
I really like TradingView's rolling VWAP (Rolling Volume-Weighted Average Price - RVWAP) indicator. But I also like clean charts that's why I'm mainly using indicators which are not displayed on the chart. Instead of simply moving the RVWAP to another pane I turned it into a centered oscillator. This allows me checking the RVWAP while having my chart clean.
You can find the oroginal RVWAP here .
Creds to TradingView for creating this indicator 👍
* I also added a fourth deviation band, gradient colors and the option to switch between candles and lines.
Math NeuronThis open source script uses the mathematical rules of a classic two-input neuron with two weights and one bias(x * w1 + y*w2 + b).
The two inputs are the rsi (length 14) of close and volume, The result that we try to anticipate is the development of a pivot high or a pivot low (high or low candle are the max or min of the previous n° )
The activation function is sigmoid(binary results).
Zaree - Bull & Bear Volume VoidThe "Zaree - Bull & Bear Volume Void" (BBVV) indicator is a versatile tool designed to help traders assess the dynamics of bull and bear power in the market, with a focus on volume-based analysis. This indicator offers a range of features that aid in identifying potential shifts in market sentiment and strength.
Details of the Indicator:
Volume Void Color Settings: This indicator allows you to customize the colors used for different conditions, such as strong bull areas, slowing bull areas, strong bear areas, and slowing bear areas. These colors play a crucial role in visualizing the indicator's output.
Volume Void Settings: The BBVV indicator provides options for selecting specific volume void functions, which include "Relative Volume Comparison," "Percentage of Average Volume," "Fixed Volume Threshold," "Volatility-Adjusted Volume," "Compare to Previous Volume Bars," "Volume Percentile Rank," and "Market Session Comparison." Each function has its own criteria for evaluating volume conditions.
Void Bull Sensitivity and Void Bear Sensitivity: These are key parameters in the settings. The values you choose for void bull sensitivity and void bear sensitivity will significantly impact the background color displayed by the indicator. Properly configuring these values is crucial for the indicator's effectiveness.
Moving Average Settings: You can specify the source and length of moving averages used in the indicator. This helps in smoothing out data and providing a clearer picture of bull and bear power.
Void Color Background Conditions: The indicator dynamically changes the background color of the chart based on the current market conditions. It takes into account bull and bear power, as well as the configured sensitivity levels to determine whether the market is in a strong or slowing bull/bear phase.
MACD and Signal Lines: The indicator also displays MACD and signal lines on the chart, helping traders identify potential bullish and bearish crossovers.
Histogram Bars: Histogram bars are used to represent the strength of bull and bear power. Above-zero bars indicate bullish strength, while below-zero bars indicate bearish strength.
How to Use the Indicator:
Begin by customizing the color settings for different market conditions to your preference.
Select a volume void function that aligns with your trading strategy and objectives.
Configure the void bull sensitivity and void bear sensitivity values carefully. These values should reflect your desired sensitivity to volume conditions.
Choose the source and length of moving averages based on your analysis requirements.
Pay attention to the background color of the chart. It will change dynamically based on the current market conditions, providing insights into the strength of bull and bear power.
Observe the MACD and signal lines for potential bullish or bearish crossovers, which can be used as additional confirmation signals.
Interpret the histogram bars to gauge the strength of bull and bear power.
Example of Usage:
As a swing trader with a focus on volume analysis, you can use the BBVV indicator to enhance your trading decisions. Here's an example of how you might use the indicator:
Select "Relative Volume Comparison" as the volume void function to assess volume relative to a simple moving average.
Configure void bull sensitivity and void bear sensitivity to match your risk tolerance and trading style.
Choose "SMA" as the moving average type with a suitable length.
Pay attention to the background color changes in the chart. Strong bull areas may indicate potential bullish opportunities, while strong bear areas may signal bearish conditions.
Monitor the MACD and signal lines for potential crossovers, aligning them with the background color to validate your trading decisions.
Use the histogram bars to assess the strength of bull and bear power, helping you gauge market sentiment.
Remember that the BBVV indicator is a valuable tool to complement your trading strategy. It provides insights into volume dynamics and market conditions, allowing you to make informed trading choices.
Be sure to adjust the indicator settings according to your trading preferences and always consider the broader market context in your analysis.
Volatility Adjusted MACDMACD, short for moving average convergence/divergence, is a trading indicator used in technical analysis of securities prices, created by Gerald Appel in the late 1970s. It is designed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock's price.
The MACD indicator (or "oscillator") is a collection of three time series calculated from historical price data, most often the closing price. These three series are: the MACD series proper, the "signal" or "average" series, and the "divergence" series which is the difference between the two. The MACD series is the difference between a "fast" (short period) exponential moving average (EMA), and a "slow" (longer period) EMA of the price series. The average series is an EMA of the MACD series itself.
This version of MACD follows the work of Alex Spiroglou, DipTA(ATAA), CFTe in his 2022 paper that was awarded Charles H. Dow Award by CMT Association . The paper is available on papers.ssrn.com or on website.of CMT Association.
Please refer to the paper for details on construction and trading rules . I personally find the volatility adjusted version as described in this paper more responsive in terms of signals and divergences.
Composite Momentum IndicatorComposite Momentum Indicator" combines the signals from several oscillators, including Stochastic, RSI, Ultimate Oscillator, and Commodity Channel Index (CCI) by averaging the standardized values (Z-Scores). Since it is a Z-Score based indicators the values will be typically be bound between +3 and -3 oscillating around 0. Here's a summary of the code:
Input Parameters: Users can customize the look-back period and set threshold values for overbought and oversold conditions. They can also choose which oscillators to include in the composite calculation.
Oscillator Calculations: The code calculates four separate oscillators - Stochastic, RSI, Ultimate Oscillator, and CCI - each measuring different aspects of market momentum.
Z-Scores Calculation: For each oscillator, the code calculates a Z-Score, which normalizes the oscillator's values based on its historical standard deviation and mean. This allows for a consistent comparison of oscillator values across different timeframes.
Composite Z-Score: The code aggregates the Z-Scores from the selected oscillators, taking into account user preferences (whether to include each oscillator). It then calculates an average Z-Score to create the "Composite Momentum Oscillator."
Conditional Color Coding: The composite oscillator is color-coded based on its average Z-Score value. It turns green when it's above the overbought threshold, red when it's below the oversold threshold, and blue when it's within the specified range.
Horizontal Lines: The code plots horizontal lines at key levels, including 0, ±3, ±2, and ±1, to help users identify important momentum levels.
Gradient Fills: It adds gradient fills above the overbought threshold and below the oversold threshold to visually highlight extreme momentum conditions.
Combining the Stochastic, RSI, Ultimate Oscillator, and Commodity Channel Index (CCI) into one composite indicator offers several advantages for traders and technical analysts:
Comprehensive Insight: Each of these oscillators measures different aspects of market momentum and price action. Combining them into one indicator provides a more comprehensive view of the market's behavior, as it takes into account various dimensions of momentum simultaneously.
Reduced Noise: Standalone oscillators can generate conflicting signals and produce noisy readings, especially during choppy market conditions. A composite indicator smoothes out these discrepancies by averaging the signals from multiple indicators, potentially reducing false signals.
Confirmation and Divergence: By combining multiple oscillators, traders can seek confirmation or divergence signals. When multiple oscillators align in the same direction, it can strengthen a trading signal. Conversely, divergence between the oscillators can warn of potential reversals or weakening trends.
Customization: Traders can tailor the composite indicator to their specific trading strategies and preferences. They have the flexibility to include or exclude specific oscillators, adjust look-back periods, and set threshold levels. This adaptability allows for a more personalized approach to technical analysis.
Clarity and Efficiency: Rather than cluttering the chart with multiple individual oscillators, a composite indicator condenses the information into a single plot. This enhances the clarity of the chart and makes it easier for traders to quickly interpret market conditions.
Overbought/Oversold Identification: Combining these oscillators can improve the identification of overbought and oversold conditions. It reduces the likelihood of false signals since multiple indicators must align to trigger these extreme conditions.
Educational Tool: For novice traders and analysts, a composite indicator can serve as an educational tool by demonstrating how different oscillators interact and influence each other's signals. It allows users to learn about multiple technical indicators in one glance.
Efficient Use of Screen Space: A single composite indicator occupies less screen space compared to multiple separate indicators. This is especially beneficial when analyzing multiple markets or timeframes simultaneously.
Holistic Approach: Instead of relying on a single indicator, a composite approach encourages a more holistic assessment of market conditions. Traders can consider a broader range of factors before making trading decisions.
Increased Confidence: A composite indicator can boost traders' confidence in their decisions. When multiple reliable indicators align, it can provide a stronger basis for taking action in the market.
In summary, combining the Stochastic, RSI, Ultimate Oscillator, and CCI into one composite indicator enhances the depth and reliability of technical analysis. It simplifies the decision-making process, reduces noise, and offers a more complete picture of market momentum, ultimately helping traders make more informed and well-rounded trading decisions.
* Feel free to compare against individual oscillatiors*
[blackcat] L3 MACD and RSI Fusion The MACD and RSI fusion is a popular technical analysis strategy used by traders to identify buy and sell signals in the market. The strategy makes use of two popular technical indicators, the Moving Average Convergence Divergence (MACD) and the Relative Strength Index (RSI), and combines them to create a powerful trading signal.
The MACD and RSI fusion was originally developed for the Chinese stock market and is commonly used by traders all over the world. The strategy is based on the idea that the MACD and RSI indicators can be used together to provide a more accurate and reliable signal.
To use the MACD and RSI fusion , traders need to follow a few simple steps. The following code is the TradingView Pine script v4 indicator equivalent of the original MACD and RSI fusion code:
```
//@version=4
study(" MACD and RSI fusion ", overlay=false)
// Define the simple fusion indicator
simple_fusion = (ema(close, 12) - ema(close, 26)) * 1.2 + rsi(close, 14) / 50
// Define the simple fusion lag indicator
simple_fusion_lag = nz(simple_fusion )
// Plot the simple fusion and simple fusion lag indicators
plot(simple_fusion, color=color.blue, title="simple fusion")
plot(simple_fusion_lag, color=color.red, title="simple fusion Lag")
```
This code defines the simple fusion and simple fusion Lag indicators and plots them on the chart. The simple fusion indicator is the sum of the 12- and 26-period exponential moving averages of the closing price, multiplied by 1.2, and added to the 14-period relative strength index of the closing price, divided by 50. The simple fusion Lag indicator is the value of the simple fusion indicator from the previous period.
Traders can use the simple fusion and simple fusion Lag indicators to identify buy and sell signals. When the simple fusion indicator crosses above the simple fusion Lag indicator, it is a buy signal, and when the simple fusion indicator crosses below the simple fusion Lag indicator, it is a sell signal.
In conclusion, the MACD and RSI fusion is a simple but powerful technical analysis strategy that combines two popular technical indicators to identify buy and sell signals in the market.
CCI RSI Trading SignalThe "CCI RSI Trading Signal" indicator combines the Commodity Channel Index (CCI) and Relative Strength Index (RSI) to provide buy and sell signals for trading. The CCI identifies potential trend reversals, while the RSI helps confirm overbought and oversold conditions.
How It Works:
The indicator generates a buy signal when the CCI crosses above -100 (indicating a potential bullish reversal) and the RSI is below the specified oversold level. On the other hand, a sell signal is produced when the CCI crosses below 100 (indicating a potential bearish reversal) and the RSI is above the specified overbought level.
Customization:
Traders can adjust the RSI and CCI periods, RSI oversold and overbought levels, as well as take profit, stop loss, and lot size settings to suit their trading preferences.
Usage:
The "CCI RSI Trading Signal" indicator can be used on various timeframes and markets to aid in decision-making, providing potential entry and exit points based on the combined analysis of CCI and RSI.
Dual-Supertrend with MACD - Strategy [presentTrading]## Introduction and How it is Different
The Dual-Supertrend with MACD strategy offers an amalgamation of two trend-following indicators (Supertrend 1 & 2) with a momentum oscillator (MACD). It aims to provide a cohesive and systematic approach to trading, eliminating the need for discretionary decision-making.
Key advantages over traditional single-indicator strategies:
- Dual Supertrend Validation: Utilizes two Supertrend indicators with different ATR periods and factors to confirm the trend direction. This double-check mechanism minimizes false signals.
- Momentum Confirmation: The MACD histogram acts as a momentum filter, confirming entries and exits, thus adding an extra layer of validation.
- Objective Entry and Exit: The strategy generates buy and sell signals based on a combination of trend direction and momentum, leaving no room for subjective interpretation.
- Automated Trade Management: The strategy includes built-in settings for commission, slippage, and initial capital, automating the trade execution process.
- Adaptability: The strategy allows for easy customization of all its parameters, adapting to a trader's specific needs and varying market conditions.
BTCUSD 8hr chart Long Condition
BTCUSD 6hr chart Long Short Condition
## Strategy, How it Works
The strategy operates on a set of clearly defined rules, primarily focusing on the trend direction confirmed by the Dual-Supertrend and the momentum as indicated by the MACD histogram.
### Entry Rules
- Long Entry: When both Supertrend indicators are bullish and the MACD histogram is above zero.
- Short Entry: When both Supertrend indicators are bearish and the MACD histogram is below zero.
### Exit Rules
- Exit long positions when either of the Supertrends turn bearish or the MACD histogram drops below zero.
- Exit short positions when either of the Supertrends turn bullish or the MACD histogram rises above zero.
### Trade Management
- The strategy uses a fixed commission rate and slippage in its calculations.
- Automated risk management features are integrated to avoid overexposure.
## Trade Direction
The strategy allows for trading in both bullish and bearish markets. Users can select their preferred trading direction ("long", "short", or "both") to align with their market outlook and trading objectives.
## Usage
- The strategy is best applied on timeframes where the trend is evident.
- Users can modify the ATR periods, factors for Supertrends, and MACD settings to suit their trading needs.
## Default Settings
- ATR Period for Supertrend 1: 10
- Factor for Supertrend 1: 3.0
- ATR Period for Supertrend 2: 20
- Factor for Supertrend 2: 5.0
- MACD Fast Length: 12
- MACD Slow Length: 26
- MACD Signal Smoothing: 9
- Commission: 0.1%
- Slippage: 1 point
- Trading Direction: Both
The strategy comes with these default settings to offer a balanced trading approach but can be customized according to individual trading preferences.
Linear RegressionThis indicator can be used to determine the direction of the current trend.
The indicator plots two different histograms based on the linear regression formula:
- The colored ones represent the direction of the short-term trend
- The gray one represents the direction of the long-term trend
In the settings, you can change the length of the short-term value, which also influences the long-term as a basis that will be multiplied