Description Usage Arguments Details Value
View source: R/momentum_data.R
We propose two estimators for the next price, and define its momentum by whichever is closest: the max of previous prices is momentum +1, and the historical mean is momentum 0
1 | evaluate_momentum_at_window(price_window, next_price, historic_price_mean)
|
price_window |
of asset in period t-τ+1,...t |
next_price |
price of asset in period t+1 |
historic_price_mean |
historic price mean at period t. For some α\in[0,1], the historic price mean is MA_t = α p_t + (1-α) MA_{t-1}, with MA_1 = p_1. |
Note that this definition of momentum is scale-invariant, i.e. if all the prices are scaled (and the historic price means computed on these scaled prices) the momentum results are identical.
the momentum defined in the description if all arguments
are present. If any of the first
three arguments are NA
, returns NA
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.