Skip to content

Commit

Permalink
cleans up namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Sep 11, 2024
1 parent 53816c4 commit 0a03845
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 28 deletions.
3 changes: 0 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ Imports:
shiny (>= 1.4.0),
xts,
zoo
LinkingTo:
RcppSimdJson,
xts
Suggests:
keyring,
knitr,
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ichimoku 1.5.4.9000 (development)

#### Updates:

* Internal performance enhancements.

# ichimoku 1.5.4

#### Updates:
Expand Down
4 changes: 2 additions & 2 deletions R/archive.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
38 changes: 20 additions & 18 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions R/ichimoku-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/oanda.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0a03845

Please sign in to comment.