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.
Highertimeframe
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.
ICT HTF Candles [Source Code] (fadi)Plotting a configurable higher timeframe on current chart's timeframe helps visualize price movement without changing timeframes. It also plots FVG and Volume Imbalance on the higher timeframe for easier visualization.
With ICT concepts, we usually wait for HTF break of structure and then find an entry on a lower timeframe. With this indicator, we can set it to the HTF and watch the develop of price action until the break of structure happens. We can then take an entry on the current timeframe.
Settings
HTF Higher timeframe to plot
Number of candles to display The number of higher timeframe candles to display to the right of current price action
Body/Border/Wick The candle colors for the body, border, and wick
Padding from current candles The distance from current timeframe's candles
Space between candles Increase / decrease the candle spacing
Candle width The size of the candles
Imbalance
Fair Value Gap Show / Hide FVG on the higher timeframe
Volume Imbalance Show / Hide Volume Imbalance on the higher timeframe
Trace
Trace lines Extend the OHLC lines of the higher timeframe and the source of each
Label Show/Hide the price levels of the OHLC
*Predictive Volume + HTF [Free]*"Predictive Volume + HTF " is a predictor of real-time to near-future volume % change on the current chart and the next highest time frame. The script calculates the volume's % change (Pred Vol) between Current Volume vs. Previous Volume by predicting whether Pred Vol will be higher or lower at the end of the current bar using an "elapsed time" vs "volume so far" concept. This gives the benefit of the most up-to-date information without artificial low/high comparisons when a bar has just formed. For example, it would be common to see -100% in a lot of instances when a new bar is just forming which would be normal because volume at the start of a new candle will generally be lower than where it was when the last bar closed. Where this indicator shines is during this old to new bar formation and the volume that's carried over to the new bar. As a result, it will now be common to see Pred Vol values starting much higher because the calculation is dividing up the bar and analyzing fractions of it instead of the entire bar that would otherwise lead to these incorrect volume % change calculations.
A few examples of Predictive Volume % Change:
In addition, this indicator uses many advanced and dynamic features:
⚡ Matrices that create the table, allowing you to add and remove columns to customize the table to show only the information that's important to you
⚡ View 2 time frames at once - meaning every time you switch time frames, the table will auto-adjust to show the next highest time frame, or "HTF"
⚡ Header function that keeps you aware of the ticker, time frame and session that you're on at all times (can use in lieu of TV's watermark feature, or use together)
⚡ Timer that shows you when a bar will begin/end
⚡ Includes the following popular time frames: 1m, 3m, 5m, 10m, 15m, 30m, 1h, 2h, 4h, 8h, 1d, week, month
⚡ 3 "bias mode" choices that use Relative Volume (RVOL) from calculations between Current, Previous & Average Volume that provide a visual with varying degrees of color representing buying & selling momentum of your favorite asset. Traders generally have an innate bias when it comes to their trading methodology. Of course it can change quickly depending on current market structure. The script's author created separate modes to account for these biases. One way to utilize the indicator is to use 2 on your chart with 1 Bullish bias \"middle right\" and another Bearish bias \"lower right\" to see if volume pressure is skewed towards your particular bias by showing how many colored boxes there are on each table.
⏩ Standard - 🟢🔴 - displays green and red to depict volume momentum using same RVOL calculations as Bullish & Bearish modes
⏩ Bullish - 🐂🐂 - displays 5 colors to represent the levels of intensity of the Buy/Sell/RVOL data (light blue, green, yellow, light orange, dark orange)
⏩ Bearish - 🐻🐻 - displays 5 colors to represent the levels of intensity of the Buy/Sell/RVOL data (light red to dark purple)
Ex. of all 3 bias modes during a burst of bullish volume momentum:
Ex. of all 3 bias modes during a burst of bearish volume momentum:
⚡ 2 alert types: 1 bullish & 1 bearish with 2 levels for each
⏩ The PREDEFINED ALERTS consist of 2 Bullish & Bearish levels with Lvl 1 designed to be less sensitive than Lvl 2
⏩ Configurable for every time frame, "On Close" or "Each Bar". On Close could be a better choice on lower time frames so that you're not getting a bunch of triggers over a short duration & Each Bar could be a better option for higher time frames so that you don't miss a move mid bar for instance
⏩ Creating a PREDEFINED BULLISH/BEARISH ALERT saves a snapshot of the alert's settings. You can then change the settings and create another alert. In this way, you can create multiple unique alerts
⏩ Create one alert for any alert type (bull and/or bear), for every time frame all at once, or you can create multiple & separate alerts, giving each one a unique name with the time frame that it's for: ex. BTC - Bullish Vol Lvl1 (1m)
In this example, you'll see what causes the alerts to trigger as well as how to create them and how they'll look when they do fire.
////////////////////////////////
It is with a sense of gratitude, appreciation and indebtedness to the coder of this script ©SimpleCryptoLife that I'm able to present this indicator to you after months of hard work. We hope that you find it invaluable during your own trading journey! Should you have any questions, feedback or critiques please do not hesitate to leave a comment.
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
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.
Higher Time Frame {HTF} Candles [QuantVue]Introducing the Higher Time Frame {HTF} Candles from QuantVue!
This script was developed to help you visually emphasize higher time frame (HTF) candles.
Higher time frames reduce the 'noise' inherent in lower time frames, providing a clearer, more accurate picture of the market's movements.
By examining higher time frames, you can better identify trends, reversals, and key areas of support and resistance.
The Higher Time Frame Candles indicator overlays higher time frame data directly onto your current chart.
You can easily specify the higher time frame candles you'd like to view, and the indicator will overlay the higher time frame candles directly over the corresponding current time frame bars.
This indicator by default will display the most current higher time frame candle plus the previous 5 candles.
Give this indicator a BOOST and COMMENT your thoughts!
We hope you enjoy.
Cheers.
TWA - HTF Candle ColorOverview:
This indicator is designed to assist trend traders by confirming the market's direction on a higher timeframe and providing overlays to determine the strength and longevity of the current trend. Its goal is to help traders develop a probability-based mindset, enabling them to remain in profitable trades for longer periods and to identify when the trend might be shifting.
Main features and how to use:
The main feature of the indicator is the green and red coloring of the candles. The candles can be used to determine market direction and use that bias to pick a trading direction. The contrarian candle overlay is another useful feature that helps trend traders identify potential trend reversals. To use this feature, traders should wait until the overlay candle coloring "clicks off" to determine the probability that the current move has reached its peak or bottom and to look for a larger retracement. The unique flexibility of this feature allows trend traders to see both sides of the story.
Calculations and what makes this original:
- It finds breaks of common fibonacci retracement and extension values on a higher time frame using my proprietary williams % R indicator to find
trend direction
- To help add more confirmation to trend direction the proprietary algorithm combines the above fibonacci breaks with confirmation from price
breaking beyond multiple deviations measured from bollinger bands.
- From your current charts timeframe it automatically calculates which higher timeframe to analyze.
- The above algorithm from the higher timeframe is distilled down to a green or red candle color on the chart to show market direction.
- It uses a blend of rsi and CCI to calculate contrarian candle coloring to show trend exhaustion.
Additional features
Contrarian candle coloring:
The contrarian candle coloring feature is designed to help trend traders see possible reversals. It overlays a different candle color on top of the HTF candles at certain periods. The unique feature of this addition is its ability to transform a trend-following indicator into a tops and bottom reversion indicator all in one. This flexibility allows traders to see both the contrarian and trend-following perspectives.
Enhanced probability:
This feature helps traders determine the probability of their potential trades long-running potential by changing the background color to green or red. Traders can use this information to help define their risk per trade. For example, if the candle coloring matches the background color, they might choose a long-running move, whereas if the candle coloring does not match the background color, they might opt for a scalping trade. The unique feature of this addition is how it gives traders the ability to view the market from different perspectives all on one screen.
Use Alternate Symbol:
Allows for the candle color to be derived from a separate symbol than the current chart .
Candle Color as Line:
Plots a line across the top or bottom of the chart showing the current color which allows users the ability to use an additional indicator that colors candles.
Contrarian Color as Line:
Plots a line across the top or bottom of the chart showing the current candle color which allows users the ability to use an additional indicator that colors candles.
Candle Color as Background:
Colors the chart background the color of the current HTF candle color which allows users the ability to use an additional indicator that colors candles.
Increase Market Sensitivity:
Quickens the response time for candles to change color which can be helpful for scalping on 1 minute charts.
ALERTS
- Get an alert when the candle color changes to green or red
-Get an alert when the enhanced probability color changes to green or red
-Get an alert when the candle color and enhanced probability color align green or red
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 @TradingView '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.
JZ_Chaikin HTF Volatility BreakoutFirst off, all credit to Harry Potter as this is a minor customization of his indicator.
Basic additions:
-- Added a Higher Timeframe that is set to Daily but can be changed. Timeframe does wait until barstate.isconfirmed so won't repaint.
-- Added HMA smoothing line to both Chart and HTF. Can be used as it's own signal, as confirmation or in combination with faster signal line -- Breakout signal & Range Highlight use both.
-- Added optional coloring of HMA based on whether increasing or decreasing.
-- Added a low volatility option that highlights Range/No Trade zones. Defval is off so needs to be selected from inputs.
Breakout Signals are very simple and both take the HTF signal and HMA. When the faster Volatility line rises from below zero and comes within the range of -10 to 0, AND the HMA signals is increasing (and also below zero) for confirmation, generates a breakout signal of an incoming big move. You can alter the breakout threshold to be greater or less than -10, I just found that works best for filtering out the noise and false signals. Won't catch everything, but pretty reliable when it does.
Tested mostly on BTC so can't vouch for other assets and would likely need modification.
I've JUST taught myself coding from scratch (and to say I'm an amateur is an understatement), so apologies in advance if anything is unclear or could be coded better. Open to any suggestions.
Trampoline DotsTrampoline Dots (Price Divergence)
Higher Time Frame Price Divergence:
Trampoline Dots serve as a "quick bounce" tool. These little dots will trigger whenever the higher aggregation MACD is above / below zero and the price is below / above the 50 period simple moving average. When these criteria are met, the price is usually under pressure of strong divergence, more often than not price will sharply reverse into the trend direction usually within the next few bars.
The Use of The Trampoline Dots:
This indicator can serve multiple ways. Obviously the main use case is the price divergence. These "dots" will not give you any precise & exact entry. But rather a zone of possible incoming reversal. There is no timing to it. All these dots will do is warn you about potential sharp reversal in the upcoming bars. It can be used by itself alone for sure, but the best way to utilize the dots is to use them in combination of other trend or momentum studies. The best signals are the ones that are within the larger time frame trend. Another great thing is that the visuals are really straight-forward and simple. It is either green dot or a red dot. Nothing more, nothing less. Also since the indicator is pretty small, it can be easily layered onto other studies as well which can create an additional confirmation for different patterns or setups.
Which Time Frame Are Reliable?
This indicator works on any time frame. But the most "stable" one is the daily & hourly time frame. My personal favorite is the hourly since these divergences can produce amazing entries in the daily trends (which are usually hidden on the daily chart). In the most aggresive trends, I like to see the green dots triggering around the 8 EMA and 13 EMA. Daily chart can show the daily and weekly (big divergences) that can take multiple days & weeks to resolve.
Hope it helps.
Buy Sell Signal ScannerThis is a higher timeframe scanner that detects whether the market is bullish or bearish according to our Buy Sell Indicator on up to 8 different timeframes. It can also be customized to scan different tickers so you can scan tickers that typically move with or against the ticker you are trading for extra confirmation. The scanner can be configured to use the exact same settings that you use with the Buy Sell Indicator so everything is using the same formula.
For price action identification, scalp mode looks at the candle body, candle wicks and size of the body and wicks and compares all of that to the previous candle to see if it is bullish or bearish. Swing mode will compare the current candle to the last 2 candles and long swing mode will compare the current candle to the last 10 candles. It’s looking for higher highs & lower lows, if the candle body is large or small and much more.
There are also filters that prevent signals from being given when the candle is small or has not made a higher high or lower low compared to the previous candle and multiple other filters to help hold positions longer. Once the price action direction has been confirmed, then the script looks at a massive amount of other calculations to determine if a signal should be given or not. These calculations are made up of all of my best indicators combined into a master signal generator as well as more new calculations from things I have learned over time and tested extensively that have not been made available to the public until now.
Price action as well as many other factors will all have to be confirming the direction before a signal can come in, but it reacts very quickly so it can give early signals at the first sign of reversal. Fine tune your settings to match your Buy Sell Indicator settings to get the same signals on the scanner.
HOW TO USE
The scanner will show the higher timeframe in a table on the side of the chart if no other ticker is selected to scan. The timeframe cell will show as green if that timeframe is currently in a bullish signal and red if that timeframe is currently in a bearish signal. If you set it to use a different ticker, the ticker name and timeframe will show up in the table.
The defaults are set up to scan the same ticker as your chart but on higher timeframes. It is set up for a 1 minute chart by default, but each timeframe can be adjusted to suit your preference all the way up to a 1 year timeframe.
You can set the scanner to look at different tickers as well which is very useful for getting confirmation by setting it to scan other tickers that usually move in the same direction or opposite of the ticker you are trading.
TRADE MODE
The signal settings allow you to match the scanner settings to your settings on the Buy Sell Indicator. There is scalp mode, swing mode and long swing mode. All 3 settings use the same calculations for signals, but they have different price action filters to help hold swings longer. Scalp mode will only be looking at the current bar compared to the previous bar, but swing mode will look at the current bar compared to the previous 2 candles. Long swing mode will compare the current candle to the last 10 candles to hold positions even longer.
There is also a candle trailing length that can be adjusted as well to suit your preference. This adds a filter that ensures the current candle is closing higher than the previous X number of candles you choose for a bull signal and is closing lower than X number of previous candles for a bear signal. Make sure to match these settings to how your Buy Sell Indicator is configured to get matching results.
You can also move the position of the scanner table to any part of the chart in the settings menu at the bottom.
ALERTS
There are alerts set up that will give you a signal when all timeframes are bullish on candle close and another signal that will alert when all timeframes are bearish on candle close. There is also an alert for when the first 4 timeframes & ticker are bullish and the last 4 timeframes & ticker are bearish or the opposite. This is useful for looking at forex markets and setting the first 4 to tickers that move together and the last 4 to tickers that move opposite.
MARKETS
This Buy Sell Signal Scanner can be used on any market with price data such as stocks, crypto, forex and futures.
TIMEFRAMES
This Buy Sell Signal Scanner can be used on any timeframe. And will scan any of our available timeframes between 1 minute and 1 year.
PAIRINGS
We recommend pairing this Buy Sell Signal Scanner with our Buy Sell Indicator so you can get signals and price action colored candles on the ticker you are trading and then use the scanner for confirmation of trend on higher timeframes and trade with the trend.
Higher Timeframe Price Action ScannerThis is a higher timeframe scanner that detects the price action trend on multiple timeframes and displays them all as red or green dots. You’ll be able to see the real time and historical price action trends so you can trade in the same direction of the overall trend on higher timeframes. You can also set it to scan a different ticker if you choose. If you find pairs that correlate very well, you can use two scanners and look at both of them for extra trend confluence.
CALCULATIONS
This scanner uses the same price action formula from our other indicator titled 1 Minute Scalping Indicator which can be found on our profile. It has Scalp Mode and Swing Mode. Both modes use the exact same price action parameters for signals, but Swing Mode will only give signals when the price action parameters are met AND the close is higher than the previous high for bull signals or when the close is lower than the previous low for bear signals.
HOW TO USE
The top line of the scanner shows the price action trend for the current chart timeframe and the rest are using the higher timeframe that you set in the input settings. They start with higher timeframe #1 as the second line from the top and go down from there.
When most or all of the dots are green, you should be looking for long positions and when most or all of the dots are red, you should be looking for short positions.
Since this scanner is using pure price action to identify trends, it’s a reliable way to see what multiple timeframes are doing.
PAIRINGS
Use this with the 1 Minute Scalping Indicator so you can get the signals and candles colored per the price action on your chart as well as see the higher timeframe price action trend from the scanner. Using both together will help you make better trading decisions.
MARKETS
You can use this scanner on any market.
TIMEFRAMES
This scanner will scan the current chart timeframe and display the result on the top line, then the lines below that will display the results from the higher timeframes you choose in the settings. It has timeframes from 1 minute all the way up to 1 year.
Higher Time Frame Average True RangesPurpose: This script will help an options trader asses risk and determine good entry and exit strategies
Background Information: The true range is the greatest of: current high minus the current low; the absolute value of the current high minus the previous close; and the absolute value of the current low minus the previous close. The Average True Range (ATR) is a 14-day moving average of the true range. Traders use the ATR indicator to assess volatility in stocks and decide when to enter and exit trades. It is important to note the limitations of using True Range and ATR: These indications cannot tell you the direction of your options trade (call vs. put) and they cannot tell you whether a particular trend is about to reverse. However, it can be used to assess if volatility has peaked for a particular direction and time period.
How this script works: This indicator calculates true range for the daily (DTR), weekly (WTR), and monthly (MTR) time frames and compares it to the Average True Range (ATR) for each of those time frames (DATR, WATR, and MATR). The comparison is displayed into a colored table in the upper right-hand corner of the screen. When a daily, weekly, or monthly true range reaches 80% of its respective ATR, the row for that time frame will turn Orange indicating medium risk for staying in the trade. If the true range goes above 100% of the respective ATR, then the row will turn Red indicating high risk for staying in the trade. When the row for a time period turns red, volatility for the time period has likely peaked and traders should heavily consider taking profits. It is important to note these calculations start at different times for each time frame: Daily (Today’s Open), Weekly (Monday’s Open), Monthly (First of the Month’s Open). This means if it’s the 15th of the month then the Monthly True Range is being calculated for the trading days in the first half of the month (approximately 10 trade days).
The script also plots three sets of horizontal dotted lines to visually represent the ATR for each time period. Each set is generated by adding and subtracting the daily, weekly, and monthly ATRs from that time periods open price. For example, the weekly ATR is added and subtracted from Mondays open price to visually represent the true range for that week. The DATR is represented by red lines, the WATR is represented by the green lines, and the MATR is represented by the blue lines. These plots could also be used to assess risk as well.
How to use this script: Use the table to assess risk and determine potential exit strategies (Green=Low Risk, Orange=Medium Risk, Red=High Risk. Use the dotted lines to speculate what a stock’s price could be in a given time period (Daily=Red, Weekly=Green, and Monthly=Blue). And don’t forget the true range’s calculation and plots starts at the beginning of each time period!
All for One Moving AverageThis is a collection of all the moving averages available. Some are built-in, a couple were tricky to source out.
Higher timeframes can be specified so you aren't limited to your chart setting.
Repainting has been disabled by default.
There is also an option to use Heikin Ashi candles as the input source rather than standard bars.
Hope that someone finds this useful.
If you'd like anything added please DM me and I'll include it!
Feel free to copy this into your own strategies/indicators.
~Dark
CH-I: Trend - Higher Timeframe BodyI took the script for the built-in indicator for candle bodies of a higher timeframe (www.tradingview.com) which has a fixed border width and style and added the possibility to customize both the border width and the border style or to even disable the display of any border at all, which makes the presentation of those boxes more flexible.
TWP Higher Timeframe Pivot Points█ OVERVIEW
This script displays the nearest support and resistance fibonacci pivot point levels from the higher reference timeframes -- weekly, monthly, and yearly levels. When trading it is always been helpful for me to be aware of significant price levels of the players participating on larger timeframes. HTF pivot points are a great tool for finding confluence and/or gaining extra conviction on your trades. This is a companion tool to be used in conjunction with the Standard Fibonacci Pivot Points .
█ CONCEPTS
Pivot points are a technical indicator / calculation that can be used to determine the overall trend of the market or determine the level that price may face support or resistance. At the same time it can lead to confirmation of the overall trend when price travels through support or resistance lines continuously.
The pivot point is the average of the high, low, and closing price of the previous time window - Day, Week, Month, Year.
The going belief is that if price is trading above the pivot point (P) then there is a bullish sentiment and trading below the pivot point (P) is a bearish sentiment.
Pivot points can be calculated a multitude of ways but the way I am using it here is using the fibonacci method. See the calculations below.
Note: Tooltips are added for each lines label that display the calculation used.
Default Ratios + Matching Labels:
pivot point = (high + low + close) / 3
support lines = pivot - (prevhigh - prevlow) * 0.236
resistance lines = pivot - (prevhigh - prevlow) * 0.236
38.2% - S1/R1
61.8% - S2/R2
100% - S3/R3
Additional (Mid) Ratios + Matching Labels:
23.6% - SA/RA
50% - SB /RB
76.4% - SC / RC
127.2% - S4/R4
141.4% - S5/R5
161.8% - S6/R6
200% - S7/R7
█ FEATURES
1 — Line Extension - Left, Right, Both, None
2 — Pivot Levels for Week, Month, and Year Pivot Points
• Show line
• Show label
• Line color
• Line style
█ HOW TO USE
• As mentioned earlier it best used along with the Standard Fibonacci Pivot Points to find levels of potential confluence where you believe may be key support, resistance, or a potential inflection point in price action.
█ LIMITATIONS
• Depending on the chart and the amount of data it naturally pulls back, the yearly fibonacci pivot point levels may not show
• Pivot points may be found useful for some and not for others
• There is no assurance that price will stop at, reverse, or reach a specific pivot level
HTF CandlesThis draws candlesticks from higher time frames on the current chart. I tried to keep the script simple using some newly introduced Pine capabilities.
To change the options like the higher time frame and candle colors, check the indicator settings.
Looking forward to your opinions!
HTF Candles by DGThigher timeframe (multi timeframe) candles
a simple study introducing new pine function box.new
Dynamic levels from higher TF: EMA, SMA, OHLC, Bollinger, Vwap[ AR ] iLevels - indicator is intended for displaying important levels from a current and higher timeframe.
The indicator hides levels if they are far from the current price . The concealment range is based on the ATR * multiplier value. This keeps the graph clean and not shrinking .
Available levels:
- EMA - 5, 10, 20, 50, 100, 200, 300, 400, 500, 1000, 2000
- SMA - 20, 50, 100, 200
- Current day - Open/High/Low/Close
- Prev day - Open/High/Low/Close
- Prev days - Historical Open/High/Low/Close
- Vwap
- Local Bollinger - upper and lower channel boundaries from current timeframe
--- Detailed description ---
Why do you need an indicator?
The indicator is designed to display the most important levels from the current and upper time frames, which are support/resistance for the price. You do not need to constantly search for the level on the upper time frame and track it on the current one. For ease of understanding, here we will assume that the main time frame is one minute, and the upper one is daily, and we are trading intraday. Of course the indicator works on any time-frame. And the most convenient moment is that the indicator automatically hides and shows levels near the current price so that the chart does not shrink (does not increase along the vertical axis). An important point - the level is calculated for the current bar, i.e. 20 bars ago most likely it was not at this value (but you can see it through the market simulation). This means that the levels move with the price change and they are always horizontal for the current bar, and not historical in general.
Benefits
Automatic hiding of levels depending on ATR
Levels from the current time frame: Bollinger, Vwap
Levels from the upper time frame: Open/High/Low/Close of the current day and Open/High/Low/Close of the previous day
Levels from the upper time frame: popular EMAs, popular EMA fibonacci, popular SMA, previous historical High/Low, if the price did not touch them
Table (summary) with levels for quick orientation
When hovering over a table/level, a tooltip appears in%
Everything can customized. Levels, colors, styles, hints - you can customize everything and make a dream indicator.
Available levels
EMA and SMA
A whole set of popular EMAs from the higher time frame: 5, 10, 20, 50, 100, 200, 300, 400, 500, 1000, 2000. Fibonacci EMAs: 13, 34, 55, 89, 144, 233
In our basic example, we add the EMA from the daily chart to the minute chart:
SMA added only the most popular: 20, 50, 100, 200
Vwap and Bollinger Bands from the current time frame
Open/High/Low/Close of the current and previous day (bar)
Open/High/Low/Close of the current (example: Current Open) and the previous bar (example: Prev Open) are requested from the higher time frame. If we use the indicator on the data of the daily chart, then we get the open/close/min/max levels of the current and the previous day. These are the usual Pivot levels that can be used as support/resistance:
Historical Open/High/Low/Close
These are the Open/High/Low/Close values of 50+ previous bars from the upper time frame. Marked as o3 (the Open value of the 3rd bar back), H55 (the High value of the 55th bar back), etc. They serve as excellent support/resistance levels, you just need to look at the upper chart to determine the significance of this level
In our example with a one-minute chart and an upper daily time frame, we can, for example, see the exact values of the historical maximum resistance or some significant support at the close of the gap.
By default, only High and Low are enabled, as they are the most significant. The summary hint contains a letter after the level - R or S, respectively, this is resistance or support.
Another good example of historical levels. On the left chart there is a daily time frame, on the right is a minute with an indicator. The indicator accurately shows the nearest historical support Low 14, 19 and 54. On the left I have highlighted them for clarity:
Lines and labels
The line is the "level". The line is the ray. It starts from the last bar and goes to the left. Since this is a ray, looking at the historical data (rewinding the chart back), it will not rescale and collapse the chart.
Label is the abbreviated name of the level, for example V (Vwap), e50 (EMA 50), or H17 (High 17). The title has been abbreviated so as not to clutter up the graph. When you hover the mouse, a tooltip appears with the full name of the level, the price and the difference in % to this level from the current price.
Settings
The indicator is very flexible and you can customize it absolutely for any needs and tasks.
Higher time frame
This is the timeframe from where the indicator requests data for most levels.
You can use different variations: minute/day, day/week, etc.
Atr Multiplier
This is the setting that allows you to decrease/increase the number of displayed levels.
It's simple - a “space” is created near the price above and below. If the level falls into this “space”, then it is displayed.
The space above is calculated as:
Price + (ATR * AtrMultiplier) and below as: Price - (ATR * AtrMultiplier)
While on the minute chart, it is optimal to use the value up to 10, on the hourly chart - up to 2-3, on the daily chart - 0.5, etc.
Line Right Shift, Label Right Shift
How many bars the levels and labels above them move from the last bar. If Line Right Shift is set to negative, the line will start at this point and go to the right side of the chart.
Show Lines ?, Show Labels?
Need to show lines or labels above them? You can turn off one option and use only the other - lines without labels or vice versa.
Show Summary table?
Summary table is a table of data that conveniently displays the full name of the levels and the price. Hover displays a tooltip with levels as a percentage.
To maximize the acceleration of the trader, the following has been done:
Levels sorted by price
The table is split in two. Green table above - levels are more expensive than the current price (possible resistance). Red table below - levels are cheaper than the current price (possible support)
Distance between tables = ATR. We quickly and easily understand the value of ATR by looking at this distance. You can compare it with the nearest bars, which will give good information.
Show ATR in Summary?
In the lower table showing the value of the current ATR. Convenient, no additional indicator needed.
Always show in Summary
A list of levels that must always be displayed on the table, even if they are far away and have not appeared. The short names of the levels are specified, separated by commas. My basic set is Open, Vwap, EMA 10, EMA 20, Bollinger High, Bollinger Low.
Always show Levels
What levels should be displayed, even if they are far away. Bollinger channels are my choice. You can add Vwap, but in some cases it will compress the graph a lot, so Vwap is only in Summary by default.
Hide labels
In order not to clutter up the graph, you can remove some of the labels. For example, Bollinger Bands have their own style and are perceived visually - a mark above the level is not needed. You can add Vwap.
Replace labels on *
Which labels need to be replaced with an asterisk so as not to clog the graph. For example, this is Vwap, which has its own style. You can hover over the star and get a tooltip for the price.
Replace ALL labels on *
You can massively replace all tags with asterisks and get information when you hover over them.
Show Prevs Open/High/Low/Close?
4 settings that allow you to show historical levels. The labels are o12, H4, L72, c8. By default, only High and Low are enabled due to their significance.
Max Prev Days - how many bars back to get historical levels. Limited by TradingView's abilities and you can get about 50-100 bars back.
Current/Prev Open/High/Low/Close?
8 settings for displaying 8 levels of the current and previous day, which are important boundaries for the price. Current Close is disabled by default, as this is the current price level and is highlighted in TradingView.
Vwap?, Local Bollinger?, Sma ?, Ema?
Vwap level, Bollinger channels and a complete list of available Ema/Sma.
The most popular ones are enabled by default.
Color/Style/Width
Visual settings for lines. All lines are divided into 7 groups. Styles are customizable for the group as a whole.
Life hacks
You can add the indicator multiple times to the chart and set each copy to different time frames. For example, you have a minute chart. You add the indicator 3 times and set each indicator to daily, hourly and 15 minute time frames. Next, you set up the styles and colors for the lines on each indicator so that you can easily distinguish them from each other. Thus, you will not miss a single important level when trading intraday.
Known Issues
The main problem is overlapping of labels and levels. Overlapping labels is difficult to solve, but work is underway.
A side issue is the visual styles of levels and labels. The main goal is to create well-visually perceptible lines so that they can be instantly identified without reading the mark. We need to create a good color scheme for the level groups.
How can the community help and improve the indicator?
Suggest ideas.
Please, write them in the comments. Suggest edits to existing functionality. Suggest solutions to problems, new features, etc.
I believe that the community's suggestions for improvement can bring the indicator to perfection.
Thanks you!
HTF Trend FilterTrend filter based on higher timeframe candles. Can be used as entry filters.
Checks if last 3 higher timeframe candles are in fully ascending order or fully descending order. Additionally you can also check if close price is above min of last two highs or below max of last two lows.
Lime and Orange candles imply partial trend in higher timeframe. (only last 3 candles align)
Green and Red candles imply complete trend. (last 3 candles align along with current close price).
Just an experiment. Can be further improved,
Multi Time Frame CandlesHello Traders,
This script can show (upto) 3 candles of another time frames without changing chart time frame realtime . You can choose the time frame and number of candles in the options. You have option to change body and wick colors as well.
in this example number of candles is 2:
You can set body and wick colors:
In this example, weekly candles are shown on 1h chart:
Enjoy!
HTF Candlestick Patterns [TradingView] vX by DGTCandlesticks are graphical representations of price movements for a given period of time. They are commonly formed by the opening, high, low, and closing prices of a financial instrument. They have their origins in the centuries-old Japanese rice trade and have made their way into modern day price charting.
It’s important to note that candlestick patterns aren’t necessarily a buy or sell signal by themselves. They are instead a way to look at market structure and a potential indication of an upcoming opportunity. It is always useful to look at candlestick patterns in context like any other market analysis tool and candlestick patterns are most useful when used in combination with other techniques. There are countless candlestick patterns that traders can use to identify areas of interest on a chart, where some candlestick patterns may provide insights into the balance between buyers and sellers, others may indicate a reversal, continuation, or indecision.
Reversal patterns are quite useful when used in context. Reversal patterns should form at the bottom of a downtrend or at the top of an uptrend. Otherwise, they are not a reversal patterns, but continuation patterns. Most reversal patterns require confirmation such as price move in the direction of reversal accompanied by appropriate trading volume. The reversal patterns can further be confirmed through other means of traditional technical analysis—like trend lines, momentum, oscillators, or volume indicators—to reaffirm buying or selling pressure. The patterns themselves do not guarantee that the trend will reverse. Investors should always confirm reversal by the subsequent price action before initiating a trade.
This study implements some of the most commonly used candlestick patterns in a context with directional movement indicator. On request users can adjust the strong trend threshold from dialog box, eighter can disabled correlation with directional movement indicator. To add additional sight to analysis the simple moving averages of 20, 50, 100 and 200 periods are added (configurable)
You may add additional indicators of your choice. Colored DMI, BB Cloud or Price Distance to its MAs may help
Enjoy it!
Disclaimer: The script is for informational and educational purposes only. Use of the script does not constitutes professional and/or financial advice. You alone the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd tradingview user liable for any possible claim for damages arising from any decision you make based on use of the script