NT30356

Multi Timeframe ATR Indicator

The Average True Range (ATR) indicator is a technical analysis tool used to measure market volatility. The ATR indicator is designed to capture the degree of price movement or price volatility over a specified period of time. It does this by calculating the true range for each bar or candlestick on a chart and then taking an average of these true range values over a set period.

In the provided Pine Script code, the ATR indicator is being calculated for two different timeframes, which allows traders to compare volatility across different periods. The script includes user-defined inputs for the length of the ATR calculation and the type of smoothing (RMA or SMA) to be applied to the true range values. The 'smoothingFunc' function within the script determines whether to use the RMA (Relative Moving Average) or SMA (Simple Moving Average) based on the user's selection.

The true range for each bar is calculated as the maximum of the following three values: the difference between the current high and low, the absolute value of the difference between the current high and the previous close, and the absolute value of the difference between the current low and the previous close. This calculation is designed to ensure that gaps and limit moves are properly accounted for in the volatility measurement.
The script then uses the 'smoothingFunc' to calculate the ATR values for the two timeframes, and these values are plotted on the chart as two separate lines, allowing traders to visually assess the volatility levels.

Overall, this custom ATR indicator is a versatile tool for traders who wish to analyse market volatility and compare it across different timeframes, potentially aiding in making more informed trading decisions based on the prevailing market conditions.

Mã nguồn mở

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

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

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

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