OPEN-SOURCE SCRIPT

ATH Drawdown

Aktualisiert
This Pine Script indicator, titled "ATH Drawdown," is designed to help traders and analysts visualize various drawdown levels from the all-time high (ATH) of a security over the past 365 days. This indicator plots several key drawdown levels on the chart and dynamically updates their color and labels to reflect market conditions.

Key Features:
Daily High Calculation:

Fetches the daily high prices for the security using the request.security function.

Highest High Calculation:

Calculates the highest high over the last 365 days using daily data. This represents the all-time high (ATH) for the specified period.

Drawdown Levels:

Computes various drawdown levels from the ATH:

2% Drawdown

5% Drawdown

10% Drawdown

15% Drawdown

25% Drawdown

45% Drawdown

50% Drawdown

Dynamic Line Coloring:

The color of the 2% drawdown line changes dynamically based on the current closing price:

Red if the close is below the 2% drawdown level.

Green if the close is above the 2% drawdown level.

Plotting Drawdown Levels:

Plots each drawdown level on the chart with specific colors and line widths for easy visual distinction:

2% Drawdown: Green or Red, depending on the closing price.

5% Drawdown: Orange.

10% Drawdown: Blue.

15% Drawdown: Maroon.

25% Drawdown: Purple.

45% Drawdown: Yellow.

50% Drawdown: Black.

Labels for Drawdown Levels:

Adds labels at the end of each drawdown line to indicate the percentage drawdown:

Labels display "2%", "5%", "10%", "15%", "25%", "45%", and "50%" respectively.

The labels are positioned dynamically at the latest bar index to ensure they are always visible.

Example Use Cases:
Risk Management: Quickly identify significant drawdown levels to assess the risk of current positions.

Support Levels: Use drawdown levels as potential support levels where price might find buying interest.

Performance Tracking: Monitor how far the price has retraced from its all-time high to understand market sentiment and performance.

This script offers traders and analysts an efficient way to visualize and track important drawdown levels from the ATH, helping in better risk management and decision-making. The dynamic color and label features enhance the readability and usability of the indicator.
Versionshinweise
Added label color option.
Pivot points and levelsstatisticsVolatility

Open-source Skript

Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun das Script auch andere Trader verstehen und prüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden. Die Nutzung dieses Codes in einer Veröffentlichung wird in unseren Hausregeln reguliert. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Möchten Sie dieses Skript auf einem Chart verwenden?

Haftungsausschluss