TradeChartist Risk Meter™𝗧𝗿𝗮𝗱𝗲𝗖𝗵𝗮𝗿𝘁𝗶𝘀𝘁 𝗥𝗶𝘀𝗸 𝗠𝗲𝘁𝗲𝗿 is a very useful and a well designed indicator, that packs a range of Risk utility tools including Trend Based Stochastic Oscillator, Bollinger Bands %B , Volatility Risk Oscillator, RSI Oscillator and RSI Risk Oscillator, along with further visual risk assessment tools like Divergence Spotter, Trend based Strength detector among other useful extras.
===================================================================================================================
™𝗧𝗿𝗮𝗱𝗲𝗖𝗵𝗮𝗿𝘁𝗶𝘀𝘁 𝗥𝗶𝘀𝗸 𝗠𝗲𝘁𝗲𝗿 𝗨𝘀𝗲𝗿 𝗠𝗮𝗻𝘂𝗮𝗹
The user can choose from one of the following four option from the 𝗥𝗶𝘀𝗸 𝗠𝗲𝘁𝗲𝗿 𝗧𝘆𝗽𝗲 dropdown from the settings.
   1. Trend Based Stochastic 
   2. Bollinger Bands %B 
   3. Volatility Risk Oscillator 
   4. RSI + RSI Risk Oscillator 
