RSI Ichimoku Cloud + SignalsIndicator Name: RSI Ichimoku Cloud with SMA200 Filter
Description:
This custom indicator combines the Relative Strength Index (RSI) with Ichimoku Cloud logic and a 200-period Simple Moving Average (SMA) applied to RSI, providing enhanced signal filtering and trend validation.
How It Works:
RSI Calculation
Standard RSI is calculated (default period: 14).
Ichimoku Cloud on RSI
Traditional Ichimoku components (Tenkan-sen, Kijun-sen, Senkou Span A & B) are applied directly to the RSI instead of price.
The future cloud (Senkou Span A/B) helps anticipate RSI momentum shifts.
SMA 200 on RSI
A 200-period SMA is calculated on the RSI line, acting as a trend filter.
Only long (buy) signals are allowed when RSI > SMA200.
Only short (sell) signals are allowed when RSI < SMA200.
Entry Signals
Buy Signal: RSI crosses above the Ichimoku cloud + cloud is bullish + Tenkan > Kijun + RSI above SMA200.
Sell Signal: RSI crosses below the cloud + cloud is bearish + Tenkan < Kijun + RSI below SMA200.
Visual Output
Buy and Sell signals are plotted as labels on the main price chart.
The indicator does not draw the RSI or SMA visually, but uses them internally for signal generation.
指標和策略
Extended Altman Z-Score ModelThe Extended Altman Z-Score Model represents a significant advancement in financial analysis and risk assessment, building upon the foundational work of Altman (1968) while incorporating contemporary data analytics approaches as proposed by Fung (2023). This sophisticated model enhances the traditional bankruptcy prediction framework by integrating additional financial metrics and modern analytical techniques, offering a more comprehensive approach to identifying financially distressed companies.
The model's architecture is built upon two distinct yet complementary scoring systems. The traditional Altman Z-Score components form the foundation, including Working Capital to Total Assets (X1), which measures a company's short-term liquidity and operational efficiency. Retained Earnings to Total Assets (X2) provides insight into the company's historical profitability and reinvestment capacity. EBIT to Total Assets (X3) evaluates operational efficiency and earning power, while Market Value of Equity to Total Liabilities (X4) assesses market perception and leverage. Sales to Total Assets (X5) measures asset utilization efficiency.
These traditional components are enhanced by extended metrics introduced by Fung (2023), which provide additional layers of financial analysis. The Cash Ratio (X6) offers insights into immediate liquidity and financial flexibility. Asset Composition (X7) evaluates the quality and efficiency of asset utilization, particularly in working capital management. The Debt Ratio (X8) provides a comprehensive view of financial leverage and long-term solvency, while the Net Profit Margin (X9) measures overall profitability and operational efficiency.
The scoring system employs a sophisticated formula that combines the traditional Z-Score with weighted additional metrics. The traditional Z-Score is calculated as 1.2X1 + 1.4X2 + 3.3X3 + 0.6X4 + 1.0X5, while the extended components are weighted as follows: 0.5 * X6 + 0.3 * X7 - 0.4 * X8 + 0.6 * X9. This enhanced scoring mechanism provides a more nuanced assessment of a company's financial health, incorporating both traditional bankruptcy prediction metrics and modern financial analysis approaches.
The model categorizes companies into three distinct risk zones, each with specific implications for financial stability and required actions. The Safe Zone (Score > 3.0) indicates strong financial health, with low probability of financial distress and suitability for conservative investment strategies. The Grey Zone (Score between 1.8 and 3.0) suggests moderate risk, requiring careful monitoring and additional fundamental analysis. The Danger Zone (Score < 1.8) signals high risk of financial distress, necessitating immediate attention and potential risk mitigation strategies.
In practical application, the model requires systematic and regular monitoring. Users should track the Extended Score on a quarterly basis, monitoring changes in individual components and comparing results with industry benchmarks. Component analysis should be conducted separately, identifying specific areas of concern and tracking trends in individual metrics. The model's effectiveness is significantly enhanced when used in conjunction with other financial metrics and when considering industry-specific factors and macroeconomic conditions.
The technical implementation in Pine Script v6 provides real-time calculations of both traditional and extended scores, offering visual representation of risk zones, detailed component breakdowns, and warning signals for critical values. The indicator automatically updates with new financial data and provides clear visual cues for different risk levels, making it accessible to both technical and fundamental analysts.
However, as noted by Fung (2023), the model has certain limitations that users should consider. It may not fully account for industry-specific factors, requires regular updates of financial data, and should be used in conjunction with other analysis tools. The model's effectiveness can be enhanced by incorporating industry-specific benchmarks and considering macroeconomic factors that may affect financial performance.
References:
Altman, E.I. (1968) 'Financial ratios, discriminant analysis and the prediction of corporate bankruptcy', The Journal of Finance, 23(4), pp. 589-609.
Li, L., Wang, B., Wu, Y. and Yang, Q., 2020. Identifying poorly performing listed firms using data analytics. Journal of Business Research, 109, pp.1–12. doi.org
ADR & ATR OverlayADR & ATR Overlay
This indicator will display the following as an overlay on your chart:
ADR
% of ADR
ADR % of Price
ATR
% of ATR
ATR % of Price
Description:
ADR : Average Day Range
% of ADR : Percentage that the current price move has covered its average.
ADR % of Price : The percentage move implied by the average range.
ATR : Average True Range
% of ATR : Percentage that the current price move has covered its average.
ATR % of Price : The percentage move implied by the average true range.
Options:
Time Frame
Length
Smoothing
Enable or Disable each value
Text Color
Background Color
How to use this indicator:
The ADR and ATR can be used to provide information about average price moves to help set targets, stop losses, entries and exits based on the potential average moves.
Example: If the "% of ADR" is reading 100%, then 100% of the asset's average price range has been covered, suggesting that an additional move beyond the range has a lower probability.
Example: "ADR % of Price" provides potential price movement in percentage which can be used to asses R/R for asset.
Example: ADR (D) reading is 100% at market close but ATR (D) is at 70% at close. This suggests that there is a potential move of 30% in Pre/Post market as suggested by averages.
Notes:
These indicators are available as oscillators to place under your chart through trading view but this indicator will place them on the chart in numerical only format.
Please feel free to modify this script if you like but please acknowledge me, I am only a hobby coder so this takes some time & effort.
TTM Scalper AlertTTM Scalper Alert — Real-Time Pivot Detector
Description:
This is a custom implementation of the classic TTM Scalper Alert, adapted to show early pivot detection and trend structure tracking in real-time. The script identifies potential highs and lows before the full pivot confirmation—giving traders an early edge—and removes outdated signals once pivots are confirmed.
It supports two levels of detection:
Fast Alert Pivots : Identified after Alert Period candles confirm a local reversal.
Confirmed Pivots : Validated only after Pivot Period candles on both sides ensure a true swing high/low.
How It Works:
Fast Detection (Early Pivots):
Detected after Alert Period (AP) candles. These are provisional signals, shown as triangle labels (▲▼) near current price. Only the latest signal is shown; previous fast pivots are deleted to avoid clutter.
Confirmed Pivots:
Detected with a full lookback of Pivot Period (PP) on both sides of the candle. Shown using plotshape with triangle markers (▲▼). Serve as anchors for price structure analysis (HH-HL or LL-LH tracking).
Custom Source Option:
Users can choose to base pivots on High/Low or Close/Open range. Helps adjust sensitivity depending on volatility or bar structure.
How to Interpret:
Trend & Market Structure:
Use Confirmed Pivots (plotshapes) to analyze market structure:
HH → HL: Uptrend
LL → LH: Downtrend
Watch for breaks in structure for possible reversals
Early Alerts:
The floating labels (▲▼) represent early warnings of a potential pivot. Use them to anticipate:
Short-term exhaustion
Quick scalping entries
Divergence setups
Inputs:
Source : Choose from High/Low or Close/Open — affects how pivots are calculated
Alert Period : How fast the script detects an early reversal pattern (used for entry timing)
Pivot Period : How many candles before/after to confirm a full pivot (used for structural analysis)
Best For:
Traders who follow price action and structure
Scalpers and intraday traders who want early signals
Anyone using pivot highs/lows for confluence with other tools (like RSI divergence, Bollinger Bands, VWAP, etc.)
Pro Tips:
Combine this with:
Trend Magic or Supertrend for directional bias
Volume spike filters to confirm reversal intent
RSI/CCI divergence to strengthen reversal pivots
Adjust Alert Period to tune early signal sensitivity (lower = faster but noisier)
Chart Patterns [ActiveQuants]The Chart Patterns indicator is a comprehensive tool designed to automatically identify a variety of common chart patterns directly on your price chart. By detecting sequences of pivot highs and lows , this indicator helps traders spot potential trend continuations , reversals , and key market structures such as Double Tops and Double Bottoms . Enhance your technical analysis by quickly recognizing these formations as they emerge.
How It Works
The indicator operates in a two-stage process:
Pivot Point Detection: It first identifies significant swing highs and swing lows (pivot points) based on a user-defined Period . These pivots form the fundamental building blocks for pattern recognition.
Pattern Recognition: Using the sequence of these detected pivot points, the script then applies logical rules to identify the following patterns:
Lower Low (LL)
Lower Low & Lower High (LL & LH)
Higher High (HH)
Higher High & Higher Low (HH & HL)
Double Tops
Double Bottoms
Patterns are drawn on the chart with connecting lines and labeled for easy identification. Double Tops and Double Bottoms also feature a status system: " Active " while forming, " Confirmed " upon neckline breakout, or " Invalid " if specific conditions negate the pattern before confirmation.
█ KEY FEATURES
Comprehensive Pattern Detection: Identifies six distinct types of chart patterns, offering insights into both trend continuation and potential reversals.
Pivot-Based Analysis: Uses a robust method of identifying pivot highs and lows as the foundation for pattern formation.
Pattern Status for Double Tops/Bottoms:
- Active: A Double Top or Double Bottom pattern has formed its two peaks/troughs and the intervening neckline point, but the price has not yet broken beyond the neckline. The pattern is developing .
- Confirmed: The price has decisively closed beyond the neckline (below for Double Top, above for Double Bottom), signaling a potential entry or validation of the pattern.
- Invalid: An " Active " Double Top or Double Bottom pattern can be invalidated if, before a neckline breakout occurs, a new pivot point forms that negates the pattern’s structural integrity. For example, if a new pivot low forms above or at the neckline of an Active Double Top, the pattern is considered invalid because the market failed to break down and instead showed relative strength.
Customizable Visuals: Allows users to define colors for bullish and bearish patterns, line widths, and the visibility of pivot points.
Selective Pattern Display: Users can choose to display all patterns or filter by status (Active, Confirmed, Invalid) for Double Tops/Bottoms. Individual pattern types can also be toggled on or off.
Historical Analysis Control: The Show Last History (Bars) input allows users to specify how far back the indicator should plot patterns, optimizing performance and chart readability.
Clear Labeling: Patterns are clearly labeled on the chart, with Double Tops/Bottoms also showing " Top 1 ," " Top 2 ," or " Bottom 1 ," " Bottom 2 " labels.
█ PATTERNS DETECTED
Lower Low (LL): Indicates a potential bearish continuation or the start of a downtrend. Forms when price makes a lower low during an uptrend.
Lower Low & Lower High (LL & LH): A stronger confirmation of a bearish trend, where the market forms a lower low followed by a lower high .
Higher High (HH): Signals a potential bullish continuation or the start of an uptrend. Forms when price makes a higher high during a downtrend.
Higher High & Higher Low (HH & HL): A stronger confirmation of a bullish trend, where the market forms a higher high followed by a higher low .
Double Top: A bearish reversal pattern characterized by two distinct peaks at roughly the same price level, separated by a trough (neckline). Confirmation occurs when price breaks below the neckline.
Double Bottom: A bullish reversal pattern featuring two distinct troughs at roughly the same price level, separated by a peak (neckline). Confirmation occurs when price breaks above the neckline.
█ EXAMPLE: DOUBLE TOP INVALIDATION
Understanding how a Double Top or Double Bottom can be invalidated is crucial. Here's an example for a Double Top:
Formation: The indicator identifies two peaks (Top 1, Top 2) at a similar price level, with a corrective trough (Neckline Pivot P5) in between. The pattern is labeled " Double Top " and is in an " Active " state. ( Imagine points P4 and P6 are the two tops, and P5 is the low point of the neckline between them ).
Pre-Breakout Condition: The price action continues, but before it breaks decisively below the P5 neckline level, a new significant swing low (a new pivot low) forms.
Invalidation Check: The indicator checks the price level of this new pivot low. If this new pivot low occurs at a price equal to or higher than the P5 neckline level, the " Active " Double Top pattern is re-labeled as " Invalid Double Top ". ( See image below for a visual representation of this scenario )
In this example, the Double Top formed with Top 1 (P4) and Top 2 (P6). The neckline is at P5. Before price broke below P5, a new pivot low formed at the red circle. Since this new pivot low is above the P5 neckline, the Double Top is marked " Invalid ".
The logic is that the market failed to break the neckline support and instead established a higher low (or a low at the support level), suggesting that the immediate bearish pressure has waned, thus invalidating the bearish reversal implication of the Double Top before it could confirm. A similar logic applies to Double Bottoms (a new pivot high forming below or at the neckline before an upside breakout).
█ USER INPUTS
Visibility and Common Styling
- Show Last History (Bars):
Specifies the number of recent bars the indicator will analyze and plot patterns on.
Default: 3000 bars. Min: 10.
- Patterns:
Filters which patterns are displayed based on their status.
Options: All, Active, Confirmed, Invalid.
Default: All.
- Pattern Line Width:
Sets the thickness of the lines used to draw the patterns.
Default: 1. Min: 1, Max: 10.
- Bearish Color:
Color for bearish patterns (LL, LL & LH, Double Tops).
Default: Red.
- Bullish Color:
Color for bullish patterns (HH, HH & HL, Double Bottoms).
Default: Green.
Pivot Points
- Period:
The lookback period on either side of a bar to qualify it as a pivot high or low. Higher values detect more significant pivots.
Default: 10 bars. Min: 2.
- Show Pivot Highs:
Toggles the visibility of detected pivot high markers.
Default: Enabled.
- Show Pivot Lows:
Toggles the visibility of detected pivot low markers.
Default: Enabled.
- Pivot Highs Color:
Color for the pivot high markers.
Default: #ff5252 (Reddish).
- Pivot Lows Color:
Color for the pivot low markers.
Default: #089981 (Greenish).
Patterns (Toggles)
- Lower Low:
Enable/disable detection and display of Lower Low patterns.
Default: Enabled.
- Lower Low & Lower High:
Enable/disable detection and display of Lower Low & Lower High patterns.
Default: Enabled.
- Higher High:
Enable/disable detection and display of Higher High patterns.
Default: Enabled.
- Higher High & Higher Low:
Enable/disable detection and display of Higher High & Higher Low patterns.
Default: Enabled.
- Double Tops:
Enable/disable detection and display of Double Top patterns.
Default: Enabled.
- Double Bottoms:
Enable/disable detection and display of Double Bottom patterns.
Default: Enabled.
█ CONCLUSION
The Chart Patterns indicator is a versatile and powerful assistant for traders who utilize classical chart pattern analysis. By automating the detection of key formations and providing clear visual cues along with status updates for patterns like Double Tops and Bottoms, it allows traders to focus on strategy development and execution. With its customizable settings, it can be adapted to various instruments and timeframes, making it a valuable addition to any technical trader's toolkit.
█ IMPORTANT NOTES
⚠ Pivot Period Sensitivity: The Period setting for pivot detection is crucial. A shorter period will identify more frequent, smaller swings, while a longer period will focus on more significant turning points. Adjust this setting based on the asset's volatility, the timeframe you are trading and your trading style.
⚠ Confirmation is Key: While the indicator identifies patterns, always wait for pattern confirmation (e.g., neckline breaks for Double Tops/Bottoms) and consider other factors like volume and market context before making trading decisions.
⚠ Confirmed Bars for Detection: Patterns are identified based on confirmed pivot points, which means a pivot is recognized period bars after it has formed. Status updates for Double Tops/Bottoms (Active, Confirmed, Invalid) also occur on confirmed bars. This approach enhances reliability and reduces the likelihood of repainting based on intra-bar price fluctuations.
⚠ Not a Standalone System: Chart patterns provide valuable insights, but they should be used in conjunction with other technical analysis tools (e.g., trendlines, moving averages, oscillators) and a sound risk management plan.
⚠ Lagging Nature: By their very definition, chart patterns are lagging indicators as they require a sequence of price action and several pivot points to complete their formation.
█ RISK DISCLAIMER
Trading involves a substantial risk of loss and is not suitable for every investor. The information provided by the Chart Patterns indicator is for educational and informational purposes only. It should not be considered as financial advice or a recommendation to buy or sell any security. Chart patterns indicate potential price movements but do not guarantee future results. Always perform your own due diligence and consult with a qualified financial advisor before making any investment decisions. Past performance is not indicative of future results.
📈 Happy trading! 🚀
UTSStrategyHelperLibrary "UTSStrategyHelper"
TODO: add library description here
stopLossPrice(sig, atr, factor, isLong)
Calculates the stop loss price using a distance determined by ATR multiplied by a factor. Example for Long trade SL: PRICE - (ATR * factor).
Parameters:
sig (float)
atr (float) : (float): The value of the atr.
factor (float)
isLong (bool) : (bool): The current trade direction.
Returns: (bool): A boolean value.
takeProfitPrice(sig, atr, factor, isLong)
Calculates the take profit price using a distance determined by ATR multiplied by a factor. Example for Long trade TP: PRICE + (ATR * factor). When take profit price is reached usually 50 % of the position is closed and the other 50 % get a trailing stop assigned.
Parameters:
sig (float)
atr (float) : (float): The value of the atr.
factor (float)
isLong (bool) : (bool): The current trade direction.
Returns: (bool): A boolean value.
trailingStopPrice(initialStopPrice, atr, factor, priceSource, isLong)
Calculates a trailing stop price using a distance determined by ATR multiplied by a factor. It takes an initial price and follows the price closely if it changes in a favourable way.
Parameters:
initialStopPrice (float) : (float): The initial stop price which, for consistency also should be ATR * factor behind price: e.g. Long trade: PRICE - (ATR * factor)
atr (float) : (float): The value of the atr. Ideally the ATR value at trade open is taken and used for subsequent calculations.
factor (float)
priceSource (float) : (float): The current price.
isLong (bool) : (bool): The current trade direction.
Returns: (bool): A boolean value.
hasGreaterPositionSize(positionSize)
Determines if the strategy's position size has grown since the last bar.
Parameters:
positionSize (float) : (float): The size of the position.
Returns: (bool): A boolean value.
hasSmallerPositionSize(positionSize)
Determines if the strategy's position size has decreased since the last bar.
Parameters:
positionSize (float) : (float): The size of the position.
Returns: (bool): A boolean value.
hasUnchangedPositionSize(positionSize)
Determines if the strategy's position size has changed since the last bar.
Parameters:
positionSize (float) : (float): The size of the position.
Returns: (bool): A boolean value.
exporthasLongPosition(positionSize)
Determines if the strategy has an open long position.
Parameters:
positionSize (float) : (float): The size of the position.
Returns: (bool): A boolean value.
hasShortPosition(positionSize)
Determines if the strategy has an open short position.
Parameters:
positionSize (float) : (float): The size of the position.
Returns: (bool): A boolean value.
hasAnyPosition(positionSize)
Determines if the strategy has any open position, regardless of short or long.
Parameters:
positionSize (float) : (float): The size of the position.
Returns: (bool): A boolean value.
hasSignal(value)
Determines if the given argument contains a valid value (means not 'na').
Parameters:
value (float) : (float): The actual value.
Returns: (bool): A boolean value.
Pullback Setup HelperThe Pullback Setup Helper is a visual tool designed to assist traders in identifying high-probability pullback entry zones in both bullish and bearish trends. It dynamically calculates support and resistance pullback areas using a combination of recent price extremes and ATR-based volatility measures.
The indicator plots two main zones: one for potential long setups beneath recent highs, and another for short setups above recent lows. These zones are derived from configurable multipliers of the ATR to define depth and width, with an additional buffer to allow for slight overshoots or market noise.
Signals are generated when price enters a pullback zone and closes in the direction of the trend, using a relaxed condition (close > previous close for longs, close < previous close for shorts) to increase signal frequency. Entry signals appear as triangles on the chart, with optional alerts available for both long and short scenarios.
This tool is best used as a contextual guide to support trend-continuation trades, particularly when combined with additional confirmation from momentum or volume indicators.
200-Day SMA & EMA with StdDev Bands and Cross TrackingLocks everything to the daily chart, regardless of which timeframe you’re viewing.
Plots two main moving averages:
A 200‑period Simple Moving Average (SMA).
A 200‑period Exponential Moving Average (EMA).
Draws shaded “bands” around each average at ±0.5σ, ±1σ, ±1.5σ, ±2σ, ±2.5σ, and ±3σ, with progressively fainter lines as you move farther from the mean.
Highlights a “stable zone” in the background when price has stayed within one standard deviation of the SMA for more than a user‑defined number of bars.
Detects and marks “deviation crossovers” between the SMA and EMA bands at 2σ, 2.5σ, and 3σ levels:
Draws a small circle at the crossover point.
Extends a line forward 500 bars at that price.
Automatically removes that line if price later touches it.
Marks Golden and Death Crosses (when the 50‑day EMA crosses the 200‑day EMA):
“GC” for Golden Cross, plotted in green.
“DC” for Death Cross, plotted in red, with the same forward‑extending line logic.
UTSConvenienceToolsLibrary "UTSConvenienceTools"
Convenience tool library containing helper functions for drawing and charting.
isDarkColor(color)
Determines on base of the luminance of the given color if the color can be considered a 'dark' color. Usefull for determining the readable font color for arbitrary colored backgrounds. Credits out to:
Parameters:
color (color) : (color): The actual color value.
Returns: (bool): A boolean value.
smallLabelLowerRight(txt, yPos, bgColor)
Displays the specified `txt` in a small label at the `yPos` of the current bar. The label points to the lower right.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
smallLabelUpperRight(txt, yPos, bgColor)
Displays the specified `txt` in a small label at the `yPos` of the current bar. The label points to the upper right.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
smallLabelCenter(txt, yPos, bgColor)
Displays the specified `txt` in a small label at the `yPos` of the current bar. The label points to the center.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
smallLabelDown(txt, yPos, bgColor)
Displays the specified `txt` in a small label at the `yPos` of the current bar. The label points down.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
smallLabelUp(txt, yPos, bgColor)
Displays the specified `txt` in a small label at the `yPos` of the current bar. The label points down.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
normalLabelLowerRight(txt, yPos, bgColor)
Displays the specified `txt` in a normal label at the `yPos` of the current bar. The label points to the lower right.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
normalLabelUpperRight(txt, yPos, bgColor)
Displays the specified `txt` in a normal label at the `yPos` of the current bar. The label points to the upper right.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
normalLabelCenter(txt, yPos, bgColor)
Displays the specified `txt` in a normal label at the `yPos` of the current bar. The label points to the center.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
normalLabelDown(txt, yPos, bgColor)
Displays the specified `txt` in a normal label at the `yPos` of the current bar. The label points down.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
normalLabelUp(txt, yPos, bgColor)
Displays the specified `txt` in a normal label at the `yPos` of the current bar. The label points down.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
largeLabelLowerRight(txt, yPos, bgColor)
Displays the specified `txt` in a large label at the `yPos` of the current bar. The label points to the lower right.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
largeLabelUpperRight(txt, yPos, bgColor)
Displays the specified `txt` in a large label at the `yPos` of the current bar. The label points to the upper right.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
largeLabelCenter(txt, yPos, bgColor)
Displays the specified `txt` in a large label at the `yPos` of the current bar. The label points to the center.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
largeLabelDown(txt, yPos, bgColor)
Displays the specified `txt` in a large label at the `yPos` of the current bar. The label points down.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
largeLabelUp(txt, yPos, bgColor)
Displays the specified `txt` in a large label at the `yPos` of the current bar. The label points down.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
autoLabelLowerRight(txt, yPos, bgColor)
Displays the specified `txt` in a auto label at the `yPos` of the current bar. The label points to the lower right.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
autoLabelUpperRight(txt, yPos, bgColor)
Displays the specified `txt` in a auto label at the `yPos` of the current bar. The label points to the upper right.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
autoLabelCenter(txt, yPos, bgColor)
Displays the specified `txt` in a auto label at the `yPos` of the current bar. The label points to the center.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
autoLabelDown(txt, yPos, bgColor)
Displays the specified `txt` in a auto label at the `yPos` of the current bar. The label points down.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned above the candle pass 'high'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
autoLabelUp(txt, yPos, bgColor)
Displays the specified `txt` in a auto label at the `yPos` of the current bar. The label points down.
Parameters:
txt (string)
yPos (float) : (float): The y-position value. To have it positioned below the candle pass 'low'.
bgColor (color) : (color): The background color value.
Returns: (bool): A boolean value.
[blackcat] L3 Market Pulse InsightOVERVIEW
The L3 Market Pulse Insight provides comprehensive analytics by evaluating key price metrics to reveal critical market sentiment and potential trade opportunities 📊🔍. This advanced indicator leverages proprietary calculations involving Simple Moving Averages (SMAs), Exponential Moving Averages (EMAs), and custom thresholds to deliver detailed insights into current market dynamics 🚀✨.
By plotting various lines representing core fundamentals and directional cues, traders gain visibility into underlying trends and shifts within the market pulse. The visual aids simplify complex data interpretation, making it easier for users to make strategic decisions based on clear, actionable information ✅⛈️.
FEATURES
Advanced Calculation Techniques:
Employs sophisticated formulas integrating SMAs and EMAs for precise trend analysis.
Incorporates fundamental lines and confirmations based on recent price extremes.
Comprehensive Visualization:
Plots multiple informational lines: Fundamental Line, Thresholds, Institutional Directions, etc., each reflecting unique aspects of price behavior.
Uses distinct colors for easy differentiation between bearish and bullish indications.
Customizable Alerts:
Generates "Buy" and "Sell" labels at pivotal moments, highlighting entry/exit points visually.
Offers flexibility to modify alert styles and positions according to user preferences.
Dynamic Adaptability:
Continuously updates plots and alerts based on incoming real-time data for timely responses.
Provides dynamic support/resistance levels adapting to evolving market conditions.
HOW TO USE
Installing the Indicator:
To start using the L3 Market Pulse Insight, add it via the Pine Editor on TradingView:
Open the editor from the bottom panel.
Copy-paste the provided script code.
Click “Add to Chart” after pasting.
Understanding Key Lines:
Familiarize yourself with what each plotted line signifies:
Fundamental Line: Represents core price movements adjusted through SMA transformations.
Low Confirmation & Warnings: Provide early signals about potential reversals or continuation scenarios.
Threshold B: Acts as a significant barrier indicating overbought/sold conditions.
Institutional Directions: Offer insights into larger player activities and intentions.
Interpreting Signals:
Pay close attention to generated "Buy" and "Sell" labels appearing directly on your chart:
"Buy" Label: Indicates favorable momentum crossing from below the confirmation level upwards.
"Sell" Label: Suggests bearish transitions when moving beneath set thresholds.
Adjusting Parameters:
While this version primarily uses default settings derived from optimal testing ranges, feel free to experiment:
Modify lookback periods in SMA/EMA functions if different timeframes align better with your strategy.
Customize plot colors/styles for enhanced readability and personal taste.
Integrating with Other Tools:
Enhance the reliability of signals produced by combining them with complementary indicators like RSI, MACD, or volume profiles for thorough validation.
Continuous Monitoring:
Regularly review performance and refine strategies incorporating insights gathered from L3 Market Pulse Insight across varying markets and assets.
LIMITATIONS
Data Dependency: Performance heavily relies on accurate historical data without anomalies.
Market Conditions Variability: Effectiveness may vary during extreme volatility or thin liquidity environments.
Parameter Fine-Tuning: Optimal configuration might differ significantly across instruments; continuous adjustments are necessary.
No Guarantees: Like any tool, this doesn't ensure profits and should be part of a broader analytical framework.
NOTES
Ensure solid grounding in technical analysis principles before deploying solely upon these insights.
Utilize backtesting rigorously under diverse market cycles to assess robustness thoroughly.
Consider external factors such as economic reports, geopolitical events influencing asset prices beyond purely statistical models.
Maintain discipline adhering predefined risk management protocols regardless of signal strength displayed here.
THANKS
We appreciate every member's contributions who have engaged actively throughout our development journey, offering constructive feedback driving improvements continually 🙏. Together we strive toward creating ever-more robust tools empowering traders worldwide!
[blackcat] L2 Market Risk MeterOVERVIEW
The L2 Market Risk Meter is designed to evaluate market conditions using various technical indicators including Moving Averages (MA), Moving Average Convergence Divergence (MACD), and Bollinger Bands 📈🔍. By analyzing these elements, the script helps traders identify potential buying opportunities and assess the overall market sentiment more effectively. This comprehensive approach aids in making informed trading decisions by providing clear visual representations of critical market factors 🚀💸.
Key components include the calculation of short-term and long-term moving averages, MACD lines, and Bollinger Bands, which are then used to plot histograms and labels directly on the chart. These visual cues assist traders in quickly interpreting complex market data, thereby enhancing their ability to navigate volatile markets and capitalize on emerging trends ✅✨.
FEATURES
Advanced Technical Analysis:
Utilizes Short and Long Moving Averages (MAs) to capture different trend durations.
Implements MACD for detecting changes in the strength, direction, momentum, and duration of a trend.
Incorporates Bollinger Bands to measure volatility and provide dynamic support/resistance levels.
Comprehensive Visualization:
Generates colored histograms representing positive and negative MACD values.
Displays labels indicating "Safe," "Risk," and "Buy" signals at crucial points on the chart.
Flexible Settings:
Allows customization of the short_ma_period and long_ma_period to tailor the analysis to individual trading styles or asset types.
Provides configurable colors and styles for histograms and labels to suit personal preferences.
Real-Time Feedback:
Updates dynamically as new price data becomes available, ensuring timely insights.
Facilitates rapid identification of shifts in market conditions through clear graphical outputs.
HOW TO USE
Adding the Indicator:
Begin by adding the L2 Market Risk Meter to your chart on TradingView. You can do this via the "Pine Editor" located at the bottom of the screen. Simply copy-paste the script into the editor and click "Add to Chart."
Configuring Parameters:
Adjust the short_ma_period and long_ma_period inputs based on your preferred timeframes and strategies. For example, shorter periods will react faster but may be noisier, while longer periods offer smoother trends but slower reactions.
Interpreting Histograms:
Monitor the plotted histograms closely:
Positive Values: Represent bullish momentum where the closing prices are higher than the moving average.
Negative Values: Suggest bearish pressure when the closing prices fall below the moving average.
Understanding Labels:
Pay attention to generated labels for actionable insights:
"Safe" Zone: Appears when the price crosses from below to above the lower Bollinger Band, suggesting reduced risk.
"Risk" Zone: Indicates heightened caution if the price breaches upward from below the upper Bollinger Band.
"Buy" Signal: Triggered under stringent bullish conditions combining all predefined criteria, signaling an opportune moment to enter long positions.
Integrating with Other Tools:
Use the L2 Market Risk Meter alongside other technical studies and fundamental analyses to corroborate findings and strengthen your trading strategy.
Regular Review:
Periodically revisit and tweak your parameters and interpretations in light of changing market environments and performance evaluations.
LIMITATIONS
Dependency on Historical Data: Since the indicator relies extensively on historical price movements, its predictions about future trends should be viewed cautiously.
Not Standalone Solution: Like any other tool, it does not guarantee profitability and must be part of a holistic trading plan that includes multiple confirmation methods.
Parameter Sensitivity: Optimal performance depends greatly on selecting appropriate MA period lengths; improper choices could lead to misleading signals.
Volatility Assumptions: The effectiveness of Bollinger Bands varies across different market conditions, especially during low volatility phases where bands might fail to expand significantly.
NOTES
Understanding individual components such as MAs, MACDs, and Bollinger Bands is essential before fully depending on this script's output.
Always backtest any new strategy incorporating this meter thoroughly against diverse market scenarios to gauge reliability.
Consider employing supplementary filters like volume spikes or candlestick patterns to validate signals further.
Be mindful of sudden news events or economic releases impacting asset prices independently of underlying trends highlighted here.
THANKS
A big thank you goes out to fellow members of the TradingView community who have contributed invaluable feedback and suggestions throughout the development process of this indicator 🙏. Your input has been instrumental in refining and improving the functionality and usability of the L2 Market Risk Meter. Continue sharing your experiences so we can collectively enhance our trading capabilities!
[blackcat] L1 Swing Reversal IndexOVERVIEW
The indicator is crafted to assist traders in identifying potential swing reversal points within various markets 📈✨. This sophisticated tool combines elements from price deviations, smoothed moving averages, and relative strength indices (RSIs) to generate actionable trade signals, making it easier for users to spot lucrative entry/exit opportunities. By visualizing key market conditions through customizable plots and labels, this indicator simplifies complex analyses into straightforward decisions.
Ideal for day traders or swing traders looking to capitalize on short-to-medium-term trends, the offers invaluable insights into market sentiment changes enabling precise timing of trades.
FEATURES
Dynamic Price Deviation Calculation: Computes adaptive price deviations considering both typical prices and volatility metrics.
Smoothed Deviations: Utilizes dual-smoothing techniques ensuring accurate reflection of underlying trends without excessive noise interference.
Enhanced RSI Integration: Includes a modified version of Relative Strength Index providing clearer overbought/oversold conditions.
Visual Signal Representation:
Colored columns indicating bullish/bearish pressure levels directly on the chart.
Dynamic labels marking specific buy/sell conditions enhancing clarity.
Customizable Parameters: Allows tweaking smoothing, volatility, and RSI periods according to user preferences facilitating tailored usage.
Alert Notifications: Supports real-time alerts via TradingView’s integrated system keeping traders informed promptly ✅🔔.
HOW TO USE
Script Setup:
Save the provided code under Indicators > Add Custom Indicator in your TradingView workspace.
Name appropriately and activate across desired charts.
Parameter Adjustments:
Configure Smoothing, Volatility, and RSI periods based on preferred trading styles or asset characteristics:
Shorter durations suit fast-paced environments while longer ones align better with slower-moving assets.
Experiment iteratively optimizing settings maximizing accuracy for specific needs.
Interpreting Plots/Labels:
Observe colored columns representing current market sentiment:
Green columns signify bullish momentum suggesting possible buying opportunities.
Red columns indicate bearish tendencies hinting at selling chances.
Note dynamic "BUY" & "SELL" labels triggered under predefined criteria guiding timely actions.
Incorporating Signals:
Integrate these generated cues within broader strategies leveraging support/resistance lines, volume data, etc., ensuring robust validation before executing trades.
Cross-reference alongside other complementary tools (e.g., MACD, Bollinger Bands) for added confirmation bolstering decision-making confidence.
Setting Up Alerts:
Enable alert notifications corresponding to crucial conditions ensuring timely updates via TradingView’s notification infrastructure.
Fine-tune alert messages reflecting personal requirements maintaining seamless workflow integration.
Testing & Validation:
Conduct thorough backtesting employing historical datasets verifying effectiveness amidst varying market scenarios.
Continuously refine parameter configurations enhancing overall performance mitigating false positives/negatives.
EXAMPLE SCENARIOS
Short-Term Trades: Capitalize on fleeting reversals by focusing primarily on shorter-period RSIs combined with swift price deviation movements.
Swing Strategies: Utilize medium-range settings identifying intermediate trend shifts maximizing profit potentials while minimizing risks.
LIMITATIONS
Accuracy relies heavily upon correctly configured inputs; hence regular re-evaluation aligning evolving dynamics proves imperative.
Excessive dependence solely on this metric might lead to missed opportunities during sideways/choppy phases necessitating additional confirmatory indicators.
Always complement outputs with fundamental analyses securing comprehensive perspectives effectively managing associated risks.
NOTES
Educational Insights: Gain deeper understanding exploring underlying principles behind price deviations and their role in technical analysis fostering better comprehension.
Risk Management Protocols: Employ strict risk management practices encompassing stop-loss/profit targets preserving capital integrity amid unpredictable market fluctuations.
Continuous Learning: Stay abreast exploring emerging financial landscapes incorporating innovative methodologies augmenting script utility and relevance.
THANKS
Thanks go out to everyone contributing towards refining and improving this script. Your valuable feedback fuels ongoing enhancements propelling superior trading experiences!
Live ICT Manipulation Candle [London Session, DST]📌 Live ICT Manipulation Candle
🔍 What This Script Does:
This indicator highlights the most volatile ( manipulative ) candle during the London session, based on range and volume, in real-time. It is designed specifically for intraday traders who follow ICT ( Inner Circle Trader ) concepts.
Key Features:
Tracks and highlights the manipulation candle between 3:00 AM to 5:00 AM NY time, adjusted for daylight savings (DST).
Displays a colored box around the manipulation candle and optionally shows a "Manipulation" label ( see chart below ).
Works on 1m, 5m, or 15m charts only — ensures high accuracy and alignment with ICT intraday concepts.
Designed for clarity during live session development.
⚠️ Disclaimer & Transparency:
This script was previously removed by TradingView due to being published with protected ( closed ) source code. I apologize for that oversight.
If you're studying ICT concepts or trading the London session volatility, this script can help you visually anchor the key manipulation point each day!
The indicator doesn't put the circles on. I put them to show the key manipulation areas per London session.
Happy trading and stay sharp!
@TJT_Pro
Multi-Timeframe Countdown Timer TTHello TradingView Community,
I'm excited to share the latest version of an indicator I've developed: The **Multi-Timeframe Countdown Timer v6**.
**What is this indicator?**
This indicator provides a clear and convenient countdown showing the time remaining until the *next candle closes* for *multiple timeframes* simultaneously on your chart.
**Key Features & Benefits:**
Tracking candle closing times across different timeframes is crucial for many trading strategies. This indicator makes it easy and visually intuitive:
1. **Multi-Timeframe Support:** Monitor countdowns for several timeframes all at once, including higher timeframes than your current chart view.
2. **Compact Table Display:** See all your chosen timers neatly organized in a small, unobtrusive table directly on your chart.
3. **Full Customization:** Tailor the indicator to your needs! You can easily customize:
* **Display Position:** Choose where the table appears on your chart.
* **Text Size:** Adjust the size of the countdown text for readability.
* **Colors:** Set colors for the background, text, and warning state.
* **Timeframe Selection:** Easily select which timeframes you want to track.
4. **4H Candle Reference Time Adjustment:** A unique feature that allows you to adjust the *start time* reference for the 4-hour candle countdown. This is essential for aligning the timer correctly with different exchange or broker time settings, ensuring accurate 4H tracking.
5. **Warning Color Alert:** The timer changes color (default: red) when there are less than 10 seconds remaining, giving you a clear visual alert just before the candle closes.
**How to Use:**
Simply add the "Multi-Timeframe Countdown Timer v6" indicator to your chart. Open its settings to select the timeframes you want to track, adjust the display position, size, colors, and configure the 4H reference time if needed.
This indicator is perfect for traders who need to stay precise with their timing and monitor activity across various time perspectives without constantly switching timeframes.
I hope you find this tool valuable for your trading! Please give it a try and share any feedback or suggestions in the comments below. If you find it useful, please hit the "Like" button!
Happy Trading!
Relative Directional Volume Indicator# Relative Directional Volume Indicator (RelDirVol)
## Overview
The Relative Directional Volume Indicator (RelDirVol) is a powerful volume analysis tool that measures current trading volume relative to historical volume while differentiating between bullish and bearish volume flows. This indicator helps traders identify unusual volume activity and determine whether it's coming from buyers or sellers, providing deeper insights into market participation and potential trend strength.
## Features
- **Relative Volume Calculation**: Compares current volume to historical averages
- **Directional Volume Analysis**: Separates and visualizes bullish vs bearish volume
- **Multiple Moving Average Options**: Customize smoothing with various MA types (SMA, EMA, WMA, HMA, VWMA)
- **Split Moving Averages**: View distinct moving averages for bullish and bearish volume flows
- **Reference Lines**: Visual guides for normal volume (1.0x) and key deviation levels (0.5x, 2.0x, 3.0x)
- **Customizable Colors**: Adjust visual appearance for improved chart readability
## How It Works
The indicator calculates the relative volume by dividing the current bar's volume by the average volume over a specified lookback period. It then categorizes this volume as either bullish (when price closes above the open) or bearish (when price closes below or equal to the open).
1. **Relative Volume**: Current volume ÷ Average volume from previous N bars
2. **Directional Classification**: Assigns volume to bullish or bearish categories based on price action
3. **Moving Averages**: Applies user-selected moving average to smooth the data
The result is displayed as color-coded histogram bars showing the relative volume magnitude, with optional moving average lines for both overall and direction-specific volume trends.
## Interpretation
### Volume Magnitude
- **Above 1.0**: Higher than average volume (more participation than normal)
- **Below 1.0**: Lower than average volume (less participation than normal)
- **2.0+**: Volume twice the normal level (significant participation)
- **3.0+**: Volume three times normal (exceptional participation, often at key events)
### Directional Analysis
- **Strong Green Bars**: Heavy bullish participation driving prices up
- **Strong Red Bars**: Heavy bearish participation driving prices down
- **Bullish MA > Bearish MA**: Overall buying pressure dominating
- **Bearish MA > Bullish MA**: Overall selling pressure dominating
### Key Signals
- **Volume Spikes with Price Breakouts**: Confirms strength of the move
- **Divergence Between MAs**: Early warning of potential shift in market control
- **Sustained Above-Average Volume**: Strong trend continuation likely
- **Volume Decline After Spike**: Potential exhaustion of trend
## Settings
- **Relative Volume Lookback**: Comparison period for average volume (default: 20)
- **Moving Average Type**: Method used for smoothing (default: SMA)
- **Moving Average Length**: Smoothing period (default: 5)
- **Show Moving Average**: Toggle overall volume MA visibility
- **Show Baseline**: Toggle 1.0 reference line visibility
- **Show Bullish/Bearish MAs**: Toggle direction-specific MA visibility
## Best Practices
This indicator performs best when combined with price action analysis and other indicators. Look for:
1. Volume confirmation of breakouts and trend changes
2. Divergence between price movement and volume direction
3. Shifts in the relationship between bullish and bearish MAs
4. Unusual volume patterns during consolidation phases
Particularly effective for swing trading, day trading, and identifying institutional participation in market moves across multiple timeframes.
Vietnamese Stock Market FTD (Follow Through Day) AlertA Pine Script implementing William O'Neil’s Follow Through Day (FTD) strategy for the Vietnamese stock market. It scans 7 predefined sector groups (Banks, Real Estate, Retail, etc.) to detect momentum breakouts.
Key Features :
Triggers an FTD signal when ≥X groups (default: 3) have ≥Y stocks (default: 2) rising above a Z% threshold (default: 5%) daily.
Highlights qualifying stocks by group in a dynamic label during alerts.
Visualizes strength via histograms and background shading.
Open-source under Mozilla Public License 2.0 .
Purpose : Identify institutional buying and potential market reversals.
Q Momentum FlowQ Momentum Flow
A hybrid trend engine combining breakout-driven momentum shifts with adaptive volatility bands. Designed for traders who want clear entries, intelligent exits, and a balance between reactivity and noise control.
🔧 Core Features
1. Momentum Shift Detection
• Uses dynamic breakout levels (ATR-based) to identify impulse-driven price shifts.
• Filters weak moves by enforcing a cooldown period and direction alternation.
2. Adaptive Trend Framework
• Trend direction is derived from a dual-EMA anchor with dynamic volatility bands.
• Sensitivity automatically adjusts based on smoothed price deviation.
3. Entry & Exit System
• Buy and sell arrows appear on valid momentum + trend alignment.
• Exit markers signal early trend weakening before full reversal.
• Arrows and labels are visually separated to reduce chart clutter.
4. Alerts (Fully Integrated)
• Buy and Sell alerts on valid entry triggers.
• Separate alerts for early exits based on weakening trend conditions.
• Compatible with automation or notification setups.
⚙️ Configurable Inputs
• Trend Length — Controls how fast the adaptive bands react.
• Smoothing — Smooths volatility for more stable band generation.
• Sensitivity — Adjusts band width and breakout tolerance.
• Visual Settings — Customize background color, arrow styles, and label size.
• Exit Logic — Built-in reversal detection to signal when trend weakens.
📈 How to Use
• Follow Buy/Sell arrows for directional entries.
• Stay in trade until either:
— Opposite signal appears, or
— “Exit” label triggers based on adaptive trend weakening.
• Use background and bar colors for regime clarity.
visualizationLibrary "visualization"
method tagLine(message, priceLevel, showCondition, labelPosition, labelSize, offsetX, textColor, bgColor, lineWidth, lineStyle)
Creates a textLabel with line at specified price level
Namespace types: series string, simple string, input string, const string
Parameters:
message (string) : Text to display in the textLabel. If starts with '$', price included. Empty = no textLabel
priceLevel (float) : Price level for textLabel and line positioning
showCondition (bool) : Condition to display the textLabel and line
labelPosition (string) : Label position ("above", "below")
labelSize (string) : Label size
offsetX (int) : X-axis offset for textLabel and line
textColor (color) : Text color
bgColor (color) : Background color
lineWidth (int) : Line width
lineStyle (string) : Line style
Returns: void
textLabel(message, showCondition, position, textColor)
Creates dynamic labels with optional arrows
Parameters:
message (string) : Message to show (prefix with "!" to hide arrow)
showCondition (bool) : Display condition
position (string) : Label position ("above", "below")
textColor (color) : Text color
Returns: void
box(showCondition, topValue, bottomValue, barsBack, borderColor, bgColor)
Creates a box around price range
Parameters:
showCondition (bool) : Condition to draw the box
topValue (float) : Optional custom top value
bottomValue (float) : Optional custom bottom value
barsBack (int) : Number of bars to look back
borderColor (color) : Box border color
bgColor (color) : Box background color
Returns: box Box object
Dynamic Trade Signal Validator (DTSV)The Dynamic Trade Signal Validator (DTSV) is designed to filter false trade signals while generating reliable, frequent trade opportunities. False signals, which lead to unprofitable trades, often occur in choppy or low-momentum markets. The DTSV combines Hull Moving Average (HMA) crossovers, Average True Range (ATR) breakout confirmation, and MACD histogram momentum filtering to ensure signals align with trend, volatility, and momentum, making it ideal for day trading or swing trading across assets like stocks, forex, or cryptocurrencies.
How It Works
The DTSV uses three components to validate trade signals, balancing frequency and reliability:
HMA Crossover for Trend Direction:
Two HMAs (default: 9-period fast, 21-period slow) detect trend changes. A buy signal triggers when the fast HMA crosses above the slow HMA (bullish), and a sell signal when it crosses below (bearish). HMAs reduce lag compared to traditional MAs, enabling more responsive trend detection.
ATR Breakout Confirmation:
The 14-period ATR ensures significant price movement by requiring the bar’s range (high minus low) to exceed the ATR multiplied by 1.0 (adjustable). This confirms volatility, reducing false signals in stagnant markets.
MACD Histogram Momentum Filter:
The MACD (default: 12, 26, 9) histogram confirms momentum. Buy signals require a positive histogram (bullish momentum), and sell signals need a negative histogram (bearish momentum), ensuring directional strength.
Signal Generation
Buy signals (green triangles below bars) occur when a bullish HMA crossover, ATR breakout, and positive MACD histogram align. Sell signals (red triangles above bars) require a bearish crossover, ATR breakout, and negative histogram. This triple confirmation minimizes false trades while maintaining frequent signals.
Smart Trend Lines [The_lurker]
Smart Trend Lines
A multi-level trend classifier that detects bullish and bearish conditions using a methodology based on drawing trend lines—main, intermediate, and short-term—by identifying peaks and troughs. The tool highlights trend strength by applying filters such as the Average Directional Index (ADX) (A), Relative Strength Index (RSI) (R), and Volume (V), making it easier to interpret trend strength. The filter markers (V, A, R) in the Smart Trend Lines indicator are powerful tools for assessing the reliability of breakouts. Breakouts containing are the most reliable, as they indicate strong volume support, trend strength, and favorable momentum. Breakouts with partial filters (such as or ) require additional confirmation, while breakouts without filters ( ) should be avoided unless supported by other strong signals. By understanding the meaning of each filter and the market context.
Core Functionality
1. Trend Line Types
The indicator generates three distinct trend line categories, each serving a specific analytical purpose:
Main Trend Lines: These are long-term trend lines designed to capture significant market trends. They are calculated based on pivot points over a user-defined period (default: 50 bars). Main trend lines are ideal for identifying macro-level support and resistance zones.
Mid Trend Lines: These are medium-term trend lines (default: 21 bars) that focus on intermediate price movements. They provide a balance between short-term fluctuations and long-term trends, suitable for swing trading strategies.
Short Trend Lines: These are short-term trend lines (default: 9 bars) that track rapid price changes. They are particularly useful for scalping or day trading, highlighting immediate support and resistance levels.
Each trend line type can be independently enabled or disabled, allowing traders to tailor the indicator to their preferred timeframes.
2. Breakout Detection
The indicator employs a robust breakout detection system that identifies when the price crosses a trend line, signaling a potential trend reversal or continuation. Breakouts are validated using the following filters:
ADX Filter: The Average Directional Index (ADX) measures trend strength. A user-defined threshold (default: 20) ensures that breakouts occur during strong trends, reducing false signals in range-bound markets.
RSI Filter: The Relative Strength Index (RSI) identifies overbought or oversold conditions. Breakouts are filtered based on RSI thresholds (default: 65 for overbought, 35 for oversold) to avoid signals in extreme market conditions.
Volume Filter: Breakouts are confirmed only when trading volume exceeds a moving average (default: 20 bars) and aligns with the breakout direction (e.g., higher volume on bullish breakouts when the candle closes higher).
Breakout events are marked with labels on the chart, indicating the type of trend line broken (Main, Mid, or Short) and the filters satisfied (Volume, ADX, RSI). Alerts are triggered for each breakout, providing real-time notifications.
3. Customization Options
The indicator offers extensive customization through input settings, organized into logical groups for ease of use:
Main Trend Line Settings
Length: Defines the number of bars used to calculate pivot points (default: 50).
Bullish Color: Color for upward-sloping (bullish) main trend lines (default: green).
Bearish Color: Color for downward-sloping (bearish) main trend lines (default: red).
Style: Line style options include solid, dashed, or dotted (default: solid).
Mid Trend Line Settings
Length: Number of bars for mid-term pivot points (default: 21).
Show/Hide: Toggle visibility of mid trend lines (default: enabled).
Bullish Color: Color for bullish mid trend lines (default: lime).
Bearish Color: Color for bearish mid trend lines (default: maroon).
Style: Line style (default: dashed).
Short Trend Line Settings
Length: Number of bars for short-term pivot points (default: 9).
Show/Hide: Toggle visibility of short trend lines (default: enabled).
Bullish Color: Color for bullish short trend lines (default: teal).
Bearish Color: Color for bearish short trend lines (default: purple).
Style: Line style (default: dotted).
General Display Settings
Break Check Price: Selects the price type for breakout detection (Close, High, or Low; default: Close).
Show Previous Trendlines: Option to display historical main trend lines (default: disabled).
Label Size: Size of breakout labels (Tiny, Small, Normal, Large, Huge; default: Small).
Filter Settings
ADX Threshold: Minimum ADX value for trend strength confirmation (default: 25).
Volume MA Period: Period for the volume moving average (default: 20).
RSI Filter: Enable/disable RSI filtering (default: enabled).
RSI Upper Threshold: Upper RSI limit for overbought conditions (default: 65).
RSI Lower Threshold: Lower RSI limit for oversold conditions (default: 35).
4. Technical Calculations
The indicator relies on several technical calculations to ensure accuracy:
Pivot Points: Pivot highs and lows are detected using the ta.pivothigh and ta.pivotlow functions, with separate lengths for Main, Mid, and Short trend lines.
Slope Calculation: The slope of each trend line is calculated as the change in price divided by the change in bar index between two pivot points.
ADX Calculation: ADX is computed using a 14-period Directional Movement Index (DMI), with smoothing over 14 bars.
RSI Calculation: RSI is calculated over a 14-period lookback using the ta.rsi function.
Volume Moving Average: A simple moving average (SMA) of volume is used to determine if current volume exceeds the average.
5. Strict Mode Validation
To ensure the reliability of trend lines, the indicator employs a strict mode check:
For bearish trend lines, all prices between pivot points must remain below the projected trend line.
For bullish trend lines, all prices must remain above the projected trend line.
Post-pivot break checks ensure that no breakouts occur between pivot points, enhancing the validity of the trend line.
6. Trend Line Extension
Trend lines are dynamically extended forward until a breakout occurs. The extension logic:
Projects the trend line using the calculated slope.
Continuously validates the extension using strict mode checks.
Stops extension upon a breakout, fixing the trend line at the breakout point.
7. Alerts and Labels
Labels: Breakout labels are placed above (for bearish breakouts) or below (for bullish breakouts) the price bar. Labels include:
A prefix indicating the trend line type (B for Main, M for Mid, S for Short).
A suffix showing satisfied filters (e.g., for Volume, ADX, and RSI).
Alerts: Each breakout triggers a one-time alert per bar close, with a descriptive message indicating the trend line type and filters met.
Detailed Code Breakdown
1. Initialization and Inputs
The script begins by defining the indicator with indicator('Smart Trend Lines ', overlay = true), ensuring it overlays on the price chart. Input settings are grouped into categories (Main, Mid, Short, General Display, Filters) for user convenience. Each input includes a tooltip in both English and Arabic, enhancing accessibility.
2. Technical Indicator Calculations
Volume MA: Calculated using ta.sma(volume, volPeriod) to compare current volume against the average.
ADX: Computed using custom dirmov and adx functions, which calculate the Directional Movement Index and smooth it over 14 periods.
RSI: Calculated with ta.rsi(close, rsiPeriod) over 14 periods.
Price Selection: The priceToCheck function selects the price type (Close, High, or Low) for breakout detection.
3. Pivot Detection
Pivot points are detected using ta.pivothigh and ta.pivotlow for each trend line type. The lookback period is set to the respective trend line length (e.g., 50 for Main, 21 for Mid, 9 for Short).
4. Trend Line Logic
For each trend line type (Main, Mid, Short):
Bearish Trend Lines: Identified when two consecutive pivot highs form a downward slope. The script validates the trend line using strict mode and post-pivot break checks.
Bullish Trend Lines: Identified when two consecutive pivot lows form an upward slope, with similar validation.
Trend lines are drawn using line.new, with separate lines for the initial segment (between pivots) and the extended segment (from the second pivot forward).
5. Breakout Detection and Labeling
Breakouts are detected when the selected price crosses the trend line level. The script checks:
Volume conditions (above average and aligned with candle direction).
ADX condition (above threshold).
RSI condition (within thresholds if enabled). Labels are created with label.new, and alerts are triggered with alert.
6. Trend Line Extension
The extendTrendline function dynamically updates the trend line’s endpoint unless a breakout occurs. It uses strict mode checks to ensure the trend line remains valid.
7. Previous Trend Lines
If enabled, previous main trend lines are stored in arrays (previousBearishStartLines, previousBullishTrendLines, etc.) and displayed on the chart, providing historical context.
Disclaimer:
The information and publications are not intended to be, nor do they constitute, financial, investment, trading, or other types of advice or recommendations provided or endorsed by TradingView.
FTC Confirmation (Daily + 60 + 30)This Pine Script strategy provides a "Full Timeframe Confirmation" (FTC) system by analyzing three timeframes: Daily, 60-min, and 30-min. It checks if all timeframes align in the same direction (either bullish or bearish) and colors the current candle accordingly. A green candle indicates a full bullish confirmation, while a maroon candle indicates a full bearish confirmation. This helps identify market trend reinforcement or rejection based on multi-timeframe analysis.
Intraday session start indicatorThis simple tool helps intraday traders by drawing a vertical line at the start of each new daily session. It’s useful for identifying session boundaries and analyzing price action around the open.
✅ Customizable line color
✅ Clean and lightweight – no clutter
🚫 No buy/sell signals – purely a visual guide
Great for scalpers and day traders who want to keep track of daily opens on lower timeframes.
Current Fractal High/Low (Dynamic)
This indicator dynamically tracks the most recent confirmed Fractal High and Fractal Low across any timeframe using custom left/right bar configurations.
🔍 Key Features:
Detects Fractal Highs and Lows based on user-defined pivot settings.
Draws a green line and label ("FH") at the most recent Fractal High.
Draws a red line and label ("FL") at the most recent Fractal Low.
All lines extend from the confirmation bar to the current candle.
Automatically removes old lines and labels for a clean, uncluttered chart.
🛠️ Customizable Inputs:
Left & Right bars for pivot sensitivity
Line width for visibility
📌 Use Cases:
Identifying structure shifts
Recognizing key swing points
Supporting liquidity and breakout strategies
💡 Fractals are confirmed only after the full formation of the pattern (left and right bars). This ensures reliability over reactivity.
This script is designed for intraday to swing traders who want a reliable way to visualize market turning points with minimal noise.