diff --git a/DESCRIPTION b/DESCRIPTION index e72686aa..dc199dc3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,9 +37,6 @@ Imports: shiny (>= 1.4.0), xts, zoo -LinkingTo: - RcppSimdJson, - xts Suggests: keyring, knitr, diff --git a/NAMESPACE b/NAMESPACE index 1198b8d4..ac5f81ae 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -78,9 +78,7 @@ importFrom(ggplot2,scale_x_continuous) importFrom(ggplot2,scale_y_continuous) importFrom(ggplot2,theme) importFrom(ggplot2,theme_grey) -importFrom(mirai,mirai) importFrom(nanonext,ncurl) -importFrom(secretbase,sha256) importFrom(shiny,HTML) importFrom(shiny,checkboxInput) importFrom(shiny,column) diff --git a/NEWS.md b/NEWS.md index ba1db491..1f4582de 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # ichimoku 1.5.4.9000 (development) +#### Updates: + +* Internal performance enhancements. + # ichimoku 1.5.4 #### Updates: diff --git a/R/archive.R b/R/archive.R index 2c1b3646..8f70c7ea 100644 --- a/R/archive.R +++ b/R/archive.R @@ -154,7 +154,7 @@ writeArchive <- function(object, file) { } } - x_archive_secure_hash <- sha256(object) + x_archive_secure_hash <- secretbase::sha256(object) save(object, x_archive_secure_hash, file = file, compress = TRUE) message(sprintf("Archive written to '%s'\nSHA256: %s", file, x_archive_secure_hash)) invisible(file) @@ -184,7 +184,7 @@ readArchive <- function(file) { stop("archive file was not created by archive()", call. = FALSE) message("Archive read from '", file, "'") - sha256 <- sha256(object) + sha256 <- secretbase::sha256(object) if (identical(sha256, x_archive_secure_hash)) message("Data verified by SHA256: ", sha256) else warning(sprintf("SHA256 of restored object: %s\ndoes not match the original: %s", sha256, x_archive_secure_hash), call. = FALSE) diff --git a/R/data.R b/R/data.R index ed26d017..ee75a88a 100644 --- a/R/data.R +++ b/R/data.R @@ -38,27 +38,29 @@ .__global__ <- ".data" -.user_agent <- sprintf("r-ichimoku/%s", as.character(packageVersion("ichimoku"))) +.user_agent <- sprintf("r-ichimoku/%s", format(packageVersion("ichimoku"))) -.mlgrid_pairs <- { - cols <- c("chikou", "close", "high", "low", "tenkan", "kijun", "senkouA", "senkouB", "cloudT", "cloudB") - pairs <- list(character(37L), character(37L)) - ctr <- 0L - for (i in 1:7) { - colm <- cols[(i + 1L):10] - for (j in seq_along(colm)) { - colsi <- cols[i] - colmj <- colm[j] - if (colsi == "close" && (colmj == "high" || colmj == "low") || - colsi == "high" && colmj == "low") next - ctr <- ctr + 1L - pairs[[1]][ctr] <- colsi - pairs[[2]][ctr] <- colmj - if (colsi == "senkouA" && colmj == "senkouB") break +.mlgrid_pairs <- local( + { + cols <- c("chikou", "close", "high", "low", "tenkan", "kijun", "senkouA", "senkouB", "cloudT", "cloudB") + pairs <- list(character(37L), character(37L)) + ctr <- 0L + for (i in 1:7) { + colm <- cols[(i + 1L):10] + for (j in seq_along(colm)) { + colsi <- cols[i] + colmj <- colm[j] + if (colsi == "close" && (colmj == "high" || colmj == "low") || + colsi == "high" && colmj == "low") next + ctr <- ctr + 1L + pairs[[1]][ctr] <- colsi + pairs[[2]][ctr] <- colmj + if (colsi == "senkouA" && colmj == "senkouB") break + } } + pairs } - pairs -} +) .ichimoku_themes <- list( classic = c("#ffc6cb", "#c3dede", "#e0a9e0", "#db4525", "#1aa1a6", "#a4d1eb", diff --git a/R/ichimoku-package.R b/R/ichimoku-package.R index d13704f6..67d80fac 100644 --- a/R/ichimoku-package.R +++ b/R/ichimoku-package.R @@ -82,9 +82,7 @@ #' PositionIdentity rel scale_color_manual scale_fill_manual #' scale_x_continuous scale_y_continuous Stat StatIdentity theme theme_grey #' %+replace% -#' @importFrom mirai mirai #' @importFrom nanonext ncurl -#' @importFrom secretbase sha256 #' @importFrom RcppSimdJson is_valid_json #' @importFrom shiny checkboxInput column downloadButton downloadHandler HTML #' fillPage fluidPage fluidRow hoverOpts invalidateLater isolate diff --git a/R/oanda.R b/R/oanda.R index 420958bf..0320feba 100644 --- a/R/oanda.R +++ b/R/oanda.R @@ -578,7 +578,7 @@ oanda_studio <- function(instrument = "USD_JPY", isTRUE(new.process) && { mc <- match.call() mc[["new.process"]] <- NULL - return(invisible(mirai(mc, oanda_studio = oanda_studio))) + return(invisible(mirai::mirai(mc, oanda_studio = oanda_studio))) } if (!missing(instrument)) instrument <- sub("-", "_", toupper(force(instrument)), fixed = TRUE) granularity <- match.arg(granularity, c("D", "W", "M",