OPEN-SOURCE SCRIPT

Swing Trend Analysis

Theo PrasadJoshi12
Cập nhật
Introducing the Swing Trend Analyzer: A Powerful Tool for Swing and Positional Trading

The Swing Trend Analyzer is a cutting-edge indicator designed to enhance your swing and positional trading by providing precise entry points based on volatility contraction patterns and other key technical signals. This versatile tool is packed with features that cater to traders of all timeframes, offering flexibility, clarity, and actionable insights.


Key Features:

1. Adaptive Moving Averages:
The Swing Trend Analyzer offers multiple moving averages tailored to the timeframe you are trading on. On the daily chart, you can select up to four different moving average lengths, while all other timeframes provide three moving averages. This flexibility allows you to fine-tune your analysis according to your trading strategy. Disabling a moving average is as simple as setting its value to zero, making it easy to customize the indicator to your needs.

2. Dynamic Moving Average Colors Based on Relative Strength:
This feature allows you to compare the performance of the current ticker against a major index or any symbol of your choice. The moving average will change color based on whether the ticker is outperforming or underperforming the selected index over the chosen period. For example, on a daily chart, if the 21-day moving average turns blue, it indicates that the ticker has outperformed the selected index over the last 21 days. This visual cue helps you quickly identify relative strength, a key factor in successful swing trading.

3. Visual Identification of Price Contractions:
The Swing Trend Analyzer changes the color of price bars to white (on a dark theme) or black (on a light theme) when a contraction in price is detected. Price contractions are highlighted when either of the following conditions is met: a) the current bar is an inside bar, or b) the price range of the current bar is less than the 14-period Average Daily Range (ADR). This feature makes it easier to spot price contractions across all timeframes, which is crucial for timing entries in swing trading.

4. Overhead Supply Detection with Automated Resistance Lines:
The indicator intelligently detects the presence of overhead supply and draws a single resistance line to avoid clutter on the chart. As price breaches the resistance line, the old line is automatically deleted, and a new resistance line is drawn at the appropriate level. This helps you focus on the most relevant resistance levels, reducing noise and improving decision-making.

5. Buyable Gap Up Marker: The indicator highlights bars in blue when a candle opens with a gap that remains unfilled. These bars are potential Buyable Gap Up (BGU) candidates, signaling opportunities for long-side entries.

6. Comprehensive Swing Trading Information Table:
The indicator includes a detailed table that provides essential data for swing trading:

a. Sector and Industry Information: Understand the sector and industry of the ticker to identify stocks within strong sectors.

b. Key Moving Averages Distances (10MA, 21MA, 50MA, 200MA): Quickly assess how far the current price is from key moving averages. The color coding indicates whether the price is near or far from these averages, offering vital visual cues.

c. Price Range Analysis: Compare the current bar's price range with the previous bar's range to spot contraction patterns.

d. ADR (20, 10, 5): Displays the Average Daily Range over the last 20, 10, and 5 periods, crucial for identifying contraction patterns. On the weekly chart, the ADR continues to provide daily chart information.

e. 52-Week High/Low Data: Shows how close the stock is to its 52-week high or low, with color coding to highlight proximity, aiding in the identification of potential breakout or breakdown candidates.

f. 3-Month Price Gain: See the price gain over the last three months, which helps identify stocks with recent momentum.

7. Pocket Pivot Detection with Visual Markers:
Pocket pivots are a powerful bullish signal, especially relevant for swing trading. Pocket pivots are crucial for swing trading and are effective across all timeframes. The indicator marks pocket pivots with circular markers below the price bar:
a. 10-Day Pocket Pivot: Identified when the volume exceeds the maximum selling volume of the last 10 days. These are marked with a blue circle.
b. 5-Day Pocket Pivot: Identified when the volume exceeds the maximum selling volume of the last 5 days. These are marked with a green circle.



The Swing Trend Analyzer is designed to provide traders with the tools they need to succeed in swing and positional trading. Whether you're looking for precise entry points, analyzing relative strength, or identifying key price contractions, this indicator has you covered. Experience the power of advanced technical analysis with the Swing Trend Analyzer and take your trading to the next level.
Phát hành các Ghi chú
Release Notes:

This release enhances the information displayed in the information table. Intraday charts now show percentage gains for the past 10, 21, and 63 bars, replacing the previous 3-month gain. Similarly, non-intraday charts now display percentage gains for the past 1, 3, 6, and 9 months. Additionally, intraday charts now include the percentage distance from the 252-bar high and low, while daily charts show the distance from the 52-week high and low.
Phát hành các Ghi chú
Release Notes:

This release enhances the information displayed in the information table. Intraday charts now show percentage gains for the past 10, 21, and 63 bars, replacing the previous 3-month gain. Similarly, non-intraday charts now display percentage gains for the past 1, 3, 6, and 9 months. Additionally, intraday charts now include the percentage distance from the 252-bar high and low, while daily charts show the distance from the 52-week high and low.

Removed unnecessary table row.
Phát hành các Ghi chú
Release Notes:
Enhanced chart clarity by adding explicit visual markers to highlight indicator features. Removed the red dot indicator for days with a red close and above-average volume to reduce visual clutter.
Phát hành các Ghi chú
Fixed Spelling
contractiongapupInside BarmovingavaragepocketpivotrelativestrengthSupply ZoneTrend AnalysisVCP

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Thông báo miễn trừ trách nhiệm