Zero Lag AMA# Zero Lag AMA Indicator
## Overview
The High Probability AMA Indicator is a sophisticated trend-following tool that adapts to market conditions by dynamically adjusting its smoothing factor based on market efficiency. Unlike standard moving averages with fixed parameters, this indicator becomes more responsive during trending markets and more stable during choppy, sideways markets.
### Adaptive Moving Average (AMA)
The AMA adjusts its sensitivity to price changes based on market conditions:
- In trending markets: The AMA closely follows price movements with minimal lag
- In ranging markets: The AMA filters out noise by smoothing price action
### Efficiency Ratio (ER)
The indicator measures market efficiency using the Efficiency Ratio:
ER = Direction / Volatility
Where:
- **Direction** is the absolute net change in price over a period (how far price has moved)
- **Volatility** is the sum of all absolute price changes over the same period (how much price has fluctuated)
The ER ranges between 0 and 1:
- Values close to 1 indicate a strong trend (efficient market movement)
- Values close to 0 indicate a choppy market (inefficient market movement)
### Variable Smoothing Constant
Based on the Efficiency Ratio, the indicator calculates a smoothing constant between two extremes:
- A fast smoothing constant for trending markets
- A slow smoothing constant for ranging markets
The formula is:
SC = ²
Where:
- FastSC = 2/(fastPeriod + 1)
- SlowSC = 2/(slowPeriod + 1)
## Key Features
### Dynamic Volatility Measurement
The indicator calculates price volatility using standard deviation over a customizable period, which helps contextualize price movements relative to recent market conditions.
### AMA Slope Analysis
The indicator tracks the AMA's slope (rate of change) to determine trend direction and strength, providing valuable context beyond just price position relative to the AMA line.
### Visual Trend Identification
The chart background changes color based on trend conditions:
- Green background indicates bullish conditions (price above AMA and positive slope)
- Red background indicates bearish conditions (price below AMA and negative slope)
## Parameters
### Essential Parameters
- **Fast Period (default: 9)**: Controls the most responsive the AMA can be during strong trends
- **Slow Period (default: 15)**: Controls how smooth the AMA becomes during choppy markets
- **Volatility Period (default: 14)**: Period for calculating price standard deviation
- **Efficiency Ratio Period (default: 20)**: Period for calculating the Efficiency Ratio
### Appearance Settings
- **AMA Line Color**: Customize the color of the Adaptive Moving Average line
## How to Use This Indicator
### Trend Identification
The primary use is identifying the current market trend:
- The AMA line direction indicates the overall trend
- Background colors provide quick visual confirmation of trend state
- Price position relative to the AMA line shows the current market bias
### Market Context
- Monitor the AMA slope to gauge trend strength
- Use volatility readings to assess market conditions
- Pay attention to how closely the AMA follows price - tight following indicates trending markets
### Optimal Trading Conditions
- Most reliable signals occur when price breaks and closes beyond the AMA line while the AMA slope confirms the direction
- The indicator performs best on higher timeframes (1H, 4H, Daily) for strategic positions
- Can also be effective on lower timeframes (5m,15m, 30m) when combined with other confirmation tools
## Best Practices
1. **Multiple Timeframe Analysis**: Confirm signals across different timeframes for higher probability setups
2. **Complementary Indicators**: Combine with:
- Volume indicators to confirm trend strength
- Oscillators for potential reversal points
- Support/resistance levels for entry and exit points
3. **Parameter Optimization**: Adjust parameters based on:
- The specific instrument being traded
- Your trading timeframe
- Current market volatility conditions
## Technical Implementation Details
The indicator uses a sophisticated calculation approach:
1. Calculates the Efficiency Ratio using price direction and volatility
2. Determines the appropriate smoothing constant based on market efficiency
3. Applies the smoothing constant to current and previous AMA values
4. Analyzes AMA slope and price position to determine market conditions
5. Provides visual feedback through line color and background shading
This implementation avoids the lag present in traditional moving averages while still filtering market noise, making it particularly valuable during transitions between trending and ranging market conditions.
Indicadores e estratégias
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)
Trend Oscillator# Trend Oscillator: Advanced Technical Analysis Indicator
## Overview
The Trend Oscillator is a sophisticated technical analysis tool designed to identify market trends, momentum shifts, and potential reversal points. Unlike basic oscillators, this indicator combines key analytical approaches to provide a more comprehensive market analysis:
1. **Mean Deviation-Based Oscillator**:(160) At its core, it measures price deviations from moving averages normalized by mean deviation
2. **Fixed Reference Levels**: Clear overbought/oversold thresholds that define extreme market conditions
3. **Trend Filtering**: EMA(36)-based trend direction confirmation to reduce false signals
## Technical Foundation
### Core Calculation Method
The indicator derives its primary oscillator value using a normalized deviation method:
- Calculates a typical price (average of source + high + low)
- Measures the deviation of typical price from its moving average
- Normalizes this deviation by the mean deviation multiplied by a scaling factor (0.015)
This formula effectively creates a momentum oscillator that quantifies how far price has moved from its equilibrium value, relative to typical market volatility.
### Fixed Overbought/Oversold Levels
The Trend Oscillator uses consistent reference levels to identify extreme market conditions:
- Standardized overbought level set at +100
- Standardized oversold level set at -100
- Neutral zone centered around the zero line
These fixed thresholds provide reliable reference points for signal generation and trend strength assessment.
### Trend Filtering Mechanism
The indicator incorporates an EMA-based trend filter that:
- Calculates a directional bias using price position relative to its EMA 36
- Modifies oscillator interpretation based on the prevailing trend
- Helps distinguish between counter-trend corrections and actual reversals
## How to Use the Trend Oscillator
### For Trend Identification
- **Bullish trend**: Oscillator above zero with positive slope
- **Bearish trend**: Oscillator below zero with negative slope
- **Trend strength**: Distance from zero line indicates trend intensity
- **Trend confirmation**: When oscillator and trend filter align
### For Entry Signals
- **Long entry opportunities**:
- Oscillator crossing above the signal line during uptrend
- Oscillator exiting oversold territory with trend filter positive
- Price showing strength while oscillator moves from negative to positive
- **Short entry opportunities**:
- Oscillator crossing below the signal line during downtrend
- Oscillator exiting overbought territory with trend filter negative
- Price showing weakness while oscillator moves from positive to negative
### For Exit Signals
- **Taking profits**: When oscillator approaches extreme levels in your trade direction
- **Stop-loss placement**: When oscillator crosses signal line against your position
- **Trend change warning**: When oscillator crosses zero line against your position
## Customization Options
### General Settings
- **Length**: (160)Controls the calculation period for the oscillator (higher values create smoother, less sensitive readings)
- **Source**: The price data input (close, open, high, low, hl2, hlc3, etc.)
### Signal Line Settings
- **Signal Line**: Optional smoothed version of the oscillator for crossover signals
- **Signal Length**:(36) Determines signal line responsiveness
### Level Settings
- **Overbought/Oversold Levels**: Standard thresholds that define extreme conditions
### Trend Filter Settings
- **Trend Period**: Lookback period for trend direction calculation
- **Trend Source**: Price data used for trend determination
### Visual Settings
- **Show Background Color**: Toggles colored background based on oscillator readings
- **Background Transparency**: Controls the opacity of background coloring
## Trading Strategy Applications
### Trend-Following Approach
1. Enter in the direction of the prevailing trend when:
- Oscillator and trend filter align
- Oscillator crosses signal line in trend direction
- Price pulls back to neutral zone during strong trend
2. Exit when:
- Oscillator crosses signal line against position
- Trend filter changes direction
- Oscillator reaches extreme level in your trade direction
### Counter-Trend Approach
1. Look for reversal opportunities when:
- Oscillator reaches extreme overbought/oversold levels
- Signal line crossover occurs at extreme readings
- Price action confirms potential reversal
2. Exit when:
- Target price levels are reached
- Oscillator returns to neutral zone
- New signals emerge in opposite direction
## Indicator Strengths
- Combines momentum and trend analysis in one comprehensive tool
- Consistent reference levels provide reliable benchmarks
- Reduces false signals through trend filter confirmation
- Visual color-coding provides intuitive market context
## Best Practices
- Effective on all timeframes for trend analysis
- Use in conjunction with support/resistance or price action
- Start with default settings and gradually adjust to your trading style and instrument
- Consider the overall market context when interpreting signals
The Trend Oscillator offers traders a comprehensive technical analysis framework that goes beyond simplistic overbought/oversold readings by incorporating trend context and normalized deviation methodology—providing a nuanced approach to market analysis with clear, consistent reference points.
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! 🚀
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.
Simulated OI Proxy with Moving Average🧠 Simulated Open Interest (OI) Proxy with Moving Average
This custom TradingView indicator estimates market participation and positioning by simulating Open Interest (OI) using a proxy derived from price change and volume movement — useful especially when OI data is unavailable (e.g., NSE stocks or options).
📊 Concept & Logic:
Since TradingView doesn’t provide real OI data for many symbols (like Indian equities), this script uses a smart proxy:
✅ Simulated OI Conditions:
Long Buildup (Green bar):
Price is rising and volume is increasing → suggests fresh buying.
Short Buildup (Red bar):
Price is falling and volume is increasing → suggests new shorts are entering.
Short Covering (Blue bar):
Price is rising but volume is falling → suggests shorts are exiting positions.
Long Unwinding (Orange bar):
Price is falling and volume is dropping → suggests long positions are closing.
Neutral (Gray):
No strong directional signal.
Each condition is assigned a numeric value for analysis:
Long Buildup = +1
Short Buildup = -1
Short Covering = +0.5
Long Unwinding = -0.5
Neutral = 0
📈 Simulated OI Moving Average (Yellow Line):
To remove short-term noise, we apply a Simple Moving Average (SMA) over the simulated OI values (default: 21 periods). This line helps you:
Identify dominant positioning trends (bullish or bearish).
Use it as a signal filter in your trading strategies.
🔧 Customization:
OI MA Period: Adjust how smooth or reactive the moving average should be.
You can change the logic or combine this with EMA, RSI, or price action tools for a complete trading system.
🔍 Use Cases:
Traders in markets where real OI data is not available (like Indian stocks/options).
To analyze buildup and unwinding behavior without relying on exchange-fed OI.
As a momentum filter or signal enhancer in broader strategies.
📌 Note:
This is a proxy indicator, not a substitute for actual Open Interest. But it’s highly effective when used alongside price action and trend filters.
[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!
NY Reversal Pattern StatsThe NY Reversal Pattern Stats indicator is a tool for identifying and analyzing specific price action patterns that occur during the New York trading session. Its goal is to highlight potential reversal or continuation opportunities that may arise from market manipulation or shifts in volatility within this key market window. Beyond simply identifying patterns, the indicator provides valuable historical statistics on their performance, helping traders evaluate their effectiveness.
Key Features
New York Session Highlighting: Clearly visualizes the defined New York trading session directly on your chart.
Automated Pattern Detection: Automatically detects two types of patterns within the New York session:
Manipulation Wick: Identifies instances where price attempts to push significantly beyond a recent session extreme but is rejected, resulting in a wick with the close returning to the original side.
Low Volatility Reversal: Detects price interaction with a recent session extreme where the resulting candle shows lower-than-average volatility, suggesting potential exhaustion or a reversal point.
Pattern Confirmation Tracking: Tracks whether a detected pattern leads to a follow-through move based on a defined confirmation rule (currently, price returning to the session midpoint).
Comprehensive Statistics Table: Displays a detailed table on the chart summarizing:
Total patterns observed.
Number of patterns that were confirmed.
Success and failure rates.
Maximum losing streak.
Statistical relevance metrics (Sigma, Z-Score, P-value) to help assess if the observed success rate is likely due to chance.
A clear description interpreting the statistical relevance and pattern performance (more often right/wrong).
Customizable Visuals: Allows users to control the appearance of the session background and pattern labels.
Alerts: Provides options to set alerts when a new pattern is detected or when a detected pattern is confirmed.
How to Use the Indicator
Add to Chart: Apply the "NY Reversal Pattern Stats" indicator to your desired chart in TradingView.
Configure Inputs: Open the indicator's settings to customize the parameters:
Session Time Definition: Set the exact start hour, minute, and duration (in hours) for the New York session you wish to analyze. Use the "NY Time" inputs (e.g., 6:00 AM - 10:00 AM for Indices, 5:00 AM - 9:00 AM for Forex). The indicator uses the "America/New_York" timezone to handle Daylight Saving Time.
NY Session Visuals: Choose whether to display the session background and pattern labels, and customize their colors.
Pattern Detection: Adjust the sensitivity of the Manipulation Wick threshold and configure the settings for the Low Volatility Reversal pattern detection (enable/disable, ATR length, volatility factor).
Confirmation: Enable or disable the session midpoint confirmation criterion.
Show Statistics Table: Toggle the visibility of the statistics table.
Interpret the Chart: Observe the highlighted New York session windows and the labels indicating detected and confirmed patterns.
Analyze the Statistics Table: Refer to the statistics table for historical performance data.
Total Patterns: Indicates the sample size. More patterns generally lead to more statistically reliable results.
Confirmed/Failed: Shows the raw counts of successful and unsuccessful patterns based on the confirmation rule.
Success/Fail Rate (%): Provides the percentage of patterns that met or did not meet the confirmation criterion.
Statistical Relevance: Read the description provided in the table. It interprets the Z-Score and sample size to tell you if the observed success rate is statistically significant (i.e., unlikely to be just random chance).
Pattern Performance: Read the description indicating whether the pattern has historically been "More often right than wrong" or "More often wrong than right" based on the success rate.
Sigma / Z-Score / P-value: These are standard statistical measures. A higher absolute Z-Score and a lower P-value (especially below 0.05 or 0.01) suggest stronger statistical evidence that the pattern's success rate is different from a random 50/50 outcome.
Set Alerts: If desired, configure alerts to be notified when patterns are detected or confirmed, allowing you to potentially take action in real-time.
Interpretation of Results
High Success Rate + High Statistical Relevance: This combination suggests the detected pattern, as defined and confirmed by the indicator, has historically shown a consistent edge within the specified New York session window, and this performance is unlikely due to random chance.
High Success Rate + Low Statistical Relevance: The pattern has performed well in the observed data, but the sample size might be too small for high confidence that this performance will continue.
Low Success Rate + High Statistical Relevance: The pattern, as defined, has historically shown a tendency to fail more often than succeed, and this underperformance is statistically significant.
Low Statistical Relevance (Regardless of Success Rate): The sample size is insufficient to draw strong conclusions about the pattern's effectiveness. More historical data is needed.
Remember that past performance is not indicative of future results. Statistical analysis provides insights into historical tendencies, but trading decisions should always involve a comprehensive analysis and risk management plan.
Limitations
Timeframe Dependency: The pattern detection and session high/low accumulation operate on the chart's current timeframe. It does not specifically analyze only the 4-hour candles as might be implied by "4H Candle Profiling Patterns".
Confirmation Criterion: The confirmation rule is fixed to price returning to the session midpoint. If your strategy uses a different confirmation or target, this indicator's statistics may not directly reflect its performance.
No London/Asia Filter: The indicator does not check the performance or characteristics of the London or Asia sessions to filter for instances where "London and Asia Fail".
Potential Timezone Compiler Issues: While the code uses standard v6 timezone handling, some specific TradingView environments may exhibit unexpected behavior with timezone strings, potentially affecting the precise timing of the session boundaries.
This indicator is a powerful tool for analyzing specific price action patterns during the New York session. By understanding its inputs, outputs, and limitations, traders can gain valuable insights into potential trading opportunities.
[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
RunRox - Entry Model🎯 RunRox Entry Model is an all-in-one reversal-pattern indicator engineered to help traders accurately identify key price-reversal points on their charts. It will be part of our premium indicator package and improve the effectiveness of your trading strategies.
The primary concept of this indicator is liquidity analysis, making it ideal for Smart Money traders and for trading within market structure. At the same time, the indicator is universal and can be integrated into any strategy. Below, I will outline the full concept of the indicator and its settings so you can better understand how it works.
🧬 CONCEPT
In the screenshot below, I’ll schematically illustrate the core idea of this indicator. It’s one of the patterns that the indicator automatically detects on the chart using a two-timeframe approach. We use the higher timeframe to identify liquidity zones, and the lower timeframe to capture liquidity removal and structure breaks. The schematic is shown in the screenshot below.
Our indicator includes three entry models in total , and I will discuss its functionality and features in more detail later in this post.
💡 FEATURES
Three entry models
PO3 HTF Bar
Entry Area
Optimization for each Entry Area
Filters
HTF FVG
Alert customization
Next, we will examine each entry model in detail.
🟠 ENTRY MODEL 1
The first model is the core one we’ll work with; all other models rely on its structure and construction. In the screenshot below, I’ll schematically show the complete model.
As shown in the screenshot above, we display higher-timeframe candles on the current chart to better visualize the entry model and keep the trader informed of what’s happening on the larger timeframe. The screenshot also highlights both the Long and Short models, as well as the Entry Area, which I will explain in more detail below.
The schematic model on the lower timeframe is shown in the screenshot above. It illustrates that after the Entry Model forms, we draw the Entry Area on the next candle and wait for a price pullback into this zone for the optimal trade entry. Statistically, before moving higher, the price typically revisits the Entry Area, covering the imbalances created by MSS; thus, the Entry Area represents the ideal entry point.
🟩 Entry Area
Once the Entry Model has formed, we focus on identifying the optimal pullback zone for taking a position. To determine which retracement area performs best, we conducted extensive historical backtesting on potential zones and selected those that consistently delivered the strongest results. This process yields Entry Areas with the highest probability of a successful reversal.
On the screenshot above, you can see an example of the Entry Area and which zones carry a higher versus lower probability of reversal. Zones rendered with greater transparency have historically delivered weaker results than the more opaque zones. The deeper-colored areas represent the optimal entry zones and can improve your risk-reward ratio by allowing you to enter at more favorable prices.
It’s important to remember that the entire Entry Area functions as a potential zone for scaling into a position. However, if your risk-to-reward ratio isn’t favorable, you can wait for the price to retrace to lower levels within the Entry Area and enter with a more attractive risk-to-reward.
🟢 Pattern Rating
Each entry model receives a rating in the form of green circles next to its name 🟢. The rating ranges from one to four circles, based on the historical performance of similar patterns. To calculate this rating, we backtest past data by analyzing candle behavior during the model’s formation and assign circles according to how similar patterns performed historically.
Example Ratings:
🟢 – One circle
🟢🟢 – Two circles
🟢🟢🟢 – Three circles
🟢🟢🟢🟢 – Four circles
The more green circles a model has, the more reliable it is—but it’s crucial to rely on your own analysis when identifying strong reversal points on the chart. This rating reflects the model’s historical performance and does not guarantee future results, so keep that in mind!
Below is a screenshot showing four model variations with different ratings on the chart.
⚠️ Unconfirmed Pattern
Entry Model 1 is designed so that, until the higher-timeframe candle closes, the pattern remains unconfirmed and is hidden on the chart. For traders who prefer to see setups as they form, there’s a dedicated feature that displays the unconfirmed pattern at the moment of its appearance - triggered by the Market Structure Shift - before the HTF candle closes. The screenshot below shows what the pattern looks like prior to confirmation.
‼️IMPORTANT: Until the pattern is confirmed and the higher-timeframe candle has closed, the model may disappear from the chart if price reverses and the HTF candle closes below the previous bar. Therefore, this mode is suitable only for experienced traders who want to see market moves in advance. Remember that the pattern can be removed from the chart, so we recommend waiting for the HTF candle to close before deciding to enter a trade.‼️
✂️ Filters
For the primary model, there are four filters designed to enhance entry points or exclude less-confirmed patterns. The filters available in the indicator are:
Bounce Filter
Market Shift Mode
Same Wave Filter
Only with Divergence
I will explain how each of these filters works below.
- Bounce Filter
The Bounce Filter identifies significant deviations of price from its mean and only displays the Entry Model once the asset’s price moves beyond the average level. The screenshot below illustrates how this appears on the chart.
The actual average-price calculation is more sophisticated than what’s shown in the screenshot, that image is just an illustrative example. When the price deviates significantly from the N-bar average, we start looking for the Entry Model. This approach works particularly well in range-bound markets without a clear trend, as it lets you trade strong deviations from the mean.
- Market Shift Mode
This filter works by detecting the initial impulse that triggered the liquidity sweep on the previous higher-timeframe candle, and then holding the Market Structure Shift level at that point after the sweep. If the filter is turned off, price may move higher following the liquidity removal, creating a new MSS level and potentially producing a false structure shift and entry signal on the formed model.
This filter helps you more accurately identify genuine shifts - but keep in mind that the model can still perform well without it, so choose the setting that best suits your trading style.
- Same Wave Filter
The Same Wave Filter removes entry models that form without a clear lower-timeframe structure when liquidity is swept from the previous higher-timeframe candle. In other words, if the prior HTF candle and the current one belong to the same impulse wave - without any retracements on the LTF - the model is filtered out.
Keep in mind that this filter may also exclude patterns that could have produced positive results, so whether to enable it depends on your trading system.
- Only with Divergence
The Only with Divergence filter detects divergence between the lows of successive candles and indicators like RSI. When the low that swept liquidity diverges from the previous candle’s low, the indicator displays a “DIV” label. Although RSI is cited as an example, our divergence calculation is more advanced. This filter highlights patterns where low divergence signals genuine liquidity manipulation and a likely aggressive price reversal.
🌀 Model Settings
Trade Direction: Choose whether to display models for Long or Short trades.
Fractal: Select between automatic fractal detection—which adapts the lower-timeframe (LTF) and higher-timeframe (HTF) candles—or Custom.
Custom Fractal: When Custom is selected, manually specify the LTF and HTF timeframes used to detect the patterns.
History Pattern Limit: Set the maximum number of patterns to display on the chart to keep it clean and uncluttered.
🎨 Model Style
You can flexibly customize the model’s appearance by choosing your preferred line thickness, color, and the other settings we discussed above.
🔵 ENTRY MODEL 2
This model appears under specific conditions when Model 1 cannot form. It’s a price-reversal model constructed according to different rules than the first model. The screenshot below shows how it looks on the chart.
This model forms less frequently than Model 1 but delivers equally strong performance and is displayed as a position-entry zone.
Like the Entry Area in Entry Model 1, this zone is calculated automatically and highlights the best entry levels: areas that showed the strongest historical results are rendered in a brighter shade.
🎨 Model Style
You can flexibly customize the style of Entry Model 2 - its color, opacity, visibility, and the average price of the previous candle.
🟢 ENTRY MODEL 3
Entry Model 3 is a continuation pattern that only forms after Entry Model 1 has completed and delivered the necessary price move to trigger Model 3.
Below is a schematic illustration of how Model 3 is intended to work.
🎨 Model Style
As with the previous models, you can flexibly customize the style of this zone.
⬆️ HTF CANDLES
One of the standout features of this indicator is the ability to plot higher-timeframe (HTF) candles directly on your lower-timeframe (LTF) chart, giving you clear visualization of the entry models and insight into what’s unfolding on the larger timeframe.
You can fully customize the HTF candles - select their style, the number of bars displayed, and tweak various settings to match your personal trading style.
HTF FVG
Fair Value Gaps (FVGs) can also be drawn on the HTF candles themselves, enabling you to spot key liquidity or interest zones at a glance, without switching between timeframes.
Additionally, you can view all significant historical HTF highs and lows, with demarcation lines showing where each HTF candle begins and ends.
All these options let you tailor the HTF candle display on your chart and monitor multiple timeframes’ trends in a single view.
📶 INFO PANEL
Instrument: the market symbol on which the model is detected
Fractal Timeframes: the LTF and HTF fractal periods used to locate the pattern
HTF Candle Countdown: the time remaining until the higher-timeframe candle closes
Trade Direction: the direction (Long or Short) in which the model is searched for entry
🔔 ALERT CUSTOMIZATION
And, of course, you can configure any alerts you need. There are seven alert types available:
Confirmed Entry Model 1
Unconfirmed Entry Model 1
Confirmed Entry Model 2
Confirmed Entry Model 3
Entry Area 1 Trigger
Entry Area 2 Trigger
Entry Area 3 Trigger
You also get a custom macro field where you can enter any placeholders to fully personalize your alerts. Below are example macros you can use in that field.
{{event}} - Event name ('New M1')
{{direction}} - Trade direction ('Long', 'Short')
{{area_beg}} - Entry Area Price
{{area_end}} - Entry Area Price
{{exchange}} - Exchange ('Binance')
{{ticker}} - Ticker ('BTCUSD')
{{interval}} - Timeframe ('1s', '1', 'D')
{{htf}} - High timeframe ('15', '60', 'D')
{{open}}-{{close}}-{{high}}-{{low}} - Candle price values
{{htf_open}}-{{htf_close}}-{{htf_high}}-{{htf_low}} - Last confirmed HTF candle's price
{{volume}} - Candle volume
{{time}} - Candle open time in UTC timezone
{{timenow}} - Signal time in UTC timezone
{{syminfo.currency}} - 'USD' for BTCUSD pair
{{syminfo.basecurrency}} - 'BTC' for BTCUSD pair
✅ USAGE EXAMPLES
Now I’ll demonstrate several ways to apply this indicator across different trading strategies.
Primarily, it’s most effective within the Smart Money framework - where liquidity and manipulation are the core focus - so it integrates seamlessly into your SMC-based approach.
However, it can also be employed in other strategies, such as classic technical analysis or Elliott Wave, to capitalize on reversal points on the chart.
Example 1
The first example illustrates forming a downtrend using a Smart Money strategy. After the market structure shifts and the first BOS is broken, we begin looking for a short entry.
Once Entry Model 1 is established, a Fair Value Gap appears, which we use as our position-entry zone. The nearest target becomes the newly formed BOS level.
In this trade, it was crucial to wait for a strong downtrend to develop before hunting for entries. Therefore, we waited for the first BOS to break and entered the trade to ride the continuation of the downtrend down to the next BOS level.
Example 2
The next example illustrates a downtrend developing with a Fair Value Gap on the 1-hour timeframe. The FVG is also displayed directly on the HTF candles in the chart.
The pattern forms within the HTF Fair Value Gap, indicating that we can balance this inefficiency and ride the continuation of the downtrend.
The target can simply be a 1:2 or 1:3 risk–reward ratio, as in our case.
📌 CONCLUSION
These two examples illustrate how this indicator can be used to identify reversals or trend continuations. In truth, there are countless ways to incorporate this tool, and each trader can adapt the model to fit their own strategy.
Always remember to rely on your own analysis and only enter trades when you feel confident in them.
Base Detector Pro [AletheiaTradeLab]This custom Trading View indicator combines William O’Neal “Base” patterns with several complementary tools—David Ryan’s ANT indicator, key pivot‐based price levels, index and earnings lines, relative strength (RS) line, and moving averages—to help you pinpoint base formations and validate whether each one merits a trade.
1. Bases (William O'Neal)
A “base” is simply a period of price consolidation following a significant run-up. During this phase, a stock moves mostly sideways within a defined trading range, forming clear support and resistance lines.
Key Criteria for a Valid Base
- Prior Uptrend
Before a base begins, the stock should already have a healthy advance—typically at least a 30% gain.
- Shapes of Bases
Bases can form in several distinct geometric patterns, each signaling a different kind of consolidation and potential breakout:
Flat Base
Shape : A horizontal rectangle bounded by nearly parallel support (bottom) and resistance (top) trendlines.
Minimum Length : 5 weeks
Maximum Length : 65 weeks
Depth : < 15%
Pivot Point : Left-side high of base
i.ibb.co i.ibb.co
Cup Base
Shape : A smooth, rounded “U” curve.
Minimum Length : 6 weeks
Maximum Length : 65 weeks
Minimum Depth : 8%
Maximum Depth : 50%
Pivot Point : Left-side high of base
i.ibb.co i.ibb.co
Sauce Base
Shape : A very gradual, broad “U” curve, often taking more length than cup bases.
Minimum Length : 6 weeks
Maximum Length : 65 weeks
Minimum Depth : 8%
Maximum Depth : 50%
Pivot Point : Left-side high of base
i.ibb.co i.ibb.co
Cup with Handle Base
Shape : A “U”‐shaped cup followed by a smaller downward-sloping flag or channel (the handle).
Minimum Length : 6 weeks
Maximum Length : 65 weeks
Minimum Depth : 8%
Maximum Depth : 50%
Pivot Point : High of the handle
i.ibb.co i.ibb.co
Saucer with Handle Base
Shape : Similar to cup with handle, but cup looks like the saucer base.
Minimum Length : 6 weeks
Maximum Length : 65 weeks
Minimum Depth : 8%
Maximum Depth : 50%
Pivot Point : High of the handle
i.ibb.co
Ascending Base
Shape : An upward-sloping channel or wedge with 3 pullbacks. Each pullback low should be higher than the previous one. It needs around 20% increase from a base to the other.
Minimum Length : 8 weeks
Maximum Length : 16 weeks
Minimum Depth : 8%
Maximum Depth : 50%
Pivot Point : Left-side high of third base
i.ibb.co i.ibb.co
Consolidation Base
Shape : Similar to flat base, but wider and fails to form any of the above bases.
Minimum Length : 8 weeks
Maximum Length : 16 weeks
Minimum Depth : 8%
Maximum Depth : 50%
Pivot Point : Left-side high of base
i.ibb.co i.ibb.co
- Base Stages
Once a stock has completed its initial 30% run-up and formed its first base, that pattern is labeled Stage 1.
After a breakout from Stage N, the stock must rally at least 20% above the Stage N pivot (the base’s resistance point). If it does, the next valid base becomes Stage N + 1.
When a breakout fails to advance at least 20% a base on base forms. This is considered an extension for the current base stage, and a letter is assigned after the stage number.
When a breakout fails and the price undercuts the low for the previous base, the base stages reset, and a rally of 30% will be needed to form a new stage 1 base.
Note that for IPO stocks, a 30% increase is not required to form the first base. As soon as it meets any of the shape of any of the available bases, it will be drawn.
- Base statistics
To help you determine how healthy is a base, some statistics are available when you hover on the small dot shown above the high-left side of each base.
i.ibb.co
Base : The specific pattern type (Flat, Cup, Sauce, etc.).
Stage : The stage number of the base (1, 2, 3 …) and, in parentheses, how many distinct bases have formed since the very first base (including base-on-base like 1a, 1b, etc.).
Pivot : The resistance level that defines the top of the base. A close above this price often signals a valid breakout and a potential entry point.
Length : The number of bars (days on a daily chart; weeks on a weekly chart) between the start of the base and the bar immediately before breakout. (The initial bar and the breakout bar themselves are not counted.)
Depth : How far, in percentage terms, the low of the base has fallen below its left-side high.
Prior Uptrend : The percent gain from the pivot of the previous base up to the start of the current base.
Blue/Red Count : The number of up days (Blue) and down days (Red) during the base where volume was above the 50-period moving average.
Price % : The percent change from the close at the end of the base to the close at the breakout bar.
Volume % : The percent difference between the volume on the breakout bar and the 50-period average volume at the end of the base.
2. ANT Indicator (David Ryan)
The ANT indicator, developed by David Ryan, is a momentum-based signal used to identify high-potential breakout candidates during a stock’s run-up phase. It complements the base patterns by flagging moments of unusually strong price and volume activity within an uptrend, helping confirm emerging strength before or during a base formation.
i.ibb.co
3. Key Price Levels (Pivots)
Plots recent pivot-based support and resistance levels.
i.ibb.co
4. Index Line Overlay
Overlays a chosen index (e.g. SPX) on the top portion of the chart to compare relative performance.
i.ibb.co
5. Relative Strength (RS) Line
Plots the price ratio of the symbol vs. an index (e.g. SPX) to identify outperformance.
i.ibb.co
6. Moving Averages (SMA & RS-MA)
Allows up to four simple (or exponential) moving averages on price (daily/weekly) and three on the RS line.
7. Earnings Line & EPS Change
Marks earnings events on daily/weekly charts and optionally plots YoY EPS change in a lower portion of the chart. The earnings line also shows a projection to estimated earnings. To maintain alignment with the price chart, the line and YoY EPS data are limited to the most recent 28 quarters on weekly charts and 8 quarters on daily charts. For analyzing older data, you can use the replay feature.
i.ibb.co
8. Bars
Since Trading View displays very thin bars when zoomed out, I added 2-pixel-wide vertical lines over the bars to make them easier to see.
9. Dark Theme
I added this for a quick workaround to adapt colors for dark theme. Enabling this overrides any custom settings. Uncheck to customize colors.
i.ibb.co
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.
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.
Session Close/OpenThis indicator allows traders to mark and track two custom session times throughout each trading day, with flexible time zone and price source configuration.
Features:
Two configurable timestamps (e.g., session open and close) with adjustable hour and minute inputs.
Choose between multiple time zones: UTC-4 = New York
Mark the price at each selected time using either open, close, high, low, or any other price source.
Tracks and plots both current session and previous session values for each time point.
Visual markers appear as colored circles on the chart for clarity.
Built-in alert conditions when the live price touches either the current or previous session levels.
Use Cases:
- Monitor price reactions at key session opens or closes.
- Set alerts for breakouts or touches at specific time-based levels.
- Combine with other strategies to enhance time-based decision making.
- Perfect for intraday traders who want precise control over session-based reference points.
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.
Position Size CalculatorPosition Size Calculator - User Guide
A simple tool to calculate optimal position size based on your risk preferences, visualize trade levels, and automatically determine trade direction.
Introduction
The Position Size Calculator is a TradingView indicator designed to help traders calculate the optimal position size for their trades based on account size and risk tolerance. This tool visually represents entry, stop loss, and take profit levels while automatically calculating the appropriate position size to maintain consistent risk management.
Getting Started
Setting Up Your Account Parameters
Setting Price Levels
Understanding the Visual Elements
Adjusting Your Trade on the Chart
Reading the Information Panel
1. Getting Started
After adding the indicator to your chart, you'll see three horizontal lines representing:
Yellow line: Entry price
Green line: Take profit price
Red line: Stop loss price
The indicator automatically detects whether you're planning a Long or Short trade based on the position of your take profit relative to your entry.
2. Setting Up Your Account Parameters
In the "Position Calculator" settings group:
Account Size : Enter your total account balance
Account Currency : Set your account currency (USD, EUR, etc.)
Risk (%) : Enter the percentage of your account you're willing to risk per trade (e.g., 2%)
Instrument Type : Select your trading instrument (Forex, Futures, Stocks, or Crypto)
Value per 0.01 lot per tick : Enter the value of 0.01 lots per tick (for most Forex pairs, this is $1 per pip for 0.01 lot)
Minimum Lot Size : Set the minimum lot size allowed by your broker (usually 0.01 for Forex)
3. Setting Price Levels
In the "Price Levels" section:
Entry Price : The price at which you plan to enter the trade
Stop Loss Price : Where you'll exit if the trade goes against you
Take Profit Price : Your target price where you'll take profits
If you set Entry Price to 0, it will default to the current price. If Stop Loss or Take Profit are set to 0, they'll default to 5% below or above entry price respectively.
4. Understanding the Visual Elements
Yellow line : Your entry price
Green line : Your take profit level
Red line : Your stop loss level
Green zone : The profit zone (between entry and take profit)
Red zone : The loss zone (between entry and stop loss)
Information panel : Shows all calculations and trade details
5. Adjusting Your Trade on the Chart
The beauty of this tool is its interactivity:
You can drag any of the lines directly on the chart to adjust entry, stop loss, or take profit
If you drag the take profit above the entry , the indicator automatically sets up for a Long trade
If you drag the take profit below the entry , it automatically configures for a Short trade
All calculations and visuals update in real-time as you adjust the lines
This means you can quickly test different scenarios and see how they affect your position size and potential profit/loss.
6. Reading the Information Panel
The information panel displays:
Account details : Your account size and currency
Risk information : Your percentage risk and the equivalent monetary amount
Position Size : The optimal lot size calculated based on your risk parameters
Price levels : Entry, Stop Loss, and Take Profit with distances in ticks
Risk/Reward ratio : Shown as 1:X (where X is the reward relative to 1 unit of risk)
Potential outcomes : The exact amount you stand to gain or lose on this trade
Trade direction : Whether this is a Long or Short trade
Visual Settings
You can customize the appearance in the "Visual" settings group:
Adjust colors for profit and loss zones
Change the transparency of colored zones
Toggle the filling of spaces between lines
Adjust how far the lines extend beyond the last candle
Practical Tips
Always double-check your "Value per 0.01 lot per tick" setting for the specific instrument you're trading
For Forex major pairs, the standard is usually $1 per pip for 0.01 lots
For other instruments, consult your broker's specifications
The indicator works best when you place your stop loss at a logical market level (support/resistance, swing high/low) rather than a fixed percentage
Final Thoughts
This Position Size Calculator helps remove emotion from your trading by objectively calculating your position size based on your predefined risk parameters. It ensures that you maintain consistent risk across all your trades, regardless of the stop loss distance, which is a key component of successful risk management.
Remember: The most important goal in trading is capital preservation. This tool helps you ensure that each trade risks only what you've decided is acceptable for your trading strategy.
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.
Pivot ATR Zones [v6]🟩 Pivot ATR Zones
Overview:
The Pivot ATR Zones indicator plots dynamic support and resistance zones based on pivot highs and lows, combined with ATR (Average True Range) volatility levels. It helps traders visually identify potential long and short trade areas, along with realistic target and stop loss zones based on market conditions.
Features:
Automatically detects pivot highs and lows
Draws ATR-based entry zones on the chart
Plots dynamic take-profit and stop-loss levels using ATR multipliers
Color-coded long (green) and short (red) zones
Entry arrow markers for clearer trade visualization
Real-time alerts when new zones form
Best For:
Scalpers, intraday traders, and swing traders who want a visual, volatility-aware way to mark potential trade areas based on key pivot structures.
How to Use:
Look for newly formed green zones for long opportunities and red zones for short setups.
Use the dashed lines as dynamic take-profit and stop levels, tuned to the current ATR value.
Combine with other confirmation tools or indicators for optimal results.