HTF Power of 3 (PO3) with Trailing Stop🔵 OVERVIEW
The HTF Power of 3 (PO3) with Trailing Stop is a technical indicator created by BigBeluga to capture institutional market cycles based on Smart Money Concepts (SMC). Detecting market manipulation phases and structural accumulation zones has always been a major challenge in technical analysis, as traditional breakouts often lead to false signals and whipsaw trades. In order to provide a solution to this problem, this indicator maps higher timeframe (HTF) Power of 3 cycles—breaking price action down into Accumulation, Manipulation, and Distribution phases—combined with an advanced volatility-based trailing stop engine.
The indicator aims to visualize institutional order-building and subsequent expansions. The core element of its calculation involves tracking HTF session levels alongside a dynamic ATR-based trailing threshold defined as:
trailingStop = close ± currentAtr * trailMultiplier
where currentAtr is the standard Average True Range of period atrPeriod , and trailMultiplier is the sensitivity footprint multiplier. Higher values of accumMultiplier and trailMultiplier allow the indicator to adjust to longer consolidation periods and filter out minor market noise.
🔵 FEATURES
The system utilizes a multi-layered matrix structure to provide actionable market intelligence:
1 — Auto HTF Matrix Mode & Session Engine
Dynamic Timeframe Scaling: When enabled, the indicator automatically scales the higher timeframe matrix dynamically based on your current chart timeframe context.
Session Tracking: Continuously calculates local open, high, low, and close parameters across higher timeframe layers to project real-time structural candles on the right side of your chart.
2 — Power of 3 (PO3) Phase Breakdown & Peak Labels
Accumulation Phase: Maps the initial consolidation boundary lines over a defined accumMultiplier bar count, outlining the high and low thresholds where institutional orders cluster.
Manipulation Phase & Peak Labels: Triggers automatically when price breaks out of the accumulation boundaries, identifying fakeouts and plotting a peak manipulation label marked with an M at the extreme high or low.
Distribution Phase & Peak Labels: Transitions into the expansion phase once the trailing stop is breached, tracking the final leg of the institutional delivery cycle and plotting a peak distribution label marked with a D .
3 — Dynamic Trailing Stop & Cloud Fill
Volatility Boundaries: Employs a robust ATR trailing line that shifts dynamically to lock in profits and signal shifts in market bias.
Visual Cloud Fills: Dynamically colors and fills the space between price action and the trailing stop line to offer clear visual confirmation of trend direction.
🔵 HOW TO USE
Apart from the basic visualization of institutional market cycles, this tool can also act in alternative ways to support decision-making:
Identify Accumulation Zones: Monitor the orange accumulation channel during the early stages of an HTF session to spot tight consolidation ranges before an expansion.
Trade the Manipulation Breakout: Wait for price to sweep outside the accumulation boundaries to trigger a "Manipulation" label and an M peak marker, signaling an institutional run on liquidity before the true directional move.
Manage Risk with Trailing Stops: Use the dynamic trailing stop line, cloud fill, and subsequent D distribution peak markers as a trailing stop loss mechanism to guide entries, manage open positions, and catch the final distribution leg.
🔵 NOTES
Why this implementation is unique:
It automates complex multi-timeframe ICT concepts directly onto lower timeframe charts without requiring manual chart reconfiguration.
The right-aligned visual projection engine gives traders a clear look at the developing higher timeframe candle and session metrics without cluttering active price history.
The script is fully optimized for Pine Script version 6, integrating seamless label sizing and automated line management for maximum rendering performance.
Indicator

Multi-Timeframe CandlesMULTI-TIMEFRAME CANDLES
WHAT IT IS
Multi-Timeframe Candles is a visual context tool that displays the current (still-forming) candle from higher timeframes directly on your chart, without requiring you to switch the chart's timeframe. Instead of flipping back and forth between 5m, 15m, 1h, 4h, and Daily charts to check what the bigger picture looks like, this indicator brings that information to you in real time, rendered as a small set of candles off to the side of the price action.
The timeframe list is fixed: 5 minutes, 15 minutes, 1 hour, 4 hours, and Daily. The indicator automatically compares each of these against the timeframe you are currently viewing and only draws the ones that are strictly higher. For example, if you are on a 5-minute chart, you will see 15m, 1h, 4h, and D. If you are on a 1-hour chart, you will only see 4h and D, since 5m and 15m are no longer higher timeframes relative to your current view. This keeps the display relevant no matter which timeframe you trade on.
WHAT IT IS MADE OF
Each higher timeframe is represented by a single candle, built from three drawing elements:
- A rectangular body showing the open and close of that timeframe's current candle, colored green (bullish) if close is greater than or equal to open, or red (bearish) otherwise.
- A thin vertical wick showing the full high-to-low range of that timeframe's current candle.
- A text label positioned below the candle, identifying which timeframe it represents (5m, 15m, 1h, 4h, or D).
These candles are placed in a horizontal row to the right of your current price action, spaced evenly apart, ordered from the smallest qualifying timeframe to the largest (left to right). They update live as price moves, since each candle reflects the still-forming candle of its respective timeframe, not a closed historical one.
HOW TO READ IT
Each candle should be read exactly like you would read it on its native timeframe's chart:
- A green candle means that timeframe is currently trading above where it opened — net bullish pressure so far on that timeframe.
- A red candle means that timeframe is currently trading below where it opened — net bearish pressure so far on that timeframe.
- The length of the wick relative to the body tells you about volatility and rejection within that timeframe's current candle: a long wick with a small body suggests indecision or a strong intra-candle reversal, while a large body with short wicks suggests a strong, decisive directional move.
- Comparing the candles across timeframes side by side lets you quickly judge alignment: if your lower timeframe and the higher timeframes are all the same color, you have multi-timeframe confluence in one direction. If they disagree (e.g., the 5m candle is red while the 4h and Daily candles are green), you are likely looking at a short-term pullback or reaction within a larger prevailing trend, which carries very different implications than a same-direction move.
HOW TO USE IT
This indicator is meant purely as a contextual reference, not a standalone signal generator. The intended use is:
1. Stay on your working timeframe (the one you actually use for entries, e.g., 1m or 5m).
2. Glance at the row of higher-timeframe candles to instantly understand where price stands relative to the open of each larger timeframe, without needing to switch charts and lose your current view, drawings, or zoom level.
3. Use this context to filter or qualify setups on your working timeframe. For example, a bullish setup on a lower timeframe may carry more weight if the higher timeframe candles are also green, indicating you are trading with the larger trend rather than against it.
4. Use it to anticipate behavior near higher-timeframe candle opens, since price often reacts around these levels even when they are not explicitly plotted as horizontal lines.
All visual aspects (candle width, spacing between candles, distance from the last bar on the chart, bullish/bearish colors, and label size) are configurable through the indicator's settings panel to fit your chart layout and personal style. Indicator

Indicator

