getSpeed: Get speed.

View source: R/functions.R

getSpeedR Documentation

Get speed.

Usage

getSpeed(df)

Arguments

df

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (df) 
{
    lf <- 7
    ldf <- tail(df, lf)
    lmdf <- lm(ldf[1:(lf - 1), ]$Adjusted ~ index(ldf[1:(lf - 
        1), ]$Date))
    lmdff <- lm(ldf[2:lf, ]$Adjusted ~ index(ldf[2:lf, ]$Date))
    return(as.numeric(lmdff$coefficients[2]) - as.numeric(lmdf$coefficients[2]))
  }

danielfhenrique789/profitmaximization documentation built on April 5, 2025, 4:05 p.m.