OPEN-SOURCE SCRIPT

Asset Drawdown & Drawdown HeatMap [InvestorUnknown]

Overview

The "Asset Drawdown & Drawdown HeatMap" indicator is designed for educational purposes to help users visualize and analyze the drawdowns of various assets. It highlights both recent and historical drawdowns, offering valuable insights into the performance and risk of different investments. Additionally, it can serve as a complementary analysis tool for trading and investing decisions.

Features

Drawdown Calculation:
  • Computes the drawdown from the highest value (ATH) to the current value, showing the percentage decline.
  • Displays both the current drawdown and the maximum historical drawdown for the selected assets.


HeatMap Visualization:
  • Uses a gradient color scheme to represent the magnitude of drawdowns over a specified lookback period.
  • Helps identify periods of significant decline and recovery visually.


스냅샷

Multiple Assets:
  • Supports up to 10 different assets (adding more would make it harder to see the drawdowns of different assets), allowing users to compare drawdowns across various symbols.
  • Each asset can be individually plotted and color-coded for clarity.


스냅샷

Customizable Settings:
  • User inputs for high and low value calculations, color preferences, and lookback periods.
  • Option to color bars based on the drawdown heatmap.


Detailed Functionality

Drawdown Calculation:
The DD() function calculates the current drawdown and the maximum historical drawdown based on the high and low values.
The drawdown is calculated as 100 - (lowvalue / ATH * 100), where ATH is the highest value observed so far.



Security Request:
Uses the request.security() function to fetch drawdown data for each specified asset on a daily timeframe.
Computes both current drawdown (TnDD) and maximum drawdown (TnMDD) for each asset.



Plotting:
Plots the drawdown values for each asset on the chart, with the option to enable or disable plotting for individual assets.
Colors the plotted lines and labels based on user-specified preferences.

HeatMap:
Creates a heatmap color gradient based on the drawdown values over the lookback period.
Colors the bars on the chart according to the heatmap to visualize drawdown severity over time.



Labels:
Displays labels for each asset's drawdown value at the end of the chart for quick reference.


This indicator is an excellent tool for educational purposes, helping users understand drawdown dynamics and their implications on asset performance. It also provides a visual aid for monitoring and comparing drawdowns across multiple assets, which can be beneficial for making informed trading and investment decisions.
Cycleseducationalstatistics

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항