RSI MTF Dashboard + RSI/ATR-Based Volatility ZonesRSI MTF (multi-timeframe) Dashboard + RSI/ATR-Based Volatility Zones is a multi-timeframe RSI alignment dashboard built to connect RSI structure, timeframe agreement, and chart-side price context into one organized workflow. Instead of treating RSI as a single value on one timeframe, this script reads RSI across a full stack of timeframes and organizes that information into a compact table, a chart-side Stack Trend, an ATR-based envelope, a bottom-pinned bias strip, optional RSI-colored candles, and localized Bull/Bear pressure markers. The goal is to make it easier to see whether the broader RSI timeframe stack is supporting price, resisting price, mixed, or transitioning.
At the center of the script is the MTF RSI table. The table can display timeframe rows from 1 minute through monthly, with each row showing:
➡️ Current RSI
➡️ Current RSI vs Previous RSI
➡️ RSI SMA 20
➡️ RSI SMA 50
➡️ SMA slope arrows
➡️ Live bar timer information
➡️Lower-timeframe and higher-timeframe RSI averages
RSI is often more useful when read as a set of relationships instead of one isolated number. A single RSI value can show strength or weakness, but RSI in relation to its prior value, RSI SMA 20, RSI SMA 50, and higher timeframe context gives a cleaner view of whether momentum is building, fading, rotating, or staying aligned.
The chart-side MTF RSI Stack Trend is where the table becomes more than just a dashboard.
Each enabled timeframe row contributes to a full-stack RSI bias score using four relationships:
➡️ Current RSI regime
➡️ Current RSI vs Previous RSI
➡️ Current RSI vs RSI SMA 20
➡️ Current RSI vs RSI SMA 50
Those scores are combined into one MTF Stack Bias reading. When the stack leans bullish, the Stack Trend can project below price like a support-style trail. When the stack leans bearish, it can project above price like a resistance-style trail. When the stack is mixed or transitioning, the trail can fall back into a neutral state. That gives the chart one clean read of the broader RSI stack instead of forcing the user to mentally combine every row in the table.
The MTF Stack ATR Envelope expands that idea into a broader volatility zone. The envelope is built around the Stack Trend system and can reference the chart Stack Trend, a higher-timeframe Stack Trend, or the midpoint between both. This creates a volatility-adjusted zone around the broader RSI stack context.
The practical use is to help answer questions like:
➡️ Is price stretched away from the active RSI stack trail?
➡️ Is price trading inside the broader stack envelope?
➡️ Is the chart trail aligned with the higher-timeframe trail?
➡️ Is the stack acting more like support, resistance, or transition?
The MTF Stack Bias Trend Strip gives another view of the same engine. Instead of projecting the stack onto price, the strip shows the raw MTF Stack Bias as a compact gradient along the bottom of the chart.
This makes it easier to see when the broader stack is:
➡️ strengthening bullish
➡️ strengthening bearish
➡️ fading back toward neutral
➡️ chopping through mixed conditions
➡️ transitioning from one regime to another
The color behavior is intentionally visual. Stronger bullish readings can push toward yellow/orange, stronger bearish readings can push toward purple/extreme purple, and mixed readings stay closer to neutral.
The optional RSI Trend Candle Overlay brings the RSI color engine directly onto the main chart. Price candles still keep normal OHLC structure, but their body, wick, and border colors can reflect the current chart-timeframe RSI state. This makes it easier to see RSI strength, weakness, stretch, or neutrality without constantly checking a separate pane.
The Bull/Bear markers add a more localized pressure layer. These markers use a Price Action-style adaptive overbought/oversold engine built from a short Wilder-style high/low channel and adaptive trigger levels. They can be shown as raw pressure markers or filtered so bullish markers only appear during bullish stack regimes and bearish markers only appear during bearish stack regimes.
A practical way to read the script:
➡️ If the table rows are broadly bullish, RSI is above its moving-average references, and the Stack Trend is holding below price, the RSI timeframe stack is generally supporting the move.
➡️ If the table rows are broadly bearish, RSI is below its moving-average references, and the Stack Trend is pressing above price, the RSI timeframe stack is generally acting more like resistance.
➡️ If the table rows disagree, the trend strip fades toward neutral, or price is moving back through the envelope, the market may be transitioning or losing clean RSI alignment.
➡️ If the Bull/Bear markers agree with the active Stack Trend regime, they may help highlight localized pressure in the same direction as the broader RSI stack.
➡️ If the markers, candles, table, trail, and trend strip disagree, that disagreement can be useful information by itself because it often points to chop, cooling momentum, or a less directional environment.
The value of RSI MTF Table + ATR Envelope Trend is organization. It takes RSI behavior across multiple timeframes and turns it into a connected chart-side framework: table detail, stack bias, trail behavior, volatility zones, candle context, trend strip pressure, and localized markers. While this script is not meant to be a standalone buy/sell signal machine, it certainly has the necessary components and features to be just that once you learn its behavior over multiple timeframes. Used alongside oscillator, pressure, pivot-structure, and divergence tools, this script can also serve as a higher-level RSI alignment dashboard. The table and trend strip help answer whether the broader RSI stack is supporting, resisting, mixed, or transitioning, while companion tools can provide more detailed oscillator-side structure, pressure, pivots, and divergence context.
Attribution: this script uses SimpleCryptoLife library helpers for timeframe formatting and higher-timeframe stabilization. Some color-engine concepts, compact transparency-helper style, tiered RSI-style trend-color mapping, and PA-style overbought/oversold triangle concepts were inspired by ideas from SimpleCryptoLife’s open-source Price Action Trend work.
💥Chart examples💥
➖Bullish structure expectation➖
For this setup to continue developing, I want to see price reclaim the purple chart Stack Trend first, then begin working back toward the blue HTF Stack Trend.
The key idea is progression:
Price is still trading below both Stack Trend references, so the broader RSI stack is not fully supportive yet. A stronger bullish shift would start with price reclaiming the faster chart-side Stack Trend, then holding above it while the HTF Stack Trend begins to flatten or move underneath price.
What I’m watching:
• Price reclaiming the purple Stack Trend
• Purple Stack Trend turning back into support
• Yellow Stack Trend / envelope behavior improving underneath price
• Blue HTF Stack Trend flattening or moving below price
• Price holding above the prior local structure zone
Until that happens, rallies into the purple/blue Stack Trend area are still tests of resistance, not confirmed bullish structure.
➖Follow up to the above chart (Bullish structure follow-through)➖
This is the progression we wanted to see from the prior setup. Earlier, price was still below both the chart Stack Trend and the HTF Stack Trend, so the bullish structure was only an expectation — not confirmation yet. Now price has started to work back into the Stack Trend zone. The short-term RSI rows are strengthening, the bottom Stack Bias strip is shifting back into warmer pressure, and price is pushing into the same area that previously needed to be reclaimed.
The key improvement:
Price is no longer simply fading below the Stack Trend structure. It is actively testing the trail/envelope area from underneath and beginning to show the early signs of a bullish reclaim attempt.
What still matters next:
Price needs to hold above the faster chart-side Stack Trend and continue working toward the blue HTF Stack Trend. If that area flips from resistance into support, the bullish structure becomes much cleaner.
Until then, this is a bullish attempt in progress — stronger than the prior chart, but still needing confirmation above the broader HTF Stack Trend zone.
➖Repeated Stack Trend failure pattern➖
Price repeatedly loses the faster yellow/chart Stack Trend, then attempts to recover back into the purple/blue Stack Trend zone.
When price cannot reclaim that upper Stack Trend structure, the purple trail begins acting like resistance and price fades back underneath it.
The key read is progression: yellow weakness first, then failed reclaim into purple/blue resistance, followed by bearish continuation if price cannot push back above the broader Stack Trend stack.
➖Bullish Stack Trend support structure➖
This is the stronger version of the bullish reclaim pattern. Price first works above the faster chart Stack Trend, then the trail begins holding underneath price instead of acting as resistance. As the move expands, the broader blue HTF Stack Trend also lifts below price, giving the rally higher-timeframe support.
The key read:
Yellow/chart Stack Trend supports first, then the HTF Stack Trend confirms underneath. When price holds above both, the RSI stack structure shifts from recovery attempt into stronger bullish continuation.
➖Bearish Stack Trend rejection➖
Price attempted to recover back into the chart Stack Trend, but the broader blue HTF Stack Trend stayed overhead the entire time.
That kept the move capped. Once price failed to reclaim and hold above the purple trail, the Stack Trend structure shifted back into resistance and price faded lower.
The key read:
A bounce into the chart trail is not enough by itself. If the HTF Stack Trend remains above price, the broader RSI stack can still act like overhead resistance.
➖MTF Stack Bias Trend Strip➖
Yellow/orange shows stronger bullish stack pressure, purple shows stronger bearish stack pressure, and muted/gray transition areas show the stack moving through mixed conditions.
The key read:
The strip gives a quick visual summary of the broader RSI environment underneath price — making it easier to see when the market is trading with bullish pressure, bearish pressure, or shifting between regimes.
Indicator

