View source: R/technical_indicators.R
| calc_distance | R Documentation |
data("sample_prices_weekly") Calculates percentage distance between prices and reference values (typically moving averages).
calc_distance(price_df, reference_df)
price_df |
Data frame with price data |
reference_df |
Data frame with reference values (same structure) |
Data.table with percentage distances
data("sample_prices_weekly")
ma20 <- calc_moving_average(sample_prices_weekly, 20)
data("sample_prices_weekly")
distance <- calc_distance(sample_prices_weekly, ma20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.