ADX (14,14) with Signals and LabelsADX14 indicator for trend identification bullish view or bearish view
Chỉ số Định hướng Trung bình (ADX)
CryptoMoves v3CryptoMoves v3 User Guide
This comprehensive guide will help you interpret the various indicators in the CryptoMoves v3 Pine Script. The script combines multiple technical indicators to provide a holistic view of market conditions.
Wave Trend Indicator
The Wave Trend indicator is the core component of this script, offering insights into trend direction and potential reversals.
Interpretation:
WT Wave 1 and WT Wave 2: These are plotted as area charts. When WT1 crosses above WT2, it's generally bullish, and when it crosses below, it's bearish1.
Overbought/Oversold Levels: The script uses multiple levels (-100, -60, -53, 53, 60, 100) to indicate extreme conditions1.
VWAP: This additional wave provides a faster-moving trend indicator1.
Key Signals:
Buy Signal: Occurs when WT1 crosses above WT2 in oversold territory (below -60) and Stochastic RSI is below 201.
Sell Signal: Triggers when WT1 crosses below WT2 in overbought territory (above 60) and Stochastic RSI is above 801.
Stochastic RSI
This indicator combines the sensitivity of RSI with the ranging capabilities of Stochastic oscillator.
Interpretation:
K and D Lines: The faster K line (blue) and slower D line (color varies) are plotted1.
Overbought/Oversold: Levels are set at 80 (overbought) and 20 (oversold)1.
Crossovers: When K crosses above D, it's potentially bullish; when K crosses below D, it's potentially bearish1.
RSI + MFI (Money Flow Index)
This custom indicator combines Relative Strength Index with Money Flow to gauge buying and selling pressure.
Interpretation:
Color Coding: Green indicates positive money flow (bullish), while red suggests negative flow (bearish)1.
Zero Line: Crossing above zero is bullish, below is bearish1.
ADX (Average Directional Index)
ADX helps determine the strength of a trend, regardless of its direction.
Interpretation:
ADX Line: Values above 25 indicate a strong trend, below 25 suggest a weak trend1.
+DI and -DI: When +DI is above -DI, the trend is bullish; when -DI is above +DI, the trend is bearish.
Background Color: Green background indicates a strong trend, red indicates a ranging market1.
RSI Divergence
This component identifies potential trend reversals by comparing price action with RSI movements.
Types of Divergences:
Regular Bullish: Price makes lower lows, but RSI makes higher lows (potential upward reversal)1.
Hidden Bullish: Price makes higher lows, but RSI makes lower lows (potential continuation of uptrend)1.
Regular Bearish: Price makes higher highs, but RSI makes lower highs (potential downward reversal)1.
Hidden Bearish: Price makes lower highs, but RSI makes higher highs (potential continuation of downtrend)1.
Woodie CCI (Commodity Channel Index)
The Woodie CCI helps identify cyclical trends in price.
Interpretation:
Overbought/Oversold: Default levels are set at +100 (overbought) and -100 (oversold)1.
Trend Direction: CCI above zero suggests an uptrend, below zero suggests a downtrend1.
Divergences: Can be used to spot potential reversals when price and CCI move in opposite directions1.
Combining Indicators for Decision Making
Strong Buy Signal: Occurs when Wave Trend shows a bullish crossover in oversold territory, Stochastic RSI is oversold, RSI shows bullish divergence, and Woodie CCI is oversold.
Strong Sell Signal: Triggers when Wave Trend shows a bearish crossover in overbought territory, Stochastic RSI is overbought, RSI shows bearish divergence, and Woodie CCI is overbought.
Trend Confirmation: Use ADX to confirm the strength of the trend identified by other indicators
To optimize the CryptoMoves v3 indicator for different timeframes, we can adjust the input parameters. Here's a table with suggested optimizations for various timeframes:
Optimization Rationale
Shorter Timeframes (5-minute, 15-minute):
Use shorter lengths for faster-moving indicators to capture quick market movements.
Reduce smoothing periods to increase sensitivity.
Medium Timeframes (1-hour, 4-hour):
Use the default or slightly increased lengths to balance between responsiveness and noise reduction.
Moderate smoothing to filter out minor fluctuations.
Longer Timeframes (1-day, 1-week, 1-month):
Increase lengths and smoothing periods to focus on longer-term trends.
Reduce sensitivity to short-term price movements.
Additional Considerations
Wave Trend Levels: The overbought and oversold levels (53, 60, 100, -53, -60, -100) can remain consistent across timeframes as they represent standard deviation multiples.
Stochastic RSI Levels: The overbought (80) and oversold (20) levels are typically kept constant across timeframes.
ADX Threshold: The default of 25 is generally applicable across timeframes, but you might consider increasing it slightly (to 30) for longer timeframes to identify stronger trends.
Woodie CCI Levels: The overbought (100) and oversold (-100) levels are standard and can remain consistent across timeframes.
Remember that these are suggested optimizations based on general principles. It's crucial to backtest these settings on your specific trading instruments and adjust them according to your trading strategy and risk management rules. The optimal settings may vary depending on the specific asset and market conditions
Strategy SuperTrend SDI WebhookThis Pine Script™ strategy is designed for automated trading in TradingView. It combines the SuperTrend indicator and Smoothed Directional Indicator (SDI) to generate buy and sell signals, with additional risk management features like stop loss, take profit, and trailing stop. The script also includes settings for leverage trading, equity-based position sizing, and webhook integration.
Key Features
1. Date-based Trade Execution
The strategy is active only between the start and end dates set by the user.
times ensures that trades occur only within this predefined time range.
2. Position Sizing and Leverage
Uses leverage trading to adjust position size dynamically based on initial equity.
The user can set leverage (leverage) and percentage of equity (usdprcnt).
The position size is calculated dynamically (initial_capital) based on account performance.
3. Take Profit, Stop Loss, and Trailing Stop
Take Profit (tp): Defines the target profit percentage.
Stop Loss (sl): Defines the maximum allowable loss per trade.
Trailing Stop (tr): Adjusts dynamically based on trade performance to lock in profits.
4. SuperTrend Indicator
SuperTrend (ta.supertrend) is used to determine the market trend.
If the price is above the SuperTrend line, it indicates an uptrend (bullish).
If the price is below the SuperTrend line, it signals a downtrend (bearish).
Plots visual indicators (green/red lines and circles) to show trend changes.
5. Smoothed Directional Indicator (SDI)
SDI helps to identify trend strength and momentum.
It calculates +DI (bullish strength) and -DI (bearish strength).
If +DI is higher than -DI, the market is considered bullish.
If -DI is higher than +DI, the market is considered bearish.
The background color changes based on the SDI signal.
6. Buy & Sell Conditions
Long Entry (Buy) Conditions:
SDI confirms an uptrend (+DI > -DI).
SuperTrend confirms an uptrend (price crosses above the SuperTrend line).
Short Entry (Sell) Conditions:
SDI confirms a downtrend (+DI < -DI).
SuperTrend confirms a downtrend (price crosses below the SuperTrend line).
Optionally, trades can be filtered using crossovers (occrs option).
7. Trade Execution and Exits
Market entries:
Long (strategy.entry("Long")) when conditions match.
Short (strategy.entry("Short")) when bearish conditions are met.
Trade exits:
Uses predefined take profit, stop loss, and trailing stop levels.
Positions are closed if the strategy is out of the valid time range.
Usage
Automated Trading Strategy:
Can be integrated with webhooks for automated execution on supported trading platforms.
Trend-Following Strategy:
Uses SuperTrend & SDI to identify trend direction and strength.
Risk-Managed Leverage Trading:
Supports position sizing, stop losses, and trailing stops.
Backtesting & Optimization:
Can be used for historical performance analysis before deploying live.
Conclusion
This strategy is suitable for traders who want to automate their trading using SuperTrend and SDI indicators. It incorporates risk management tools like stop loss, take profit, and trailing stop, making it adaptable for leverage trading. Traders can customize settings, conduct backtests, and integrate it with webhooks for real-time trade execution. 🚀
Important Note:
This script is provided for educational and template purposes and does not constitute financial advice. Traders and investors should conduct their research and analysis before making any trading decisions.
EMA Adaptive Trailing StopThe EMA Adaptive Trailing Stop Strategy is a versatile and comprehensive Pine Script designed for TradingView. This script provides an adaptive trailing stop mechanism that leverages the Exponential Moving Average (EMA) to adjust trailing stops based on market conditions. The strategy dynamically switches between trending and ranging markets by utilizing both Average True Range (ATR) and Average Directional Index (ADX) to detect market conditions.
Key Features:
EMA-Based Trailing Stop:
The script uses the EMA value to set trailing stops precisely. The EMA offers a more responsive calculation to price changes, ensuring closer and more accurate trailing stops that follow market movements effectively.
Market Condition Detection:
The script employs ATR and ADX to distinguish between trending and ranging markets. ATR measures market volatility, while ADX gauges trend strength. The combination of these two indicators provides a more accurate market condition detection.
Customizable Settings:
The script offers various flexible parameters to adjust EMA length, multipliers, and ATR length. Users can customize these settings according to their preferences and trading strategy.
Two Modes:
The script adapts to market conditions by providing two modes: trending mode and ranging mode. In trending mode, the trailing stop is tighter to follow price movements closely, whereas in ranging mode, the trailing stop is looser to accommodate lower volatility.
Entry and Exit Conditions:
The script detects market conditions to set buy and sell signals. These conditions include the calculations of EMA, ATR, and ADX to ensure the signals generated are valid and profitable.
Alerts:
The script provides buy and sell signals through alert conditions for efficient trade management. Users can enable these alerts to get real-time notifications when valid buy or sell signals are detected.
Suitable for Scalping and Swing Trading:
The script is well-suited for both scalping and swing trading strategies. Scalpers can benefit from the responsive and tighter trailing stops during trending conditions, while swing traders can take advantage of the adaptive and looser trailing stops during ranging conditions, allowing them to capture larger price movements.
Explanation of Mode 1 and Mode 2:
Mode 1: Trending Market:
In this mode, the market is identified as trending based on the ADX and ATR values.
LONG 1: This label indicates a buy signal in the trending market mode. It signifies that the trailing stop has been activated and a long position (buy) should be taken when the market is trending.
SHORT 1: This label indicates a sell signal in the trending market mode. It signifies that the trailing stop has been activated and a short position (sell) should be taken when the market is trending.
Mode 2: Ranging Market:
In this mode, the market is identified as ranging based on the ADX and ATR values.
LONG 2: This label indicates a buy signal in the ranging market mode. It signifies that the trailing stop has been activated and a long position (buy) should be taken with a looser trailing stop when the market is ranging.
SHORT 2: This label indicates a sell signal in the ranging market mode. It signifies that the trailing stop has been activated and a short position (sell) should be taken with a looser trailing stop when the market is ranging.
Technical Usage:
Variable Initialization:
The script initializes variables to store values such as trailing stop, long position status, and short position status.
Market Condition Detection:
The script calculates ATR and ADX values to detect whether the market is trending or ranging. This includes the use of f_adx function to calculate ADX values and determine market conditions.
EMA-Based Trailing Stop Calculation:
The script adjusts the trailing stop based on EMA values and ATR. The calculation involves customizable multipliers and parameters that influence the trailing stop's precision.
Plot Trailing Stop:
The script displays the trailing stop on the chart for clear visualization. This includes plotting the trailing stop line with appropriate colors to indicate long and short positions.
Entry and Exit Conditions:
The script determines the entry (buy) and exit (sell) conditions based on market condition detection and trailing stop settings. These conditions are crucial for generating valid buy or sell signals.
Plotshape and Alert:
The script provides plotshapes for buy and sell signals and sets up alert conditions for real-time notifications when a valid buy or sell signal is detected.
ADX for BTC [PineIndicators]The ADX Strategy for BTC is a trend-following system that uses the Average Directional Index (ADX) to determine market strength and momentum shifts. Designed for Bitcoin trading, this strategy applies a customizable ADX threshold to confirm trend signals and optionally filters entries using a Simple Moving Average (SMA). The system features automated entry and exit conditions, dynamic trade visualization, and built-in trade tracking for historical performance analysis.
⚙️ Core Strategy Components
1️⃣ Average Directional Index (ADX) Calculation
The ADX indicator measures trend strength without indicating direction. It is derived from the Positive Directional Movement (+DI) and Negative Directional Movement (-DI):
+DI (Positive Directional Index): Measures upward price movement.
-DI (Negative Directional Index): Measures downward price movement.
ADX Value: Higher values indicate stronger trends, regardless of direction.
This strategy uses a default ADX length of 14 to smooth out short-term fluctuations while detecting sustainable trends.
2️⃣ SMA Filter (Optional Trend Confirmation)
The strategy includes a 200-period SMA filter to validate trend direction before entering trades. If enabled:
✅ Long Entry is only allowed when price is above a long-term SMA multiplier (5x the standard SMA length).
✅ If disabled, the strategy only considers the ADX crossover threshold for trade entries.
This filter helps reduce entries in sideways or weak-trend conditions, improving signal reliability.
📌 Trade Logic & Conditions
🔹 Long Entry Conditions
A buy signal is triggered when:
✅ ADX crosses above the threshold (default = 14), indicating a strengthening trend.
✅ (If SMA filter is enabled) Price is above the long-term SMA multiplier.
🔻 Exit Conditions
A position is closed when:
✅ ADX crosses below the stop threshold (default = 45), signaling trend weakening.
By adjusting the entry and exit ADX levels, traders can fine-tune sensitivity to trend changes.
📏 Trade Visualization & Tracking
Trade Markers
"Buy" label (▲) appears when a long position is opened.
"Close" label (▼) appears when a position is exited.
Trade History Boxes
Green if a trade is profitable.
Red if a trade closes at a loss.
Trend Tracking Lines
Horizontal lines mark entry and exit prices.
A filled trade box visually represents trade duration and profitability.
These elements provide clear visual insights into trade execution and performance.
⚡ How to Use This Strategy
1️⃣ Apply the script to a BTC chart in TradingView.
2️⃣ Adjust ADX entry/exit levels based on trend sensitivity.
3️⃣ Enable or disable the SMA filter for trend confirmation.
4️⃣ Backtest performance to analyze historical trade execution.
5️⃣ Monitor trade markers and history boxes for real-time trend insights.
This strategy is designed for trend traders looking to capture high-momentum market conditions while filtering out weak trends.
ADX with Moving AverageADX with Moving Average is a powerful indicator that enhances trend analysis by combining the standard Average Directional Index (ADX) with a configurable moving average.
The ADX helps traders identify the strength of a trend. In general:
ADX 0-20 – Absent or Weak Trend
ADX 25-50 – Strong Trend
ADX 50-75 – Very Strong Trend
ADX 75-100 – Extremely Strong Trend
By adding a moving average we can judge if the ADX itself is trending upwards or downwards, i.e. if a new trend is emerging or an existing one is weakening.
This combination allows traders to better confirm strong trends and filter out weak or choppy market conditions.
Key Features & Customization:
✔ Configurable DI & ADX Lengths – Adjust how quickly the ADX reacts to price movements (default: 14, 14).
✔ Multiple Moving Average Options – Choose between SMA, EMA, WMA, VWMA, or T3 for trend confirmation.
✔ Custom MA Length – Fine-tune the sensitivity of the moving average to match your strategy.
🔹 Use this indicator to confirm strong trends before entering trades, filter out false signals, or refine existing strategies with a dynamic trend-strength component. 🚀
Crypto Scanner v4This guide explains a version 6 Pine Script that scans a user-provided list of cryptocurrency tokens to identify high probability tradable opportunities using several technical indicators. The script combines trend, momentum, and volume-based analyses to generate potential buying or selling signals, and it displays the results in a neatly formatted table with alerts for trading setups. Below is a detailed walkthrough of the script’s design, how traders can interpret its outputs, and recommendations for optimizing indicator inputs across different timeframes.
## Overview and Key Components
The script is designed to help traders assess multiple tokens by calculating several indicators for each one. The key components include:
- **Input Settings:**
- A comma-separated list of symbols to scan.
- Adjustable parameters for technical indicators such as ADX, RSI, MFI, and a custom Wave Trend indicator.
- Options to enable alerts and set update frequencies.
- **Indicator Calculations:**
- **ADX (Average Directional Index):** Measures trend strength. A value above the provided threshold indicates a strong trend, which is essential for validating momentum before entering a trade.
- **RSI (Relative Strength Index):** Helps determine overbought or oversold conditions. When the RSI is below the oversold level, it may present a buying opportunity, while an overbought condition (not explicitly part of this setup) could suggest selling.
- **MFI (Money Flow Index):** Similar in concept to RSI but incorporates volume, thus assessing buying and selling pressure. Values below the designated oversold threshold indicate potential undervaluation.
- **Wave Trend:** A custom indicator that calculates two components (WT1 and WT2); a crossover where WT1 moves from below to above WT2 (particularly near oversold levels) may signal a reversal and a potential entry point.
- **Scanning and Trading Zone:**
- The script identifies a *bullish setup* when the following conditions are met for a token:
- ADX exceeds the threshold (strong trend).
- Both RSI and MFI are below their oversold levels (indicating potential buying opportunities).
- A Wave Trend crossover confirms near-term reversal dynamics.
- A *trading zone* condition is also defined by specific ranges for ADX, RSI, MFI, and a limited difference between WT1 and WT2. This zone suggests that the token might be in a consolidation phase where even small moves may be significant.
- **Alerts and Table Reporting:**
- A table is generated, with each row corresponding to a token. The table contains columns for the symbol, ADX, RSI, MFI, WT1, WT2, and the trading zone status.
- Visual cues—such as different background colors—highlight tokens with a bullish setup or that are within the trading zone.
- Alerts are issued based on the detection of a bullish setup or entry into a trading zone. These alerts are limited per bar to avoid flooding the trader with notifications.
## How to Interpret the Indicator Outputs
Traders should use the indicator values as guidance, verifying them against their own analysis before making any trading decision. Here’s how to assess each output:
- **ADX:**
- **High values (above threshold):** Indicate strong trends. If other indicators confirm an oversold condition, a trader may consider a long position for a corrective reversal.
- **Low values:** Suggest that the market is not trending strongly, and caution should be taken when considering entry.
- **RSI and MFI:**
- **Below oversold levels:** These conditions are traditionally seen as signals that an asset is undervalued, potentially triggering a bounce.
- **Above typical resistance levels (not explicitly used here):** Would normally caution a trader against entering a long position.
- **Wave Trend (WT1 and WT2):**
- A crossover where WT1 moves upward above WT2 in an oversold environment can signal the beginning of a recovery or reversal, thereby reinforcing buy signals.
- **Trading Zone:**
- Being “in zone” means that the asset’s current values for ADX, RSI, MFI, and the closeness of the Wave Trend lines indicate a period of consolidation. This scenario might be suitable for both short-term scalping or as an early exit indicator, depending on further market analysis.
## Timeframe Optimization Input Table
Traders can optimize indicator inputs depending on the timeframe they use. The following table provides a set of recommended input values for various timeframes. These values are suggestions and should be adjusted based on market conditions and individual trading styles.
Timeframe ADX RSI MFI ADX RSI MFI WT Channel WT Average
5-min 10 10 10 20 30 20 7 15
15-min 12 12 12 22 30 20 9 18
1-hour 14 14 14 25 30 20 10 21
4-hour 16 16 16 27 30 20 12 24
1-day 18 18 18 30 30 20 14 28
Adjust these parameters directly in the script’s input settings to match the selected timeframe. For shorter timeframes (e.g., 5-min or 15-min), the shorter lengths help filter high-frequency noise. For longer timeframes (e.g., 1-day), longer input values may reduce false signals and capture more significant trends.
## Best Practices and Usage Tips
- **Token Limit:**
- Limit the number of tokens scanned to 10 per query line. If you need to scan more tokens, initiate a new query line. This helps manage screen real estate and ensures the table remains legible.
- **Confirming Signals:**
- Use this script as a starting point for identifying high potential trades. Each indicator’s output should be used to confirm your trading decision. Always cross-reference with additional technical analysis tools or market context.
- **Regular Review:**
- Since the script updates the table every few bars (as defined by the update frequency), review the table and alerts regularly. Market conditions change rapidly, so timely decisions are crucial.
## Conclusion
This Pine Script provides a comprehensive approach for scanning multiple cryptocurrencies using a combination of trend strength (ADX), momentum (RSI and MFI), and reversal signals (Wave Trend). By using the provided recommendation table for different timeframes and limiting the tokens to 20 per query line (with a maximum of four query lines), traders can streamline their scanning process and more effectively identify high probability tradable tokens. Ultimately, the outputs should be critically evaluated and combined with additional market research before executing any trades.
Advanced Supertrend Enhanced ADXEnhanced Supertrend ADX Indicator - Technical Documentation
Overview
The Enhanced Supertrend ADX indicator combines ADX directional strength with Supertrend trend-following capabilities, creating a comprehensive trend detection system. It's enhanced with normalization techniques and multiple filters to provide reliable trading signals.
Key Features and Components
The indicator incorporates three main components:
Core ADX and Supertrend Fusion
Uses a shorter ADX period for increased sensitivity
Integrates Supertrend signals for trend confirmation
Applies a long-term moving average for trend context
Advanced Filtering System
Volatility filter: Identifies periods of significant market movement
Momentum filter: Confirms the strength and sustainability of trends
Lateral market detection: Identifies ranging market conditions
Data Normalization
Standardizes indicator readings across different instruments
Makes signals comparable across various market conditions
Reduces extreme values and false signals
Model Assumptions
The indicator operates under several key assumptions:
Market Behavior
Markets alternate between trending and lateral phases
Strong trends correlate with increased volatility
Price momentum confirms trend strength
Market transitions follow identifiable patterns
Signal Reliability
Low ADX values indicate lateral markets
Valid signals require both volatility and momentum confirmation
Multi-filter confirmation increases signal reliability
Price normalization enhances signal quality
Trading Applications
The indicator supports different trading approaches:
Trend Trading
Strong signals when all filters align
Clear distinction between bullish and bearish trends
Momentum confirmation for trend continuation
Range Trading
Clear identification of lateral markets
Band-based trading boundaries
Reduced false breakout signals
Transition Trading
Early identification of trend-to-range transitions
Clear signals for range-to-trend transitions
Momentum-based confirmation of breakouts
Risk Considerations
Important factors to consider:
Signal Limitations
Potential delay in fast-moving markets
False signals during extreme volatility
Time frame dependency
Best Practices
Use in conjunction with other indicators
Apply proper position sizing
Focus on liquid instruments
Consider market context
Performance Characteristics
The indicator shows optimal performance under specific conditions:
Ideal Conditions
Daily timeframe analysis
Clear trending market phases
Liquid market environments
Normal volatility conditions
Challenging Conditions
Choppy market conditions
Extremely low volatility
Highly volatile markets
Illiquid instruments
Implementation Recommendations
For optimal use, consider:
Market Selection
Best suited for major markets
Requires adequate liquidity
Works well with trending instruments
Timeframe Selection
Primary: Daily charts
Secondary: 4-hour charts
Caution on lower timeframes
Risk Management
Use appropriate position sizing
Set clear stop-loss levels
Consider market volatility
Monitor overall exposure
This indicator serves as a comprehensive tool for market analysis, combining traditional technical analysis with modern filtering techniques. Its effectiveness depends on proper implementation and understanding of market conditions.
Trend Strength & Direction📌 Assumptions of the "Trend Strength & Direction" Model
This model is designed to measure both trend strength and trend direction, using a modified version of the ADX (Average Directional Index) while also identifying ranging markets. Below is a detailed breakdown of all key assumptions.
1️⃣ Using ADX as the Basis for Trend Strength
Why ADX?
The ADX (Average Directional Index) is one of the most commonly used indicators for measuring trend strength, regardless of direction.
How is it calculated?
ATR (Average True Range) is used to normalize volatility.
Directional movement (+DM and -DM) is smoothed with an Exponential Moving Average (EMA) to obtain the +DI (Positive Directional Indicator) and -DI (Negative Directional Indicator).
Trend strength is derived by normalizing the absolute difference between +DI and -DI, divided by the sum of both.
🔹 Assumption: A high ADX means the trend is strong (whether bullish or bearish).
2️⃣ 50-Period Moving Average for Trend Strength
Why add a moving average?
ADX can be very volatile in the short term.
A 50-period SMA (Simple Moving Average) is used to smooth out trend strength and identify sustained trends.
🔹 Assumption: The SMA reduces false signals caused by short-term ADX spikes.
3️⃣ Identifying a Ranging Market (ADX Below 35)
How is a ranging market defined?
If the trend strength (ADX) is below 35, the market is considered "ranging".
The 35-level threshold is chosen empirically since ADX values below this level often indicate a lack of strong price direction.
When the market is ranging, the background color turns yellow.
🔹 Assumption: ADX < 35 indicates a sideways market, so the indicator colors the background yellow.
4️⃣ Determining Trend Direction Using +DI and -DI
How is direction determined?
If +DI > -DI, the trend is bullish (green).
If -DI > +DI, the trend is bearish (red).
If ADX is below 35, the market is ranging and turns yellow.
🔹 Assumption: Trend direction is determined by the relationship between +DI and -DI, not ADX values.
5️⃣ Background Color to Highlight Market Conditions
Yellow background if ADX < 35 → Ranging market.
Green background if ADX ≥ 35 and bullish.
Red background if ADX ≥ 35 and bearish.
🔹 Assumption: The background color visually differentiates trending vs. ranging phases.
6️⃣ Reference Levels for ADX
Lateral Threshold (35) → Below this, the trend is weak or ranging.
Neutral Threshold (50) → Intermediate level indicating moderate trend strength.
Strong Trend Threshold (75) → Above this, the trend is very strong and possibly overextended.
🔹 Assumption: ADX above 75 indicates a very strong trend, potentially near exhaustion.
🔹 Summary of Key Assumptions
1️⃣ ADX is the core strength metric → Strong trends when ADX > 35, weak below 35.
2️⃣ The 50-period SMA smooths out volatility → Prevents false signals.
3️⃣ Ranging markets are defined as ADX < 35 → Yellow background color.
4️⃣ Trend direction is based on +DI vs. -DI → Green = bullish, Red = bearish.
5️⃣ Background colors enhance readability → Helps distinguish different market phases.
6️⃣ ADX reference levels (35, 50, 75) indicate increasing trend strength.
Conclusion
This model combines ADX with a moving average and color-based logic to highlight trend strength, trend direction, and sideways markets. It helps traders quickly identify the best conditions for entering or exiting trades. 🚀
Strength Measurement -HTStrength Measurement -HT
This indicator provides a comprehensive view of trend strength by calculating the average ADX (Average Directional Index) across multiple timeframes. It helps traders identify strong trends, potential reversals, and confirm signals from other indicators.
Key Features:
Multi-Timeframe Analysis: Analyze trend strength across different timeframes. Choose which timeframes to include in the calculation (5 min, 15 min, 30 min, 1 hour, 4 hour).
Customizable ADX Parameters: Adjust the ADX smoothing (adxlen) and DI length (dilen) parameters to fine-tune the indicator to your preferred settings.
Smoothed Average ADX: The average ADX is smoothed using a Simple Moving Average to reduce noise and provide a clearer picture of the overall trend.
Color-Coded Visualization: The histogram clearly indicates trend direction and strength:
Green: Uptrend
Red: Downtrend
Darker shades: Stronger trend
Lighter shades: Weaker trend
Reference Levels: Includes horizontal lines at 25, 50, and 75 to provide benchmarks for trend strength classification.
Alerts: Set alerts for strong trend up (ADX crossing above 50) and weakening trend (ADX crossing below 25).
How to Use:
Select Timeframes: Choose the timeframes you want to include in the average ADX calculation.
Adjust ADX Parameters: Fine-tune the adxlen and dilen values based on your trading style and the timeframe of the chart.
Identify Strong Trends: Look for histogram bars with darker green or red colors, indicating a strong trend.
Spot Potential Reversals: Watch for changes in histogram color and height, which may suggest a weakening trend or a potential reversal.
Combine with Other Indicators: Use this indicator with other technical analysis tools to confirm trading signals.
Note: This indicator is based on the ADX, which is a lagging indicator.
ADX-DMIThis script manually calculates the Directional Movement Index (DMI) and the Average Directional Index (ADX) using Wilder’s smoothing technique. The DMI indicators are used to assess the strength and direction of a market trend. It includes three main lines: ADX (yellow), DI+ (green), and DI− (red). Traders use these indicators to determine whether a trend is strong and in which direction it is moving.
The process begins by defining the length parameter, which determines how many periods are considered in the calculation. It then calculates the True Range (TR), which is the greatest of three values: the difference between the current high and low, the difference between the current high and the previous close, and the difference between the current low and the previous close. This TR is used to compute the Average True Range (ATR), which smooths out price fluctuations to get a clearer picture of the market’s volatility. Next, the script calculates the +DM (positive directional movement) and -DM (negative directional movement) based on the changes in the highs and lows from one period to the next.
Finally, the script computes the DI+ and DI− values by dividing the smoothed +DM and -DM by the ATR and multiplying by 100 to express them as percentages. The DX value is calculated as the absolute difference between DI+ and DI−, normalized by the sum of both values. The ADX is then derived by smoothing the DX value over the specified length. The three indicators — ADX, DI+, and DI− — are plotted in the lower chart panel, providing traders with visual cues about the trend’s direction (DI+ and DI−) and strength (ADX).
Important Notice:
The use of technical indicators like this one does not guarantee profitable results. This indicator should not be used as a standalone analysis tool. It is essential to combine it with other forms of analysis, such as fundamental analysis, risk management strategies, and awareness of current market conditions. Always conduct thorough research.
Note: The effectiveness of any technical indicator can vary based on market conditions and individual trading styles. It's crucial to test indicators thoroughly using historical data before applying them in live trading scenarios.
Disclaimer:
Trading financial instruments involves substantial risk and may not be suitable for all investors. Past performance is not indicative of future results. This indicator is provided for informational and educational purposes only and should not be considered investment advice. Always conduct your own research before making any trading decisions.
ADX and DI Trend meter and status table IndicatorThis ADX (Average Directional Index) and DI (Directional Indicator) indicator helps identify:
Trend Direction & Strength:
LONG: +DI above -DI with ADX > 20
SHORT: -DI above +DI with ADX > 20
RANGE: ADX < 20 indicates choppy/sideways market
Trading Signals:
Bullish: +DI crosses above -DI (green triangle)
Bearish: -DI crosses below +DI (red triangle)
ADX Strength Levels:
Strong: ADX ≥ 50
Moderate: ADX 30-49
Weak: ADX 20-29
No Trend: ADX < 20
Best Uses:
Trend confirmation before entering trades
Identifying ranging vs trending markets
Exit signal when trend weakens
Works well on multiple timeframes
Most effective in combination with other indicators
The table displays current trend direction and ADX strength in real-time
ADX Breakout Strategy█ OVERVIEW
The ADX Breakout strategy leverages the Average Directional Index (ADX) to identify and execute breakout trades within specified trading sessions. Designed for the NQ and ES 30-minute charts, this strategy aims to capture significant price movements while managing risk through predefined stop losses and trade limits.
This strategy was taken from a strategy that was posted on YouTube. I would link the video, but I believe is is "against house rules".
█ CONCEPTS
The strategy is built upon the following key concepts:
ADX Indicator: Utilizes the ADX to gauge the strength of a trend. Trades are initiated when the ADX value is below a certain threshold, indicating potential for trend development.
Trade Session Management: Limits trading to specific hours to align with optimal market activity periods.
Risk Management: Implements a fixed dollar stop loss and restricts the number of trades per session to control exposure.
█ FEATURES
Customizable Stop Loss: Set your preferred stop loss amount to manage risk effectively.
Trade Session Configuration: Define the trading hours to focus on the most active market periods.
Entry Conditions: Enter long positions when the price breaks above the highest close in the lookback window and the ADX indicates potential trend strength.
Trade Limits: Restrict the number of trades per session to maintain disciplined trading.
Automated Exit: Automatically closes all positions at the end of the trading session to avoid overnight risk.
█ HOW TO USE
Configure Inputs :
Stop Loss ($): Set the maximum loss per trade.
Trade Session: Define the active trading hours.
Highest Lookback Window: Specify the number of bars to consider for the highest close.
Apply the Strategy :
Add the ADX Breakout strategy to your chart on TradingView.
Ensure you are using a 30-minute timeframe for optimal performance.
█ LIMITATIONS
Market Conditions: The strategy is optimized for trending markets and may underperform in sideways or highly volatile conditions.
Timeframe Specific: Designed specifically for 30-minute charts; performance may vary on different timeframes.
Single Asset Focus: Primarily tested on NQ and ES instruments; effectiveness on other symbols is not guaranteed.
█ DISCLAIMER
This ADX Breakout strategy is provided for educational and informational purposes only. It is not financial advice and should not be construed as such. Trading involves significant risk, and you may incur substantial losses. Always perform your own analysis and consider your financial situation before using this or any other trading strategy. The source material for this strategy is publicly available in the comments at the beginning of the code script. This strategy has been published openly for anyone to review and verify its methodology and performance.
TASC 2024.12 Dynamic ADX Histogram█ OVERVIEW
This script introduces a new version of the ADX oscillator, designed by Neil Jon Harrington and featured in the "Revisualizing The ADX Oscillator" article from the December 2024 edition of TASC's Traders' Tips .
█ CONCEPTS
The directional movement index (DMI+ and DMI−) and average directional index (ADX) indicators have long been popular with technical analysts. Developed by J. Welles Wilder in the 1970s, these indicators provide information about the direction and strength of price movements across bars. The DMI+ measures positive price movement, the DMI- measures negative price movement, and the ADX gauges the average strength of price trends. Although these indicators can provide helpful insights into price action and momentum, Neil Jon Harrington argues they are often misunderstood or misapplied.
Harrington's indicator, the Dynamic ADX Histogram (DADX), applies directional information to the ADX based on DMI+ and DMI- values to create a single oscillator centered around 0. The indicator displays the oscillator as a histogram with dynamic colors based on ADX movements and user-defined strength thresholds. The author believes this modification of the ADX and DMI data offers a more intuitive visualization of the information provided by Wilder's calculations.
An additional feature of the DADX is the option to use average (smooth) DMI+ and DMI- values in the oscillator's calculation, which reduces noise and choppiness at the cost of added lag.
█ USAGE
The "ADX Length" input determines the number of bars in the DMI and ADX calculation. The "DMI Smoothing Length" input controls the number of bars in the DMI smoothing calculation. Use a value of 1 for non-smoothed DMI data.
The sign of the DADX indicates the direction of price movements based on the difference between the smoothed DMI+ and DMI- values. The absolute value of the oscillator corresponds to the ADX, representing the trend strength.
The "Low Threshold" and "High Threshold" inputs define the ADX thresholds for categorizing trending, non-trending, and exhaustion states. The low threshold specifies the minimum absolute oscillator value required to indicate a trend, and the high threshold marks the absolute value where trend strength is excessive, possibly suggesting an upcoming consolidation or reversal. The indicator colors the histogram based on these thresholds and changes in the ADX, with brighter colors denoting a strengthening trend and darker colors signaling a weakening trend.
Adaptive Squeeze Momentum StrategyThe Adaptive Squeeze Momentum Strategy is a versatile trading algorithm designed to capitalize on periods of low volatility that often precede significant price movements. By integrating multiple technical indicators and customizable settings, this strategy aims to identify optimal entry and exit points for both long and short positions.
Key Features:
Long/Short Trade Control:
Toggle Options: Easily enable or disable long and short trades according to your trading preferences or market conditions.
Flexible Application: Adapt the strategy for bullish, bearish, or neutral market outlooks.
Squeeze Detection Mechanism:
Bollinger Bands and Keltner Channels: Utilizes the convergence of Bollinger Bands inside Keltner Channels to detect "squeeze" conditions, indicating a potential breakout.
Dynamic Squeeze Length: Calculates the average squeeze duration to adapt to changing market volatility.
Momentum Analysis:
Linear Regression: Applies linear regression to price changes over a specified momentum length to gauge the strength and direction of momentum.
Dynamic Thresholds: Sets momentum thresholds based on standard deviations, allowing for adaptive sensitivity to market movements.
Momentum Multiplier: Adjustable setting to fine-tune the aggressiveness of momentum detection.
Trend Filtering:
Exponential Moving Average (EMA): Implements a trend filter using an EMA to align trades with the prevailing market direction.
Customizable Length: Adjust the EMA length to suit different trading timeframes and assets.
Relative Strength Index (RSI) Filtering:
Overbought/Oversold Signals: Incorporates RSI to avoid entering trades during overextended market conditions.
Adjustable Levels: Set your own RSI oversold and overbought thresholds for personalized signal generation.
Advanced Risk Management:
ATR-Based Stop Loss and Take Profit:
Adaptive Levels: Uses the Average True Range (ATR) to set stop loss and take profit points that adjust to market volatility.
Custom Multipliers: Modify ATR multipliers for both stop loss and take profit to control risk and reward ratios.
Minimum Volatility Filter: Ensures trades are only taken when market volatility exceeds a user-defined minimum, avoiding periods of low activity.
Time-Based Exit:
Holding Period Multiplier: Defines a maximum holding period based on the momentum length to reduce exposure to adverse movements.
Automatic Position Closure: Closes positions after the specified holding period is reached.
Session Filtering:
Trading Session Control: Limits trading to predefined market hours, helping to avoid illiquid periods.
Custom Session Times: Set your preferred trading session to match market openings, closings, or specific timeframes.
Visualization Tools:
Indicator Plots: Displays Bollinger Bands, Keltner Channels, and trend EMA on the chart for visual analysis.
Squeeze Signals: Marks squeeze conditions on the chart, providing clear visual cues for potential trade setups.
Customization Options:
Indicator Parameters: Fine-tune lengths and multipliers for Bollinger Bands, Keltner Channels, momentum calculation, and ATR.
Entry Filters: Choose to use trend and RSI filters to refine trade entries based on your strategy.
Risk Management Settings: Adjust stop loss, take profit, and holding periods to match your risk tolerance.
Trade Direction Control: Enable or disable long and short trades independently to align with your market strategy or compliance requirements.
Time Settings: Modify the trading session times and enable or disable the time filter as needed.
Use Cases:
Trend Traders: Benefit from aligning entries with the broader market trend while capturing breakout movements.
Swing Traders: Exploit periods of low volatility leading to significant price swings.
Risk-Averse Traders: Utilize advanced risk management features to protect capital and manage exposure.
Disclaimer:
This strategy is a tool to assist in trading decisions and should be used in conjunction with other analyses and risk management practices. Past performance is not indicative of future results. Always test the strategy thoroughly and adjust settings to suit your specific trading style and market conditions.
Trend IdentifierThe “Trend Identifier” indicator is designed to help traders quickly identify trending and sideways market conditions, allowing them to adapt their strategies based on the prevailing market sentiment. By combining several technical analysis tools—ATR (Average True Range), ADX (Average Directional Index), EMA (Exponential Moving Average), and RSI (Relative Strength Index)—this script provides insights into the market’s strength, direction, and volatility to improve trade decision-making.
How It Works
1. ATR (Average True Range):
• ATR measures market volatility. In this script, ATR is used in combination with a moving average to identify periods of rising or falling volatility, which helps differentiate between trending and non-trending conditions.
2. ADX (Average Directional Index):
• ADX is a key component in identifying the strength of a trend. The script uses a threshold system to classify market conditions:
• If ADX is low (below a specified threshold plus a buffer) and ATR indicates low volatility, the market is likely in a sideways condition.
• If ADX is high (above a threshold minus a buffer) with increasing ATR, the market is likely in a trending condition.
3. EMA (Exponential Moving Average):
• A 20-period EMA is used instead of a simple moving average to enhance trend detection speed. The close price’s position relative to the EMA helps identify bullish or bearish trends when combined with ADX and ATR data.
4. RSI (Relative Strength Index):
• RSI acts as a confirmation tool for trend strength. A bullish trend is confirmed if RSI is above 50 and the price is above the EMA, whereas a bearish trend is confirmed if RSI is below 50 and the price is below the EMA.
Market Condition Signals
• Sideways Signal:
• When ADX and ATR indicate a low-volatility, sideways market, the indicator changes the background color to gray, signaling potential low-trend movement or consolidation. A “S” symbol appears above the bars, making it easier to spot this condition.
• Bullish Trend:
• When conditions favor a strong upward trend, the background changes to green. A “B” symbol is displayed below the bar, indicating the onset of a bullish market condition.
• Bearish Trend:
• Conversely, if conditions indicate a downward trend, the background color changes to red. A “S” symbol is displayed below the bar, showing a bearish trend condition.
Using the Indicator
This indicator helps traders understand the current market structure in a glance:
• Sideways (Gray): Low-volatility consolidation period, ideal for range-bound strategies or waiting for a breakout.
• Bullish (Green): Confirmed uptrend, potentially suitable for buying or long entries.
• Bearish (Red): Confirmed downtrend, ideal for short selling or exiting long positions.
The “Trend Identifier” is a powerful tool for traders who seek a clear view of the market structure, using a balanced approach of volatility, trend strength, and momentum. By combining the power of ATR, ADX, EMA, and RSI, this indicator provides a nuanced picture of the market’s behavior, assisting traders in making more informed decisions.
DMI Delta by 0xjcfOverview
This indicator integrates the Directional Movement Index (DMI), Average Directional Index (ADX), and volume analysis into an Oscillator designed to help traders identify divergence-based trading signals. Unlike typical volume or momentum indicators, this combination provides insight into directional momentum and volume intensity, allowing traders to make well-informed decisions based on multiple facets of market behavior.
Purpose and How Components Work Together
By combining DMI and ADX with volume analysis, this indicator helps traders detect when momentum diverges from price action—a common precursor to potential reversals or significant moves. The ADX filter enhances this by distinguishing trending from range-bound conditions, while volume analysis highlights moments of extreme sentiment, such as solid buying or selling. Together, these elements provide traders with a comprehensive view of market strength, directional bias, and volume surges, which help filter out weaker signals.
Key Features
DMI Delta and Oscillator: The DMI indicator measures directional movement by comparing DI+ and DI- values. This difference (DMI Delta) is calculated and displayed as a histogram, visualizing changes in directional bias. When combined with ADX filtering, this histogram helps traders gauge the strength of momentum and spot directional shifts early. For instance, a rising histogram in a bearish price trend might signal a potential bullish reversal.
Volume Analysis with Extremes: Volume is monitored to reveal when market participation is unusually high, using a customizable multiplier to highlight significant volume spikes. These extreme levels are color-coded directly on the histogram, providing visual cues on whether buying or selling interest is particularly strong. Volume analysis adds depth to the directional insights from DMI, allowing traders to differentiate between regular and powerful moves.
ADX Trending Filter: The ADX component filters trends by measuring the overall strength of a price move, with a default threshold of 25. When ADX is above this level, it suggests that the market is trending strongly, making the DMI Delta readings more reliable. Below this threshold, the market is likely range-bound, cautioning traders that signals might not have as much follow-through.
Using the Indicator in Divergence Strategies
This indicator excels in divergence strategies by highlighting moments when price action diverges from directional momentum. Here’s how it aids in decision-making:
Bullish Divergence: If the price is falling to new lows while the DMI Delta histogram rises, it can indicate weakening bearish momentum and signal a potential price reversal to the upside.
Bearish Divergence: Conversely, if prices are climbing but the DMI Delta histogram falls, it may point to waning bullish momentum, suggesting a bearish reversal.
Visual Cues and Customization
The color-coded output enhances usability:
Bright Green/Red: Extreme volume with strong bullish or bearish signals, often at points of high potential for trend continuation or reversal.
Green/Red Shades: These shades reflect trending conditions (bullish or bearish) based on ADX, factoring in volume. Green signals a bullish trend, and red is a bearish trend.
Blue/Orange Shades: Indicates non-trending or weaker conditions, suggesting a more cautious approach in range-bound markets.
Customizable for Diverse Trading Styles
This indicator allows users to adjust settings like the ADX threshold and volume multiplier to optimize performance for various timeframes and strategies. Whether a trader prefers swing trading or intraday scalping, these parameters enable fine-tuning to enhance signal reliability across different market contexts.
Practical Usage Tips
Entry and Exit Signals: Use this indicator in conjunction with price action. Divergences between the price and DMI Delta histogram can reinforce entry or exit decisions.
Adjust Thresholds: Based on backtesting, customize the ADX Trending Threshold and Volume Multiplier to ensure optimal performance on different timeframes or trading styles.
In summary, this indicator is tailored for traders seeking a multi-dimensional approach to market analysis. It blends momentum, trend strength, and volume insights to support divergence-based strategies, helping traders confidently make informed decisions. Remember to validate signals through backtesting and use it alongside price action for the best results.
RSI Crossover and ADX oscillator [deepakks444]RSI Crossover and ADX Oscillator
The RSI Crossover and ADX Oscillator is a custom indicator designed to help traders identify potential trend reversals and trend strength by analyzing the Relative Strength Index (RSI) across multiple timeframes, combined with the Average Directional Index (ADX) to measure the momentum of a trend. This indicator provides a more comprehensive view of the market, allowing traders to spot possible entry and exit points based on multiple signals and conditions.
How the Script Works:
1. Multi-Timeframe RSI Calculation:
This indicator calculates the RSI for three different timeframes:
RSI 1 (default: 15 minutes)
RSI 2 (default: 1 hour)
RSI 3 (default: Daily)
By comparing the RSI across multiple timeframes, traders can gauge both short-term and longer-term momentum. For example, if the shorter timeframe RSI is moving in the same direction as the longer timeframe RSI, it may confirm the strength of the trend. Conversely, if they diverge, it could signal a potential reversal or weakening of the trend.
Each RSI value can also be smoothed using a variety of smoothing methods (SMA, EMA, WMA, RMA) to reduce noise and produce cleaner signals.
2. RSI Smoothing Options:
The smoothing function helps make RSI readings clearer by filtering out short-term fluctuations. This can be useful in volatile markets where small movements can trigger false signals. The user can select the preferred smoothing method (or choose none) and set the smoothing factor to control the sensitivity of the RSI line.
None: No smoothing applied.
SMA (Simple Moving Average): Averages RSI over a specified period, providing a more straightforward trend line.
EMA (Exponential Moving Average): Puts more weight on recent data points, making the trend line more responsive to recent price movements.
WMA (Weighted Moving Average): A weighted average that emphasizes more recent values.
RMA (Running Moving Average): Another smoothing option similar to SMA but with different calculation properties.
3. ADX Trend Strength Measurement:
The Average Directional Index (ADX) is used to measure the strength of a trend, regardless of its direction. ADX is a widely used tool to confirm whether the market is trending strongly or if the market is in a sideways range.
ADX > 25: Indicates a strong trend.
ADX < 25: Indicates a weak trend or range-bound market.
In this script, the color of the ADX line changes dynamically based on whether the trend is strengthening (green) or weakening (red). This allows traders to quickly assess whether the market conditions are favorable for trend-following strategies.
4. Divergence Detection:
The script includes an option to detect regular bullish and bearish divergence between price and RSI. Divergence occurs when price moves in one direction but RSI moves in the opposite direction, which may indicate that the current trend is weakening and could be about to reverse.
Bullish Divergence: Occurs when the price makes a lower low, but the RSI makes a higher low. This could signal a potential upward reversal.
Bearish Divergence: Occurs when the price makes a higher high, but the RSI makes a lower high. This could signal a potential downward reversal.
These divergence signals help traders spot potential reversal points before they become obvious on the price chart itself.
5. No-Trade Zone:
The no-trade zone is an important feature of this script. It highlights the range between RSI 40 and 60, which represents a neutral or indecisive market condition. When the RSI is within this range, it indicates that the market lacks clear directional momentum, making it a riskier environment for trend-following trades. The script shades this region on the chart, visually warning traders to avoid initiating trades during these periods.
Visual Table Display:
To improve clarity, the script includes a table that shows key values directly on the chart:
RSI 1 (15-minute): Displays the current RSI value for the 15-minute timeframe.
RSI 2 (1-hour): Displays the current RSI value for the 1-hour timeframe.
RSI 3 (Daily): Displays the current RSI value for the Daily timeframe.
ADX: Displays the current ADX value, with color-coding to show whether the trend is strengthening (green) or weakening (red).
Long/Short Signal: This final cell in the table shows whether a potential Long or Short signal is currently active based on RSI crossovers and ADX strength.
The table can be repositioned on the chart according to user preference (Top Right, Top Left, Bottom Right, Bottom Left).
Possible Entry and Exit Points:
Long Entry Criteria:
RSI 1 crosses above RSI 2.
RSI 1 is above its 9-period moving average (to confirm upward momentum).
When these conditions are met, the script will display a potential Long signal in the table, and an alert will be triggered if enabled.
Note : ADX is rising, indicating that the trend strength is increasing. ADX is falling, indicating that the trend is weakening.
Short Entry Criteria:
RSI 1 (15-minute) crosses below RSI 2 (1-hour).
RSI 1 is below its 9-period moving average (to confirm downward momentum).
Note : ADX is rising, indicating that the trend strength is increasing. ADX is falling, indicating that the trend is weakening.
When these conditions are met, the script will display a potential Short signal in the table, and an alert will be triggered if enabled.
Exit Criteria:
Exit a Long position when a Short signal is generated or when a yellow candle appears, which indicates that momentum is weakening.
Exit a Short position when a Long signal is generated or when a yellow candle appears.
Customizable Inputs:
This script offers several customization options for users:
RSI Length and Timeframes:
Adjust the length of the RSI calculation and the timeframes for each RSI (default: 15-minute, 1-hour, Daily). This allows traders to tailor the script to different market conditions and assets.
Smoothing Method:
Choose how the RSI values are smoothed (None, SMA, EMA, WMA, RMA) and adjust the smoothing factor.
ADX Settings:
Toggle the ADX on/off, and adjust the smoothing factor and DI length to match your preferred trend strength calculation.
Divergence Detection:
Enable or disable divergence detection and set the range of bars for detecting divergence patterns.
Table Position:
Change the location of the table on the chart (Top Right, Top Left, Bottom Right, Bottom Left).
Note : I have used RSI 1 = 3 Minutes, RSI 2 = 15 Minutes and RSI 3 = 1 Hour as input in the shown chart.
Important Notes:
This script is intended for educational purposes only. It is designed to help traders learn how to combine RSI and ADX to analyze trends and momentum, but it should not be used as financial advice or a guaranteed trading strategy.
Always test the script in a demo environment before using it in live trading to understand how it behaves with different assets and timeframes.
Proper risk management and additional confirmations should be used alongside this indicator for effective trading.
Gabriel's Witcher Strategy [65 Minute Trading Bot]Strategy Description: Gabriel's Witcher Strategy
Author: Gabriel
Platform: TradingView Pine Script (Version 5)
Backtested Asset: Avalanche (Coinbase Brokage for Volume adjustment)
Timeframe: 65 Minutes
Strategy Type: Comprehensive Trend-Following and Momentum Strategy with Scalping and Risk Management Features
Overview
Gabriel's Witcher Strategy is an advanced trading bot designed for the Avalanche pair on a 65-minute timeframe. This strategy integrates a multitude of technical indicators to identify and execute high-probability trading opportunities. By combining trend-following, momentum, volume analysis, and range filtering, the strategy aims to capitalize on both long and short market movements. Additionally, it incorporates scalping mechanisms and robust risk management features, including take-profit (TP) levels and commission considerations, to optimize trade performance and profitability.
====Key Components====
Source Selection:
Custom Source Flexibility: Allows traders to select from a wide range of price and volume sources (e.g., Close, Open, High, Low, HL2, HLC3, OHLC4, VWAP, On-Balance Volume, etc.) for indicator calculations, enhancing adaptability to various trading styles.
Various curves of Volume Analysis are employed:
Tick Volume Calculation: Utilizes tick volume as a fallback when actual volume data is unavailable, ensuring consistency across different data feeds.
Volume Indicators: Incorporates multiple volume-based indicators such as On-Balance Volume (OBV), Accumulation/Distribution (AccDist), Negative Volume Index (NVI), Positive Volume Index (PVI), and Price Volume Trend (PVT) for comprehensive market analysis.
Trend Indicators:
ADX (Average Directional Index): Measures trend strength using either the Classic or Masanakamura method, with customizable length and threshold settings. It's used to open positions when the mesured trend is strong, or exit when its weak.
Jurik Moving Average (JMA): A smooth moving average that reduces lag, configurable with various parameters including source, resolution, and repainting options.
Parabolic SAR: Identifies potential reversals in market trends with adjustable start, increment, and maximum settings.
Custom Trend Indicator: Utilizes highest and lowest price points over a specified timeframe to determine current and previous trend bases, visually represented with color-filled areas.
Momentum Indicators:
Relative Strength Index (RSI): Evaluates the speed and change of price movements, smoothed with a custom length and source. It's used to not enter the market for shorts in oversold or longs for overbought conditions, and to enter for long in oversold or shorts for overboughts.
Momentum-Based Calculations: Employs both Double Exponential Moving Averages (DEMA) on a MACD-based RSI to enhance momentum signal accuracy which is then further accelerated by a Hull MA. This is the technical analysis tool that determines bearish or bullish momentum.
OBV-Based Momentum Conditions: Uses two exponential moving averages of OBV to determine bullish or bearish momentum shifts, anomalities, breakouts where banks flow their funds in or Smart Money Concepts trade.
Moving Averages (MA):
Multiple MA Types: Includes Simple Moving Average (SMA), Exponential Moving Average (EMA), Weighted Moving Average (WMA), Hull Moving Average (HMA), and Volume-Weighted Moving Average (VWMA), selectable via input parameters.
MA Speed Calculation: Measures the percentage change in MA values to determine the direction and speed of the trend.
Range Filtering:
Variance-Based Filter: Utilizes variance and moving averages to filter out trades during low-volatility periods, enhancing trade quality.
Color-Coded Range Indicators: Visualizes range filtering with color changes on the chart for quick assessment.
Scalping Mechanism:
Heikin-Ashi Candles: Optionally uses Heikin-Ashi candles for smoother price action analysis.
EMA-Based Trend Detection: Employs fast, medium, and slow EMAs to determine trend direction and potential entry points.
Fractal-Based Filtering: Detects regular or BW (Black & White) fractals to confirm trade signals.
Take Profit (TP) Management:
Dynamic TP Levels: Calculates TP levels based on the number of consecutive long or short entries, adjusting targets to maximize profits.
TP Signals and Re-Entry: Plots TP signals on the chart and allows for automatic re-entry upon TP hit, maintaining continuous trade flow.
Risk Management:
Commission Integration: Accounts for trading commissions to ensure net profitability.
Position Sizing: Configured to use a percentage of equity for each trade, adjustable via input parameters.
Pyramiding: Allows up to one additional position per direction to enhance gains during strong trends.
Alerts and Visual Indicators:
Buy/Sell Signals: Plots visual indicators (triangles and flags) on the chart to signify entry and TP points.
Bar Coloring: Changes bar colors based on ADX and trend conditions for immediate visual cues.
Price Levels: Marks significant price levels related to TP and position entries with cross styles.
Input Parameters
Source Settings:
Custom Sources (srcinput): Choose from various price and volume sources to tailor indicator calculations.
ADX Settings:
ADX Type (ADX_options): Select between 'CLASSIC' and 'MASANAKAMURA' methods.
ADX Length (ADX_len): Defines the period for ADX calculation.
ADX Threshold (th): Sets the minimum ADX value to consider a strong trend.
RSI Settings:
RSI Length (len_3): Period for RSI calculation.
RSI Source (src_3): Source data for RSI.
Trend Strength Settings:
Channel Length (n1): Period for trend channel calculation.
Average Length (n2): Period for smoothing trend strength.
Jurik Moving Average (JMA) Settings:
JMA Source (inp): Source data for JMA.
JMA Resolution (reso): Timeframe for JMA calculation.
JMA Repainting (rep): Option to allow JMA to repaint.
JMA Length (lengths): Period for JMA.
Parabolic SAR Settings:
SAR Start (start): Initial acceleration factor.
SAR Increment (increment): Acceleration factor increment.
SAR Maximum (maximum): Maximum acceleration factor.
SAR Point Width (width): Visual width of SAR points.
Trend Indicator Settings:
Trend Timeframe (timeframe): Period for trend indicator calculations.
Momentum Settings:
Source Type (srcType): Select between 'Price' and 'VWAP'.
Momentum Source (srcPrice): Source data for momentum calculations.
RSI Length (rsiLen): Period for momentum RSI.
Smooth Length (sLen): Smoothing period for momentum RSI.
OBV Settings:
OBV Line 1 (e1): EMA period for OBV line 1.
OBV Line 2 (e2): EMA period for OBV line 2.
Moving Average (MA) Settings:
MA Length (length): Period for MA calculations.
MA Type (matype): Select MA type (1: SMA, 2: EMA, 3: HMA, 4: WMA, 5: VWMA).
Range Filter Settings:
Range Filter Length (length0): Period for range filtering.
Range Filter Multiplier (mult): Multiplier for range variance.
Take Profit (TP) Settings:
TP Long (tp_long0): Percentage for long TP.
TP Short (tp_short0): Percentage for short TP.
Scalping Settings:
Scalping Activation (ACT_SCLP): Enable or disable scalping.
Scalping Length (HiLoLen): Period for scalping indicators.
Fast EMA Length (fastEMAlength): Period for fast EMA in scalping.
Medium EMA Length (mediumEMAlength): Period for medium EMA in scalping.
Slow EMA Length (slowEMAlength): Period for slow EMA in scalping.
Filter (filterBW): Enable or disable additional fractal filtering.
Pullback Lookback (Lookback): Number of bars for pullback consideration.
Use Heikin-Ashi Candles (UseHAcandles): Option to use Heikin-Ashi candles for smoother trend analysis.
Strategy Logic
Indicator Calculations:
Volume and Source Selection: Determines the primary data source based on user input, ensuring flexibility and adaptability.
ADX Calculation: Computes ADX using either the Classic or Masanakamura method to assess trend strength.
RSI Calculation: Evaluates market momentum using RSI, further smoothed with custom periods.
Trend Strength Assessment: Utilizes trend channel and average lengths to gauge the robustness of current trends.
Jurik Moving Average (JMA): Smooths price data to reduce lag and enhance trend detection.
Parabolic SAR: Identifies potential trend reversals with adjustable parameters for sensitivity.
Momentum Analysis: Combines RSI with DEMA and OBV-based conditions to confirm bullish or bearish momentum.
Moving Averages: Employs multiple MA types to determine trend direction and speed.
Range Filtering: Filters out low-volatility periods to focus on high-probability trades.
Trade Conditions:
Long Entry Conditions:
ADX Confirmation: ADX must be above the threshold, indicating a strong uptrend.
RSI and Momentum: RSI below 70 and positive momentum signals.
JMA and SAR: JMA indicates an uptrend, and Parabolic SAR is below the price.
Trend Indicator: Confirms the current trend direction.
Range Filter: Ensures market is in an upward range.
Scalping Option: If enabled, additional scalping conditions must be met.
Short Entry Conditions:
ADX Confirmation: ADX must be above the threshold, indicating a strong downtrend.
RSI and Momentum: RSI above 30 and negative momentum signals.
JMA and SAR: JMA indicates a downtrend, and Parabolic SAR is above the price.
Trend Indicator: Confirms the current trend direction.
Range Filter: Ensures market is in a downward range.
Scalping Option: If enabled, additional scalping conditions must be met.
Position Management:
Entry Execution: Places long or short orders based on the identified conditions and user-selected position types (Longs, Shorts, or Both).
Take Profit (TP): Automatically sets TP levels based on predefined percentages, adjusting dynamically with consecutive trades.
Re-Entry Mechanism: Allows for automatic re-entry upon TP hit, maintaining active trading positions.
Exit Conditions: Closes positions when TP levels are reached or when opposing trend signals are detected.
Visual Indicators:
Bar Coloring: Highlights bars in green for bullish conditions, red for bearish, and orange for neutral.
Plotting Price Levels: Marks significant price levels related to TP and trade entries with cross symbols.
Signal Shapes: Displays triangle and flag shapes on the chart to indicate trade entries and TP hits.
Alerts:
Custom Alerts: Configured to notify traders of long entries, short entries, and TP hits, enabling timely trade management and execution.
Usage Instructions
Setup:
Apply the Strategy: Add the script to your TradingView chart set to BTCUSDT with a 65-minute timeframe.
Configure Inputs: Adjust the input parameters under their respective groups (e.g., Source Settings, ADX, RSI, Trend Strength, etc.) to match your trading preferences and risk tolerance.
Position Selection:
Choose Position Type: Use the Position input to select Longs, Shorts, or Both based on your market outlook.
Execution: The strategy will automatically execute and manage positions according to the selected type, ensuring targeted trading actions.
Signal Interpretation:
Buy Signals: Blue triangles below the bars indicate potential long entry points.
Sell Signals: Red triangles above the bars indicate potential short entry points.
Take Profit Signals: Flags above or below the bars signify TP hits for long and short positions, respectively.
Bar Colors: Green bars suggest bullish conditions, red bars indicate bearish conditions, and orange bars represent neutral or consolidating markets.
Risk Management:
Default Position Size: Set to 100% of equity. Adjust the default_qty_value as needed for your risk management strategy.
Commission: Accounts for a 0.1% commission per trade. Adjust the commission_value to match your broker's fees.
Pyramiding: Allows up to one additional position per direction to enhance gains during strong trends.
Backtesting and Optimization:
Historical Testing: Utilize TradingView's backtesting features to evaluate the strategy's performance over historical data.
Parameter Tuning: Optimize input parameters to align the strategy with current market dynamics and personal trading objectives.
Alerts Configuration:
Set Up Alerts: Enable and configure alerts based on the predefined alertcondition statements to receive real-time notifications of trade signals and TP hits.
Additional Features
Comprehensive Indicator Integration: Combines multiple technical indicators to provide a holistic view of market conditions, enhancing trade signal accuracy.
Scalping Options: Offers an optional scalping mechanism to capitalize on short-term price movements, increasing trading flexibility.
Dynamic Take Profit Levels: Adjusts TP targets based on the number of consecutive trades, maximizing profit potential during favorable trends.
Advanced Volume Analysis: Utilizes various volume indicators to confirm trend strength and validate trade signals.
Customizable Range Filtering: Filters trades based on market volatility, ensuring trades are taken during optimal conditions.
Heikin-Ashi Candle Support: Optionally uses Heikin-Ashi candles for smoother price action analysis and reduced noise.
====Recommendations====
Thorough Backtesting:
Historical Performance: Before deploying the strategy in a live trading environment, perform comprehensive backtesting to understand its performance under various market conditions. These are the premium settings for Avalanche Coinbase.
Optimization: Regularly review and adjust input parameters to ensure the strategy remains effective amidst changing market volatility and trends. Backtest the strategy for each crypto and make sure you are in the right brokage when using the volume sources as it will affect the overall outcome of the trading strategy.
Risk Management:
Position Sizing: Adjust the default_qty_value to align with your risk tolerance and account size.
Stop-Loss Implementation: Although the strategy includes TP levels, they're also consided to be a stop-loss mechanisms to protect against adverse market movements.
Commission Adjustment: Ensure the commission_value accurately reflects your broker's fees to maintain realistic backtesting results. Generally, 0.1~0.3% are most of the average broker's comission fees.
Slipage: The slip comssion is 1 Tick, since the strategy is adjusted to only enter/exit on bar close where most positions are available.
Continuous Monitoring:
Strategy Performance: Regularly monitor the strategy's performance to ensure it operates as expected and make adjustments as needed. A max-drawndown hit has been added to operate in case the premium Avalanche settings go wrong, but you can turn it off an adjust the equity percentage to 50% if you are confortable with the high volatile max-drown or even 100% if your account allows you to borrow cash.
Customization:
Indicator Parameters: Tailor indicator settings (e.g., ADX length, RSI period, MA types) to better fit your specific trading style and market conditions.
Scalping Options: Enable or disable scalping based on your trading preferences and risk appetite.
Conclusion
Gabriel's Witcher Strategy is a robust and versatile trading solution designed to navigate the complexities of the Crypto market. By integrating a wide array of technical indicators and providing extensive customization options, this strategy empowers traders to execute informed and strategic trades. Its comprehensive approach, combining trend analysis, momentum detection, volume evaluation, and range filtering, ensures that trades are taken during optimal market conditions. Additionally, the inclusion of scalping features and dynamic take-profit management enhances the strategy's adaptability and profitability potential. Unlike any trading strategy, with both diligent testing and continuous monitoring under the strategy tester, it's possible to achieve sustained success by adjusting the settings to the individual Crypto that need it, for example this one is preset for Avalanche Coinbase 65 Miinutes but it can be adjust for BTCUSD or Etherium if you backtest and search for the right settings.
Trend, Momentum and Price value analysis [deepakks444]Trend, Momentum, and Price Value Analysis
This indicator combines several key technical analysis tools to help traders evaluate the market's trend strength, momentum, and overall price behavior. It uses a variety of signals to generate a "Buy," "Sell," or "No Clear Indication" based on multiple indicators and plots them directly on the chart. A customizable table also summarizes these signals, making it easy to interpret the market conditions in real-time.
Key Features:
VWAP (Volume-Weighted Average Price): Indicates whether the price is above or below the VWAP line, helping to identify buying or selling opportunities based on fair value.
Alligator Indicator: Utilizes three simple moving averages (SMAs) to track trend direction, providing a clear "Buy" or "Sell" signal when the averages are aligned.
Supertrend: A widely-used trend-following indicator, this script identifies potential buy or sell zones based on the price's relationship with the Supertrend line.
20-period Moving Average (MA): A simple moving average to track the overall trend direction. The signal is based on the price crossing above or below the MA.
ADX (Average Directional Index): Measures the strength of the trend. A reading above 25 indicates a "Buy" signal, while a reading below suggests a "Sell."
RSI (Relative Strength Index): Generates a buy signal when RSI exceeds 60 and a sell signal when it drops below 40. Values between 40 and 60 indicate a neutral condition.
MACD (Moving Average Convergence Divergence): Provides a signal for buying when the MACD line crosses above the signal line, and selling when it crosses below.
Volume Signal: Compares current volume against the 20-period moving average to identify significant volume spikes. This helps in determining if the market is supported by strong volume.
Customization Options:
Moving Average Length: Customize the 20-period MA length to better fit your trading style or the asset you’re analyzing.
Supertrend Settings: Adjust the Supertrend factor and ATR period for different timeframes or volatility environments.
Table Position: Customize where the signal table is displayed on the chart (Top Right, Top Left, Bottom Right, or Bottom Left).
Table Appearance: Set the table background color and choose between small or tiny text size for better readability.
Signal Summary:
The indicator computes a combined signal based on the number of "Buy" or "Sell" signals from the individual indicators. If 5 or more indicators suggest a "Buy" or "Sell," the table will display a combined signal for easier decision-making. This feature consolidates the signals into one straightforward output, helping you filter noise and act on clear trends.
Table Display:
The customizable table organizes the signals of the key indicators, showing:
Indicator: Lists all the indicators in use, such as VWAP, Alligator, Supertrend, etc.
Signal: Displays "Buy," "Sell," or "Neutral" for each indicator based on the current market conditions.
Intended Use:
This script is designed to help traders monitor multiple technical indicators at once, giving them a clearer view of the market’s trend strength, momentum, and volatility. While it simplifies the process of interpreting various signals, users should use it in combination with their own research and risk management strategies.
Disclaimer: This script is for educational purposes only and should not be considered financial advice. All trading involves risk, and the performance of an indicator in the past does not guarantee future results. Always perform due diligence and use proper risk management techniques.
3 days ago
Release Notes
A "Buy" triangle is plotted below the bar if the signal changes to "Buy".
A "Sell" triangle is plotted above the bar if the signal changes to "Sell".
Script Name: Trend, Momentum, and Price Value Analysis
The Trend, Momentum, and Price Value Analysis script provides a multi-faceted approach to market analysis, combining several technical indicators into a single tool. This script offers an easy-to-interpret table summarizing various indicator signals, along with visual buy/sell signals on the chart.
Key Features:
VWAP (Volume Weighted Average Price):
The VWAP provides insights into whether the current price is above or below the average weighted price, helping traders identify potential buy or sell opportunities.
Alligator Indicator (Simplified):
Using three simple moving averages (SMAs), this tool helps identify the beginning of trends and potential buy/sell zones based on the Alligator jaw, teeth, and lips.
Supertrend:
A trend-following indicator that determines whether the market is in a bullish or bearish phase based on ATR and factor inputs. The Supertrend line is plotted on the chart.
20-period Moving Average (MA):
A basic moving average that assists in gauging price direction and the overall trend.
ADX (Average Directional Index):
Helps identify the strength of a trend. A value above 25 indicates a strong trend.
RSI (Relative Strength Index):
Measures momentum by identifying overbought and oversold conditions. A signal is triggered when RSI is above 60 (buy) or below 40 (sell).
MACD (Moving Average Convergence Divergence):
A momentum indicator that provides signals when the MACD line crosses the signal line.
Volume Signal:
Compares the current volume with a 20-period average to determine if volume supports the current trend direction.
Signal Table:
A table is generated on the chart, displaying real-time signals from each of the above indicators. The table is customizable with background colors and text sizes.
The position of the table can be set to any corner of the chart for convenience.
Combined Signal Logic:
The script calculates a Combined Signal based on the majority of buy or sell signals across all the indicators. If 5 or more indicators give a buy or sell signal, a combined signal is generated.
Buy/Sell Signal Plots:
The script plots buy (green triangle) and sell (red triangle) signals on the chart based on the combined signal when transitioning from a previous opposite signal.
Customizable Inputs:
Users can customize the length of the moving averages, adjust the background and text colors of the table, and choose the position of the table on the chart.
Trend, Momentum and Price value analysis Extended [deepakks444]Trend, Momentum, and Price Value Analysis Extended
This Pine Script™ indicator is designed to offer traders a comprehensive overview of price trends, momentum, and market strength through the use of several widely-recognized technical analysis tools. The indicator integrates multiple signals and plots directly on the chart, as well as a customizable table to help visually organize and interpret the data. Here’s an overview of the key features included:
Key Features:
VWAP (Volume-Weighted Average Price): Calculates the average price weighted by volume to give insight into whether the price is above or below the market's fair value.
Alligator Indicator: Uses a combination of three moving averages (jaw, teeth, and lips) to help identify trending conditions.
Supertrend: A trend-following indicator that signals potential buy or sell opportunities based on price movements relative to a dynamically calculated support/resistance line.
20-period Moving Average (MA): A basic moving average to smooth out price data and highlight the underlying trend.
MACD (Moving Average Convergence Divergence): Helps identify changes in the strength, direction, and momentum of a trend.
Volume with Moving Average: Compares current volume against its moving average to identify potential volume spikes.
RSI (Relative Strength Index): Measures the speed and change of price movements, signaling overbought or oversold conditions.
ADX (Average Directional Index): An indicator used to quantify trend strength, helping traders determine whether the market is trending or in a range.
Pivot Points: Calculates daily pivot points and identifies support and resistance levels based on price movements.
Bollinger Bands: A volatility indicator that uses standard deviation to highlight potential overbought or oversold conditions.
Customization Options:
Modify the length of the price and volume moving averages.
Adjust RSI thresholds for buy and sell signals.
Set the thresholds for ADX to differentiate between weak, average, and strong trends.
Toggle the visibility of the 20-period MA and Supertrend on the chart.
Choose to display the percentage difference between the current price and indicator values in the table.
Table Display:
The indicator includes a table that summarizes the status of all signals, showing:
Signal (Buy/Sell/Neutral): Based on each indicator's interpretation of price action.
Percentage Difference: Optional display of how far the price is from the reference level (e.g., the difference between the price and VWAP, Supertrend line, or Moving Average).
The table allows traders to quickly assess the current market conditions across several indicators in one place, making it easier to gauge overall market sentiment.
Signal Logic:
This indicator uses a scoring system to calculate the percentage of indicators signaling a buy or sell. If the buy or sell score reaches 70% or higher, the indicator will plot buy or sell signals on the chart. The combined signal logic is displayed in the table as "Buy," "Sell," or "No Signal," based on the majority of the contributing indicators.
Intended Use:
This tool is designed to assist traders in their technical analysis by consolidating multiple popular indicators into one script. It provides a clear visual representation of various market signals, helping traders to make informed decisions about potential trade entries and exits. However, this indicator is for educational purposes and should not be used as financial advice. Traders should always use proper risk management and conduct their own research before making any trading decisions.
Disclaimer: This script is for educational purposes only and does not constitute financial advice. Trading involves risk, and past performance of an indicator does not guarantee future results. Please use it alongside proper risk management practices.
Signals for Trending or Ranging market using RSI and WMAThis trading indicator is based on several key components, including the Average Directional Index (ADX), and a combination of RSI and Weighted Moving Average (WMA) to signal trading opportunities in both trending and ranging markets. Here's a breakdown:
ADX Calculation: The script calculates the ADX to identify market trends. A threshold value of ADX is used to distinguish between trending and ranging market conditions.
RSI and WMA for Different Market Conditions: The script calculates two sets of RSI and WMA, one for trending markets and another for ranging markets. This allows the strategy to adjust based on market conditions determined by the ADX value.
Trade Signals: The script generates long and short signals based on the alignment of RSI and WMA.
Long Signals: Triggered when RSI and WMA indicate upward momentum.
Short Signals: Triggered when both RSI and WMA suggest downward movement.
The signals are confirmed by pivot points, with the stop loss placed at the most recent high or low.
Stop Loss and Trade Management: The script includes dynamic stop-loss management. It moves the stop loss in halfway original stop loss after achieving 2R and to break-even after achieving a 4R gain.
Performance Tracking: It tracks the number of winning and losing trades and calculates the total "R" (risk/reward) for the active trades. Debugging labels are added on the chart to display statistics for wins, losses, and total R performance.
Plotting: The script plots the stop loss and entry price on the chart for visual clarity. Additionally, it colors the background green or red based on whether a long or short position is active.
Overall, this indicator combines ADX, RSI, and WMA indicators with a robust trade management system to execute and track trading signals in both trending and ranging markets.
Daksh RSI POINT to ShootHere are the key points and features of the Pine Script provided:
### 1. **Indicator Settings**:
- The indicator is named **"POINT and Shoot"** and is set for non-overlay (`overlay=false`) on the chart.
- `max_bars_back=4000` is defined, indicating the maximum number of bars that the script can reference.
### 2. **Input Parameters**:
- `Src` (Source): The price source, default is `close`.
- `rsilen` (RSI Length): The length for calculating RSI, default is 20.
- `linestylei`: Style for the trend lines (`Solid` or `Dashed`).
- `linewidth`: Width of the plotted lines, between 1 and 4.
- `showbroken`: Option to show broken trend lines.
- `extendlines`: Option to extend trend lines.
- `showpivot`: Show pivot points (highs and lows).
- `showema`: Show a weighted moving average (WMA) line.
- `len`: Length for calculating WMA, default is 9.
### 3. **RSI Calculation**:
- Calculates a custom RSI value using relative moving averages (`ta.rma`), and optionally uses On-Balance Volume (`ta.obv`) if `indi` is set differently.
- Plots RSI values as a green or red line depending on its position relative to the WMA.
### 4. **Pivot Points**:
- Utilizes the `ta.pivothigh` and `ta.pivotlow` functions to detect pivot highs and lows over the defined period.
- Stores up to 10 recent pivot points for highs and lows.
### 5. **Trend Line Drawing**:
- Lines are drawn based on pivot highs and lows.
- Calculates potential trend lines using linear interpolation and validates them by checking if subsequent bars break or respect the trend.
- If the trend is broken, and `showbroken` is enabled, it draws dotted lines to represent these broken trends.
### 6. **Line Management**:
- Initializes multiple lines (`l1` to `l20` and `t1` to `t20`) and uses these lines for drawing uptrend and downtrend lines.
- The maximum number of lines is set to 20 for uptrends and 20 for downtrends, due to a limit on the total number of lines that can be displayed on the chart.
### 7. **Line Style and Color**:
- Defines different colors for uptrend lines (`ulcolor = color.red`) and downtrend lines (`dlcolor = color.blue`).
- Line styles are determined by user input (`linestyle`) and use either solid or dashed patterns.
- Broken lines use a dotted style to indicate invalidated trends.
### 8. **Pivot Point Plotting**:
- Plots labels "H" and "L" for pivot highs and lows, respectively, to visually indicate turning points on the chart.
### 9. **Utility Functions**:
- Uses helper functions to get the values and positions of the last 10 pivot points, such as `getloval`, `getlopos`, `gethival`, and `gethipos`.
- The script uses custom logic for line placement based on whether the pivots are lower lows or higher highs, with lines adjusted dynamically based on price movement.
### 10. **Plotting and Visuals**:
- The main RSI line is plotted using a color gradient based on its position relative to the WMA.
- Horizontal lines (`hline1` and `hline2`) are used for visual reference at RSI levels of 60 and 40.
- Filled regions between these horizontal lines provide visual cues for potential overbought or oversold zones.
These are the main highlights of the script, which focuses on trend detection, visualization of pivot points, and dynamic line plotting based on price action.