RSI Trend Dashboard + SMMA Channel OverlayAt its core, this script is an RSI trend framework designed to organize momentum into a compact dashboard that is easy to read at a glance, while also extending that same logic back onto the main chart through an optional SMMA-style channel overlay. Instead of treating RSI as just a single line crossing fixed levels, this script breaks it into a layered structure: current RSI state, higher-timeframe comparison, fast and slow RSI average relationships, and a summarized fast-vs-slow regime table view. The goal is not simply to show whether RSI is high or low but to create a cleaner way to read momentum alignment, trend agreement, and chart-side context from one unified engine.
The foundation of the script is the 5-row RSI trend strip. That strip is built to answer a practical set of questions quickly:
Is RSI in a bullish, bearish, or neutral zone?
Is chart RSI above or below its higher-timeframe RSI reference?
Is RSI above or below its fast average?
Is RSI above or below its slow average?
And is the fast average currently above or below the slow average?
That matters because momentum is often easier to interpret as a stack of relationships instead of as one isolated value. A single RSI print can be helpful, but RSI in relation to HTF RSI, fast structure, and slow structure often gives a better read on whether momentum is strengthening, weakening, or starting to rotate.
The added features here are not meant to feel bolted on. They are different ways of reading the same momentum structure. In this script, that includes:
➖ a 5-row trend strip
➖ a stabilized higher-timeframe RSI comparison
➖ fast and slow RSI average relation rows
➖ a fast-vs-slow summary row
➖ a compact dashboard table with current values, bar-to-bar deltas, and slope arrows
➖ an optional RSI-colored price candle overlay
➖ an optional Trend SMMA Channel Overlay on the main chart
➖ an optional smoothed OHLC4 price-average line used to color the channel
➖ optional bullish and bearish triangle markers derived from the overlay engine
The dashboard table is there to keep the same engine readable in a more precise format. The pane gives the fast visual impression. The table gives the actual current readings: rounded values, simple deltas, and short slope arrows so the trader can see not only where RSI and its companion series are, but whether they are currently improving, fading, or flattening. I like that combination because it keeps the script visual first, but still lets you confirm the details without needing to inspect each series manually.
The higher-timeframe layer is an important part of the script. Rather than leaving RSI fully isolated to the local chart, this indicator compares the chart RSI against the next logical higher timeframe so traders can quickly judge whether local momentum is aligned with broader context or starting to separate from it. The script uses SimpleCryptoLife’s HighTimeframeSampling library to stabilize that HTF reference series, which helps keep the higher-timeframe comparison cleaner and more reliable in live use.
The chart-side Trend SMMA Channel Overlay serves a different purpose. While the pane organizes RSI structure, the overlay projects a smoother trend context directly onto price using Wilder-style smoothed high and low boundaries, along with an optional smoothed OHLC4 price-average line. That creates a second way to read the same market: the pane shows internal momentum relationships, while the chart overlay helps show whether smoothed price-average behavior is pressing above the channel, below it, or back inside it. In other words, the pane gives the momentum-state view and the chart gives the price-structure view.
This script also uses auto timeframe length resolvers for the main chart-side overlay tools, which I think makes it more practical across different chart speeds. Instead of forcing users to constantly retune multiple lengths when moving from lower timeframes to higher ones, the script can automatically resolve separate preset lengths for the Trend SMMA channel, the OHLC4 price-average line, and the bullish/bearish triangle engine. Manual controls are still available, but the default design is meant to stay more adaptive and chart-friendly out of the box.
A practical way to think about it:
➡️ If RSI is strong, above HTF RSI, and above both fast and slow averages, momentum is generally aligned in the bullish direction.
➡️ If RSI is weak, below HTF RSI, and below both fast and slow averages, momentum is generally aligned in the bearish direction.
➡️ If the rows begin to disagree with each other, that often signals transition, cooling, or a market that is no longer moving with the same clean momentum structure.
➡️ If the Trend SMMA overlay is also pushing outside its channel in the same direction, that can help reinforce what the pane is already suggesting.
➡️ If the pane and chart overlay begin to disagree, that can be a useful sign that trend strength may be losing alignment.
This is not meant to predict reversals by itself, and I would not treat it as a stand-alone signal machine. The way I use it is more practical:
➖ to judge whether RSI momentum is aligned or mixed
➖ to compare local RSI behavior against higher-timeframe context
➖ to see whether fast and slow momentum structure are still confirming each other
➖ to keep pane-space momentum and chart-space trend context visually connected
That overall framing is very similar to the way my previous Chandelier and Heikin Ashi publishings were written: one central engine, then multiple companion layers that help interpret the same underlying structure rather than replacing it with unrelated tools.
Bar Replay is especially useful here. Watching the strip build one bar at a time makes it much easier to see when RSI shifts from neutral into directional territory, when chart RSI moves above or below its HTF reference, when the fast/slow relationship changes, and how the chart-side SMMA overlay responds as price-average behavior moves through the channel. Scripts like this are often easier to understand dynamically than from a single static screenshot.
Like most momentum tools, this works best with confluence. I would not use it in isolation. Structure, volume, support and resistance, price action, market regime, and higher-timeframe context all still matter. The value of this script is not that it replaces those tools. The value is that it gives RSI a more organized dashboard-style expression while also extending that same read onto the main chart through a cleaner trend overlay.
Credit where it’s due: this script uses SimpleCryptoLife’s HighTimeframeSampling library for the stabilized HTF reference, and portions of the Trend SMMA channel, OHLC4 price-average interaction, and bullish/bearish triangle logic were adapted from concepts used in SimpleCryptoLife’s open-source Price Action Trend work. I always want that lineage to be clear, especially when chart-side concepts have been reworked into a different script and broader dashboard framework.
Indicator

Indicator

Indicator

Z-EMA Fusion BandsDesigned with crypto markets in mind, particularly Bitcoin , it builds on the concept that the 1-Week 50 EMA often serves as a long-term bull/bear market threshold — an area where institutional bias, momentum shifts, and cyclical rotations tend to occur.
🔹 Core Components & Synergies:
1. 1W 50 EMA (Higher Timeframe)
- This EMA is calculated on a weekly timeframe, regardless of your current chart.
- In crypto, price above the 1W 50 EMA typically aligns with long-term bull market phases, while extended periods below can signify bearish macro structure.
- The slope of the EMA is also analyzed to add directional confidence to trend strength.
2. ±1 Standard Deviation Bands
- Surrounding the 50 EMA, these bands visualize normal price dispersion relative to trend.
- When price consistently hugs or breaks outside these bands, it often reflects market expansion, volatility events, or mean-reversion opportunity.
3. Z-Score Gradient Fill
- The area between the bands is filled using a Z-score-based gradient, which dynamically adjusts color based on how far price is from the EMA (in terms of standard deviations).
- Color shifts from aqua (near EMA) to fuchsia (far from EMA) help you spot price compression, equilibrium, or overextension at a glance.
- The fill also uses transparency scaling, making it fade as price stretches further, emphasizing the core structure.
4. Directional EMA Coloring
- The EMA line itself is colored based on:
- The slope of the EMA (rising/falling)
- Whether the HTF candle is bullish or bearish
- This provides intuitive color-coded confirmation of momentum alignment or potential exhaustion.
5. Price/EMA Divergence Detection
- The script detects bullish and bearish divergence between price and the EMA (rather than using a traditional oscillator).
- Bullish Divergence: Price makes a lower low, EMA makes a higher low.
- Bearish Divergence: Price makes a higher high, EMA makes a lower high.
- These signals often mark transitional zones where momentum fades before a trend reversal or correction.
📊 Suggested Uses:
🔸 Swing and Position Trading:
- Use the 1W 50 EMA as a macro-trend anchor.
- Stay long-biased when price is above with positive slope, and short-biased when below.
- Consider entries near band edges for mean-reversion plays, especially if confluence forms with divergence signals.
🔸 Volatility-Based Filtering:
- Use the Z-score fill to identify volatility compression (near EMA) or expansion (edge of bands).
- Combine this with breakout strategies or dynamic position sizing.
🔸 Divergence Confirmation:
- Combine divergence markers with HTF EMA slope for high-probability setups.
- Bullish div + EMA flattening/rising can signal the start of accumulation after a macro dip.
🔸 Multi-Timeframe Analysis:
- Works well as a structural overlay on intraday charts (1H, 4H, 1D).
- Use this indicator to track long-term bias while executing lower timeframe trades.
⚠️ Disclaimer:
This indicator is designed for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any asset.
Always use proper risk management, and combine with your own analysis, tools, and strategy. Performance in past market conditions does not guarantee future results. Indicator

