- ago
I compute ATR as follows:
CODE:
var atr = ATR.Series(barsDaily, 14);


I'm confused since it is computed from bars. I expect it to be computed from time series. Are OHLC of `atr` bars contains ATR of OHLC time series? How to compute, say, ATR from typical price only, to compose bars with close as typical price and empty series for OHL?

Where are the docs of ATR?
0
317
8 Replies

Reply

Bookmark

Sort
- ago
#1
Positively no. Check the original formula everywhere from Wikipedia to StockCharts. ATR by Welles Wilder relies on a complete BarHistory and cannot be derived from a single price series.
0
Glitch8
 ( 10.57% )
- ago
#2
The docs for Average True Range (ATR) are all over the web, just google it. For example:

https://corporatefinanceinstitute.com/resources/equities/average-true-range/
0
- ago
#3
ATR is based on True Range (TR), which factors in the Highs and Lows of the previous day. In other words, OHLC information (in BarHistory) is required to compute TR.

I have thought about creating a "robust" StdDev TimeSeries to replace ATR, which takes TimeSeries input, but the implementation is complicated because the random error surrounding the StdDev calculation is not normally distributed; it's skewed.

There are some robust volatility metrics developed, but none work that well for this application. Remember "robust statistics" is an area of research. It's science is still under development.
0
- ago
#4
OK. I was wrong. ATR is computed from OHLC.

But what data is inside OHL of ATR indicator computed by WL8?

Is there a doc where it’s described?
0
Cone8
 ( 7.51% )
- ago
#5
Indicators, in general, take either a TimeSeries (could be just O, H, L, C, V, or any other indicator) or a BarHistory, which has OHLC/V.

ATR takes a BarHistory parameter. It's a standard indicator. You can find it documented in countless places, like our old Wiki for WealthLab 6 and prior (http://www2.wealth-lab.com/wl5wiki/AllPages.aspx?Cat=Standard%20Indicators), but Investopedia is usually a good reference.
0
- ago
#6
Sorry, I'm not following. `ATR` instance allows to get its data via `Bars`. It's not a time-series which I expect from `ATR`. I might also expect that `Close` time-series of `Bars` contains proper values of ATR. But there are also `Open`, `High` and `Low` time-series of `Bars` which are not empty and contain different values. What are those? How are they computed?
0
- ago
#7
You're confused. ATR TAKES a BarHistory as a parameter (due to its formula requirement). But all indicators including ATR would RETURN a TimeSeries, i.e. any indicator is time series and not bars.
1
Glitch8
 ( 10.57% )
- ago
#8
The way a stock chart works is that each bar of data contains four values, open high low and close.

Open is the price the stock opened that day. Low is the lowest price the stock reached that day. High is the highest price the stock reached that day. And close is the final price the stock closed at on that day.
0

Reply

Bookmark

Sort