Economic Growth Index (XLY/XLP)Keeping an eye on the macroeconomic environment is an essential part of a successful investing and trading strategy. Piecing together and analysing its complex patterns are important to detect probable changing trends. This may seem complicated, or even better left to experts and gurus, but it’s made a whole lot easier by this indicator, the Economic Growth Index (EGI).
Common sense shows that in an expanding economy, consumers have access to cash and credit in the form of disposable income, and spend it on all sorts of goods, but mainly crap they don’t need (consumer discretionary items). Companies making these goods do well in this phase of the economy, and can charge well for their products.
Conversely, in a contracting economy, disposable income and credit dry up, so demand for consumer discretionary products slows, because people have no choice but to spend what they have on essential goods. Now, companies making staple goods do well, and keep their pricing power.
These dynamics are represented in EGI, which plots the Rate of Change of the Consumer Discretionary ETF (XLY) in relation to the Consumer Staples ETF (XLP). Put simply, green is an expanding phase of the economy, and red shrinking. The signal line is the market, a smoothed RSI of the S&P500. Run this on a Daily timeframe or higher. Check it occasionally to see where the smart money is heading.
Cerca negli script per "长三角ETF技术形态分析(如支撑位、压力位、技术指标)"
Blackrock Spot ETF Premium BTCUSD (COINBASE) V1I created an indicator that takes the spot BTC/USD pair from major exchanges and compares it to the Spot BTC/USD pair on Coinbase that institutions will use for their Spot ETFs.
Blackrock Spot ETF Premium BTCUSD (COINBASE)
I suspect we will see a new "Kimchi Premium" where the Spot ETF pressures from institutions will raise the Coinbase Bitcoin price by a factor of 10-50% premium to the other exchanges.
Naturally excess coins from other exchanges will flow into Coinbase to capture this.
This indicator should be good for some time until one of the other exchanges delist or stop using BTCUSD "spot" If it breaks it I will update it if I remember.
FederalXBT,
Convert ETF to Futures/IndexThis indicator is used to automatically map an ETF's VWAP and 10 levels above and below the strike of your choice, to the futures or index instrument currently being viewed/traded. This works very well when using both SPY to ES/MES/SPX or QQQ to NQ/MNQ/NDX to plot the ETF strikes and can lead to some incredible trades, especially when trading level to level. Since SPY, QQQ, IWM, and DIA have the same price action as their futures iteration, there seems to be a direct correlation between their levels and VWAP . This indicator is made to easily map these key levels to the appropriate futures instrument. If you have a way to measure GEX centered around a certain level, I recommend color coding the lines to help indicate whether the level will have strong positive or negative gamma hedging associated with it.
NIFTY / BANKNIFTY ETF SIP NOTIFIERNIFTY / BANKNIFTY - ETF SIP NOTIFIER
STUDY concept -
- As a market investor, one cannot time the market.
- Specailly, working professionals and job holders don't have time for market tracking.
- The idea of the script is - When Nifty closes below 2% previous day high, market has corrected and it's available at a discount w.r.t. previous day
- One can then invest in NIFTY / BANKNIFTY via ETF option on same or next day.
- If you like this idea, Save this script and add alert condition of this script in NIFTY / BANKNIFTY chart.
- One can get notification on TradingView mobile app or via email when the criteria is met.
- Logic can be applied to investing in INDEXES , NIFTY, BANKNIFTY.
Logic may be improved later.
NOTE - Investing is a serious and risky business. Profit / Loss from this investing idea is sole responsibility of the investor. This script is for education and learning purpose.
Oil ETF VolumeDirexxion Daily has both 'bear' and 'bull' oil ETFs. This tracks the volume in both combined. It also tracks them individually: the bear ETF is the red line, and bull the green.
NOTE: the color of the volume bars is determined by whatever ticker you're currently looking at, and whether current close is gt/lt previous close. It is intended to be used while looking at the USOIL chart. The colors will be inverted if you're looking at the 'bear' ETF! as the higher closes will actually mean price is going down :D
Standardized Leveraged ETF Fund of FlowsThis indicator tracks and standardizes the 3-month fund flows of major leveraged ETFs across different asset classes, including equities, gold, and bonds.
The fund flows are summed over a 3-month period (63 trading days) and then standardized using a 500-day rolling mean and standard deviation.
The resulting normalized fund flow values are plotted in three distinct colors:
Blue for Equities Fund Flows
Yellow for Gold Fund Flows
Green for Bond Fund Flows
CE - 42MACRO Fixed Income and Macro This is Part 2 of 2 from the 42MACRO Recreation Series
However, there will be a bonus Indicator coming soon!
The CE - 42MACRO Fixed Income and Macro Table is a next level Macroeconomic and market analysis indicator.
It aims to provide a probabilistic insight into the market realized GRID Macro regimes,
track a multiplex of important Assets, Indices, Bonds and ETF's to derive extra market insights by showing the most important aggregates and their performance over multiple timeframes... and what that might mean for the whole market direction.
For traders and especially investors, the unique functionalities will be of high value.
Quick guide on how to use it:
docs.google.com
WARNING
By the nature of the macro regimes, the outcomes are more accurate over longer Chart Timeframes (Week to Months).
However, it is also a valuable tool to form an advanced,
market realized, short to medium term bias.
NOTE
This Indicator is intended to be used alongside the 1nd part "CE - 42MACRO Equity Factor"
for a more wholistic approach and higher accuracy.
Methodology:
The Equity Factor Table tracks specifically chosen Assets to identify their performance and add the combined performances together to visualize 42MACRO's GRID Equity Model.
For this it uses the below Assets:
Convertibles ( AMEX:CWB )
Leveraged Loans ( AMEX:BKLN )
High Yield Credit ( AMEX:HYG )
Preferreds ( NASDAQ:PFF )
Emerging Market US$ Bonds ( NASDAQ:EMB )
Long Bond ( NASDAQ:TLT )
5-10yr Treasurys ( NASDAQ:IEF )
5-10yr TIPS ( AMEX:TIP )
0-5yr TIPS ( AMEX:STIP )
EM Local Currency Bonds ( AMEX:EMLC )
BDCs ( AMEX:BIZD )
Barclays Agg ( AMEX:AGG )
Investment Grade Credit ( AMEX:LQD )
MBS ( NASDAQ:MBB )
1-3yr Treasurys ( NASDAQ:SHY )
Bitcoin ( AMEX:BITO )
Industrial Metals ( AMEX:DBB )
Commodities ( AMEX:DBC )
Gold ( AMEX:GLD )
Equity Volatility ( AMEX:VIXM )
Interest Rate Volatility ( AMEX:PFIX )
Energy ( AMEX:USO )
Precious Metals ( AMEX:DBP )
Agriculture ( AMEX:DBA )
US Dollar ( AMEX:UUP )
Inverse US Dollar ( AMEX:UDN )
Functionalities:
Fixed Income and Macro Table
Shows relative market Asset performance
Comes with different Calculation options like RoC,
Sharpe ratio, Sortino ratio, Omega ratio and Normalization
Allows for advanced market (health) performance
Provides the calculated, realized GRID market regimes
Informs about "Risk ON" and "Risk OFF" market states
Visuals - for your best experience only use one (+ BarColoring) at a time:
You can visualize all important metrics:
- GRID regimes of the currently chosen calculation type
- Risk On/Risk Off with background colouring and additional +1/-1 values
- a smoother GRID model
- a smoother Risk On/ Risk Off metric
- Barcoloring for enabled metric of the above
If you have more suggestions, please write me
Fixed Income and Macro:
The visualisation of the relative performance of the different assets provides valuable information about the current market environment and the actual market performance.
It furthermore makes it possible to obtain a deeper understanding of how the interconnected market works and makes it simple to identify the actual market direction,
thus also providing all the information to derive overall market health, market strength or weakness.
Utility:
The Fixed Income and Macro Table is divided in 4 Columns which are the GRID regimes:
Economic Growth:
Goldilocks
Reflation
Economic Contraction:
Inflation
Deflation
Top 5 Fixed Income/ Macro Factors:
Are the values green for a specific Column?
If so then the market reflects the corresponding GRID behavior.
Bottom 5 Fixed Income/ Macro Factors:
Are the values red for a specific Column?
If so then the market reflects the corresponding GRID behavior.
So if we have Goldilocks as current regime we would see green values in the Top 5 Goldilocks Cells and red values in the Bottom 5 Goldilocks Cells.
You will find that Reflation will look similar, as it is also a sign of Economic Growth.
Same is the case for the two Contraction regimes.
******
This Indicator again is based to a majority on 42MACRO's models.
I only brought them into TV and added things on top of it.
If you have questions or need a more in-depth guide DM me.
GM
RSI - S&P Sector ETFsThe script displays RSI of each S&P SPDR Sector ETF
XLB - Materials
XLC - Communications
XLE - Energy
XLF - Financials
XLI - Industrials
XLK - Technology
XLP - Consumer Staples
XLRE - Real Estate
XLU - Utilities
XLV - Healthcare
XLY - Consumer Discretionary
It is meant to identify changes in sector rotation, compare oversold/overbought signals of each sector, and/or any price momentum trading strategy applicable to a trader.
InfoPanel - SeasonalityThis panel will show which is the best month to buy a stock, index or ETF or even a cryptocurrency in the past 5 years.
Script to use only with MONTHLY timeframe.
Thanks to: RicardoSantos for his hard work.
Please use comment section for any feedback.
Guitar Hero [theUltimator5]The Guitar Hero indicator transforms traditional oscillator signals into a visually engaging, game-like display reminiscent of the popular Guitar Hero video game. Instead of standard line plots, this indicator presents oscillator values as colored segments or blocks, making it easier to quickly identify market conditions at a glance.
Choose from 8 different technical oscillators:
RSI (Relative Strength Index)
Stochastic %K
Stochastic %D
Williams %R
CCI (Commodity Channel Index)
MFI (Money Flow Index)
TSI (True Strength Index)
Ultimate Oscillator
Visual Display Modes
1) Boxes Mode : Creates distinct rectangular boxes for each bar, providing a clean, segmented appearance. (default)
This visual display is limited by the amount of box plots that TradingView allows on each indictor, so it will only plot a limited history. If you want to view a similar visual display that has minor breaks between boxes, then use the fill mode.
2) Fill Mode : Uses filled areas between plot boundaries.
Use this mode when you want to view the plots further back in history without the strict drawing limitations.
Five-Level Color-Coded System
The indicator normalizes all oscillator values to a 0-100 scale and categorizes them into five distinct levels:
Level 1 (Red): Very Oversold (0-19)
Level 2 (Orange): Oversold (20-29)
Level 3 (Yellow): Neutral (30-70)
Level 4 (Aqua): Overbought (71-80)
Level 5 (Lime): Very Overbought (81-100)
Customization Options
Signal Parameters
Signal Length: Primary period for oscillator calculation (default: 14)
Signal Length 2: Secondary period for Stochastic %D and TSI (default: 3)
Signal Length 3: Tertiary period for TSI calculation (default: 25)
Display Controls
Show Horizontal Reference Lines: Toggle grid lines for better level identification
Show Information Table: Display current signal type, value, and normalized value
Table Position: Choose from 9 different screen positions for the info table
Display Mode: Switch between Boxes and Fills visualization
Max Bars to Display: Control how many historical bars to show (50-450 range)
Normalization Process
The indicator automatically normalizes different oscillator ranges to a consistent 0-100 scale:
Williams %R: Converts from -100/0 range to 0-100
CCI: Maps typical -300/+300 range to 0-100
TSI: Transforms -100/+100 range to 0-100
Other oscillators: Already use 0-100 scale (RSI, Stochastic, MFI, Ultimate Oscillator)
This was designed as an educational tool
The gamified approach makes learning about oscillators more engaging for new traders.
六-TRAMA6I notice some people like to use different time frames, and will open multiple windows with the same indicators. This takes up space and can become confusing :(
I have created a multi-timeframe TRAMA indicator with adjustable lengths.
Feel free to experiment to find something that works and come up with new uses.
Enjoy! :)
Stochastic RSI + MACD + ADX Here are the conditions
#1 The time scale is same as the overall top chart choice.
#2 The alert should be sent to desktop notification
For Buy Alert
1. The Stochastic RSI is over sold. Meaning less than or equal to 20
2. The MACD signal (orange line) is above MACD
3. ADX <= DI+ and DI- > DI+
Sell Alert
1. The Stochastic RSI is over bought. Meaning above or equal to 80
2. The MACD is above MACD signal (orange line)
3. ADX>= DI+ and DI+ > DI-
Multi Ticker Price Percentage Change TrackerThis script is used to track percentage change of price of selected tickers and raise alert when it passes beyond certain threshold. It is useful for those who want to closely track a few selected tickers.
Trading Macro Windows by BW v2
Trading Macros by BW: Integrating ICT Concepts for Session Analysis
This indicator combines two key Inner Circle Trader (ICT) concepts—Change in State of Delivery (CISD) or Inverted Fair Value Gap (IFVG) signals with Macro Time Windows—to provide a unified tool for analyzing intraday price action, particularly during Pacific Time (PT) sessions. Rather than simply merging existing scripts, this integration creates a cohesive visual framework that highlights how macro consolidation periods interact with potential reversal or continuation signals like CISD or IFVG. By overlaying macro candle styling and borders on the chart alongside selectable signal lines, traders can better contextualize setups within ICT's macro narrative, where price often manipulates liquidity during these windows before displacing toward higher-timeframe objectives.
Core Components and How They Work Together:
Macro Time Windows (Inspired by ICT's Macro Periods):
ICT emphasizes "macro" as 30-minute windows (e.g., 06:45–07:15 PT, 07:45–08:15 PT, up to 11:45–12:15 PT) where price tends to consolidate, sweep liquidity, or form key structures like Fair Value Gaps (FVGs). These periods set the stage for the session's directional bias.
The indicator styles candles within these windows using a user-defined color for wicks, borders, and bodies (translucent for visibility). This visual emphasis helps traders focus on activity inside macros, where reversals or continuations often originate.
Borders are drawn as vertical lines at the start and end of each window (with a +5 minute buffer to capture related activity), using a dotted style by default. This creates a "study zone" that encapsulates macro events, allowing traders to assess if price is respecting or violating these zones in alignment with broader ICT models like the Power of 3 (AMD cycle).
Toggle: "Macro Candles Enabled" (default: true) – Turn off to disable styling and borders if focusing solely on signals.
CISD or IFVG Signals (Selectable Mode):
Mode Selection: Choose between "Change in the State of Delivery" (CISD) or "IFVG" (default: IFVG). Both detect shifts in market delivery during specific 30-minute slices (15–45 or 17–45 minutes past the hour in PT sessions).
CISD Mode: Based on ICT's definition of a sudden directional shift, this identifies aggressive displacements after sweeping recent highs/lows. It uses a rolling reference high/low over 6 bars, checks for sweeps (penetrating by at least 2 ticks in the last 2-3 bars), reclamation (closing beyond the reference with at least 50% body), and displacement (50% of prior range or an immediate FVG of 6+ ticks). Signals plot a horizontal line from the close, extending 24 bars right, labeled "CISD."
IFVG Mode: Focuses on Inverted Fair Value Gaps, where a bullish FVG (low > high by 13+ ticks) forms but is inverted (closed below) in the same slice, signaling bearish intent (or vice versa). This targets violations against opposing liquidity, often leading to raids on external ranges. Signals plot similarly, labeled "IFVG."
Shared Logic: Both modes enforce a 55-bar cooldown to prevent clustering, operate only during PT sessions (06:30–13:00), and use tick-based thresholds for precision across instruments. The integration with macros allows traders to see if signals occur within or at the edges of macro windows, enhancing confirmation—for example, a CISD inside a macro might indicate a manipulated reversal toward the session's true objective.
Toggle: "Signals Enabled" (default: true) – Turn off to hide all signal lines and labels, isolating the macro visualization.
How Components Interact:
Macro windows provide the "narrative context" (consolidation/manipulation), while CISD/IFVG signals detect the "delivery shift" (displacement). Together, they form a mashup that justifies publication: isolated signals can be noisy, but when filtered by macro periods, they align with ICT's session model. For instance, an IFVG inversion during a macro might confirm a liquidity sweep before targeting PD arrays or order blocks.
No external dependencies; all calculations are self-contained using Pine's built-in functions like ta.highest/lowest for references and time-based sessions for windows.
Usage Guidelines:
Apply to intraday charts (e.g., 1-5 min) or stocks during PT hours.
Look for confluence: A bull IFVG signal post-macro low sweep might target the next macro high or daily bias.
Customize colors/styles for signals (solid/dashed/dotted lines) and macros to suit your chart.
Backtest in replay mode to observe how macros frame signals—e.g., price often respects macro borders as S/R.
Limitations: Timezone-fixed to PT (America/Los_Angeles); signals are directional hints, not trade entries. Combine with ICT tools like order blocks or liquidity pools for full setups.
This script draws from community ICT implementations but refines them into a single, purpose-built tool for macro-driven trading, reducing chart clutter while emphasizing interconnected concepts. Feedback welcome!
Above & Below EMA Combined Buy and sell with 35 EMA as a guide. It'll buy below the EMA with MACD crossover and sell at EMA on candle close, unless thats a high volume candle, then will continue in trade. May buy above EMA if momentum and volume are rising.
Simple Moving Averages (8, 50, 100, 200)8 day EMA
50 day SMA
100 day SMA
200 day SMA
Useful for looking at trends in the market, when looking at indices, such as SPY or QQQ
Opening Range Levels ControlSimple indicator to show opening range high and low. Also includes previous day high and low.
Batch Screener Template [YuL]This is a template for a screener that can take a list of any number of tickers (each on its own line), and split them into batches. Then you can choose which batch you want to display on the chart.
Create multiple copies of this indicator to display multiple batches on the same chart.
You can replace expr with your own indicator or expression you'd like to check.
It is also simple enough to add alerts.
Feel free to contact me if you want custom version, my contacts are in profile.
Transfer Function Filter [theUltimator5]The Transfer Function Filter is an engineering style approach to transform the price action on a chart into a frequency, then filter out unwanted signals using Butterworth-style filter approach.
This indicator allows you to analyze market structure by isolating or removing different frequency components of price movement—similar to how engineers filter signals in control systems and electrical circuits.
🔎 Features
Four Filter Types
1) Low Pass Filter – Smooths price data, highlighting long-term trends while filtering out short-term noise. This filter acts similar to an EMA, removing noisy signals, resulting in a smooth curve that follows the price of the stock relative to the filter cutoff settings.
Real world application for low pass filter - Used in power supplies to provide a clean, stable power level.
2) High Pass Filter – Removes slow-moving trends to emphasize short-term volatility and rapid fluctuations. The high pass filter removes the "DC" level of the chart, removing the average price moves and only outputting volatility.
Real world application for high pass filter - Used in audio equalizers to remove low-frequency noise (like rumble) while allowing higher frequencies to pass through, improving sound clarity.
3) Band Pass Filter – Allows signals to plot only within a band of bar ranges. This filter removes the low pass "DC" level and the high pass "high frequency noise spikes" and shows a signal that is effectively a smoothed volatility curve. This acts like a moving average for volatility.
Real world application for band pass filter - Radio stations only allow certain frequency bands so you can change your radio channel by switching which frequency band your filter is set to.
4) Band Stop Filter – Suppresses specific frequency bands (cycles between two cutoffs). This filter allows through the base price moving average, but keeps the high frequency volatility spikes. It allows you to filter out specific time interval price action.
Real world application for band stop filter - If there is prominent frequency signal in the area which can cause unnecessary noise in your system, a band stop filter can cancel out just that frequency so you get everything else
Configurable Parameters
• Cutoff Periods – Define the cycle lengths (in bars) to filter. This is a bit counter-intuitive with the numbering since the higher the bar count on the low-pass filter, the lower the frequency cutoff is. The opposite holds true for the high pass filter.
• Filter Order – Adjust steepness and responsiveness (higher order = sharper filtering, but with more delay).
• Overlay Option – Display Low Pass & Band Stop outputs directly on the price chart, or in a separate pane. This is enabled by default, plotting the filters that mimic moving averages directly onto the chart.
• Source Selection – Apply filters to close, open, high, low, or custom sources.
Histograms for Comparison
• BS–LP Histogram – Shows distance between Band Stop and Low Pass filters.
• BP–HP Histogram – Highlights differences between Band Pass and High Pass filters.
Histograms give the visualization of a pseudo-MACD style indicator
Visual & Informational Aids
• Customizable colors for each filter line.
• Optional zero-line for histogram reference.
• On-chart info table summarizing active filters, cutoff settings, histograms, and filter order.
📊 Use Cases
Trend Detection – Use the Low Pass filter to smooth noise and follow underlying market direction.
Volatility & Cycle Analysis – Apply High Pass or Band Pass to capture shorter-term patterns.
Noise Suppression – Deploy Band Stop to remove specific choppy frequencies.
Momentum Insight – Watch the histograms to spot divergences and relative filter strength.
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.
Multi-Timeframe Bollinger Band PositionBeta version.
My 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.
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.
Changing of the GuardChanging of the Guard (COG) - Advanced Reversal Pattern Indicator
🎯 What It Does
The Changing of the Guard (COG) indicator identifies high-probability reversal setups by detecting specific candlestick patterns that occur at key institutional levels. This indicator combines traditional price action analysis with volume-weighted and moving average confluence to filter out noise and focus on the most reliable trading opportunities.
🔧 Key Features
Multi-Timeframe VWAP Analysis
• Daily VWAP (Gray circles) - Intraday institutional reference
• Weekly VWAP (Yellow circles) - Short-term institutional bias
• Monthly VWAP (Orange circles) - Long-term institutional sentiment
Triple EMA System
• EMA 20 (Blue) - Short-term trend direction
• EMA 50 (Purple) - Medium-term momentum
• EMA 200 (Navy) - Long-term market structure
Adaptive COG Pattern Detection
• 2-Bar Mode: Quick reversal signals for scalping
• 3-Bar Mode: Balanced approach for swing trading (default)
• 4-Bar Mode: Conservative signals for position trading
📊 How It Works
The indicator identifies "changing of the guard" moments when:
1. Pattern Formation: 2-4 consecutive bars show exhaustion in one direction
2. Reversal Confirmation: A counter-trend bar appears with strong momentum
3. Confluence Trigger: The reversal bar crosses through a significant VWAP or EMA level
Bullish COG: Green triangle appears below bars when bearish exhaustion meets bullish reversal at key support
Bearish COG: Red triangle appears above bars when bullish exhaustion meets bearish reversal at key resistance
💡 Trading Applications
Swing Trading: Use 3-bar mode with EMA 50/200 confluence for multi-day holds
Day Trading: Use 2-bar mode with Daily VWAP confluence for intraday reversals
Position Trading: Use 4-bar mode with Monthly VWAP confluence for major trend changes
⚙️ Customization Options
• Toggle VWAP display on/off
• Toggle EMA display on/off
• Toggle COG signals on/off
• Select detection mode (2-bar, 3-bar, 4-bar)
• Built-in alert system for automated notifications
🎨 Visual Design
Clean, professional interface with:
• Subtle dotted lines for VWAPs to avoid chart clutter
• Color-coded EMAs for easy trend identification
• Clear triangle signals that don't obstruct price action
• Customizable display options for different trading styles
📈 Best Practices
• Combine with volume analysis for additional confirmation
• Use higher timeframe bias to filter trade direction
• Consider market structure and support/resistance levels
• Backtest different modes to find optimal settings for your strategy
⚠️ Risk Management
This indicator identifies potential reversal points but should be used with proper risk management. Always consider:
• Overall market trend and structure
• Volume confirmation
• Multiple timeframe analysis
• Appropriate position sizing
Perfect for traders who want to catch reversals at institutional levels with high-probability setups. The confluence requirement ensures you're trading with the smart money, not against it.