Trend Strength IndicatorThis is a Trend Strength Indicator that shows you the immediate trend and historical trend of price for up to 7 higher timeframes.
It shows the strength of each timeframe by showing a red or green dot based on where price is at compared to the previous higher timeframe candle. The brighter red or green the dot is, the stronger the trend is compared to that higher timeframe candle.
The colors and timeframes can be customized to suit your preference and you can also turn off as many timeframes as you’d like if you want less time frames to show up on the indicator.
It also includes alerts for when all timeframes are bullish or all timeframes are bearish.
Keep these timeframes set to higher time frames than your chart so you can trade in the direction of the overall higher timeframe trend.
Bullish Scoring & Colors
If the current candle close is above the midline of the higher time frame candle, it is given a score of 1 and a dark green dot. If the current candle close is above the higher timeframe candle body, then it is given a score of 2 and a medium green dot. If the current candle close is above the high of the higher time frame candle, it is given a score of 3 and a bright green dot.
The higher the score the stronger the bullish trend and the brighter green the dot will be.
Bearish Scoring & Colors
If the current candle close is below the midline of the higher timeframe candle, it is given a score of -1 and a dark red dot. If the current candle close is below the higher timeframe candle body, then it is given a score of -2 and a medium red dot. If the current candle close is below the low of the higher timeframe candle, it is given a score of -3 and a bright red dot.
The lower the score, the stronger the bearish trend and the brighter red the dot will be.
Trend Scoring Modes
We gave you the option to set the trend scoring mode to either score based on price above or below the midline for quick and easy trend identification, or using the midline, candle body and highs and lows to give you a more detailed view of the trend strength. You can switch between these modes by selecting your preferred mode in the settings panel. The default is Open, High, Low, Close + Midline.
Sending Trend Direction To External Indicators
We coded in the ability to use the trend strength score as a signal that you can use to filter other indicators. This feature is great for notifying signal generating indicators what direction the market is trending in so that the signal generating indicator only gives signals in the direction of the trend.
This feature works by providing a data output of 1, 0 or -1. 1 means the trend is bullish, 0 means the trend is neutral and -1 means the trend is bearish.
This score is calculated by using the score of each timeframe that is turned on and checking if all timeframes are in the same direction or not. So if 3 timeframes are turned on and they are all bullish, the indicator will provide a data output of 1. This tells your external indicators that the trend is bullish.
This data output can be found in the data window and is labeled Trend Direction To Send To External Indicators.
At the bottom of the settings panel, there is a setting called Trend Score Threshold For External Indicators. This setting is the score threshold that all timeframes will need to meet to allow a trend strength signal to go through. So if set to 1, then all timeframes must be scored 1 or higher for bullish or -1 or lower for bearish. If set to 2, then all timeframes must be 2 or higher for bullish or -2 or lower for bearish. If set to 3, then all timeframes must be 3 for bullish or -3 for bearish. If all timeframes have met this threshold, then a bullish or bearish signal can be sent to your external indicator as a trend filter.
Labels
There are labels to the right of each row of dots, telling you which timeframe is which so you can easily identify what timeframe each row is showing the trend for.
Alerts
You can set alerts for when all timeframes are bullish or when all timeframes are bearish. If you have some time frames turned off at the time of creating your alerts, then it will only require all timeframes that are on to be all bullish or bearish to generate an alert. Make sure to set your alerts to once per bar close to ensure you don’t get premature alerts that aren’t yet valid.
Backtesting
This indicator helps you quickly identify and backtest the trend direction, how strong that trend is on multiple timeframes and helps you spot reversals and trend continuations. Make sure you look back at a lot of historical data to see how price moves when trend changes take place and how well price continues in each direction compared to the overall trend. This will help you gain confidence in reading the indicator and using it to your advantage when trading.
Best Way To Use The Indicator
This indicator is designed to help you quickly identify the trend on various different timeframes. The brighter the green dots are, the stronger the bullish trend is. The brighter the red dots are, the stronger the bearish trend is.
Trade in the direction of the trend. If the colors are mixed green and red, then price is likely to chop back and forth, so only trade the extremes of the ranges when that happens.
When most of the lower timeframe dots are the same color, that means it is a strong trend and you should place trades in the direction of the trend to be safe. The lower timeframes will start trending before the higher timeframes, so take notice of the lower timeframe colors starting to agree with each other and then take advantage of the trend that is forming.
You can also spot reversals with this indicator by watching for the lower timeframes to start changing color after a strong trend in one direction. The lower timeframes will start to change color one by one, indicating that the trend is actually changing direction.
For best results, make sure you wait for the trend to show all bullish or all bearish at the same time before you place any trades. If you can be patient enough to do that, you will increase the probability of winning your trade because you are trading with the direction of the overall higher timeframe trend which is typically an easy way to win more trades. Of course wait for pullbacks during the trend so you can keep a tight stop loss after entering your trade.
If you are scalping, you can turn off the higher timeframes and just use the 1 hour through 1 day. This won’t be as reliable as using all timeframes and waiting for them to align, but it is suitable for scalping quick intraday movements.
Other Indicators To Pair This With
Use this in combination with our Higher Timeframe Candle Levels indicator so you can see all of these levels being used to calculate the trend strength scores and watch how price reacts to those levels. You should also use our Breakout Scanner to find other markets with strong trends so you always know which market is trending the strongest and can trade those. Trend Strength Indicator, Higher Timeframe Candle Levels and the Breakout Scanner all use the same levels and calculate the trend scores the same way so they are designed to work all together to help you quickly be able to read a chart and find what direction to trade in. Indicator

