ATR | R Documentation |
Returns the average true range as well as the relative price based on the ATR as a reference
ATR(df, period, current = FALSE, mrprice = NULL, hideprints = TRUE)
df |
Dataframe with price data. |
period |
Calculation period in day for the true range |
current |
If one wants to input the latest price point before data update |
mrprice |
Most recent price; |
hideprints |
if TRUE hides the print outs regarding the percentile within an ATR |
Returns a vector of ATR calculations in dataframe format. If current = TRUE, returns the most recent ATR as well as where price is in the context of the ATR
ATR(SPY15, 14) ATR(SPY15, 14, current = TRUE, mrprice = tail(SPYdaily$close, 1) + 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.