Skip to content

Commit

Permalink
Fix whitespace and remove unneeded files
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaulrich committed Feb 13, 2024
1 parent 1eef823 commit b0890f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 31 deletions.
25 changes: 11 additions & 14 deletions R/MovingAverages.R
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,14 @@ function(x, n=10, wts=1:n, ...) {

# replace 1:(n-1) with NAs and prepend NAs from original data
ma[1:(n-1)] <- NA


# Convert back to original class
ma <- reclass(ma,x)

if(!is.null(dim(ma))) {
colnames(ma) <- "WMA"
}

return(ma)
}

Expand Down Expand Up @@ -315,16 +316,15 @@ function(price, volume, n=10, ...) {

# Call C routine
ma <- .Call(C_evwma, pv[,1], pv[,2], n)

# Convert back to original class
ma <- reclass(ma, price)

if(!is.null(dim(ma))) {
colnames(ma) <- "EVWMA"
}

return(ma)

}

#-------------------------------------------------------------------------#
Expand Down Expand Up @@ -388,10 +388,8 @@ function(x, n=20, ...) {
if(!is.null(dim(hma))) {
colnames(hma) <- "HMA"
}

return(
hma
)

return(hma)
}

#-------------------------------------------------------------------------#
Expand All @@ -417,14 +415,13 @@ function(x, n=9, offset=0.85, sigma=6, ...) {
wts <- wts/sumWeights

alma <- x * NA_real_

for(i in seq_len(NCOL(x))) {
alma[,i] <- WMA(x[,i], n, wts)
}

if(!is.null(dim(alma))) {
colnames(alma) <- "ALMA"
}

reclass(alma, x)
}
17 changes: 0 additions & 17 deletions TTR.Rproj

This file was deleted.

Binary file removed src/TTR.dll
Binary file not shown.

0 comments on commit b0890f0

Please sign in to comment.