Higher Timeframe Candle LevelsThis is an indicator that shows higher time frame candle levels from various preset timeframes. These higher time frame candles act as support and resistance levels, so look for reversals and continuations off of these levels. When price exceeds the high or low of these levels, you should look for breakouts in the same direction and trade with the trend.
It includes candle levels for the following timeframes: 1 hour, 4 hour, 1 day, 1 week, 1 month, 1 quarter and 1 year. The indicator also includes a trend candle coloring feature, trend strength scoring table, stop loss feature, line identification labels, alerts for trend changes, alerts for level touches and full customization of all options.
How To Trade With This Indicator
These higher timeframe candle levels will act as support and resistance levels, so look for price to react at any of the levels you have turned on and then look for potential bounce or reversal signs at those levels so you can trade those direction changes. Price outside of the higher timeframe candle highs and low typically signals a breakout as well, so look for price to continue after passing the highs or lows.
You can use the direction of the higher timeframe candles as your trend as well. Try to only trade in the direction of the trend of the higher timeframes to increase the likelihood of your trade going in your favor.
The highs and lows of daily and up levels are excellent levels to find quick reversal off of. Watch for price action to struggle to break through these levels and then trade the reversal. If price breaks through these levels easily, watch for price to retest the level and then continue beyond that level. Trade the retest in the direction of the trend.
The open, close and midline levels are excellent for trading bounces. Watch for price to form wicks beyond these levels and close on the other side and use that as a sign that price may bounce there. Use that with price action to confirm your trade and then take trades off of those level bounces.
Use the alerts for daily and up timeframe level touches across all of your favorite markets so that way you are always notified in real time when price is at a level that could provide a potential trading opportunity.
Higher Time Frame Candle Levels
The indicator shows the current candle open, previous open, previous high, previous low, previous close and previous candle body midline levels of each candle for each time frame. This helps you easily see what is going on with the higher time frame candles and read the price action from your lower time frame charts.
Each candle level will paint red if it was a down candle or green if it was an up candle, except the midlines and current candle open lines, those are a different color for easy differentiation. The line colors can be customized to your preferences in the settings and you can also toggle the candle body coloring on or off, as well as change the color of the candle body background.
Each timeframe can be adjusted to your preferences, allowing you to turn all of the levels on or off. You can also adjust how many previous candles show up on your chart so you can backtest it and see for yourself how accurate these levels are.
When adjusting the number of candles, you will get a notification if you have more than 500 lines turned on, so just turn down the number of levels for whatever timeframe you can’t see on your chart to lower that number below 500. The notification will go away once you are under 500 lines again. Each candle has 6 lines if all levels are turned on for that timeframe: open, current candle open, close, high, low and midline. The default settings keep you under 500 lines total, so just be aware of that limitation when adjusting those numbers and adjust the number of levels down on the timeframes that are not useful on the current chart bar.
You can also extend the levels right on any time frame from the daily levels and above. This is useful when price is breaking above or below all levels and you need to know if there are any other previous candle levels in the way as price moves away from the most recent higher time frame candles.
To understand the intraday trend of each higher time frame, look to see where price is at according to each higher time frame candle. If the price is above the midline of the candle, it is bullish. If the price is above the candle body it is more bullish. If the price is above the high, it is very bullish. If the price is below the midline of the candle, it is bearish. If the price is below the candle body it is more bearish. If the price is below the low, it is very bearish. Make sure you backtest this yourself and go through lots of historical data to get a feel for how price reacts to these levels and establishes the trend. Then use that trend information to your advantage and trade in the direction of the trend.
Since users are limited to a certain amount of historical bars based on which Tradingview plan you have, some longer timeframe levels won’t show up because the start of that candle is too far back in history. You will get a notification at the top of that chart if that happens. It will tell you to lower the display timeframe for that timeframe until that notification goes away, which means it was able to plot the most recent candle for that timeframe on your chart.
Trend Candle Coloring
The indicator includes a feature that paints the candles based on whether the current time frame candles are above or below the most recent midline, candle body or high & low of a higher time frame candle of your choice. This helps you see the overall trend of the higher timeframe so you can trade with the trend.
The candle coloring will have an up color, down color and neutral color which can all be customized to suit your preferences. If the current time frame candle close is above the setting you choose, it will show the up color. If the current time frame candle close is below the setting you choose, it will show the down color. If the current time frame candle close is equal to or in the middle of the setting you chose, it will show the neutral color.
So, for example if you set it to candle body, then it will show the up color if the current candle is above the top of the candle body, down color if it is below the bottom of the candle body and neutral color if it is inside the candle body. This helps you wait for price action to move beyond the inside of the previous higher time frame candle before taking a position when price is breaking out of that previous candle so you can trade the momentum of that move. The candle coloring is fully customizable, but make sure to turn off your candle coloring on other indicators and your chart settings for it to show up properly.
Trend Strength Scoring Table
The trend strength scoring table displays a table at the bottom of the screen(table position is customizable), showing a score for the trend strength of each higher time frame. If the current candle close is above the midline, its strength is 1. If the current candle close is above the midline, but below the top of the candle body, its strength is 2. If the current candle close is above the high, its strength is 3. The same goes for below the midline, bottom of the candle body and below the low, but the scores would be negative 1, 2 or 3 instead.
This trend strength table allows you to quickly identify the trend on each higher time frame so you can wait until the trend is the same across all time frames before placing a trade in the direction of the trend. It also shows a total score on the far right side that adds all of the current trend scores together to give you a total strength score. Try to only trade when that number is very high compared to how many time frames you have turned on. Each time frame can have up to a maximum score of 3 if bullish and -3 if bearish. Each time frame in the table can be turned on or off to suit your preferences.
Stop Loss Feature
There is also a stop loss feature that you can set to whatever time frame you choose and whatever direction you chose, such as long or short. It will follow the most recent higher time frame candle’s trend using one of the following settings: candle body, high & low or midline. Once a new higher time frame candle is created, the stop loss will update to the most recent candle’s levels so you can use these levels as a trailing stop loss to maximize your wins.
If you have it set to use the candle body and it is set to long mode, then the stop loss will use the previous higher time frame candle’s lowest candle body level. So if it was an up candle previously, it will use the open. If it was a down candle previously, it will use the close. The opposite is true for short positions.
The stop loss will start working once you turn it on in the settings and will update automatically as new higher time frame candles are formed. It also shows a line of where the stop loss was previously since it was turned on.
I recommend using the high & low setting, especially when the market starts trending.
Candle Level Identification Labels
There are labels for each level starting with the 4 hour time frame and above so you can easily tell what level of each candle you are looking at, even if the rest of the candle is not showing within the chart pane. You can customize the label coloring for up candles and down candles and midlines as well as adjust the number of bars that the labels are offset from the current bar so they are visible on your chart without overlapping the current price action or other indicator labels. Labels for each time frame can be turned on or off as needed. The 1 hour labels were not included because it clogs up the chart, but it has labels for all time frames from the 4 hour candles and up.
Alerts
The indicator includes alerts for when the trend has changed to the opposite direction. The trend change alert is based on your settings for the Trend Candle Coloring. Whatever settings you have the trend candle coloring set to, will be used to set up your alerts. The Trend Candle Coloring setting must be turned on as well when creating your alerts for it to work properly. Make sure to backtest your settings and then create your alerts.
It also has alerts for when price is touching an open or close, high or low, midline or any of those levels for each timeframe. This allows you to be notified when price touches one of these levels so you can check the chart and look for potential trade opportunities if price wants to bounce off of that level. To make it easy for you to get alerts on many different tickers, just use the alert for any level touch on whatever timeframes you want.
Other Indicators To Pair This With
Use this in combination with our Trend Strength Indicator so you can visually see the historic and current trend for all of these levels. You should also use our Breakout Scanner to find other markets with strong trends so you always know which market is trending the strongest and can trade those. Trend Strength Indicator, Higher Timeframe Candle Levels and the Breakout Scanner all use the same levels and calculate the trend scores the same way so they are designed to work together to help you quickly be able to read a chart and find what direction to trade in. Indicator