The source price for the Risk Meter can be chosen from  Sᴏᴜʀᴄᴇ  dropdown. Both Trend Based Stochastic and Volatility Risk Oscillator use High/Low prices as default. Enable  Usᴇ Sᴏᴜʀᴄᴇ Pʀɪᴄᴇ  under respective section to use a different source price.
Users can choose to plot Risk Meter background fill by enabling or disabling  Rɪsᴋ Mᴇᴛᴇʀ Bᴀᴄᴋɢʀᴏᴜɴᴅ . The background fill is based on the trend intensity and uses 2 different colour schemes based on user preference. When the  Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ  is used, it uses the background fill to mask the zone. If background fill is disabled, orange colour is used to mask the zone.
All of the Risk Meter plots can be plotted as  Line ,  Histogram  or  Area  plots and each of the sections include the  Pʟᴏᴛ Sᴛʏʟᴇ  option, so the user can choose a specific type of plot style for each  of the Risk Meter Oscillators, based on user preference.
===================================================================================================================
═══ 𝟭. 𝗧𝗿𝗲𝗻𝗱 𝗕𝗮𝘀𝗲𝗱 𝗦𝘁𝗼𝗰𝗵𝗮𝘀𝘁𝗶𝗰 ═══
Trend Based Stochastic Oscillator is a modified version of the classic Stochastic Oscillator with the difference being the limits and also the plot itself to an extent. 
--> Trend based Stochastic is a single plot oscillates between -100 to +100 and occasionally breaches these limits and can signal extremely overbought or oversold conditions unlike classic Stochastic indicator, which has two plots and strictly oscillates between 0-100.
--> Trend based Stochastic is extremely sensitive to price action, making it possible to detect every single divergence, both regular and hidden, even with the default smoothing factor of 5
--> Risk Meter employs  Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ  to let user choose the threshold limit and only from this point onwards, Risk Meter detects the divergences. This helps filter a lot of noise in addition to Price and Oscillator Pivot detection under 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 section. 
The user has to choose the length for the Trend based Stochastic plot by entering number of bars in  Lᴏᴏᴋʙᴀᴄᴋ Lᴇɴɢᴛʜ  input box (Default value is 55). The user can also change the smoothing factor from default value of 5 by entering the value in  Sᴍᴏᴏᴛʜɪɴɢ  input box. Smoothing is particularly useful to detect the strength, based on the trend if 𝐂𝐨𝐥𝐨𝐫 𝐙𝐨𝐧𝐞𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐒𝐭𝐫𝐞𝐧𝐠𝐭𝐡 is enabled and the required trend length is entered in  Tʀᴇɴᴅ Sᴛʀᴇɴɢᴛʜ Dᴇᴛᴇᴄᴛɪᴏɴ Lᴇɴɢᴛʜ . This feature splits the Risk Meter Plot into Bull and Bear zones based on the trend strength. HIgher Smoothing with default trend strength detection of 5 (upto 10) works well for sensitive price hugging scalps/swings. For longer trends, higher detection lengths can be used.
===================================================================================================================
════ 𝟮. 𝗕𝗼𝗹𝗹𝗶𝗻𝗴𝗲𝗿 𝗕𝗮𝗻𝗱𝘀 %𝗕 ═════
Bollinger Bands %B in Risk Meter oscillates between -100 to +100 rather than 0 - 1 in the classic version, with oversold/overbought levels breaching the limits and the plot is exactly the same otherwise. 
Risk Meter employs  Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ  for Bollinger Bands %B to let the user choose the threshold limit and only from this point onwards, Risk Meter detects the divergences. This helps filter a lot of noise in addition to Price and Oscillator Pivot detection under 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 section. 
The user has to choose the Simple Moving Average (SMA) length for the plot by entering number of bars in  BB SMA Lᴇɴɢᴛʜ  input box (Default value is 20). There is no need for Standard Deviation as the fundamental plot is exactly the same, given that the plot oscillates between -100 to +100. The user can also change the smoothing factor from default value of 5 by entering the value in  Sᴍᴏᴏᴛʜɪɴɢ  input box. Smoothing is particularly useful to detect the strength, based on the trend if 𝐂𝐨𝐥𝐨𝐫 𝐙𝐨𝐧𝐞𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐒𝐭𝐫𝐞𝐧𝐠𝐭𝐡 is enabled and the required trend length is entered in  Tʀᴇɴᴅ Sᴛʀᴇɴɢᴛʜ Dᴇᴛᴇᴄᴛɪᴏɴ Lᴇɴɢᴛʜ . This feature splits the Risk Meter Plot into Bull and Bear zones based on the trend strength. HIgher Smoothing with default trend strength detection of 5 (upto 10) works well for sensitive price hugging scalps/swings. For longer trends, higher detection lengths can be used.
===================================================================================================================
══════ 𝟯. 𝗩𝗼𝗹𝗮𝘁𝗶𝗹𝗶𝘁𝘆 𝗥𝗶𝘀𝗸 ═══════
Volatility Risk Oscillator is an original ™TradeChartist model designed to visually see the Volatility risk for the security on any time frame. 
To plot Volatility Risk for the security, the user has to enter the number of bars to detect volatility risk in  Lᴏᴏᴋʙᴀᴄᴋ Lᴇɴɢᴛʜ  input box (Default Value is 55). The user can also change the smoothing factor from default value of 5 by entering the value in  Sᴍᴏᴏᴛʜɪɴɢ  input box. Smoothing is particularly useful to detect the strength based on trend if 𝐂𝐨𝐥𝐨𝐫 𝐙𝐨𝐧𝐞𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐒𝐭𝐫𝐞𝐧𝐠𝐭𝐡 is enabled and required trend length is entered in  Tʀᴇɴᴅ Sᴛʀᴇɴɢᴛʜ Dᴇᴛᴇᴄᴛɪᴏɴ Lᴇɴɢᴛʜ . This feature splits the Risk Meter Plot into Bull and Bear zones based on the trend strength. HIgher Smoothing with default trend strength detection of 5 (upto 10) works well for sensitive price hugging scalps/swings. For longer trends, higher detection lengths can be used.
Even though Divergences work on Volatility Risk Oscillator, it is not employed as it produces far too many and there is no set Threshold limit that can be set to filter the divergences.
===================================================================================================================
══════ 𝟰. 𝗥𝗦𝗜 𝗢𝘀𝗰𝗶𝗹𝗹𝗮𝘁𝗼𝗿 ═══════
There are two different types of RSI Oscillators in this section that can be plotted.
RSI Oscillator - Classic RSI modified to fit -100 to +100 scale rather than 0 - 100 scale. Risk Meter employs  Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ  for RSI Oscillator also, to let the user choose the threshold limit and only from this point onwards, Risk Meter detects the divergences. This helps filter a lot of noise in addition to Price and Oscillator Pivot detection under 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 section. 
RSI Risk Oscillator -  This oscillator plots the potential RSI risk based on RSI length (which can be changed in  RSI Lᴇɴɢᴛʜ  input box and main source price ( Sᴏᴜʀᴄᴇ ). The user can also change the smoothing factor from default value of 5 by entering the value in  Sᴍᴏᴏᴛʜɪɴɢ  input box. Smoothing is particularly useful to detect the strength, based on the trend if 𝐂𝐨𝐥𝐨𝐫 𝐙𝐨𝐧𝐞𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐒𝐭𝐫𝐞𝐧𝐠𝐭𝐡 is enabled and the required trend length is entered in  Tʀᴇɴᴅ Sᴛʀᴇɴɢᴛʜ Dᴇᴛᴇᴄᴛɪᴏɴ Lᴇɴɢᴛʜ . This feature splits the Risk Meter Plot into Bull and Bear zones based on the trend strength. Higher Smoothing with default trend strength detection of 5 (upto 10) works well for sensitive price hugging scalps/swings. For longer trends, higher detection lengths can be used.
To plot RSI Risk Oscillator, 𝐒𝐡𝐨𝐰 𝐑𝐒𝐈 𝐑𝐢𝐬𝐤 𝐎𝐬𝐜𝐢𝐥𝐥𝐚𝐭𝐨𝐫 must be enabled. Disabling this option plots normal RSI Oscillator.
The 4hr chart of BTC-USDT below shows use of RSI Risk Oscillator (Top) with RSI Oscillator (bottom).
  
===================================================================================================================
╔═══════ 𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀 ═══════╗
Risk Meter detects both Regular and Hidden Bullish and Bearish Divergences at every occurence. This can be filtered by the use of  Dᴇᴄɪᴅᴇʀ Tʜʀᴇsʜᴏʟᴅ  in above sections. To plot divergences, enable 
𝗗𝗶𝘃𝗲𝗿𝗴𝗲𝗻𝗰𝗲𝘀,  Sʜᴏᴡ Rᴇɢᴜʟᴀʀ Dɪᴠᴇʀɢᴇɴᴄᴇs  and  Sʜᴏᴡ Hɪᴅᴅᴇɴ Dɪᴠᴇʀɢᴇɴᴄᴇs . All divergences are enabled as default.
Users can further filter Divergences by entering the number of bars to the right in  Rɪɢʜᴛ ʙᴀʀs ғᴏʀ Pɪᴠᴏᴛ Cᴏɴғɪʀᴍᴀᴛɪᴏɴ  input box to confirm the Price Pivot (for Regular divergences) and Oscillator Pivot (for Hidden Divergences).
The example chart of 4hr BTC-USDT chart shows the Divergences filtered by use of RSI Threshold. It is important to note that the trend intensity colour on the plot and bars (if bar colour option is enabled) will help detect if the Divergence would hold. 
  
===================================================================================================================
╔═══════ 𝗨𝘀𝗲𝗳𝘂𝗹  𝗘𝘅𝘁𝗿𝗮𝘀 ═══════╗
Risk Meter offer two vibrant Colour Themes, namely  Chilli  and  Flame , which can be opted from  Rɪsᴋ Mᴇᴛᴇʀ Tʜᴇᴍᴇ  dropdown. These themes also offer the option to plot the trend intensity on the price bars as bar colours by enabling  Rɪsᴋ Mᴇᴛᴇʀ Cᴏʟᴏᴜʀ Bᴀʀs . Bar colors can also be inverted using  Iɴᴠᴇʀᴛ Bᴀʀ Cᴏʟᴏᴜʀ  option.
Users can also choose to use the  Simple  theme and choose preferred colours from  Sɪᴍᴘʟᴇ Tʜᴇᴍᴇ ʙᴜʟʟ Cᴏʟᴏᴜʀ  and  Sɪᴍᴘʟᴇ Tʜᴇᴍᴇ ʙᴇᴀʀ Cᴏʟᴏᴜʀ  colour input. 
 Note:  The indicator  does not repaint  and can be confidently used for alerts and trade entries without worrying about plots disappearing after bar close. 
===================================================================================================================
 Example Charts 
 1. 89 period Trend Based Stochastic Oscillator as Histogram plot on LINK-USDT 1hr chart with Chilli Theme. 
  
  2. 89 period Volatility Risk Oscillator as Histogram plot on SPX 1hr chart with Chilli Theme. 
  
 3. 14 period RSI Risk Oscillator as Area plot on AAPL Daily Chart with Flame Theme.  
  
 4. 100 period Volatility Risk Oscillator using Trend Strength plotted as Zones on 1hr EUR-USD chart with Chilli Theme. 
  
===================================================================================================================
 Best Practice:  Test with different settings first using Paper Trades before trading with real money
===================================================================================================================
 This is not a free to use indicator. Get in touch with me (PM me directly if you would like trial access to test the indicator)
Premium Scripts - Trial access and Information 
Trial access offered on all Premium scripts.
PM me directly to request trial access to the scripts or for more information.
===================================================================================================================
חפש סקריפטים עבור "bollingerband"
[blackcat] L2 Center Band BollingerLevel: 2
Background
Bollinger bands are a type of price envelope developed by John Bollinger , where price envelopes define upper and lower price ranges. Bollinger Bands are envelopes that are represented with a standard deviation above and below a simple moving average of price. Because the spacing of the bands is based on the standard deviation, they adjust for fluctuations in the volatility of the underlying price.
Function
  L2 Center Band Bollinger takes advantage of Bollinger band to detect sideways and trends. At the same time, I made an improvement and the center Bollinger line as a fast-slow-line color band. The algorithm of the color center band is composed of price and volume information, which produces gold cross and dead cross for short term long and short entries.
Key Signal
aa10 --> bollinger middle fast line
aa12 --> bollinger middle slow line
up --> upper envelope
dn --> lower envelope
Pros and Cons
Pros:
1. it can easy see the sections of trends or sideways by width of Bollinger band 
2. long and short entries are disclosed
Cons:
1. Some noise is still incorporated in trends
2. due to this is un-optimized version, time frame and trading pairs need to be selected
3. Bollinger re-entry signal is not disclosed yet
Remarks
The long and short signal is compatible to @nilux strategy backtest framework for sandardized backtest scheme:   Backtest
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Bollinger Bands Filter
Bollinger Bands is a classic indicator that uses a simple moving average of 20 periods, along with plots of upper and lower bands that are 2 standard deviations away from the basis line. These bands help visualize price volatility and trend based on where the price is, in relation to the bands.
 Bollinger Bands filter  plots a long signal when price closes above the upper band and plots a short signal when price closes below the lower band. It doesn't take into account any other parameters such as Volume/RSI/ Fundamentals etc, so user must use discretion based on confirmations from another indicator or based on fundamentals.
The filter works great when the price closes above/below upper/lower bands with continuation on next bar. It is definitely useful to have this filter along with other indicators to get early glimpse of breach/fail of bands on candle close during BB squeeze or based on volatility.
This can be used on Heikin Ashi candles for spotting trends, but HA candles are not recommended for trade entries as they don't reflect true price of the asset.
This filter's default is 55 SMA and 1 standard deviation, but these can be changed from settings.
It is definitely worth reading the  22 rules of Bollinger Bands  written by John Bollinger. 
==================================================================
 Note:  
1. Alerts can be created for long and short signals using "Once per bar close".
2. The indicator doesn't repaint.
==================================================================
Colored Directional Movement and Bollinger Band's Cloud by DGTThis study combines Bollinger Bands,  one of the most popular technical analysis indicators on the market, and Directional Movement (DMI), which is another quite valuable technical analysis indicator. 
Bollinger Bands used in conjunction with Directional Movement (DMI) may help getting a better understanding of the ever changing landscape of the market and perform more advanced technical analysis
Here are details of the concept applied 
1- Plots Bollinger Band’s (BB) Cloud colored based on Bollinger Band Width (BBW) Indicator’s value
Definition
Bollinger Bands (created by John Bollinger ) are a way to measure volatility . As volatility increases, the wider the bands become and similarly as volatility decreases, the gap between bands narrows
Bollinger Bands, in widely used approach, consist of a band of three lines. Likewise common usage In this study a band of five lines is implemented
The line in the middle is a Simple Moving Average (SMA) set to a period of 20 bars (the most popular usage). The SMA then serves as a base for the Upper and Lower Bands. The Upper and Lower Bands are used as a way to measure volatility by observing the relationship between the Bands and price. the Upper and Lower Bands in this study are set to two and three standard deviations (widely used form is only two standard deviations)  away from the SMA (The Middle Line), hence there are two Upper Bands and two Lower Bands. The background between two Upper Bands is filled with a green color and the background between two Lower Bands is filled with a red color. In this we have obtained Bollinger Band’s (BB) Clouds (Upper Cloud and Lower Cloud)
Additionally the intensity of the color of the background is calculated  with Bollinger Bands Width ( BBW ), which is a technical analysis indicator derived from the standard Bollinger Bands indicator. Bollinger Bands Width, quantitatively measures the width between the Upper and Lower Bands. In this study the intensity of the color of the background is increased if BBW value is greater than %25 
What to look for
Price Actions : Prices are almost always within the bands especially at this study the bands of three standard deviations away from the SMA. Price touching or breaking the BB Clouds could be considered as buying or selling opportunity.  However this is not always the case, there are exceptions such as Walking the Bands. “Walking the Bands” can occur in either a strong uptrend or a strong downtrend. During a strong trend, there may be repeated instances of price touching or breaking through the BB Clouds. Each time that this occurs, it is not a signal, it is a result of the overall strength of the move. In this study in order to get a better understanding of the trend and add ability to perform some advanced technical analysis Directional Movement Indicator (DMI) is added to be used in conjunction with Bollinger Bands. 
Cycling Between Expansion and Contraction : One of the most well-known theories in regards to Bollinger Bands is that volatility typically fluctuates between periods of expansion (Bands Widening : surge in volatility and price breaks through the BB Cloud) and contraction (Bands Narrowing : low volatility and price is moving relatively sideways). Using Bollinger Bands in conjunction with Bollinger Bands Width  may help identifying beginning of a new directional trend which can result in some nice buying or selling signals. Of course the trader should always use caution
2- Plots Colored  Directional Movement Line
Definition
Directional Movement (DMI) (created by J. Welles Wilder ) is actually a collection of three separate indicators combined into one. Directional Movement consists of the Average Directional Index (ADX) , Plus Directional Indicator (+D I) and Minus Directional Indicator (-D I) . ADX's purposes is to define whether or not there is a trend present. It does not take direction into account at all. The other two indicators (+DI and -DI) are used to compliment the ADX. They serve the purpose of determining trend direction. By combining all three, a technical analyst has a way of determining and measuring a trend's strength as well as its direction. 
This study combines all three lines in a single colored shapes series plotted on the top of the price chart indicating the trend strength with different colors and its direction with triangle up and down shapes.    
What to look for
Trend Strength : Analyzing trend strength is the most basic use for the DMI. Wilder believed that a DMI reading above 25 indicated a strong trend, while a reading below 20 indicated a weak or non-existent trend
Crosses : DI Crossovers are the significant trading signal generated by the DMI
With this study
A Strong Trend is assumed when ADX >= 25
Bullish Trend is defined as  (+D I > -DI ) and (ADX >= 25), which is plotted as green triangle up shape on top of the price chart
Bearish Trend is defined as  (+D I < -DI ) and (ADX >= 25), which is plotted as red triangle down shape on top of the price chart
Week Trend is assumed when  17< ADX < 25, which is plotted as black triangles up or down shape, depending on +DI-DI values, on top of the price chart
Non-Existent Trend is assumed when  ADX < 17, which is plotted as yellow triangles up or down shape, depending on +DI-DI values, on top of the price chart
Additionally intensity of the colors used in all cases above are defined by comparing ADX’s current value with its previous value 
Summary of the Study:
Even more simplified and visually enhanced DMI drawing comparing to its classical usage (may require a bit practice to get used to it)
As said previously, to get a better understanding of the trend and add ability to perform some advanced technical analysis Directional Movement Indicator (DMI) is used in conjunction with Bollinger Bands. 
PS: Analysis and tests are performed with high volatile Cryptocurrency Market 
Source of References : definitions provided herein are gathered from TradingView’s knowledgebase/library
Disclaimer: The script is for informational and educational purposes only. Use of the script does not constitutes professional and/or financial advice. You alone the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd tradingview user liable for any possible claim for damages arising from any decision you make based on use of the script
Turtle IndexThis Indicator is a combination of Super Smoother Filter and Bollinger Bands %B.
This Indicator is used in Trend-Momentum gauging. Use this indicator with Turtle Oscillator.
Tran Truong indicatorChỉ báo tìm điểm vào ra thị trường dựa trên phân kỳ hội tụ
bao gồm ichimoku, bollingerband
[NMC]RSI MTF, StochasticRSI MTF, BB%, WavetrendThis is our second indicator and is very useful if you want to create a strategy based on multiple indicators and time frames. RSI and Stochastic RSI are multi-timeframe and they are based on ChrisMoody's multi-timeframe scripts.
You can choose from RSI, Stochastic RSI, BB% and Wavetrend. In the near future we my add CCI, CMF, TSI or any similar indicator with the possibility to plot from a higher timeframe.
acmillions88 predictive indicatorsUnlike most scripts, this script actually predicts the mini trends. Works great with double bollingerbands.
6xMa_ichimoku_MTF_Boll_SuperTrend V2 update [PlungerMen]hello!
This script very funny :))
This Script version update , I made for a friend named Huu Trung You can add to it This script have 3 ema , 3 wma , bollingerBand super Trend, Ichimokhu, mtf ma In settings there is a section to turn off what you do not like Hope you enjoy this version
6x MA in one Chart 
You can change color, hide Ma if you want 
Ichimoku Clound
MTF indicator
Boolinger band and Super trend pro
have you like!
3Ema_3Wma_boll_MTF_ichi [PlungerMen]hello ! 
This Script version I made for a friend named Huu Trung 
You can add to it 
This script have 
3 ema , 
3 wma , 
bollingerBand super Trend, 
Ichimokhu, 
mtf ma 
In settings there is a section to turn off what you do not like 
Hope you enjoy this version
[MV] %B with SMA + Volume Based Colored Bars
Entry Signal when  %B  Crosses with  SMA  and this is more meaningful if it supports colored bars.
 Black Bar  when prices go down and  volume  is bigger than 150% of its  average, that indicates us price action is supported by a strong   bearish volume  
 Blue Bar  when prices go up and  volume  bigger than 150% of its  average, that indicates us price action is supported by a strong  bullish volume 
