MENTFX AVERAGES MULTI TIMEFRAMEThe MENTFX AVERAGES MULTIME TIMEFRAME indicator is designed to provide traders with the ability to visualize multiple moving averages (MAs) from higher timeframes on their current chart, regardless of the chart's timeframe. It combines the power of exponential moving averages (EMAs) to help traders identify trends, spot potential reversal points, and make more informed trading decisions.
Key Features:
Multi-Timeframe Moving Averages: This indicator plots moving averages from daily timeframes directly on your chart, helping you keep track of higher timeframe trends while trading in any timeframe.
Customizable Moving Averages: You can adjust the length and visibility of up to three EMAs (default settings are 5, 10, and 20-period EMAs) to suit your trading style.
Overlay on Price: The indicator is designed to be overlaid on your price chart, seamlessly integrating with your existing analysis.
Simple but Effective: By offering a clear visual guide to where price is trading relative to important higher timeframe levels, this indicator helps traders avoid trading against major trends.
Why It’s Unique:
Validation Timeframe Flexibility: Unlike traditional moving average indicators that only work within the same chart's timeframe, the MENTFX AVERAGES M indicator allows you to pull moving averages from higher timeframes (default: Daily) and overlay them on any chart you're currently viewing, whether it's intraday (minutes) or even weekly. This cross-timeframe visibility is critical in determining the true market trend, adding context to your trades.
Customizability: Although the default settings focus on daily EMAs (5, 10, and 20 periods), traders can modify the parameters, including the type of moving average (Simple, Weighted, etc.), making it adaptable for any strategy. Whether you want shorter-term or longer-term averages, this indicator covers your needs.
Trend Confirmation Tool: The use of multiple EMAs helps traders confirm trend direction and potential price breakouts or reversals. For example, when the shorter-term 5 EMA crosses above the 20 EMA, it can signal a potential bullish trend, while the opposite could indicate bearish pressure.
How This Indicator Helps:
Identify Key Support and Resistance Levels: Higher timeframe moving averages often act as dynamic support and resistance. This indicator helps you stay aware of those critical levels, even when trading lower timeframes.
Trend Identification: Knowing where the market is relative to the 5, 10, and 20 EMAs from a higher timeframe gives you a clearer picture of whether you're trading with or against the prevailing trend.
Improved Decision Making: By aligning your trades with the direction of higher timeframe trends, you can increase your confidence in trade entries and exits, avoiding low-probability setups.
Multi-Market Use: This indicator works well across various asset classes—stocks, forex, crypto, and commodities—making it versatile for any trader.
How to Use:
Intraday Trading: Use the daily EMAs as a guide to see if intraday price movements align with longer-term trends.
Swing Trading: Plot daily EMAs to track the strength of a larger trend, using pullbacks to the moving averages as potential entry points.
Trend Trading: Monitor crossovers between the moving averages to signal potential changes in trend direction.
Default Settings:
5 EMA (Daily) – Blue Line
10 EMA (Daily) – Black Line
20 EMA (Daily) – Red Line
These lines will plot on your chart with a subtle opacity (33%) to ensure they don’t obstruct price action, while still providing crucial visual guidance on market trends.
This indicator is perfect for traders who want to blend technical analysis with multi-timeframe insights, helping you stay in sync with broader market movements while executing trades on any timeframe.
HTF
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.
ICT HTF FVGs v2 (fadi)NOTICE: Instead of updating the existing ICT HTF FVGs indicator, this indicator is being published separately due to the requests to keep the original by some traders and because of the drastic change in behavior/configurations. If the original v1 version is more appropriate for your style of trading, feel free to continue to use it.
ICT HTF FVGs v2
In trading, Fair Value Gaps (FVGs) refer to market inefficiencies or imbalances that occur when buying and selling activities are not equal. These gaps can be identified on various timeframes and are used in different trading strategies.
FVGs are crucial in price action trading as they highlight the difference between the current market price of an asset and its fair value. Traders use these gaps to identify potential trading opportunities, as they often indicate areas where the market may correct itself
This indicator will overlap the higher timeframe (HTF) FVGS over the current timeframe to help traders anticipate and plan their trades.
Features
Up to 6 higher timeframes (HTF) can be overlayed on a chart
Traders can limit the number of HTF FVGs to preset number of HTFs
Lower and current timeframes can be included
Configurable spacing of HTF FVGs to prevent overlapping
Configurable Smart Expansion of FVGs based on proximity to current price
Traders can decide what constitutes a Mitigated FVG
Show or hide mitigated FVGs to declutter the chart
Flexible display settings that controls how the FVGs are displayed
Flexible labeling of the FVG levels and content
Higher Timeframes Display Settings
This indicator provides the ability to select up to 6 HTF intervals. These intervals are based on the trader's timeframes including any custom timeframes.
Timeframe Configurations
Enable or Disable a Timeframe
The Timeframe to Display
Bullish / BISI FVG Color
Bearish / SIBI FVG Color
The number of FVGs For The Selected Timeframe
Limit to the next HTFs only can be used to display the selected number of HTF FVGs. For example, if the trader selects 3 then only 3 HTF FVGs will be displayed.
Note: If either of the next two options is selected, they will take up spots from this count.
Hide lower Timeframes restricts the FVGs to higher timeframes only. If this option is disabled, it will show lower timeframes FVGs as well.
Hide Current Timeframe removes current timeframe from the selected list of HTF FVGs. If this option is disabled, it will show current timeframe FVGs as well.
Background Transparency Enable or disable the background color (shaded area) of the FVG. If it is enabled, it will set the transparency amount. The higher the value, the more transparent the background.
Extend lines controls when and how to extend the FVG levels. There are three options:
Extension Only extends the FVGs by the specified number provided below only.
Current Candle Plus Extension extends all the FVGs beyond the current candle by the number provided below.
When in Range will only extend the FVGs near current price based on the advanced settings below. This setting will use Average True Range multiplier to calculate the range (shows FVGs that are higher or lower by the average candle size multiplied by the number in Advanced section).
Mitigated shows or hides the mitigated HTF FVGs. A FVG is considered mitigated based on one of the following options:
None will ignore mitigation and show all FVGs.
Touched when a HTF FVG is touched regardless of how deep the price get inside the FVG.
Wick filled the FVG is closed by a wick or body of a candle.
Body filled the FVG is closed by the body of a candle
Wick filled half a candle's wick or body has reached the C.E. of the FVG
Body filled half a candle body has reached the C.E. of the FVG
Extend mitigated lines sets the number of candles to extend the mitigated FVG levels by for better visibility.
Important Note: Mitigation is calculated based on the timeframe of the FVG, not current timeframe.
Display
Display settings focus on how the FVGs will be displayed. The trader is in total control and there are multiple ways to overlay FVGs on the chart.
Open / Close / C.E. / Link controls the borders. Traders can enable or disable any of them as well as set the thickness and style. Link is the right border.
C.E. also offers the option of setting the bullish (BISI) and bearish (SIBI) colors of the C.E. level
Labeling controls if the labels should be displayed next to the FVG, their color, background, and font size.
Label levels to display controls which levels to show. Open, High. or the C.E.
Label display content controls what to show in the labels, the timeframe of the label, is it a BISI or a SIBI, and a label to indicate if it is the Open or the Close.
Note: if the distance between the open and close has the potential of overlapping the labels, then the indicator will only show the C.E. label for visual clarity.
Advanced Settings
Advanced settings controls some internal calculations:
Proximity factor based on daily range used to calculate possible range of FVGs within a day's range to keep the chart clean. The higher the value, the more FVGs will be shown.
Combine labels factor for visibility used to calculate the distance between the open and close and if all the labels or only the C.E. should be displayed. The higher the value, the bigger the distance for combination (smaller numbers will show more labels).
Range should be within X candles used when "When in Range" option is selected. This is the ATR multiplier used to extend the FVGs. The higher the number, the more FVGs will be extended.
Once desired settings have been achieved, the settings can be saved as default from the bottom left of the indicator settings page for future use.
HTF Multi Candles DisplayHTF Multi Candles Display
Description
The HTF Multi Candles Display is a powerful and versatile indicator that overlays higher timeframe (HTF) candles on your current chart, providing traders with a comprehensive multi-timeframe analysis tool in a single view. This indicator is particularly valuable for traders who employ strategies that rely on higher timeframe context, such as the Power of Three strategy, Turtle Soup, Candle Range Theory (CRT), and Inner Circle Trader (ICT) concepts like Price Delivery (PD) arrays.
> **Notice**: If you find this indicator beneficial for your trading, I would greatly appreciate any contribution in the form of TradingView Coins. Thank you for your support!
Key Features
1. Displays up to 5 higher timeframe candles
2. Customizable higher timeframe selection (5m to Monthly)
3. Adjustable candle appearance (colors, wicks, width)
4. Time labels for easy reference
5. Optional vertical lines to separate HTF candles
6. Offset adjustment to position candles away from the chart edge
7. Customizable wick and border colors
8. Flexible vertical line styles (solid, dashed, dotted)
9. Adjustable time label font sizes
How it Helps Traders
### 1. Multi-timeframe Analysis
By overlaying higher timeframe candles on your current chart, this indicator allows you to easily identify key levels, trends, and potential reversal points across different timeframes without switching between multiple charts.
### 2. Power of Three Strategy
This indicator is invaluable for traders using the Inner Circle Trader (ICT) Power of Three strategy, which focuses on accumulation, manipulation, and distribution phases. The higher timeframe candles help identify these phases more accurately, allowing for better trade entries and exits:
- Accumulation: Identify periods of sideways price action on higher timeframes.
- Manipulation: Spot false breakouts or breakdowns on lower timeframes that are contained within higher timeframe ranges.
- Distribution: Recognize when price is approaching significant higher timeframe levels where smart money may begin to distribute.
### 3. Turtle Soup
Traders can use this indicator to spot potential Turtle Soup setups by identifying key breakout levels on higher timeframes and comparing them to current price action. This helps in:
- Identifying false breakouts that may lead to Turtle Soup trade opportunities.
- Confirming the validity of breakouts by comparing lower timeframe momentum to higher timeframe structure.
### 4. Candle Range Theory (CRT)
This indicator is extremely useful for traders applying Candle Range Theory. CRT focuses on the relationship between the current candle's range and the previous candle's range. By displaying higher timeframe candles, traders can:
- Easily compare candle ranges across multiple timeframes.
- Identify potential breakout or breakdown levels based on the previous HTF candle's range.
- Spot instances where the current lower timeframe price action is testing or breaking significant HTF candle ranges.
- Recognize potential reversal points where price reaches the extremes of higher timeframe candle ranges.
### 5. Support and Resistance
Higher timeframe candles often represent significant support and resistance levels. This indicator makes it easy to spot these levels and incorporate them into your trading decisions, allowing you to:
- Identify key support and resistance levels from higher timeframes.
- Anticipate potential price reactions at these levels on your current timeframe.
- Plan entries, exits, and stop-loss placement with greater precision.
### 6. Trend Identification
By displaying multiple HTF candles, traders can quickly assess the overall trend direction on higher timeframes, helping to align trades with the broader market direction:
- Easily visualize the trend on higher timeframes without changing your chart.
- Identify potential trend changes or continuations based on HTF candle patterns.
- Align your trades with the higher timeframe trend for potentially higher probability setups.
### 7. Enhanced Decision Making
The combination of current timeframe price action and higher timeframe context allows for more informed decision-making, potentially improving trade quality and risk management:
- Validate trade setups by ensuring they align with higher timeframe structure.
- Avoid low-probability trades that conflict with higher timeframe trends or key levels.
- Adjust position sizing based on the proximity to significant HTF levels.
### 8. Time Efficiency
Instead of constantly switching between timeframes, traders can view all necessary information on a single chart, streamlining their analysis process:
- Reduce the time spent switching between multiple charts.
- Quickly assess market conditions across various timeframes.
- Improve focus by having all relevant information in one view.
### 9. ICT Price Delivery (PD) Arrays
The HTF Multi Candles Display is particularly useful for traders familiar with Inner Circle Trader (ICT) concepts, especially in identifying Price Delivery (PD) arrays:
- Visualize potential PD arrays across multiple timeframes without switching charts.
- Identify key swing highs and lows that form PD array structures.
- Recognize patterns such as Breaker Blocks, Inefficient Price Points, and Fair Value Gaps more easily on higher timeframes.
- Spot potential areas where smart money might be accumulating or distributing by analyzing the relationship between HTF candles.
- Use the series of HTF candles to identify potential Order Blocks, which are often key components of PD arrays.
- Recognize Mitigation Points and Liquidity Voids more effectively by analyzing the structure of multiple HTF candles.
By displaying a series of HTF candles, this indicator allows traders to more easily identify and validate ICT concepts like PD arrays, enhancing their ability to spot high-probability trading opportunities and potential market turning points.
Conclusion
The HTF Multi Candles Display indicator is suitable for traders of all levels, from beginners looking to understand market structure across timeframes to experienced traders refining their multi-timeframe analysis techniques. Whether you're day trading, swing trading, or looking for longer-term positions, this indicator provides valuable insights to enhance your trading strategy.
By incorporating higher timeframe context into your analysis, you can make more informed trading decisions, identify high-probability setups, and potentially improve your overall trading performance. The HTF Multi Candles Display is a versatile tool that adapts to various trading strategies and helps traders gain a deeper understanding of market dynamics across multiple timeframes, including advanced concepts like ICT Price Delivery arrays.
Higher Time Frame(HTF)The Higher Time Frame (HTF) will be displayed in a box. You can choose HTF periods from: 15min, 30min, 1hour, 2hour, 3hour, 4hour, 6hour, 8hour, 12hour, 1day, 1week, 2week, 4week, 1month, 2month, 3month, 4month, 6month, and 1year.
An error will occur if you set a period longer than the current candlestick period being displayed. The HTF Box can display a maximum of 500 boxes. There is no guarantee that all combinations of periods will work correctly.
----
上位足(Higher Time Frame, HTF) をボックスで表示します。
上位足の期間は、15分 30分 1時間 2時間 3時間 4時間 6時間 8時間 12時間 1日 1週 2週 4週 1月 2月 3月 4月 6月 1年から選べます。
表示しているローソク足の期間より長い期間を設定しないとエラーとなります。
上位足ボックスは最大500個表示することができます。
全ての期間の組み合わせで正しく動くことを保証するものではありません。
HTF Candle Consistency [LuxAlgo]The HTF Candle Consistency indicator tracks the most recent candle sentiment in up to 10 Higher Timeframe (HTF) and colors the user chart candle bodies based on the dominating sentiment. Users can weigh specific timeframes more significantly.
Additionally, the script provides an HTF dashboard that displays the current directional readouts for each selected timeframe to allow for an independent HTF analysis.
🔶 USAGE
Analyzing the movement and direction of higher timeframe candles can help filter out noisy variation from the price, and could be utilized to time trades better. When the majority of recent candles from the selected timeframes are bullish, the candle body will be colored in green, if this majority is bearish it will be colored in red.
Using the "Tricolor" coloring mode introduces a third coloring option, and is used when there isn't a clear sentiment majority across the selected timeframes, this option effectively allows for filtering out unwanted trends.
Users can control the variations to be filtered out depending on their chart timeframe and the enabled HTF's in the settings. Using low timeframes with higher HTF's will gray out a larger amount of candles, disabling these timeframes, changing them, or giving higher weighting to lower HTF's will allow for obtaining more dominance detection, and as such less grayed-out candles.
As seen above, the weight function allows for precise control over the specific elements being analyzed.
This indicator also features a dashboard for viewing each timeframe's direction at the same time. By doing so, it allows for better judgment on the specific elements composing the current HTF majority.
🔶 DETAILS
This indicator is only intended for Higher Timeframe Analysis, all the input timeframes should be kept equal to or lower than your current chart timeframe.
NOTE: This is necessary for data accuracy in most multi-timeframe indicators, and is generally a good practice to keep in mind.
As a reminder, the dashboard will display the timeframe in red text if a lower timeframe is detected. It is recommended to change or disable this timeframe for your analysis.
This indicator can support up to 10 timeframes, each with independent weightings.
NOTE: When a timeframe is disabled, the dashboard will no longer display that timeframe, and it will not be used in calculations.
🔹 Candle Coloring
Candle color can be selected between 3 modes.
Tricolor (Default): Changes the color based on a 3-part split of the possible data sum range.
Bicolor: Changes the color based on the sum being greater than or less than 0.
Gradient: Uses a 3-color gradient to determine the candle color based on the possible data sum range.
🔶 SETTINGS
🔹 Higher Timeframes
Toggle: Enable/Disable the timeframe from analysis.
Timeframe: Select which timeframe to use for analysis. <- NOTE: This input reflects any custom intervals you have created on Tradingview.
Weight: Determines the Weighting (Multiplier) for the timeframe's direction.
🔹 Style
Color Mode: (More details above) Determines the color mode in use for coloring candles.
🔹 Dashboard
General Settings: Control Toggle, Location, & Size of Dashboard on your chart.
Orientation: Choose to display the dashboard in a "Vertical (default)" or "Horizontal" orientation to fit your style.
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.
HTF FVG and Wick Fill trackingImbalances in the charts are some of the clearest and most traded price areas. Two of the best and most used are fair value gaps FVGs and large candle wicks. In both of these price appears to move in such a way that most are left behind having 'missed' the move. But in reality price will often come back to these price points to re-balance and absorb the liquidity that was left behind.
This indicator takes these areas and makes viewing and tracking them clearer than ever. It does this, by first allowing the user to overlay a higher timeframe candle on the current chart. This in itself provides an in depth look at a higher timeframe candle both as it forms and in its final form.
Next the indicator identifies either the FVG or large wicks, on the chosen higher timeframe, all while the chart remains on a lower timeframe. As seen here the fair value gaps are clearly highlighted, taken from a 4 hour timeframe, while the actual chart is on 15 minutes. This allows the user even greater accuracy in identifying their key trading areas.
Utilizing the indicators unique feature, these areas can optionally be extended forward to the current timeframe and 'filled' in realtime. Areas that are filled to the users defined level, will be removed from the chart.
With supplementary settings for how much history to show, how large of a wick should be highlighted and complete control over the colour scheme, users will be able to track and understand the filling of imbalances like never before.
HTF Candle ProjectionsThe HTF Candle Projections indicator shows a number of candles from a higher time frame (HTF) projected to the right of the candles in the current timeframe. This can be very useful if you want to analyze two different timeframes without the need to switching between the different timeframes.
This indicator is highly inspired by the HTF Power of Three indicator by @toodegrees but is fully free and open source, it also have support for showing more than just one candle in the projection. It is also inspired by the HTF Candle Insights (Expo) indicator by @Zeiierman but differ in the way that it update the HTF candles in real time and also have support for showing Open/High/Low projections that also updates in real time.
This indicator is released under TradingViews default license ( Mozilla Public License 2.0 )
Period SeparatorA useful indicator designed to display vertical line separators at specified periods, for example every hour or every 4 hours.
To use this indicator, you must be in a timeframe lower than the specified timeframe on the indicator.
I haven't found any other scripts that allow for custom time frames so I created my own :)
Let me know if you have any suggestions.
CFX - Plot HTF BarIf you lose track of what's going on while being on the lower timeframes, you can use this indicator in order to plot the higher timeframe bar to the right hand side of the chart.
Supports multiple timeframes
Supports different colors
Supports different color for inside bars
Supports toggle-able pip range
HTF Fair Value Gap [LuxAlgo]The HTF Fair Value Gap indicator aims to display the exact time/price locations of fair value gaps within a higher user-selected chart timeframe.
🔶 USAGE
The indicator can be used to detect higher time frame fair value gaps. Detected historical HTF FVG are displayed as changes in chart background colors, with a green color indicating a bullish FVG and red a bearish FVG.
The most recent HTF FVG is displayed as a candle to the right of the most recent price candle. Dashed lines indicate the exact location of the FVG upper and lower extremities.
The wicks of the FVG candle indicate the price deviation from the FVG extremities after its formation and can help determine where the FVG is located within a trend.
A "Status" dashboard is included to indicate if the FVG is mitigated or not. This is also indicated by the border of the FVG candle, with a solid border indicating an unmitigated FVG.
🔶 SETTINGS
Timeframe: Chart timeframe used to retrieve the fair value gaps
🔹 Style
Offset: Offset to the right (in bars) of the FVG candle from the most recent bar.
Width: Width (in bars) of the FVG candle.
🔹 Dashboard
Show Dashboard: Determine whether to display the dashboard or not.
Location: Location of the dashboard on the chart.
Size: Size of the dashboard on the chart.
Papercuts Time Sampled Higher Timeframe EMA Without SecurityThis EMA uses a higher time sampled method instead of using security to gather higher timeframe data.
Its quite fast and worked well with the timeframes prescribed, up to 8hrs, after 8hrs, the formatting gets more complicated and i probably wouldn't use it anyway.
You can use this as a guide to avoid security and even f_security with this method.
NOTE: This includes the non repainting f_security call so that i woudl be able to check my results against what it does, thats not nessecary to keep at all.
There is some minor differences in data, but its so minor it doesnt bother me, though it would be interesting to know what the difference actually is. If anyone figures that out, leave a comment and let me know!
This is meant to be an example for others to build and learn and play with.. so enjoy!
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
libHTF[without request.security()]Library "libHTF"
libHTF: use HTF values without request.security()
This library enables to use HTF candles without request.security().
Basic data structure
Using to access values in the same manner as series variable.
The last member of HTF array is always latest current TF's data.
If new bar in HTF(same as last bar closes), new member is pushed to HTF array.
2nd from the last member of HTF array is latest fixed(closed) bar.
HTF: How to use
1. set TF
tf_higher() function selects higher TF. TF steps are ("1","5","15","60","240","D","W","M","3M","6M","Y").
example:
tfChart = timeframe.period
htf1 = tf_higher(tfChart)
2. set HTF matrix
htf_candle() function returns 1 bool and 1 matrix.
bool is a flag for start of new candle in HTF context.
matrix is HTF candle data(0:open,1:time_open,2:close,3:time_close,4:high,5:time:high,6:low,7:time_low).
example:
=htf_candle(htf1)
3. how to access HTF candle data
you can get values using .lastx() method.
please be careful, return value is always float evenif it is "time". you need to cast to int time value when using for xloc.bartime.
example:
htf1open=m1.lastx("open")
htf1close=m1.lastx("close")
//if you need to use histrical value.
lastopen=open
lasthtf1open=m1.lastx("open",1)
4. how to store Data of HTF context
you have to use array to store data of HTF context.
array.htf_push() method handles the last member of array. if new_bar in HTF, it push new member. otherwise it set value to the last member.
example:
array a_close=array.new(1,na)
a_close.htf_push(b_new_bar1,m1.lastx("close"))
HTFsrc: How to use
1. how to setup src.
set_src() function is set current tf's src from string(open/high/low/close/hl2/hlc3/ohlc4/hlcc4).
set_htfsrc() function returns src array of HTF candle.
example:
_src="ohlc4"
src=set_src(_src)
htf1src=set_htfsrc(_src,b_new_bar1,m1)
(if you need to use HTF src in series float)
s_htf1src=htf1src.lastx()
HighLow: How to use
1. set HTF arrays
highlow() and htfhighlow() function calculates high/low and return high/low prices and time.
the functions return 1 int and 8arrays.
int is a flag for new high(1) or new low(-1).
arrays are high/low and return high/low data. float for price, int for time.
example
=
highlow()
=
htfhighlow(m1)
2. how to access HighLow data
you can get values using .lastx() method.
example:
if i_renew==1
myhigh=a_high.lastx()
//if you need to use histrical value.
myhigh=a_high.lastx(1)
other functions
functions for HTF candle matrix or HTF src array in this script are
htf_sma()/htf_ema()/htf_rma()
htf_rsi()/htf_rci()/htf_dmi()
method lastx(arrayid, lastindex)
method like array.last. it returns lastindex from the last member, if parameter is set.
Namespace types: float
Parameters:
arrayid (float )
lastindex (int) : (int) default value is "0"(the last member). if you need to access historical value, increment it(same manner as series vars).
Returns: float value of lastindex from the last member of the array. returns na, if fail.
method lastx(arrayid, lastindex)
method like array.last. it returns lastindex from the last member, if parameter is set.
Namespace types: int
Parameters:
arrayid (int )
lastindex (int) : (int) default value is "0"(the last member). if you need to access historical value, increment it(same manner as series vars).
Returns: int value of lastindex from the last member of the array. returns na, if fail.
method lastx(m, _type, lastindex)
method for handling htf matrix.
Namespace types: matrix
Parameters:
m (matrix) : (matrix) matrix for htf candle.
_type (string) : (string) value type of htf candle:
lastindex (int) : (int) default value is "0"(the last member).
Returns: (float) value of htf candle. (caution: need to cast float to int to use time values!)
method set_last(arrayid, val)
method to set a value of the last member of the array. it sets value to the last member.
Namespace types: float
Parameters:
arrayid (float )
val (float) : (float) value to set.
Returns: nothing
method htf_push(arrayid, b, val)
method to push new member to htf context. if new bar in htf, it works as push. else it works as set_last.
Namespace types: float
Parameters:
arrayid (float )
b (bool) : (bool) true:push,false:set_last
val (float) : (float) _f the value to set.
Returns: nothing
method tf_higher(tf)
method to set higher tf from tf string. TF steps are .
Namespace types: series string, simple string, input string, const string
Parameters:
tf (string) : (string) tf string
Returns: (string) string of higher tf.
htf_candle(_tf, _TZ)
build htf candles
Parameters:
_tf (string) : (string) tf string.
_TZ (string) : of timezone. default value is "GMT+3".
Returns: bool for new bar@htf and matrix for snapshot of htf candle
set_src(_src_type)
set src.
Parameters:
_src_type (string) : (string) type of source:
Returns: (series float) src value
set_htfsrc(_src_type, _nb, _m)
set htf src.
Parameters:
_src_type (string) : (string) type of source:
_nb (bool) : (bool) flag of new bar
_m (matrix) : (matrix) matrix for htf candle.
Returns: (array) array of src value
is_up()
last_is_up()
peak_bottom(_latest, _last)
Parameters:
_latest (bool)
_last (bool)
htf_is_up(_m)
Parameters:
_m (matrix)
htf_last_is_up(_m)
Parameters:
_m (matrix)
highlow(_b_bartime_price)
Parameters:
_b_bartime_price (bool)
htfhighlow(_m, _b_bartime_price)
Parameters:
_m (matrix)
_b_bartime_price (bool)
htf_sma(_a_src, _len)
Parameters:
_a_src (float )
_len (int)
htf_rma(_a_src, _new_bar, _len)
Parameters:
_a_src (float )
_new_bar (bool)
_len (int)
htf_ema(_a_src, _new_bar, _len)
Parameters:
_a_src (float )
_new_bar (bool)
_len (int)
htf_rsi(_a_src, _new_bar, _len)
Parameters:
_a_src (float )
_new_bar (bool)
_len (int)
rci(_src, _len)
Parameters:
_src (float)
_len (int)
htf_rci(_a_src, _len)
Parameters:
_a_src (float )
_len (int)
htf_dmi(_m, _new_bar, _len, _ma_type)
Parameters:
_m (matrix)
_new_bar (bool)
_len (int)
_ma_type (string)
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.
HTF Liquidity Dashboard [TFO]The purpose of this indicator is to server as a multi-symbol scanner that indicates when user-defined symbols have exceeded their previous Day/Week/Month highs and lows.
By default, the dashboard will use a compact view where the green ✔ means that price has swept and is currently exceeding the level of interest, the red ❌ implies that price swept the level but reversed back into the original range, and - indicates that the level hasn't been reached. However, the dashboard text can be toggled to show the numerical values of the highs and lows instead of these compact strings, as shown in the following image.
These levels may be shown and customized on the current chart as well via the Show Levels option. By default, levels from the selected timeframes will initially be plotted as black, and will change to red once traded through. Users can optionally increase the Session Limit parameter to show more than one previous high/low on their chart, for each selected timeframe.
Optionally, we can also plot labels to show when any of the user-defined symbols have exceeded their respective highs and lows, for any of the selected timeframes. Alerts can be created for these events as well; simply select the desired symbols and timeframes, create a new alert using this indicator, and you should be alerted when highs and lows are traded through. Note: if you encounter any issues with duplicate alerts, try deleting the alert, navigating to a lower timeframe such as the 1m, and making a new alert.
120x ticker screener (composite tickers)In specific circumstances, it is possible to extract data, far above the 40 `request.*()` call limit for 1 single script .
The following technique uses composite tickers . Changing tickers needs to be done in the code itself as will be explained further.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
🔶 PRINCIPLE
Standard example:
c1 = request.security('MTLUSDT' , 'D', close)
This will give the close value from 1 ticker (MTLUSDT); c1 for example is 1.153
Now let's add 2 tickers to MTLUSDT; XMRUSDT and ORNUSDT with, for example, values of 1.153 (I), 143.4 (II) and 0.8242 (III) respectively.
Just adding them up 'MTLUSDT+XMRUSDT+ORNUSDT' would give 145.3772 as a result, which is not something we can use...
Let's multiply ORNUSDT by 100 -> 14340
and multiply MTLUSDT by 1000000000 -> 1153000000 (from now, 10e8 will be used instead of 1000000000)
Then we make the sum.
When we put this in a security call (just the close value) we get:
c1 = request.security('MTLUSDT*10e8+XMRUSDT*100+ORNUSDT', 'D', close)
'MTLUSDT*10e8+XMRUSDT*100+ORNUSDT' -> 1153000000 + 14340 + 0.8242 = 1153014340.8242 (a)
This (a) will be split later on, for example:
1153014330.8242 / 10e8 = 1.1530143408242 -> round -> in this case to 1.153 (I), multiply again by 10e8 -> 1153000000.00 (b)
We subtract this from the initial number:
1153014340.8242 (a)
- 1153000000.0000 (b)
–––––––––––––––––
14340.8242 (c)
Then -> 14340.8242 / 100 = 143.408242 -> round -> 143.4 (II) -> multiply -> 14340.0000 (d)
-> subtract
14340.8242 (c)
- 14340.0000 (d)
––––––––––––
0.8242 (III)
Now we have split the number again into 3 tickers: 1.153 (I), 143.4 (II) and 0.8242 (III)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
In this publication the function compose_3_() will make a composite ticker of 3 tickers, and the split_3_() function will split these 3 tickers again after passing 1 request.security() call.
In this example:
t46 = 'BINANCE:MTLUSDT', n46 = 10e8 , r46 = 3, t47 = 'BINANCE:XMRUSDT', n47 = 10e1, r47 = 1, t48 = 'BINANCE:ORNUSDT', r48 = 4 // T16
•••
T16= compose_3_(t48, t47, n47, t46, n46)
•••
= request.security(T16, res, )
•••
= split_3_(c16, n46, r46, n47, r47, r48)
🔶 CHANGING TICKERS
If you need to change tickers, you only have to change the first part of the script, USER DEFINED TICKERS
Back to our example, at line 26 in the code, you'll find:
t46 = 'BINANCE:MTLUSDT', n46 = 10e8 , r46 = 3, t47 = 'BINANCE:XMRUSDT', n47 = 10e1, r47 = 1, t48 = 'BINANCE:ORNUSDT', r48 = 4 // T16
( t46 , T16 ,... will be explained later)
You need to figure out how much you need to multiply each ticker, and the number for rounding, to get a good result.
In this case:
'BINANCE:MTLUSDT', multiply number = 10e8, round number is 3 (example value 1.153)
'BINANCE:XMRUSDT', multiply number = 10e1, round number is 1 (example value 143.4)
'BINANCE:ORNUSDT', NO multiply number, round number is 4 (example value 0.8242)
The value with most digits after the decimal point by preference is placed to the right side (ORNUSDT)
If you want to change these 3, how would you do so?
First pick your tickers and look for the round values, for example:
'MATICUSDT', example value = 0.5876 -> round -> 4
'LTCUSDT' , example value = 77.47 -> round -> 2
'ARBUSDT' , example value = 1.0231 -> round -> 4
Value with most digits after the decimal point -> MATIC or ARB, let's pick ARB to go on the right side, LTC at the left of ARB, and MATIC at the most left side.
-> 'MATICUSDT', LTCUSDT', ARBUSDT'
Then check with how much 'LTCUSDT' and 'MATICUSDT' needs to be multiplied to get this: 5876 0 7747 0 1.0231
'MATICUSDT' -> 10e10
'LTCUSDT' -> 10e3
Replace:
t46 = 'BINANCE:MTLUSDT', n46 = 10e8 , r46 = 3, t47 = 'BINANCE:XMRUSDT', n47 = 10e1, r47 = 1, t48 = 'BINANCE:ORNUSDT', r48 = 4 // T16
->
t46 = 'BINANCE:MATICUSDT', n46 = 10e10 , r46 = 4, t47 = 'BINANCE:LTCUSDT', n47 = 10e3, r47 = 2, t48 = 'BINANCE:ARBUSDT', r48 = 4 // T16
DO NOT change anything at t46, n46,... if you don't know what you're doing!
Only
• tickers ('BINANCE:MTLUSDT', 'BINANCE:XMRUSDT', 'BINANCE:ORNUSDT', ...),
• multiply numbers (10e8, 10e1, ...) and
• round numbers (3, 1, 4, ...)
should be changed.
There you go!
🔶 LIMITATIONS
🔹 The composite ticker fails when 1 of the 3 isn't in market in the weekend, while the other 2 are.
That is the reason all tickers are crypto. I think it is possible to combine stock,... tickers, but they have to share the same market hours.
🔹 The number cannot be as large as you want, the limit lays around 15-16 digits.
This means when you have for example 123, 45.67 and 0.000000000089, you'll get issues when composing to this:
-> 123045670.000000000089 (21 digits)
Make sure the numbers are close to each other as possible, with 1 zero (or 2) in between:
-> 1.230045670089 (13 digits by doing -> (123 * 10e-3) + (45.67 * 10e-7) + 0.000000000089)
🔹 This script contains examples of calculated values, % change, SMA, RMA and RSI.
These values need to be calculated from HTF close data at current TF (timeframe).
This gives challenges. For example the SMA / %change is not a problem (same values at 1h TF from Daily data).
RMA , RSI is not so easy though...
Daily values are rather similar on a 2-3h TF, but 1h TF and lower is quite different.
At the moment I haven't figured out why, if someone has an idea, don't hesitate to share.
The main goal of this publication is 'composite tickers ~ request.security()' though.
🔹 When a ticker value changes substantially (x10, x100), the multiply number needs to be adjusted accordingly.
🔶 SETTINGS
SHOW SETS
SET
• Length : length of SMA, RMA and RSI
• HTF : Higher TimeFrame (default Daily)
TABLE
• Size table : \ _ Self-explanatory
• Include exchange name : /
• Sort : If exchange names are shown, the exchanges will be sorted first
COLOURS
• CH%
• RSI
• SMA (RMA)
DEBUG
Remember t46 , T16 ,... ?
This can be used for debugging/checking
ALWAYS DISABLE " sort " when doing so.
Example:
Set string -> T1 (tickers FIL, CAKE, SOL)
(Numbers are slightly different due to time passing by between screen captures)
Placing your tickers at the side panel makes it easy to compare with the printed label below the table (right side, 332201415014.45 ),
together with the line T1 in the script:
t1 = 'BINANCE:FILUSDT' , n1 = 10e10, r1 = 4, t2 = 'BINANCE:CAKEUSDT' , n2 = 10e5 , r2 = 3, t3 = 'BINANCE:SOLUSDT' , r3 = 2 // T1
FIL : 3.322
CAKE: 1.415
SOL : 14.56
Now it is easy to check whether the tickers are placed close enough to each other, with 1-2 zero's in between.
If you want to check a specific ticker, use " Show Ticker" , see out initial example:
Set string -> T16
Show ticker -> 46 (in the code -> t46 = 'BINANCE:MTLUSDT')
(Set at 0 to disable " check string " and NONE to disable " Set string ")
-> Debug/check/set away! 😀
🔶 OTHER TECHNIQUES
• REGEX ( Regular expression ) and str.match() is used to delete the exchange name from the ticker, in other words, everything before ":" is deleted by following regex:
exch(t) => incl_exch ? t : str.match(t, "(?<=:) +")
• To sort, array.sort_indices() is used (line 675 in the code), just as in my first "sort" publication Sort array alphabetically - educational
aSort = arrT.copy()
sort_Indices = array.sort_indices(id= aSort, order= order.ascending)
• Numbers and text colour will adjust automatically when switching between light/dark mode by using chart.fg_color / chart.bg_color
🔹 DISCLAIMER
Please don't ask me for custom screeners, thank you.
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
PD-Box with Fractal Points V1 (by Jonny86FXPro)PD-Box with Fractal Points V1 (by Jonny86FXPro)
This indicator has several functions:
Premium/Discount Box: The two most recent fractal highs and lows form a premium/discount box that provides valuable information about potential price movements.
Fractal Breaker Lines: Two fractal breaker lines are integrated for the high and low points to better visually represent the break of a fractal point.
Customizable: The genius of this indicator is that you can customize everything to your own needs. Whether you want to display lines, or change the colors of the box or lines, everything is possible.
Automatic Adjustment: Once a fractal point is broken, the premium discount automatically adjusts to the current price. Once a new fractal point is formed, the box is automatically adjusted again.
HTF Analysis: Use this indicator for your HTF analysis and determine in which direction the price could develop.
Premium Discount Box Information: When the price is in the premium range, there is a higher probability of a sell-off. However, if the price breaks upward, there is a good chance that it will continue to rise. The opposite is true for the discount range.
Power Behind Each Move: It is important how the price hits the fractal point. If there is power behind each move, the chances are very good that it will continue in that direction. If there is no real power behind it, it could be an indication of a trend reversal.
Weak Breaks: In the premium range, a weak upward break could lead to a bearish move, and in the discount range, a weak downward break through the fractal low point could lead to a move in the bullish direction.
As you can see, this powerful indicator has many functions that can help you determine trend direction and potential price movements.
Quick overview of functions:
Designed for higher timeframes such as 4H chart.
Identifies the last two fractal highs and lows to create a premium/discount box.
Includes two fractal breaker lines for the high and low points to better visually represent fractal breaks.
Customizable to fit individual needs, including the ability to show/hide lines and change box/line colors.
Automatically adjusts premium/discount levels to current price when a fractal point is broken.
Can be used for higher timeframe analysis to determine potential price direction.
Premium/discount box provides insight into potential market direction based on price movement within its range.
Fractal break with strong market momentum indicates a higher chance of trend continuation.
Fractal break with weak market momentum may suggest a potential trend reversal.
A powerful indicator that can greatly assist in determining trend direction.
Market Structure & Liquidity: CHoCHs+Nested Pivots+FVGs+Sweeps//Purpose:
This indicator combines several tools to help traders track and interpret price action/market structure; It can be divided into 4 parts;
1. CHoCHs, 2. Nested Pivot highs & lows, 3. Grade sweeps, 4. FVGs.
This gives the trader a toolkit for determining market structure and shifts in market structure to help determine a bull or bear bias, whether it be short-term, med-term or long-term.
This indicator also helps traders in determining liquidity targets: wether they be voids/gaps (FVGS) or old highs/lows+ typical sweep distances.
Finally, the incorporation of HTF CHoCH levels printing on your LTF chart helps keep the bigger picture in mind and tells traders at a glance if they're above of below Custom HTF CHoCH up or CHoCH down (these HTF CHoCHs can be anything from Hourly up to Monthly).
//Nomenclature:
CHoCH = Change of Character
STH/STL = short-term high or low
MTH/MTL = medium-term high or low
LTH/LTL = long-term high or low
FVG = Fair value gap
CE = consequent encroachement (the midline of a FVG)
~~~ The Four components of this indicator ~~~
1. CHoCHs:
•Best demonstrated in the below charts. This was a method taught to me by @Icecold_crypto. Once a 3 bar fractal pivot gets broken, we count backwards the consecutive higher lows or lower highs, then identify the CHoCH as the opposite end of the candle which ended the consecutive backwards count. This CHoCH (UP or DOWN) then becomes a level to watch, if price passes through it in earnest a trader would consider shifting their bias as market structure is deemed to have shifted.
•HTF CHoCHs: Option to print Higher time frame chochs (default on) of user input HTF. This prints only the last UP choch and only the last DOWN choch from the input HTF. Solid line by default so as to distinguish from local/chart-time CHoCHs. Can be any Higher timeframe you like.
•Show on table: toggle on show table(above/below) option to show in table cells (top right): is price above the latest HTF UP choch, or is price below HTF DOWN choch (or is it sat between the two, in a state of 'uncertainty').
•Most recent CHoCHs which have not been met by price will extend 10 bars into the future.
• USER INPUTS: overall setting: SHOW CHOCHS | Set bars lookback number to limit historical Chochs. Set Live CHoCHs number to control the number of active recent chochs unmet by price. Toggle shrink chochs once hit to declutter chart and minimize old chochs to their origin bars. Set Multi-timeframe color override : to make Color choices auto-set to your preference color for each of 1m, 5m, 15m, H, 4H, D, W, M (where up and down are same color, but 'up' icon for up chochs and down icon for down chochs remain printing as normal)
2. Nested Pivot Highs & Lows; aka 'Pivot Highs & Lows (ST/MT/LT)'
•Based on a seperate, longer lookback/lookforward pivot calculation. Identifies Pivot highs and lows with a 'spikeyness' filter (filtering out weak/rounded/unimpressive Pivot highs/lows)
•by 'nested' I mean that the pivot highs are graded based on whether a pivot high sits between two lower pivot highs or vice versa.
--for example: STH = normal pivot. MTH is pivot high with a lower STH on either side. LTH is a pivot high with a lower MTH on either side. Same applies to pivot lows (STL/MTL/LTL)
•This is a useful way to measure the significance of a high or low. Both in terms of how much it might be typically swept by (see later) and what it would imply for HTF bias were we to break through it in earnest (more than just a sweep).
• USER INPUTS: overall setting: show pivot highs & lows | Bars lookback (historical pivots to show) | Pivots: lookback/lookforward length (determines the scale of your pivot highs/lows) | toggle on/off Apply 'Spikeyness' filter (filters out smooth/unimpressive pivot highs/lows). Set Spikeyness index (determines the strength of this filter if turned on) | Individually toggle on each of STH, MTH, LTH, STL, MTL, LTL along with their label text type , and size . Toggle on/off line for each of these Pivot highs/lows. | Set label spacer (atr multiples above / below) | set line style and line width
3. Grade Sweeps:
•These are directly related to the nested pivots described above. Most assets will have a typical sweep distance. I've added some of my expected sweeps for various assets in the indicator tooltips.
--i.e. Eur/Usd 10-20-30 pips is a typical 'grade' sweep. S&P HKEX:5 - HKEX:10 is a typical grade sweep.
•Each of the ST/MT/LT pivot highs and lows have optional user defined grade sweep boxes which paint above until filled (or user option for historical filled boxes to remain).
•Numbers entered into sweep input boxes are auto converted into appropriate units (i.e. pips for FX, $ or 'handles' for indices, $ for Crypto. Very low $ units can be input for low unit value crypto altcoins.
• USER INPUTS: overall setting: Show sweep boxes | individually select colors of each of STH, MTH, LTH, STL, MTL, LTL sweep boxes. | Set Grade sweep ($/pips) number for each of ST, MT, LT. This auto converts between pips and $ (i.e. FX vs Indices/Crypto). Can be a float as small or large as you like ($0.000001 to HKEX:1000 ). | Set box text position (horizontal & vertical) and size , and color . | Set Box width (bars) (for non extended/ non-auto-terminating at price boxes). | toggle on/off Extend boxes/lines right . | Toggle on/off Shrink Grade sweeps on fill (they will disappear in realtime when filled/passed through)
4. FVGs:
•Fair Value gaps. Represent 'naked' candle bodies where the wicks to either side do not meet, forming a 'gap' of sorts which has a tendency to fill, or at least to fill to midline (CE).
•These are ICT concepts. 'UP' FVGS are known as BISIs (Buyside imbalance, sellside inefficiency); 'DOWN' FVGs are known as SIBIs (Sellside imbalance, buyside inefficiency).
• USER INPUTS: overall setting: show FVGs | Bars lookback (history). | Choose to display: 'UP' FVGs (BISI) and/or 'DOWN FVGs (SIBI) . Choose to display the midline: CE , the color and the line style . Choose threshold: use CE (as opposed to Full Fill) |toggle on/off Shrink FVG on fill (CE hit or Full fill) (declutter chart/see backtesting history)
////••Alerts (general notes & cautionary notes)::
•Alerts are optional for most of the levels printed by this indicator. Set them via the three dots on indicator status line.
•Due to dynamic repainting of levels, alerts should be used with caution. Best use these alerts either for Higher time frame levels, or when closely monitoring price.
--E.g. You may set an alert for down-fill of the latest FVG below; but price will keep marching up; form a newer/higher FVG, and the alert will trigger on THAT FVG being down-filled (not the original)
•Available Alerts:
-FVG(BISI) cross above threshold(CE or full-fill; user choice). Same with FVG(SIBI).
-HTF last CHoCH down, cross below | HTF last CHoCH up, cross above.
-last CHoCH down, cross below | last CHoCH up, cross above.
-LTH cross above, MTH cross above, STH cross above | LTL cross below, MTL cross below, STL cross below.
////••Formatting (general)::
•all table text color is set from the 'Pivot highs & Lows (ST, MT, LT)' section (for those of you who prefer black backgrounds).
•User choice of Line-style, line color, line width. Same with Boxes. Icon choice for chochs. Char or label text choices for ST/MT/LT pivot highs & lows.
////••User Inputs (general):
•Each of the 4 components of this indicator can be easily toggled on/off independently.
•Quite a lot of options and toggle boxes, as described in full above. Please take your time and read through all the tooltips (hover over '!' icon) to get an idea of formatting options.
•Several Lookback periods defined in bars to control how much history is shown for each of the 4 components of this indicator.
•'Shrink on fill' settings on FVGs and CHoCHs: Basically a way to declutter chart; toggle on/off depending on if you're backtesting or reading live price action.
•Table Display: applies to ST/MT/LT pivot highs and to HTF CHoCHs; Toggle table on or off (in part or in full)
////••Credits:
•Credit to ICT (Inner Circle Trader) for some of the concepts used in this indicator (FVGS & CEs; Grade sweeps).
•Credit to @Icecold_crypto for the specific and novel concept of identifying CHoCHs in a simple, objective and effective manner (as demonstrated in the 1st chart below).
CHoCH demo page 1: shifting tweak; arrow diagrams to demonstrate how CHoCHs are defined:
CHoCH demo page 2: Simplified view; short lookback history; few CHoCHs, demo of 'latest' choch being extended into the future by 10 bars:
USAGE: Bitcoin Hourly using HTF daily CHoCHs:
USAGE-2: Cotton Futures (CT1!) 2hr. Painting a rather bullish picture. Above HTF UP CHoCH, Local CHoCHs show bullish order flow, Nice targets above (MTH/LTH + grade sweeps):
Full Demo; 5min chart; CHoCHs, Short term pivot highs/lows, grade sweeps, FVGs:
Full Demo, Eur/Usd 15m: STH, MTH, LTH grade sweeps, CHoCHs, Usage for finding bias (part A):
Full Demo, Eur/Usd 15m: STH, MTH, LTH grade sweeps, CHoCHs, Usage for finding bias, 3hrs later (part B):
Realtime Vs Backtesting(A): btc/usd 15m; FVGs and CHoCHs: shrink on fill, once filled they repaint discreetly on their origin bar only. Realtime (Shrink on fill, declutter chart):
Realtime Vs Backtesting(B): btc/usd 15m; FVGs and CHoCHs: DON'T shrink on fill; they extend to the point where price crosses them, and fix/paint there. Backtesting (seeing historical behaviour):
ICT HTF Candles (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