VWAP Multi-TimeframeThis is a multi-timeframe VWAP indicator that provides volume weighted average price calculations for the following time periods:
15min
30min
1H
2H
4H
6H
8H
12H
1D
1W
1M
3M
6M
1Y
You can use the lower timeframes for short term trend control areas and use the longer timeframes for long term trend control areas. Trade in the direction of the trend and watch for price reactions that you can trade when price gets close to or touches any of these levels.
This indicator will provide a data plot value of 1 for bullish when price is above all VWAPs that are turned on, -1 for bearish when price is below all VWAPs that are turned on and 0 for neutral when price is not above or below all VWAPs. Use this 1, -1, 0 value as a filter on your signal generating indicators so that you can prevent signals from coming in unless they are in the same direction as the VWAP trend.
Features
Trend direction value of 1, -1 or 0 to send to external indicators so you can filter your signal generating indicators using the VWAP trend.
Trend table that shows you whether price is above or below all of the major VWAPs. This includes the daily, weekly, monthly and yearly VWAPs.
Trend coloring between each VWAP and the close price of each candle so you can easily identify the trend direction.
Customization
Set the source value to use for all of the VWAP calculations. The default is HLC3.
Turn on or off each VWAP.
Change the color of each VWAP line.
Change the thickness of each VWAP line.
Turn on or off labels for each VWAP or turn all labels on or off at once.
Change the offset length from the current bar to the label text.
Change the label text color.
Turn on or off trend coloring for each VWAP.
Change the color for up trends and down trends.
Turn on or off the trend direction display table.
Change the location of the trend direction display table.
Adjust the background and text colors on the trend direction display table.
How To Use The Trend Direction Filtering Feature
The indicator will provide a data plot value of 1 for bullish when price is above all of the VWAPs that are turned on, a value of -1 for bearish when price is below all of the VWAPS that are turned on and a value of 0 for neutral when price is above and below some of the VWAPs that are turned on.
The name of the value to use with your external indicators will show up as: VWAP Multi-Timeframe: Trend Direction To Send To External Indicators
Make sure to use that as your source on your external indicators to get the correct values.
This 1, -1 or 0 value can then be used by another external indicator to tell the indicator what is allowed to do. For instance if you have another indicator that provides buy and sell signals, you can use this trend direction value to prevent your other indicator from giving a sell signal when the VWAP trend is bullish or prevent your other indicator from giving a buy signal when the VWAP trend is bearish.
You will need to program your other indicators to use this trend filtering feature, but this indicator is already set up with this filtering code so you can use it with any other indicator that you choose to filter(if you know how to customize pine script).
Markets You Can Use This Indicator On
This indicator uses volume and price to calculate values, so it will work on any chart that provides volume and price data.
Indicator

Previous Key Levels (fadi)Previous Key Levels indicator is a highly configurable OHLC levels tool designed to provide traders with the ability to plot multiple levels while minimizing screen clutter. This indicator is perfect for those who want to monitor various timeframes simultaneously without overloading their charts with unnecessary information.
How to Use It
This indicator offers traders the flexibility to track up to 6 higher timeframes (HTFs) and multiple candles for each timeframe. For example, a trader can choose to monitor the OHLC of the last four 4-hour candles, providing a comprehensive view of significant price levels over different periods.
Key Features
Highly Configurable: Customize the number of timeframes and candles to suit your trading strategy.
Minimal Screen Clutter: Efficiently plot multiple levels without overwhelming your chart.
Flexible Application: Ideal for identifying support and resistance levels, liquidity sweeps, target levels, and more, adapting to various trading styles.
Traders have diverse trading styles and preferences. Some may use these levels to identify support and resistance zones, while others might look for liquidity sweeps or set target levels. By offering a high degree of customization, the Previous Key Levels indicator caters to the unique needs of individual traders, helping them make informed decisions based on historical price action across multiple timeframes.
Timeframe Settings
Toggle to track 6 HTF settings and the number of candles to track for each.
Limit to next HTFs only can be used to limit the HTF levels displayed based on the current timeframe.
Hide Above will disable the indicator above the specified interval.
Offset to Left and Right are used to specify where the level line starts and ends based on the current candle.
Offset between HTFs extends HTF levels to become more readable.
HTF Settings
Choice of the OHLC levels to track.
Specify the color, line style, and line width for each level.
Mark the start of that level, for example, draw a vertical line where the 4H candle has started.
Trace back to draw optional lines to track back to the origin of the level.
Label Settings
Highly configurable labels that allow traders to customize the labels to their liking.
Label color, background, and size.
Customize using up to 9 configurable parts.
Fading Levels
To prevent clutter, the indicator offers the option to change the transparency of the levels based on their distance from the current price. The distance is calculated based on a configurable Average True Range (ATR).
Change Transparency to a percentage of its current color.
Range should be within X candles will fade any level that is X candles length away from the current price.
ATR length used in calculation will calculate the average size of candles in the calculation.
Indicator

libTFLibrary "libTF"
libTF: Find higher/lower TF automatically
This library to find higher/lower TF from current timeframe(timeframe.period) for Pine Script version6(or higher).
Basic Algorithm
Using a timeframe scale Array and timeframe.in_seconds() function to find higher/lower timeframe.
Return value is na if could not find TF in the timeframe scale.
The timeframe scale could be changed by the parameter 'scale'(CSV).
How to use
1. Set higher/lower TF
higher()/lower() function returns higher/lower TF.
Default timeframe scale is "1, 5, 15, 60, 240, 1D, 1M, 3M, 12M".
example:
htf1 = higher()
htf2 = higher(htf1)
ltf1 = lower()
ltf2 = lower(ltf1)
2. Set higher/lower TF using your timeframe scale
The timeframe scale could be changed by the parameter.
example:
myscale="1,60,1D,1M,12M"
htf1 = higher(timeframe.period,myscale)
htf2 = higher(htf1,myscale)
ltf1 = lower(timeframe.period,myscale)
ltf2 = lower(ltf1,myscale)
3. How to use with request.*() function
na value is set if no higher/lower TF in timeframe scale.
It returns current timeframe's value, when na value as timeframe parameter in request.*().
As bellow, if it should be na when timeframe is na.
example:
return_value_request_htf1 = na(htf1)?na:request.security(syminfo.tickerid,htf1,timeframe.period)
return_value_request_ltf1 = na(ltf1)?na:request.security(syminfo.tickerid,ltf1,timeframe.period)
higher(tf, scale)
higher: find higher TF from TF string.
Parameters:
tf (string) : default value is timeframe.period.
scale (string) : TF scale in CSV. default is "1,5,15,60,240,1D,1W,1M,3M,12M".
Returns: higher TF string.
lower(tf, scale)
lower: find lower TF from TF string.
Parameters:
tf (string) : default value is timeframe.period.
scale (string) : TF scale in CSV. defalut is "1,5,15,60,240,1D,1W,1M,3M,12M".
Returns: lower TF string. Library

Higher Time Frame Strat [QuantVue]The Higher Time Frame Strat Indicator is a tool that helps traders visualize and analyze price action from a higher timeframe (HTF) on their current chart. It applies the Strat method, a trading strategy focused on identifying key price action setups by observing how current price bars relate to previous ones. This helps in understanding the market's structure and determining potential trading opportunities based on higher timeframe data.
Key Concepts:
Strat Basics:
Type 1 Bar (Inside Bar): The current bar's high is lower than the previous bar's high, and its low is higher than the previous bar's low. This signifies a consolidation, or indecision, as the price is contained within the previous bar's range.
Type 2 Bar (Directional Bar): The current bar either breaks above the previous bar's high (bullish) or stays above the previous bar's low (bearish), indicating a continuation in the price direction.
Type 3 Bar (Outside Bar): The current bar breaks both above the previous bar's high and below the previous bar's low, showing volatility and a potential reversal.
Higher Timeframe Visualization:
The indicator uses a user-defined higher timeframe (default: 1 hour) and plots the last three higher timeframe candles on the current chart.
Strat Classification:
When a new higher timeframe candle forms, the indicator draws a semi-transparent box around the candle's range (high to low), along with the Strat type label. This provides a visual cue to the trader about the structure of the newly formed candle and how it fits into the overall market movement.
The script classifies each higher timeframe candle as one of the Strat types (1, 2, or 3). Based on the relationship between the current candle and the previous candle's high/low, it assigns a label ("1", "2", or "3"), helping traders quickly identify the price action setup on the higher timeframe.
How to Use the Indicator:
Trend Continuation: Look for Type 2 bars, which indicate a continuation in the current trend. For example, a Type 2 up suggests the price is breaking above the previous high, potentially signaling further upward movement.
Reversals: Type 3 bars show increased volatility, where the price breaks both above and below the previous bar's range. This could indicate a reversal, so be prepared for a potential change in direction.
Consolidation: Inside bars (Type 1) signify a tightening range and can signal the beginning of a breakout once the price moves outside of the previous bar's high or low.
By combining these price action concepts with the visualization of higher timeframe data, traders can potentially get earlier entry and exits as a higher timeframe set up forms. Indicator