VBC author @KIVANCfr3762
MFI * %B [seiglerj]Oscillator averaging Money Flow Index and Bollinger Bands' %B
Colored bars indicate buy or sell signals
I have no idea if this is the right way to combine these two, but I'm gonna try it and see what happens
Trend Pullback Reversal TPRThe TPR(Trend Pullback Reversal) indicator forms a possible price trend with support and resistance lines. It also comes with a unqiue band and center line as additional features.
  TPR works on all timeframes and all symbols and all type of bar chart.
 
 TPR never repaints. 
There are 4 Parameters:
    Period: umber of bars used for calculations
    Factor: Multiplier factor, small number for short trend, large number for long trend
    Source: the input series, default is Close
    ShowBand: enable to show band and center line
 
Most trend indicators have similar plot, the difference is where and when they change the direction. Unlike other trend indicators, TPR will focus on main trend and filter out most minor price movements. The green cross-line represents an uptrend, the red cross-line represents a downtrend.
The additional band and center line may look like bollinger band, but the TPR band algorithm is completely different from bollingerband. There is no standard deviation in TPR band calculation. 
RSI Bands, RSI %B and RSI BandwidthRSI bands provide an intuitive way of visualizing how the price movement causes RSI to move with in its range (0-100). Upper/Lower bands signify overbought and oversold levels respectively (Default: 70/30, you can customize them via options page). These bands closely match what Constance Brown explains in her book "Technical Analysis for the Trading Professional". 
I have also coded up 2 scripts to visualize %B and Bandwidth, just as in BollingerBands. As you can see %B is equivalent to the actual RSI. Along with RSI_Bandwidth and %B, the bands convey a lot of information. 
Another tip is to render Bollinger Bands along with RSIBands...endless possibilities :)
I have included all 3 scripts in the same chart, as they are all related. Since TradingView doesn't allow sharing more than one script in the same chart, you can only "Add script" RSI Bands. 
If you want to use RSI %B and Bandwidth, follow this guide to "Make mine" this chart and get access to the source: 
drive.google.com
For the complete list of my indicators, check this post:
Indicators: Traders Dynamic Index, HLCTrends and Trix Ribbon1) Trix Ribbon  
===============================================================
This was built on request. Many Stock/FX traders overlay multiple Trix lines to form the ribbon, this indicator makes it easy. 
Also, optionally this can plot a BollingerBand on Trix_1. 
More info on Trix:
stockcharts.com
2) High/Low/Close Trend Indicator  
===============================================================
Simple indicator using EMAs of H/L/C. If blue line is above the red line, the trend is up, else down. Keep an eye on the zero line too. 
3) Traders Dynamic Index   
===============================================================
This hybrid indicator helps to decipher and monitor market conditions related to trend direction, market strength, and market volatility.        
TDI has the following components:
 * Green line = RSI Price line                                     
 * Red line   = Trade Signal line                                    
 * Blue lines = Volatility Bands
 * Orange line = Market Base Line                                    
Trend Direction - Immediate and Overall:
---------------------------------------------------- 
 * Immediate = Green over Red...price action is moving up.
               Red over Green...price action is moving down.      
 * Overall = Orange line trends up and down generally between the lines 32 & 68. Watch for Orange line to bounces off these lines for market reversal. Trade long when price is above the Orange line, and trade short when price is below.                                              
                                                                
Market Strength & Volatility - Immediate and Overall:
----------------------------------------------------
 * Immediate = Green Line - Strong = Steep slope up or down.       
	                        Weak = Moderate to Flat slope.        
 * Overall = Blue Lines - When expanding, market is strong and trending. When constricting, market is weak and in a range. When the Blue lines are extremely tight in a narrow range, expect an economic announcement or other market condition to spike the market.       
Entry conditions:
----------------------------------------------------
 * Scalping  - Long = Green over Red, 
               Short = Red over Green      
 * Active - Long = Green over Red & Orange lines                  
            Short = Red over Green & Orange lines                     
 * Moderate - Long = Green over Red, Orange, & 50 lines           
              Short= Red over Green, Green below Orange & 50 line 
                                                                
Exit conditions:
----------------------------------------------------
If Green crosses either Blue lines, consider exiting when the Green line crosses back over the Blue line.         
 * Long = Green crosses below Red                                 
 * Short = Green crosses above Red                                
More info on a complete system using TDI:
www.forexmt4.com
Custom Symbol Chart Overlay [ T W K ] :Custom Symbol Chart Overlay   indicator for all types of Trading View account Users ❗
 This Indicator has specially designed for apply Custom Symbol / Script on chart, in addition to current Live Chart symbol. 
 **No need for separate chart layout ( available for Paid Trading View users only! ) 
