This site is based on Github/Jekyll.
Graphs are generated dynamically through the R package knitr.
The source code to these posts are available on GitHub.

Latest posts

Stockmomentum.3

2016-01-17

stock momentum

https://www.donfishback.com/2016/01/panic-selling-a-pause-then-another-smash-whats-next/

  • S&P 500 ($SPX) closes down more than 1% for three straight days.
  • Each close is a new 20-day low.
  • The final close on the third day is below the 200-day moving average.
momersion <- function(R, n, returnLag = 1) {
  momentum <- sign(R * lag(R, returnLag))
  momentum[momentum < 0] <- 0
  momersion <- runSum(momentum, n = n)/n * 100
  colnames(momersion) <- "momersion"
  return(momersion)
}
## Copyright All the content in this website is licensed under [CC BY-NC-SA 3.0](http://creativecommons.org/licenses/by-nc-sa/3.0/).