Higher-timeframe requests█ OVERVIEW
This publication focuses on enhancing awareness of the best practices for accessing higher-timeframe (HTF) data via the request.security() function. Some "traditional" approaches, such as what we explored in our previous `security()` revisited publication, have shown limitations in their ability to retrieve non-repainting HTF data. The fundamental technique outlined in this script is currently the most effective in preventing repainting when requesting data from a higher timeframe. For detailed information about why it works, see this section in the Pine Script™ User Manual .
█ CONCEPTS
Understanding repainting
Repainting is a behavior that occurs when a script's calculations or outputs behave differently after restarting it. There are several types of repainting behavior, not all of which are inherently useless or misleading. The most prevalent form of repainting occurs when a script's calculations or outputs exhibit different behaviors on historical and realtime bars.
When a script calculates across historical data, it only needs to execute once per bar, as those values are confirmed and not subject to change. After each historical execution, the script commits the states of its calculations for later access.
On a realtime, unconfirmed bar, values are fluid . They are subject to change on each new tick from the data provider until the bar closes. A script's code can execute on each tick in a realtime bar, meaning its calculations and outputs are subject to realtime fluctuations, just like the underlying data it uses. Each time a script executes on an unconfirmed bar, it first reverts applicable values to their last committed states, a process referred to as rollback . It only commits the new values from a realtime bar after the bar closes. See the User Manual's Execution model page to learn more.
In essence, a script can repaint when it calculates on realtime bars due to fluctuations before a bar's confirmation, which it cannot reproduce on historical data. A common strategy to avoid repainting when necessary involves forcing only confirmed values on realtime bars, which remain unchanged until each bar's conclusion.
Repainting in higher-timeframe (HTF) requests
When working with a script that retrieves data from higher timeframes with request.security() , it's crucial to understand the differences in how such requests behave on historical and realtime bars .
The request.security() function executes all code required by its `expression` argument using data from the specified context (symbol, timeframe, or modifiers) rather than on the chart's data. As when executing code in the chart's context, request.security() only returns new historical values when a bar closes in the requested context. However, the values it returns on realtime HTF bars can also update before confirmation, akin to the rollback and recalculation process that scripts perform in the chart's context on the open bar. Similar to how scripts operate in the chart's context, request.security() only confirms new values after a realtime bar closes in its specified context.
Once a script's execution cycle restarts, what were previously realtime bars become historical bars, meaning the request.security() call will only return confirmed values from the HTF on those bars. Therefore, if the requested data fluctuates across an open HTF bar, the script will repaint those values after it restarts.
This behavior is not a bug; it's simply the default behavior of request.security() . In some cases, having the latest information from an unconfirmed HTF bar is precisely what a script needs. However, in many other cases, traders will require confirmed, stable values that do not fluctuate across an open HTF bar. Below, we explain the most reliable approach to achieve such a result.
Achieving consistent timing on all bars
One can retrieve non-fluctuating values with consistent timing across historical and realtime feeds by exclusively using request.security() to fetch the data from confirmed HTF bars. The best way to achieve this result is offsetting the `expression` argument by at least one bar (e.g., `close [1 ]`) and using barmerge.lookahead_on as the `lookahead` argument.
We discourage the use of barmerge.lookahead_on alone since it prompts the function to look toward future values of HTF bars across historical data, which is heavily misleading. However, when paired with a requested `expression` that includes a one-bar historical offset, the "future" data the function retrieves is not from the future. Instead, it represents the last confirmed bar's values at the start of each HTF bar, thus preventing the results on realtime bars from fluctuating before confirmation from the timeframe.
For example, this line of code uses a request.security() call with barmerge.lookahead_on to request the close price from the "1D" timeframe, offset by one bar with the history-referencing operator [ ] . This line will return the daily price with consistent timing across all bars:
float htfClose = request.security(syminfo.tickerid, "1D", close , lookahead = barmerge.lookahead_on)
Note that:
• This technique only works as intended for higher-timeframe requests .
• When designing a script to work specifically with HTFs, we recommend including conditions to prevent request.security() from accessing timeframes equal to or lower than the chart's timeframe, especially if you intend to publish it. In this script, we included an if structure that raises a runtime error when the requested timeframe is too small.
• A necessary trade-off with this approach is that the script must wait for an HTF bar's confirmation to retrieve new data on realtime bars, thus delaying its availability until the open of the subsequent HTF bar. The time elapsed during such a delay varies with each market, but it's typically relatively small.
👉 Failing to offset the function's `expression` argument while using barmerge.lookahead_on will produce historical results with lookahead bias , as it will look to the future states of historical HTF bars, retrieving values before the times at which they're available in the feed. See the `lookahead` and Future leak with `request.security()` sections in the Pine Script™ User Manual for more information.
Evolving practices
The fundamental technique outlined in this publication is currently the only reliable approach to requesting non-repainting HTF data with request.security() . It is the superior approach because it avoids the pitfalls of other methods, such as the one introduced in the `security()` revisited publication. That publication proposed using a custom `f_security()` function, which applied offsets to the `expression` and the requested result based on historical and realtime bar states. At that time, we explored techniques that didn't carry the risk of lookahead bias if misused (i.e., removing the historical offset on the `expression` while using lookahead), as requests that look ahead to the future on historical bars exhibit dangerously misleading behavior.
Despite these efforts, we've unfortunately found that the bar state method employed by `f_security()` can produce inaccurate results with inconsistent timing in some scenarios, undermining its credibility as a universal non-repainting technique. As such, we've deprecated that approach, and the Pine Script™ User Manual no longer recommends it.
█ METHOD VARIANTS
In this script, all non-repainting requests employ the same underlying technique to avoid repainting. However, we've applied variants to cater to specific use cases, as outlined below:
Variant 1
Variant 1, which the script displays using a lime plot, demonstrates a non-repainting HTF request in its simplest form, aligning with the concept explained in the "Achieving consistent timing" section above. It uses barmerge.lookahead_on and offsets the `expression` argument in request.security() by one bar to retrieve the value from the last confirmed HTF bar. For detailed information about why this works, see the Avoiding Repainting section of the User Manual's Other timeframes and data page.
Variant 2
Variant 2 ( fuchsia ) introduces a custom function, `htfSecurity()`, which wraps the request.security() function to facilitate convenient repainting control. By specifying a value for its `repaint` parameter, users can determine whether to allow repainting HTF data. When the `repaint` value is `false`, the function applies lookahead and a one-bar offset to request the last confirmed value from the specified `timeframe`. When the value is `true`, the function requests the `expression` using the default behavior of request.security() , meaning the results can fluctuate across chart bars within realtime HTF bars and repaint when the script restarts.
Note that:
• This function exclusively handles HTF requests. If the requested timeframe is not higher than the chart's, it will raise a runtime error .
• We prefer this approach since it provides optional repainting control. Sometimes, a script's calculations need to respond immediately to realtime HTF changes, which `repaint = true` allows. In other cases, such as when issuing alerts, triggering strategy commands, and more, one will typically need stable values that do not repaint, in which case `repaint = false` will produce the desired behavior.
Variant 3
Variant 3 ( white ) builds upon the same fundamental non-repainting approach used by the first two. The difference in this variant is that it applies repainting control to tuples , which one cannot pass as the `expression` argument in our `htfSecurity()` function. Tuples are handy for consolidating `request.*()` calls when a script requires several values from the same context, as one can request a single tuple from the context rather than executing multiple separate request.security() calls.
This variant applies the internal logic of our `htfSecurity()` function in the script's global scope to request a tuple containing open and `srcInput` values from a higher timeframe with repainting control. Historically, Pine Script™ did not allow the history-referencing operator [ ] when requesting tuples unless the tuple came from a function call, which limited this technique. However, updates to Pine over time have lifted this restriction, allowing us to pass tuples with historical offsets directly as the `expression` in request.security() . By offsetting all items in a tuple `expression` by one bar and using barmerge.lookahead_on , we effectively retrieve a tuple of stable, non-repainting HTF values.
Since we cannot encapsulate this method within the `htfSecurity()` function and must execute the calculations in the global scope, the script's "Repainting" input directly controls the global `offset` and `lookahead` values to ensure it behaves as intended.
Variant 4 (Control)
Variant 4, which the script displays as a translucent orange plot, uses a default request.security() call, providing a reference point to compare the difference between a repainting request and the non-repainting variants outlined above. Whenever the script restarts its execution cycle, realtime bars become historical bars, and the request.security() call here will repaint the results on those bars.
█ Inputs
Repainting
The "Repainting" input (`repaintInput` variable) controls whether Variant 2 and Variant 3 are allowed to use fluctuating values from an unconfirmed HTF bar. If its value is `false` (default), these requests will only retrieve stable values from the last confirmed HTF bar.
Source
The "Source" input (`srcInput` variable) determines the series the script will use in the `expression` for all HTF data requests. Its default value is close .
HTF Selection
This script features two ways to specify the higher timeframe for all its data requests, which users can control with the "HTF Selection" input (`tfTypeInput` variable):
1) If its value is "Fixed TF", the script uses the timeframe value specified by the "Fixed Higher Timeframe" input (`fixedTfInput` variable). The script will raise a runtime error if the selected timeframe is not larger than the chart's.
2) If the input's value is "Multiple of chart TF", the script multiplies the value of the "Timeframe Multiple" input (`tfMultInput` variable) by the chart's timeframe.in_seconds() value, then converts the result to a valid timeframe string via timeframe.from_seconds() .
Timeframe Display
This script features the option to display an "information box", i.e., a single-cell table that shows the higher timeframe the script is currently using. Users can toggle the display and determine the table's size, location, and color scheme via the inputs in the "Timeframe Display" group.
█ Outputs
This script produces the following outputs:
• It plots the results from all four of the above variants for visual comparison.
• It highlights the chart's background gray whenever a new bar starts on the higher timeframe, signifying when confirmations occur in the requested context.
• To demarcate which bars the script considers historical or realtime bars, it plots squares with contrasting colors corresponding to bar states at the bottom of the chart pane.
• It displays the higher timeframe string in a single-cell table with a user-specified size, location, and color scheme.
Look first. Then leap.
Indicator