▫️▷ : # Indicator have settings for fetch the  different Chart types  (ex - Heikin-Ashi /                standard) data and have the input for this.
 all you need is to just select the Chart type. This setting allows user to apply different types of chart on single layout screen. 
 ✔ (ex 1:- Standard current chart of BTCUSD  ( SPOT )  with Custom Heikin-Ashi chart of BTCUSD ( PERPETUAL futures ). 
 ✔ (ex 2:- Standard current chart of XAUUSD  ( CFDs )  with Custom Standard chart of XAUUSD ( CFDs ) with MA / BB / ST input. 
▫️▷ : It has 3 Moving average Lines, Bollinger Bands, and Super Trend input. (*Note:- all Inputs are customizable)
▫️▷ : # Indicator have ⏰ Alerts for automation trading ( #algo ) : Super Trend (3 conditions)
 Usage:- This Indicator is helpful for apply Multiple symbols of different chart types on single layout screen. 
 Compatible with All Devices (Laptop / Mobile / Tablet / PC). 
 ✅ HOW TO GET ACCESS : 
Add to favorite and enjoy the true Trading View's sprit of community growth, without any limitations.
🔆If you like any of  my Invite-Only indicators , kindly DM and let me know!
 ⚠ RISK DISCLAIMER : 
All content provided by "@TradeWithKeshhav" is for informational & educational purposes only.
It does not constitute any financial advice or a solicitation to buy or sell any securities of any type. All investments / trading involve risks. Past performance does not guarantee future results / returns.
 Regards : 
Team @TradeWithKeshhav
Happy trading and investing!
3SD Bollinger Exhaustion & Reversal Alert IndicatorThe Bollinger Band 3 Standard Deviation (3SD) captures roughly 99% of price action within its boundaries.
When price moves beyond these extremes, it often signals temporary overextension — creating opportunities for mean reversion trades, especially when aligned with the prevailing trend.
This indicator alerts you when:
- Price touches the 3SD Bollinger Band on higher timeframes (H4, D1, W1, M1), and
- A reversal reaction occurs — defined by a bullish or bearish candle close on H1 or H4.
Together, these conditions identify potential high-probability entry zones where exhaustion meets trend alignment.
🚀 Coming Soon
A premium version is in development, combining this 3SD exhaustion logic with my proprietary trend-following system.
It will generate confluence-based trade signals when price interacts with both the 3SD band and the trend-following band.
Stay tuned for updates.
Copeland Dynamic Dominance Matrix System | GForgeCopeland Dynamic Dominance Matrix System | GForge  - v1
---
 📊 COMPREHENSIVE SYSTEM OVERVIEW 
The GForge Dynamic BB% TrendSync System represents a revolutionary approach to algorithmic portfolio management, combining cutting-edge statistical analysis, momentum detection, and regime identification into a unified framework. This system processes up to 39 different cryptocurrency assets simultaneously, using advanced mathematical models to determine optimal capital allocation across dynamic market conditions.
 Core Innovation: Multi-Dimensional Analysis 
Unlike traditional single-asset indicators, this system operates on multiple analytical dimensions:
 
 Momentum Analysis:  Dual Bollinger Band Modified Deviation (DBBMD) calculations
 Relative Strength:  Comprehensive dominance matrix with head-to-head comparisons
 Fundamental Screening:  Alpha and Beta statistical filtering
 Market Regime Detection:  Five-component statistical testing framework
 Portfolio Optimization:  Dynamic weighting and allocation algorithms
 Risk Management:  Multi-layered protection and regime-based positioning
 
---
 🔧 DETAILED COMPONENT BREAKDOWN 
 1. Dynamic Bollinger Band % Modified Deviation Engine (DBBMD) 
The foundation of this system is an advanced oscillator that combines two independent Bollinger Band systems with asymmetric parameters to create unique momentum readings.
 Technical Implementation: 
 [ 
// BB System 1: Fast-reacting with extended standard deviation
primary_bb1_ma_len = 40    // Shorter MA for responsiveness
primary_bb1_sd_len = 65    // Longer SD for stability
primary_bb1_mult = 1.0     // Standard deviation multiplier
// BB System 2: Complementary asymmetric design  
primary_bb2_ma_len = 8     // Longer MA for trend following
primary_bb2_sd_len = 66    // Shorter SD for volatility sensitivity
primary_bb2_mult = 1.7     // Wider bands for reduced noise
 
 Key Features: 
 
 Asymmetric Design:  The intentional mismatch between MA and Standard Deviation periods creates unique oscillation characteristics that traditional Bollinger Bands cannot achieve
 Percentage Scale:  All readings are normalized to 0-100% scale for consistent interpretation across assets
 Multiple Combination Modes:  
   
   BB1 Only: Fast/reactive system
   BB2 Only: Smooth/stable system  
   Average: Balanced blend (recommended)
   Both Required: Conservative (both must agree)
   Either One: Aggressive (either can trigger)
   
 Mean Deviation Filter:  Additional volatility-based layer that measures the standard deviation of the DBBMD% itself, creating dynamic trigger bands
 
 Signal Generation Logic: 
 
// Primary thresholds
primary_long_threshold = 71   // DBBMD% level for bullish signals
primary_short_threshold = 33  // DBBMD% level for bearish signals
// Mean Deviation creates dynamic bands around these thresholds
upper_md_band = combined_bb + (md_mult * bb_std)
lower_md_band = combined_bb - (md_mult * bb_std)
// Signal triggers when DBBMD crosses these dynamic bands
long_signal = lower_md_band > long_threshold
short_signal = upper_md_band < short_threshold
 
For more information on this BB% indicator, find it here:
  
 2. Revolutionary Dominance Matrix System 
This is the system's most sophisticated innovation - a comprehensive framework that compares every asset against every other asset to determine relative strength hierarchies.
 Mathematical Foundation: 
The system constructs a mathematical matrix where each cell   represents whether asset i dominates asset j:
 
// Core dominance matrix (39x39 for maximum assets)
var matrix dominance_matrix = matrix.new(39, 39, 0)
// For each qualifying asset pair (i,j):
for i = 0 to active_count - 1
    for j = 0 to active_count - 1
        if i != j
            // Calculate price ratio BB% TrendSync for asset_i/asset_j
            ratio_array = calculate_price_ratios(asset_i, asset_j)
            ratio_dbbmd = calculate_dbbmd(ratio_array)
            
            // Asset i dominates j if ratio is in uptrend
            if ratio_dbbmd_state == 1
                matrix.set(dominance_matrix, i, j, 1)
 
 Copeland Scoring Algorithm: 
Each asset receives a dominance score calculated as:
 Dominance Score = Total Wins - Total Losses 
 
// Calculate net dominance for each asset
for i = 0 to active_count - 1
    wins = 0
    losses = 0
    for j = 0 to active_count - 1
        if i != j
            if matrix.get(dominance_matrix, i, j) == 1
                wins += 1
            else
                losses += 1
    
    copeland_score = wins - losses
    array.set(dominance_scores, i, copeland_score)
 
 Head-to-Head Analysis Process: 
 
 Ratio Construction:  For each asset pair, calculate price_asset_A / price_asset_B
 DBBMD Application:  Apply the same DBBMD analysis to these ratios
 Trend Determination:  If ratio DBBMD shows uptrend, Asset A dominates Asset B
 Matrix Population:  Store dominance relationships in mathematical matrix
 Score Calculation:  Sum wins minus losses for final ranking
 
This creates a tournament-style ranking where each asset's strength is measured against all others, not just against a benchmark.
 3. Advanced Alpha & Beta Filtering System 
The system incorporates fundamental analysis through Capital Asset Pricing Model (CAPM) calculations to filter assets based on risk-adjusted performance.
 Alpha Calculation (Excess Return Analysis): 
 
// CAPM Alpha calculation
f_calc_alpha(asset_prices, benchmark_prices, alpha_length, beta_length, risk_free_rate) =>
    // Calculate asset and benchmark returns
    asset_returns = calculate_returns(asset_prices, alpha_length)
    benchmark_returns = calculate_returns(benchmark_prices, alpha_length)
    
    // Get beta for expected return calculation
    beta = f_calc_beta(asset_prices, benchmark_prices, beta_length)
    
    // Average returns over period
    avg_asset_return = array_average(asset_returns) * 100
    avg_benchmark_return = array_average(benchmark_returns) * 100
    
    // Expected return using CAPM: E(R) = Beta * Market_Return + Risk_Free_Rate
    expected_return = beta * avg_benchmark_return + risk_free_rate
    
    // Alpha = Actual Return - Expected Return
    alpha = avg_asset_return - expected_return
 
 Beta Calculation (Volatility Relationship): 
 
// Beta measures how much an asset moves relative to benchmark
f_calc_beta(asset_prices, benchmark_prices, length) =>
    // Calculate return series for both assets
    asset_returns =  
    benchmark_returns =  
    
    // Populate return arrays
    for i = 0 to length - 1
        asset_return = (current_price - previous_price) / previous_price
        benchmark_return = (current_bench - previous_bench) / previous_bench
        
    // Calculate covariance and variance
    covariance = calculate_covariance(asset_returns, benchmark_returns)
    benchmark_variance = calculate_variance(benchmark_returns)
    
    // Beta = Covariance(Asset, Market) / Variance(Market)
    beta = covariance / benchmark_variance
 
 Filtering Applications: 
 
 Alpha Filter:  Only includes assets with alpha above specified threshold (e.g., >0.5% monthly excess return)
 Beta Filter:  Screens for desired volatility characteristics (e.g., beta >1.0 for aggressive assets)
 Combined Screening:  Both filters must pass for asset qualification
 Dynamic Thresholds:  User-configurable parameters for different market conditions
 
 4. Intelligent Tie-Breaking Resolution System 
When multiple assets have identical dominance scores, the system employs sophisticated methods to determine final rankings.
 Standard Tie-Breaking Hierarchy: 
 
// Primary tie-breaking logic
if score_i == score_j  // Tied dominance scores
    // Level 1: Compare Beta values (higher beta wins)
    beta_i = array.get(beta_values, i)
    beta_j = array.get(beta_values, j)
    
    if beta_j > beta_i
        swap_positions(i, j)
    else if beta_j == beta_i
        // Level 2: Compare Alpha values (higher alpha wins)
        alpha_i = array.get(alpha_values, i)
        alpha_j = array.get(alpha_values, j)
        
        if alpha_j > alpha_i
            swap_positions(i, j)
 
 Advanced Tie-Breaking (Head-to-Head Analysis): 
For the top 3 performers, an enhanced tie-breaking mechanism analyzes direct head-to-head price ratio performance:
 
// Advanced tie-breaker for top performers
f_advanced_tiebreaker(asset1_idx, asset2_idx, lookback_period) =>
    // Calculate price ratio over lookback period
    ratio_history =  
    for k = 0 to lookback_period - 1
        price_ratio = price_asset1  / price_asset2 
        array.push(ratio_history, price_ratio)
    
    // Apply simplified trend analysis to ratio
    current_ratio = array.get(ratio_history, 0)
    average_ratio = calculate_average(ratio_history)
    
    // Asset 1 wins if current ratio > average (trending up)
    if current_ratio > average_ratio
        return 1  // Asset 1 dominates
    else
        return -1  // Asset 2 dominates
 
 5. Five-Component Aggregate Market Regime Filter 
This sophisticated framework combines multiple statistical tests to determine whether market conditions favor trending strategies or require defensive positioning.
 Component 1: Augmented Dickey-Fuller (ADF) Test 
Tests for unit root presence to distinguish between trending and mean-reverting price series.
 
// Simplified ADF implementation
calculate_adf_statistic(price_series, lookback) =>
    // Calculate first differences
    differences =  
    for i = 0 to lookback - 2
        diff = price_series  - price_series 
        array.push(differences, diff)
    
    // Statistical analysis of differences
    mean_diff = calculate_mean(differences)
    std_diff = calculate_standard_deviation(differences)
    
    // ADF statistic approximation
    adf_stat = mean_diff / std_diff
    
    // Compare against threshold for trend determination
    is_trending = adf_stat <= adf_threshold
 
 Component 2: Directional Movement Index (DMI) 
Classic Wilder indicator measuring trend strength through directional movement analysis.
 
// DMI calculation for trend strength
calculate_dmi_signal(high_data, low_data, close_data, period) =>
    // Calculate directional movements
    plus_dm_sum = 0.0
    minus_dm_sum = 0.0
    true_range_sum = 0.0
    
    for i = 1 to period
        // Directional movements
        up_move = high_data  - high_data 
        down_move = low_data  - low_data 
        
        // Accumulate positive/negative movements
        if up_move > down_move and up_move > 0
            plus_dm_sum += up_move
        if down_move > up_move and down_move > 0
            minus_dm_sum += down_move
            
        // True range calculation
        true_range_sum += calculate_true_range(i)
    
    // Calculate directional indicators
    di_plus = 100 * plus_dm_sum / true_range_sum
    di_minus = 100 * minus_dm_sum / true_range_sum
    
    // ADX calculation
    dx = 100 * math.abs(di_plus - di_minus) / (di_plus + di_minus)
    adx = dx  // Simplified for demonstration
    
    // Trending if ADX above threshold
    is_trending = adx > dmi_threshold
 
 Component 3: KPSS Stationarity Test 
Complementary test to ADF that examines stationarity around trend components.
 
// KPSS test implementation
calculate_kpss_statistic(price_series, lookback, significance_level) =>
    // Calculate mean and variance
    series_mean = calculate_mean(price_series, lookback)
    series_variance = calculate_variance(price_series, lookback)
    
    // Cumulative sum of deviations
    cumulative_sum = 0.0
    cumsum_squared_sum = 0.0
    
    for i = 0 to lookback - 1
        deviation = price_series  - series_mean
        cumulative_sum += deviation
        cumsum_squared_sum += math.pow(cumulative_sum, 2)
    
    // KPSS statistic
    kpss_stat = cumsum_squared_sum / (lookback * lookback * series_variance)
    
    // Compare against critical values
    critical_value = significance_level == 0.01 ? 0.739 : 
                    significance_level == 0.05 ? 0.463 : 0.347
    
    is_trending = kpss_stat >= critical_value
 
 Component 4: Choppiness Index 
Measures market directionality using fractal dimension analysis of price movement.
 
// Choppiness Index calculation
calculate_choppiness(price_data, period) =>
    // Find highest and lowest over period
    highest = price_data 
    lowest = price_data 
    true_range_sum = 0.0
    
    for i = 0 to period - 1
        if price_data  > highest
            highest := price_data 
        if price_data  < lowest
            lowest := price_data 
            
        // Accumulate true range
        if i > 0
            true_range = calculate_true_range(price_data, i)
            true_range_sum += true_range
    
    // Choppiness calculation
    range_high_low = highest - lowest
    choppiness = 100 * math.log10(true_range_sum / range_high_low) / math.log10(period)
    
    // Trending if choppiness below threshold (typically 61.8)
    is_trending = choppiness < 61.8
 
 Component 5: Hilbert Transform Analysis 
Phase-based cycle detection and trend identification using mathematical signal processing.
 
// Hilbert Transform trend detection
calculate_hilbert_signal(price_data, smoothing_period, filter_period) =>
    // Smooth the price data
    smoothed_price = calculate_moving_average(price_data, smoothing_period)
    
    // Calculate instantaneous phase components
    // Simplified implementation for demonstration
    instant_phase = smoothed_price
    delayed_phase = calculate_moving_average(price_data, filter_period)
    
    // Compare instantaneous vs delayed signals
    phase_difference = instant_phase - delayed_phase
    
    // Trending if instantaneous leads delayed
    is_trending = phase_difference > 0
 
 Aggregate Regime Determination: 
 
// Combine all five components
regime_calculation() =>
    trending_count = 0
    total_components = 0
    
    // Test each enabled component
    if enable_adf and adf_signal == 1
        trending_count += 1
    if enable_adf
        total_components += 1
        
    // Repeat for all five components...
    
    // Calculate trending proportion
    trending_proportion = trending_count / total_components
    
    // Market is trending if proportion above threshold
    regime_allows_trading = trending_proportion >= regime_threshold
 
The system only allows asset positions when the specified percentage of components indicate trending conditions. During choppy or mean-reverting periods, the system automatically positions in USD to preserve capital.
 6. Dynamic Portfolio Weighting Framework 
Six sophisticated allocation methodologies provide flexibility for different market conditions and risk preferences.
 Weighting Method Implementations: 
 1. Equal Weight Distribution: 
 
// Simple equal allocation
if weighting_mode == "Equal Weight"
    weight_per_asset = 1.0 / selection_count
    for i = 0 to selection_count - 1
        array.push(weights, weight_per_asset)
 
 2. Linear Dominance Scaling: 
 
// Linear scaling based on dominance scores
if weighting_mode == "Linear Dominance"
    // Normalize scores to 0-1 range
    min_score = array.min(dominance_scores)
    max_score = array.max(dominance_scores)
    score_range = max_score - min_score
    
    total_weight = 0.0
    for i = 0 to selection_count - 1
        score = array.get(dominance_scores, i)
        normalized = (score - min_score) / score_range
        weight = 1.0 + normalized * concentration_factor
        array.push(weights, weight)
        total_weight += weight
    
    // Normalize to sum to 1.0
    for i = 0 to selection_count - 1
        current_weight = array.get(weights, i)
        array.set(weights, i, current_weight / total_weight)
 
 3. Conviction Score (Exponential): 
 
// Exponential scaling for high conviction
if weighting_mode == "Conviction Score"
    // Combine dominance score with DBBMD strength
    conviction_scores =  
    for i = 0 to selection_count - 1
        dominance = array.get(dominance_scores, i)
        dbbmd_strength = array.get(dbbmd_values, i)
        conviction = dominance + (dbbmd_strength - 50) / 25
        array.push(conviction_scores, conviction)
    
    // Exponential weighting
    total_weight = 0.0
    for i = 0 to selection_count - 1
        conviction = array.get(conviction_scores, i)
        normalized = normalize_score(conviction)
        weight = math.pow(1 + normalized, concentration_factor)
        array.push(weights, weight)
        total_weight += weight
    
    // Final normalization
    normalize_weights(weights, total_weight)
 
 Advanced Features: 
 
 Minimum Position Constraint:  Prevents dust allocations below specified threshold
 Concentration Factor:  Adjustable parameter controlling weight distribution aggressiveness
 Dominance Boost:  Extra weight for assets exceeding specified dominance thresholds
 Dynamic Rebalancing:  Automatic weight recalculation on portfolio changes
 
 7. Intelligent USD Management System 
The system treats USD as a competing asset with its own dominance score, enabling sophisticated cash management.
 USD Scoring Methodologies: 
 Smart Competition Mode (Recommended): 
 
f_calculate_smart_usd_dominance() =>
    usd_wins = 0
    
    // USD beats assets in downtrends or weak uptrends
    for i = 0 to active_count - 1
        asset_state = get_asset_state(i)
        asset_dbbmd = get_asset_dbbmd(i)
        
        // USD dominates shorts and weak longs
        if asset_state == -1 or (asset_state == 1 and asset_dbbmd < long_threshold)
            usd_wins += 1
    
    // Calculate Copeland-style score
    base_score = usd_wins - (active_count - usd_wins)
    
    // Boost during weak market conditions
    qualified_assets = count_qualified_long_assets()
    if qualified_assets <= active_count * 0.2
        base_score := math.round(base_score * usd_boost_factor)
    
    base_score
 
 Auto Short Count Mode: 
 
// USD dominance based on number of bearish assets
usd_dominance = count_assets_in_short_state()
// Apply boost during low activity
if qualified_long_count <= active_count * 0.2
    usd_dominance := usd_dominance * usd_boost_factor
 
 Regime-Based USD Positioning: 
When the five-component regime filter indicates unfavorable conditions, the system automatically overrides all asset signals and positions 100% in USD, protecting capital during choppy markets.
 8. Multi-Asset Infrastructure & Data Management 
The system maintains comprehensive data structures for up to 39 assets simultaneously.
 Data Collection Framework: 
 
// Full OHLC data matrices (200 bars depth for performance)
var matrix open_data = matrix.new(39, 200, na)
var matrix high_data = matrix.new(39, 200, na)  
var matrix low_data = matrix.new(39, 200, na)
var matrix close_data = matrix.new(39, 200, na)
// Real-time data collection
if barstate.isconfirmed
    for i = 0 to active_count - 1
        ticker = array.get(assets, i)
          = request.security(ticker, timeframe.period, 
                                        [open , high , low , close ], 
                                       lookahead=barmerge.lookahead_off)
        
        // Store in matrices with proper shifting
        matrix.set(open_data, i, 0, nz(o, 0))
        matrix.set(high_data, i, 0, nz(h, 0))
        matrix.set(low_data, i, 0, nz(l, 0))
        matrix.set(close_data, i, 0, nz(c, 0))
 
 Asset Configuration: 
The system comes pre-configured with 39 major cryptocurrency pairs across multiple exchanges:
 
 Major Pairs:  BTC, ETH, XRP, SOL, DOGE, ADA, etc.
 Exchange Coverage:  Binance, KuCoin, MEXC for optimal liquidity
 Configurable Count:  Users can activate 2-39 assets based on preferences
 Custom Tickers:  All asset selections are user-modifiable
 
---
 ⚙️ COMPREHENSIVE CONFIGURATION GUIDE 
 Portfolio Management Settings 
 Maximum Portfolio Size (1-10): 
 
 Conservative (1-2):  High concentration, captures strong trends
 Balanced (3-5):  Moderate diversification with trend focus  
 Diversified (6-10):  Lower concentration, broader market exposure
 
 Dominance Clarity Threshold (0.1-1.0): 
 
 Low (0.1-0.4):  Prefers diversification, holds multiple assets frequently
 Medium (0.5-0.7):  Balanced approach, context-dependent allocation
 High (0.8-1.0):  Concentration-focused, single asset preference
 
 Signal Generation Parameters 
 DBBMD Thresholds: 
 
// Standard configuration
primary_long_threshold = 71   // Conservative: 75+, Aggressive: 65-70
primary_short_threshold = 33  // Conservative: 25-30, Aggressive: 35-40
// BB System parameters
bb1_ma_len = 40        // Fast system: 20-50
bb1_sd_len = 65        // Stability: 50-80  
bb2_ma_len = 8         // Trend: 60-100
bb2_sd_len = 66        // Sensitivity: 10-20
 
 Risk Management Configuration 
 Alpha/Beta Filters: 
 
 Alpha Threshold:  0.0-2.0% (higher = more selective)
 Beta Threshold:  0.5-2.0 (1.0+ for aggressive assets)
 Calculation Periods:  20-50 bars (longer = more stable)
 
 Regime Filter Settings: 
 
 Trending Threshold:  0.3-0.8 (higher = stricter trend requirements)
 Component Lookbacks:  30-100 bars (balance responsiveness vs stability)
 Enable/Disable:  Individual component control for customization
 
---
 📊 PERFORMANCE TRACKING & VISUALIZATION 
 Real-Time Dashboard Features 
The compact dashboard provides essential information:
 
 Current Holdings:  Asset names and allocation percentages
 Dominance Score:  Current position's relative strength ranking
 Active Assets:  Qualified long signals vs total asset count
 Returns:  Total portfolio performance percentage
 Maximum Drawdown:  Peak-to-trough decline measurement
 Trade Count:  Total portfolio transitions executed
 Regime Status:  Current market condition assessment
 
 Comprehensive Ranking Table 
The left-side table displays detailed asset analysis:
 
 Ranking Position:  Numerical order by dominance score
 Asset Symbol:  Clean ticker identification with color coding
 Dominance Score:  Net wins minus losses in head-to-head comparisons
 Win-Loss Record:  Detailed breakdown of dominance relationships
 DBBMD Reading:  Current momentum percentage with threshold highlighting
 Alpha/Beta Values:  Fundamental analysis metrics when filters enabled
 Portfolio Weight:  Current allocation percentage in signal portfolio
 Execution Status:  Visual indicator of actual holdings vs signals
 
 Visual Enhancement Features 
 
 Color-Coded Assets:  39 distinct colors for easy identification
 Regime Background:  Red tinting during unfavorable market conditions
 Dynamic Equity Curve:  Portfolio value plotted with position-based coloring
 Status Indicators:  Symbols showing execution vs signal states
 
---
 🔍 ADVANCED TECHNICAL FEATURES 
 State Persistence System 
The system maintains asset states across bars to prevent excessive switching:
 
// State tracking for each asset and ratio combination
var array asset_states = array.new(1560, 0)  // 39 * 40 ratios
// State changes only occur on confirmed threshold breaks
if long_crossover and current_state != 1
    current_state := 1
    array.set(asset_states, asset_index, 1)
else if short_crossover and current_state != -1  
    current_state := -1
    array.set(asset_states, asset_index, -1)
 
 Transaction Cost Integration 
Realistic modeling of trading expenses:
 
// Transaction cost calculation
transaction_fee = 0.4  // Default 0.4% (fees + slippage)
// Applied on portfolio transitions
if should_execute_transition
    was_holding_assets = check_current_holdings()
    will_hold_assets = check_new_signals()
    
    // Charge fees for meaningful transitions
    if transaction_fee > 0 and (was_holding_assets or will_hold_assets)
        fee_amount = equity * (transaction_fee / 100)
        equity -= fee_amount
        total_fees += fee_amount
 
 Dynamic Memory Management 
Optimized data structures for performance:
 
 200-Bar History:  Sufficient for calculations while maintaining speed
 Matrix Operations:  Efficient storage and retrieval of multi-asset data
 Array Recycling:  Memory-conscious data handling for long-running backtests
 Conditional Calculations:  Skip unnecessary computations during initialization
 
12H 30 assets portfolio
  
---
 🚨 SYSTEM LIMITATIONS & TESTING STATUS 
 
 CURRENT DEVELOPMENT PHASE: ACTIVE TESTING & OPTIMIZATION 
This system represents cutting-edge algorithmic trading technology but remains in continuous development. Key considerations:
 Known Limitations: 
 
 Requires significant computational resources for 39-asset analysis
 Performance varies significantly across different market conditions  
 Complex parameter interactions may require extensive optimization
 Slippage and liquidity constraints not fully modeled for all assets
 No consideration for market impact in large position sizes
 
 Areas Under Active Development: 
 
 Enhanced regime detection algorithms
 Improved transaction cost modeling
 Additional portfolio weighting methodologies
 Machine learning integration for parameter optimization
 Cross-timeframe analysis capabilities
 
 
---
 🔒 ANTI-REPAINTING ARCHITECTURE & LIVE TRADING READINESS 
One of the most critical aspects of any trading system is ensuring that signals and calculations are based on confirmed, historical data rather than current bar information that can change throughout the trading session. This system implements comprehensive anti-repainting measures to ensure  100% reliability for live trading .
 The Repainting Problem in Trading Systems 
Repainting occurs when an indicator uses current, unconfirmed bar data in its calculations, causing:
 
 False Historical Signals:  Backtests appear better than reality because calculations change as bars develop
 Live Trading Failures:  Signals that looked profitable in testing fail when deployed in real markets
 Inconsistent Results:  Different results when running the same indicator at different times during a trading session
 Misleading Performance:  Inflated win rates and returns that cannot be replicated in practice
 
 GForge Anti-Repainting Implementation 
This system eliminates repainting through multiple technical safeguards:
 1. Historical Data Usage for All Calculations 
 
// CRITICAL: All calculations use PREVIOUS bar data (note the   offset)
  = request.security(ticker, timeframe.period, 
                                         [open , high , low , close , close], 
                                        lookahead=barmerge.lookahead_off)
// Store confirmed previous bar OHLC for calculations
matrix.set(open_data, i, 0, nz(o1, 0))   // Previous bar open
matrix.set(high_data, i, 0, nz(h1, 0))   // Previous bar high  
matrix.set(low_data, i, 0, nz(l1, 0))    // Previous bar low
matrix.set(close_data, i, 0, nz(c1, 0))  // Previous bar close
// Current bar close only for visualization
matrix.set(current_prices, i, 0, nz(c0, 0))  // Live price display
 
 2. Confirmed Bar State Processing 
 
// Only process data when bars are confirmed and closed
if barstate.isconfirmed
    // All signal generation and portfolio decisions occur here
    // using only historical, unchanging data
    
    // Shift historical data arrays
    for i = 0 to active_count - 1
        for bar = math.min(data_bars, 199) to 1
            // Move confirmed data through historical matrices
            old_data = matrix.get(close_data, i, bar - 1)
            matrix.set(close_data, i, bar, old_data)
    
    // Process new confirmed bar data
    calculate_all_signals_and_dominance()
 
 3. Lookahead Prevention 
 
// Explicit lookahead prevention in all security calls
request.security(ticker, timeframe.period, expression, 
                lookahead=barmerge.lookahead_off)
// This ensures no future data can influence current calculations
// Essential for maintaining signal integrity across all timeframes
 
 4. State Persistence with Historical Validation 
 
// Asset states only change based on confirmed threshold breaks
// using historical data that cannot change
var array asset_states = array.new(1560, 0)
// State changes use only confirmed, previous bar calculations
if barstate.isconfirmed
      = 
        f_calculate_enhanced_dbbmd(confirmed_price_array, ...)
    
    // Only update states after bar confirmation
    if long_crossover_confirmed and current_state != 1
        current_state := 1
        array.set(asset_states, asset_index, 1)
 
 Live Trading vs. Backtesting Consistency 
The system's architecture ensures identical behavior in both environments:
 Backtesting Mode: 
 
 Uses historical   offset data for all calculations
 Processes confirmed bars with `barstate.isconfirmed`
 Maintains identical signal generation logic
 No access to future information
 
 Live Trading Mode: 
 
 Uses same historical   offset data structure
 Waits for bar confirmation before signal updates
 Identical mathematical calculations and thresholds
 Real-time price display without affecting signals
 
 Technical Implementation Details 
 Data Collection Timing 
 
// Example of proper data collection timing
if barstate.isconfirmed  // Wait for bar to close
    // Collect PREVIOUS bar's confirmed OHLC data
    for i = 0 to active_count - 1
        ticker = array.get(assets, i)
        
        // Get confirmed previous bar data (note   offset)
          = 
            request.security(ticker, timeframe.period, 
                            [open , high , low , close , close], 
                           lookahead=barmerge.lookahead_off)
        
        // ALL calculations use prev_* values
        // current_close only for real-time display
        portfolio_calculations_use_previous_bar_data()
 
 Signal Generation Process 
 
// Signal generation workflow (simplified)
if barstate.isconfirmed and data_bars >= minimum_required_bars
    
    // Step 1: Calculate DBBMD using historical price arrays
    for i = 0 to active_count - 1
        historical_prices = get_confirmed_price_history(i)  // Uses   offset data
          = calculate_dbbmd(historical_prices)
        update_asset_state(i, state)
    
    // Step 2: Build dominance matrix using confirmed data
    calculate_dominance_relationships()  // All historical data
    
    // Step 3: Generate portfolio signals
    new_portfolio = generate_target_portfolio()  // Based on confirmed calculations
    
    // Step 4: Compare with previous signals for changes
    if portfolio_signals_changed()
        execute_portfolio_transition()
 
 Verification Methods for Users 
Users can verify the anti-repainting behavior through several methods:
 1. Historical Replay Test 
 
 Run the indicator on historical data
 Note signal timing and portfolio changes
 Replay the same period - signals should be identical
 No retroactive changes in historical signals
 
 2. Intraday Consistency Check 
 
 Load indicator during active trading session
 Observe that previous day's signals remain unchanged
 Only current day's final bar should show potential signal changes
 Refresh indicator - historical signals should be identical
 
 Live Trading Deployment Considerations 
 Data Quality Assurance 
 
 Exchange Connectivity:  Ensure reliable data feeds for all 39 assets
 Missing Data Handling:  System includes safeguards for data gaps
 Price Validation:  Automatic filtering of obvious price errors
 Timeframe Synchronization:  All assets synchronized to same bar timing
 
 Performance Impact of Anti-Repainting Measures 
The robust anti-repainting implementation requires additional computational resources:
 
 Memory Usage:  200-bar historical data storage for 39 assets
 Processing Delay:  Signals update only after bar confirmation
 Calculation Overhead:  Multiple historical data validations
 Alert Timing:  Slight delay compared to current-bar indicators
 
However, these trade-offs are essential for reliable live trading performance and accurate backtesting results.
 Critical: Equity Curve Anti-Repainting Architecture 
The most sophisticated aspect of this system's anti-repainting design is the  temporal separation between signal generation and performance calculation . This creates a realistic trading simulation that perfectly matches live trading execution.
 The Timing Sequence 
 
// STEP 1: Store what we HELD during the current bar (for performance calc)
if barstate.isconfirmed
    // Record positions that were active during this bar
    array.clear(held_portfolio)
    array.clear(held_weights)
    
    for i = 0 to array.size(execution_portfolio) - 1
        array.push(held_portfolio, array.get(execution_portfolio, i))
        array.push(held_weights, array.get(execution_weights, i))
    // STEP 2: Calculate performance based on what we HELD
    portfolio_return = 0.0
    for i = 0 to array.size(held_portfolio) - 1
        held_asset = array.get(held_portfolio, i)
        held_weight = array.get(held_weights, i)
        
        // Performance from current_price vs reference_price
        // This is what we ACTUALLY earned during this bar
        if held_asset != "USD"
            current_price = get_current_price(held_asset)      // End of bar
            reference_price = get_reference_price(held_asset)  // Start of bar
            asset_return = (current_price - reference_price) / reference_price
            portfolio_return += asset_return * held_weight
    // STEP 3: Apply return to equity (realistic timing)
    equity := equity * (1 + portfolio_return)
    // STEP 4: Generate NEW signals for NEXT period (using confirmed data)
      = f_generate_target_portfolio()
    
    // STEP 5: Execute transitions if signals changed
    if signal_changed
        // Update execution_portfolio for NEXT bar
        array.clear(execution_portfolio)
        array.clear(execution_weights)
        for i = 0 to array.size(new_signal_portfolio) - 1
            array.push(execution_portfolio, array.get(new_signal_portfolio, i))
            array.push(execution_weights, array.get(new_signal_weights, i))
 
 Why This Prevents Equity Curve Repainting 
 
 Performance Attribution:  Returns are calculated based on positions that were **actually held** during each bar, not future signals
 Signal Timing:  New signals are generated **after** performance calculation, affecting only **future** bars
 Realistic Execution:  Mimics real trading where you earn returns on current positions while planning future moves
 No Retroactive Changes:  Once a bar closes, its performance contribution to equity is permanent and unchangeable
 
 The One-Bar Offset Mechanism 
This system implements a critical one-bar timing offset:
 
// Bar N: Performance Calculation
// ================================
// 1. Calculate returns on positions held during Bar N
// 2. Update equity based on actual holdings during Bar N
// 3. Plot equity point for Bar N (based on what we HELD)
// Bar N: Signal Generation  
// ========================
// 4. Generate signals for Bar N+1 (using confirmed Bar N data)
// 5. Send alerts for what will be held during Bar N+1
// 6. Update execution_portfolio for Bar N+1
// Bar N+1: The Cycle Continues
// =============================
// 1. Performance calculated on positions from Bar N signals
// 2. New signals generated for Bar N+2
 
 Alert System Timing 
The alert system reflects this sophisticated timing:
 Transaction Cost Realism 
Even transaction costs follow realistic timing:
 
// Fees applied when transitioning between different portfolios
if should_execute_transition
    // Charge fees BEFORE taking new positions (realistic timing)
    if transaction_fee > 0
        fee_amount = equity * (transaction_fee / 100)
        equity -= fee_amount  // Immediate cost impact
        total_fees += fee_amount
    
    // THEN update to new portfolio
    update_execution_portfolio(new_signals)
    transitions += 1
// Fees reduce equity immediately, affecting all future calculations
// This matches real trading where fees are deducted upon execution
 
 
 LIVE TRADING CERTIFICATION: 
This system has been specifically designed and tested for live trading deployment. The comprehensive anti-repainting measures ensure that:
 
 Backtesting results accurately represent real trading potential
 Signals are generated using only confirmed, historical data
 No retroactive changes can occur to previously generated signals
 Portfolio transitions are based on reliable, unchanging calculations
 Performance metrics reflect realistic trading outcomes including proper timing
 
Users can deploy this system with confidence that live trading results will closely match backtesting performance, subject to normal market execution factors such as slippage and liquidity.
 
---
 ⚡ ALERT SYSTEM & AUTOMATION 
The system provides comprehensive alerting for automation and monitoring:
 Available Alert Conditions 
 
 Portfolio Signal Change:  Triggered when new portfolio composition is generated
 Regime Override Active:  Alerts when market regime forces USD positioning
 Individual Asset Signals:  Can be configured for specific asset transitions
 Performance Thresholds:  Drawdown or return-based notifications
 
---
 📈 BACKTESTING & PERFORMANCE ANALYSIS 
8 Comprehensive Metrics Tracking 
The system maintains detailed performance statistics:
 
 Equity Curve:  Real-time portfolio value progression
 Returns Calculation:  Total and annualized performance metrics  
 Drawdown Analysis:  Peak-to-trough decline measurements
 Transaction Counting:  Portfolio transition frequency
 Fee Tracking:  Cumulative transaction cost impact
 Win Rate Analysis:  Success rate of position changes
 
 Backtesting Configuration 
 
// Backtesting parameters
initial_capital = 10000.0     // Starting capital
use_custom_start = true       // Enable specific start date
custom_start = timestamp("2023-09-01")  // Backtest beginning
transaction_fee = 0.4         // Combined fees and slippage %
// Performance calculation
total_return = (equity - initial_capital) / initial_capital * 100
current_drawdown = (peak_equity - equity) / peak_equity * 100
 
---
 🔧 TROUBLESHOOTING & OPTIMIZATION 
 Common Configuration Issues 
 
 Insufficient Data:  Ensure 100+ bars available before start date
 [*} Not Compiling:  Go on an asset's price chart with 2 or 3 years of data to
make the system compile or just simply reapply the indicator again
 Too Many Assets:  Reduce active count if experiencing timeouts
 Regime Filter Too Strict:  Lower trending threshold if always in USD
 Excessive Switching:  Increase MD multiplier or adjust thresholds
 
---
 💡 USER FEEDBACK & ENHANCEMENT REQUESTS 
 
The continuous evolution of this system depends heavily on user experience and community feedback. Your insights will help motivate me for new improvements and new feature developments.
---
 ⚖️ FINAL COMPREHENSIVE RISK DISCLAIMER 
 
 TRADING INVOLVES SUBSTANTIAL RISK OF LOSS 
This indicator is a sophisticated analytical tool designed for educational and research purposes. Important warnings and considerations:
 System Limitations: 
 
 No algorithmic system can guarantee profitable outcomes
 Complex systems may fail in unexpected ways during extreme market events
 Historical backtesting does not account for all real-world trading challenges
 Slippage, liquidity constraints, and market impact can significantly affect results
 System parameters require careful optimization and ongoing monitoring
 
 The creator and distributor of this indicator assume no liability for any financial losses, system failures, or adverse outcomes resulting from its use.  This tool is provided "as is" without any warranties, express or implied.
 By using this indicator, you acknowledge that you have read, understood, and agreed to assume all risks associated with algorithmic trading and cryptocurrency investments. 
Multi-Timeframe Bollinger BandsMy hope is to optimize the settings for this indicator and reintroduce it as a "strategy" with suggested position entry and exit points shown in the price pane.
I’ve been having good results setting the “Bollinger Band MA Length” in the Input tab to between 5 and 10. You can use the standard 20 period, but your results will not be as granular.
This indicator has proven very good at finding local tops and bottoms by combining data from multiple timeframes. Use timeframes that are lower than the timeframe you are viewing in your price pane. Be cognizant that the indicator, like other oscillators, does occasionally produce divergences at tops and bottoms.
Any feedback is appreciated.
 Overview 
This indicator is an oscillator that measures the normalized position of the price relative to Bollinger Bands across multiple timeframes. It takes the price's position within the Bollinger Bands (calculated on different timeframes) and averages those positions to create a single value that oscillates between 0 and 1. This value is then plotted as the oscillator, with reference lines and colored regions to help interpret the price's relative strength or weakness.
 How It Works
Bollinger Band Calculation: 
The indicator uses a custom function f_getBBPosition() to calculate the position of the price within Bollinger Bands for a given timeframe.
 Price Position Normalization: 
For each timeframe, the function normalizes the price's position between the upper and lower Bollinger Bands.
It calculates three positions based on the high, low, and close prices of the requested timeframe:
pos_high = (High - Lower Band) / (Upper Band - Lower Band)
pos_low = (Low - Lower Band) / (Upper Band - Lower Band)
pos_close = (Close - Lower Band) / (Upper Band - Lower Band)
If the upper band is not greater than the lower band or if the data is invalid (e.g., na), it defaults to 0.5 (the midline).
The average of these three positions (avg_pos) represents the normalized position for that timeframe, ranging from 0 (at the lower band) to 1 (at the upper band).
 Multi-Timeframe Averaging: 
The indicator fetches Bollinger Band data from four customizable timeframes (default: 30min, 60min, 240min, daily) using request.security() with lookahead=barmerge.lookahead_on to get the latest available data.
It calculates the normalized position (pos1, pos2, pos3, pos4) for each timeframe using f_getBBPosition().
These four positions are then averaged to produce the final avg_position:avg_position = (pos1 + pos2 + pos3 + pos4) / 4
This average is the oscillator value, which is plotted and typically oscillates between 0 and 1.
 Moving Averages: 
Two optional moving averages (MA1 and MA2) of the avg_position can be enabled, calculated using simple moving averages (ta.sma) with customizable lengths (default: 5 and 10).
These can be potentially used for MA crossover strategies.
 What Is Being Averaged? 
The oscillator (avg_position) is the average of the normalized price positions within the Bollinger Bands across the four selected timeframes. Specifically:It averages the avg_pos values (pos1, pos2, pos3, pos4) calculated for each timeframe.
Each avg_pos is itself an average of the normalized positions of the high, low, and close prices relative to the Bollinger Bands for that timeframe.
This multi-timeframe averaging smooths out short-term fluctuations and provides a broader perspective on the price's position within the volatility bands.
 Interpretation 
0.0 The price is at or below the lower Bollinger Band across all timeframes (indicating potential oversold conditions).
0.15: A customizable level (green band) which can be used for exiting short positions or entering long positions.
0.5: The midline, where the price is at the average of the Bollinger Bands (neutral zone).
0.85: A customizable level (orange band) which can be used for exiting long positions or entering short positions.
1.0: The price is at or above the upper Bollinger Band across all timeframes (indicating potential overbought conditions).
The colored regions and moving averages (if enabled) help identify trends or crossovers for trading signals.
 Example 
If the 30min timeframe shows the close at the upper band (position = 1.0), the 60min at the midline (position = 0.5), the 240min at the lower band (position = 0.0), and the daily at the upper band (position = 1.0), the avg_position would be:(1.0 + 0.5 + 0.0 + 1.0) / 4 = 0.625
This value (0.625) would plot in the orange region (between 0.85 and 0.5), suggesting the price is relatively strong but not at an extreme.
 Notes 
The use of lookahead=barmerge.lookahead_on ensures the indicator uses the latest available data, making it more real-time, though its effectiveness depends on the chart timeframe and TradingView's data feed.
The indicator’s sensitivity can be adjusted by changing bb_length ("Bollinger Band MA Length" in the Input tab), bb_mult ("Bollinger Band Standard Deviation," also in the Input tab), or the selected timeframes.
Advanced VWAP Multi-MA System with Bollinger Bands & Dashboard📊 Key Features:
Core Functionality:
* VWAP Calculation with customizable anchor periods (Session/Week/Month/Quarter/Year)
* Multiple Moving Average Types (EMA, SMA, WMA, HMA, RMA, VWMA)
* Three MA Lengths (Fast: 9, Medium: 21, Slow: 50)
* Standard Deviation Bands with 3 levels (1σ, 2σ, 3σ)
* Dynamic band multipliers (adjustable from 0.5 to 5.0)
🎨 Visual Theme System:
* Theme Types: Dark, Light, Pro
* Visual Styles: Quantum, Holographic, Crystalline, Plasma, Nebula
* Visual Intensity Control (20-100%)
* Multi-layer Harmonic Nodes with gradient effects
* Energy Flow Lines based on momentum
* Minimal signal dots for buy/sell conditions
📈 Holographic Dashboard:
* Real-time VWAP position tracking
* MA trend analysis (Bullish/Bearish/Neutral)
* Band position indicator (±1σ, ±2σ, ±3σ)
* Volatility percentage
* Momentum direction
* Current visual theme display
✨ Visual Effects:
* Quantum Fields: Multi-layer boxes with dynamic transparency
* Energy Flow: Momentum-based directional lines
* Gradient Fills: Between bands and MAs
* Borderless Design: Clean, modern appearance
* Emoji Headers: Enhanced visual appeal (⚡ 🌌 📊 🔮)
🎯 Trading Signals:
* Bullish Signal: Close > VWAP AND Close > Fast MA AND Fast MA > Medium MA
* Bearish Signal: Close < VWAP AND Close < Fast MA AND Fast MA < Medium MA
Signalgo BBSignalgo BB: Technical Overview
  
Signalgo BB is a Bollinger Bands (BB) indicator for TradingView, designed to provide a multi-dimensional view of volatility, trend, and trading opportunities within a single overlay. Below is a detailed, impartial explanation of its workings, inputs, and trading logic.
Core Mechanics
Signalgo BB operates on the principle of nested volatility bands and moving averages. It calculates:
Fast & Slow Bands: Two sets of Bollinger Bands (BB), using different moving average types (EMA or SMA), lengths, and standard deviation multipliers.
Volatility Cloud: A dynamic visual layer indicating when price is inside both, one, or neither band.
Filtering: A short-term RSI is used to confirm trend direction and filter out weak signals.
Inputs & Components
MA Type: Choice between EMA, SMA for both fast and slow MA calculations.
Fast/Slow Lengths
Fast/Slow Deviations
RSI Length/Thresholds
Show Cloud: Toggle for the visual volatility cloud.
Signal Mode: Band Break.
Prevent Repeated Signals: Option to suppress duplicate signals in the same direction.
TP/SL & Trailing Logic: Advanced, automated trade management with ATR-based distances, three take-profit levels, and a dynamic trailing stop.
  
Signal Generation
Band Break: Triggers when price crosses the fast BB band.
RSI Filter: All signals require RSI confirmation.
Prevent Repeated Signals: Optionally only marks the first breakout in a series to reduce overtrading.
Entry/Exit Marks: Labels are plotted for visual clarity, and signals can trigger TradingView alerts.
  
Trade Management
Stop Loss (SL): Set at a multiple of ATR from the entry price, adapting to current volatility.
Take Profits (TP1, TP2, TP3): Three levels scaled by risk-reward ratios, supporting partial exits.
Trailing Stop: After the first TP is hit, SL moves to breakeven and then trails at a user-defined multiple of ATR, locking in further gains.
Event Markers: Each TP, SL, and trailing stop event is labeled on the chart.
Direction State: The indicator tracks active trades, allowing for only one open position per direction at a time.
Cloud Visualization: The background color changes depending on whether price is inside both, one, or no bands, making it easier to visualize market conditions.
Multiple Signal Logics: It doesn’t just look at breakouts, it includes cloud crossings, mean reversion, and a choice of how to combine them.
Rigorous Filtering: Signals require RSI trend confirmation, reducing false entries during weak phases.
Automated Trade Management: Built-in TP/SL and trailing logic, dynamically adapting to volatility.
Signal Suppression: Option to prevent repeated signals, reducing noise and overtrading.
Customizable MA Types: Supports EMA, SMA, and a selection algorithm for future expansion.
Trading Strategy Application
Volatility Regimes: The cloud’s color indicates whether price is inside, between, or outside the bands, helping traders identify trending, ranging, or breakout conditions.
Signals: entries can be based on breakouts filtered by RSI trend strength.
Risk Management: All active trades are managed by TP/SL logic, trailing stops after TP1, and visual feedback on exits.
Visual Alerts: Both signals and TP/SL events are marked on the chart for manual review.
  
Flexibility: Users can switch modes or suppress repeated signals as needed, depending on trading style.
Practical Usage
Intraday to Swing: Suitable for timeframes from minutes to days, depending on the MA periods and volatility profile.
Manual or Automated: The visual overlay and alerts support both manual trading and automated strategies.
Education & Review: The colored cloud and event markers make it easy to review past price action and learn from signals.
What separates this indicator from traditional ones:
1. Dual Bollinger Bands
Traditional: Most indicators use a single set of Bollinger Bands (two standard deviations above/below a moving average).
Signalgo BB: Implements two sets of bands—a "fast" set (shorter moving average, narrower deviation) and a "slow" set (longer moving average, wider deviation). This provides both immediate (fast) and broader context (slow) for volatility and price action.
2. Volatility Cloud Visualization
Traditional: Standard Bollinger Bands display as two lines, with the area between sometimes shaded as a "band" but without dynamic color changes.
Signalgo BB: The background is colored differently depending on whether price is within both, one, or neither band, offering a visual "cloud" that distinguishes trending, ranging, or breakout regimes at a glance.
3. RSI Filtering
Traditional: Many indicators either don’t filter signals, or if they do, it’s not always configurable.
Signalgo BB: Adds an optional RSI filter, requiring signals to be confirmed by short-term RSI overbought/oversold conditions. This reduces false signals in range-bound or low-trend environments.
4. Prevention of Repeated Signals
Traditional: Most indicators will keep firing signals as long as conditions are met, which can cause overtrading.
Signalgo BB: Offers a user-toggleable option to suppress repeated signals in the same direction until the opposite signal occurs. This reduces noise for discretionary traders.
5. Integrated Trade Management
Traditional: Manual or separate coding is required for stop-loss, take-profit, and trailing stop logic.
Signalgo BB: Builds in dynamic, ATR-based stop-loss; up to three take-profit levels and a trailing stop that activates after the first TP is hit. All levels are visually plotted on the chart, and events (TP/SL hits) are labeled, aiding strategy review and automation.
6. Event Labeling and Alerts
Traditional: Alerts may exist for entry/exit, but rarely for each TP/SL event.
Signalgo BB: Places labels for every entry, exit, and TP/SL event. It also provides TradingView alertconditions for each event, enabling automated notifications or integration with trading bots.
7. Directional State Tracking
Traditional: Indicators typically do not track the "state" of a trade (e.g., active long/short/flat) beyond simple signals.
Signalgo BB: Maintains persistent variables for entry price, SL, TP, trailing stop, and trade direction, ensuring only one active signal per direction. This prevents overlapping entries and mimics realistic trade management.
8. User Customization
Traditional: Default settings are often hardcoded, or customization is limited.
Signalgo BB: Offers extensive user inputs for MA type and TP/SL logic—making the tool adaptable to many strategies and timeframes.






















