DojiEmoji

Modified ATR Indicator [KL]

DojiEmoji Cập nhật   
Modified Average True Range (ATR) Indicator
This indicator displays the ATR with relative highs and relative lows statistically determined.

What is ATR:
To know what ATR is, we need to understand what a True Range (TR) is.
- TR at a given bar is the highest distance between points: a) High vs low, b) High vs Close, and c) Low vs Close.
- ATR is the moving average of TRs over a predefined lookback period; 14 is the most commonly used.
- ATR can be mathematically expressed as:

Why is ATR Important
ATR often used to measure volatility; high volatility is indicated by high ATR, vice versa for low. This is a versatile tool allowing traders to determine entry/exit points, as well as the size of stop losses and when to take profits relative to it.

This is an opinion: Through observations, I have noticed that ATR can also indirectly tell us the levels of relative volume. This intuitively makes sense because in order to increase length of TR, high amounts of capital inflow/outflow is required (graphically speaking, high volume is required in order to make lengths of candle sticks longer). The relationship between ATR and relative volume should hold unless the market is illiquid to the extreme that there is no relationship between volume and price.

That said, knowing the relative lows/highs of ATR is very useful. It can be interpreted as:
- Relative high = high volatility, usually during sell offs
- Relative low = decreasing volume, could indicate price consolidation

Instead of arbitrarily determining whether ATR is high/low, this indicator will determine relative highs and relative lows using a simple statistical model.

How relative high/low is determined by this model
This indicator applies two-tailed hypothesis testing to test whether ATR (ie. say lookback of 14) has greatly deviated from a larger sample size (ie. lookback of 50). Assuming ATR is normally distributed and variance is known, then test statistic (z) can be used to determine whether ATR14 is within the critical area under Null Hypothesis: ATR14 == ATR50. If z falls below/above the left/right critical values (ie. 1.645 for a 90% confidence interval), then this is shown by the indicator through using different colors to plot the ATR line.
Phát hành các Ghi chú:
Amended: Confidence interval -> Critical values Mapping
Phát hành các Ghi chú:
Added "Point estimation model", can be selected in Settings -> Inputs -> Model. For details, refer to the inline code documentations.
Phát hành các Ghi chú:
Added label attached to the last bar showing current atr(len) value.
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 đồ?