Indicator

HighLowBox+220MAs[libHTF]HighLowBox+220MAs
This is a sample script of libHTF to use HTF values without request.security().
import nazomobile/libHTFwoRS/1
HTF candles are calculated internally using 'GMT+3' from current TF candles by libHTF .
To calcurate Higher TF candles, please display many past bars at first.
The advantage and disadvantage is that the data can be generated at the current TF granularity.
Although the signal can be displayed more sensitively, plots such as MAs are not smooth.
In this script, assigned ➊,➋,➌,➍ for htf1,htf2,htf3,htf4.
HTF candles
Draw candles for HTF1-4 on the right edge of the chart. 2 candles for each HTF.
They are updated with every current TF bar update.
Left edge of HTF candles is located at the x-postion latest bar_index + offset.
DMI HTF
ADX/+DI/DI arrows(8lines) are shown each timeframes range.
Current TF's is located at left side of the HighLowBox.
HTF's are located at HighLowBox of HTF candles.
The top of HighLowBox is 100, The bottom of HighLowBox is 0.
HighLowBox HTF
Enclose in a square high and low range in each timeframe.
Shows price range and duration of each box.
In current timeframe, shows Fibonacci Scale inside(23.6%, 38.2%, 50.0%, 61.8%, 76.4%)/outside of each box.
Outside(161.8%,261.8,361.8%) would be shown as next target, if break top/bottom of each box.
In HTF, shows Fibonacci Level of the current price at latest box only.
Boxes:
1 for current timeframe.
4 for higher timeframes.(Steps of timeframe: 5, 15, 60, 240, D, W, M, 3M, 6M, Y)
HighLowBox TrendLine
Draw TrendLine for each HighLow Range. TrendLine is drawn between high and return high(or low and return low) of each HighLowBox.
Style of TrendLine is same as each HighLowBox.
HighLowBox RSI
RSI Signals are shown at the bottom(RSI<=30) or the top(RSI>=70) of HighLowBox in each timeframe.
RSI Signal is color coded by RSI9 and RSI14 in each timeframe.(current TF: ●, HTF1-4: ➊➋➌➍)
In case of RSI<=30, Location: bottom of the HighLowBox
white: only RSI9 is <=30
aqua: RSI9&RSI14; <=30 and RSI9RSI14
green: only RSI14 <=30
In case of RSI>=70, Location: top of the HighLowBox
white: only RSI9 is >=70
yellow: RSI9&RSI14; >=70 and RSI9>RSI14
orange: RSI9&RSI14; >=70 and RSI9=70
blue/green and orange/red could be a oversold/overbought sign.
20/200 MAs
Shows 20 and 200 MAs in each TFs(tfChart and 4 Higher).
TFs:
current TF
HTF1-4
MAs:
20SMA
20EMA
200SMA
200EMA
Indicator

HTF Support & Resistance [QuantVue]The "HTF Support / Resistance" indicator highlights critical price levels across multiple timeframes helping you recognize major support/resistance areas.
Whether you're a day trader needing to understand the current day's price action, or a long-term investor looking to analyze yearly trends, this indicator can be a valuable addition to your trading toolkit.
The daily levels, which can be enabled or disabled according to your preference, will give you insights into the open, high, and low levels for the current and previous day.
Similarly, weekly levels provide information for the current and previous weeks, while monthly levels cover the current and previous months.
In addition, the indicator offers more extended views through its quarterly and yearly levels. These will help you understand long-term trends and major support/resistance areas, and they can be particularly beneficial for major support/resistance levels.
Features:
🔹Visualization: View support and resistance levels from Daily, Weekly, Monthly, Quarterly, and Yearly timeframes.
🔹Customizable Appearance: Tailor the display colors and line styles for each level according to your preferences.
🔹Clear Labeling: Each level is clearly labeled for quick identification.
🔹Extension Option: Opt to extend the support and resistance lines across the chart for better visualization.
Give this indicator a BOOST and COMMENT your thoughts!
We hope you enjoy.
Cheers. Indicator

Indicator

Indicator

Higher TimeFrame Smooth Moving AveragesScript is designed for those who dislike how plotting a moving average from a higher timeframe on a lower timeframe chart results in a choppy zigzag line when using the standard request.security(syminfo.ticker,"x",ta.sma(src,len)) method.
My more elegant solution was to translate the chart's current timeframe, and the selected higher timeframe into seconds, then check if selected timeframe is Larger than chart timeframe, but not so large that too many bars would be necessary. Then the quotient is calculated by dividing the chosen timeframe (value in seconds) by the chart's timeframe (value in seconds).
Then take that quotient and multiply it by the chosen length. This gives us how many bars of the chart's timeframe would be used in calculating the higher timeframe Moving Average
Use the value to calculate a moving average of choice (SMA,EMA,WMA,LRC,DEMA,TEMA,TRIMA,FRAMA) thanks to @PulseWire 's ta library () and @alexgrover 's () for their functions supporting series as length, making this possible.
Basically, get how many of the current chart's bars are in the higher timeframe moving average and use that as the length for calculation using chart's timeframe.
If the higher timeframe relative is too large relative to chart's timeframe, due to bar referencing limits some combinations may not be possible under current limitations, but most will work by either moving chart's timeframe higher or higher timeframe lower assuming you aren't trying to do something too extreme like plotting a weekly moving average onto a 30 second chart etc.
Indicator

Indicator

Indicator
