Skip to content

Commit

Permalink
Fixed a KuCoin Bug
Browse files Browse the repository at this point in the history
The KuCoin data is loaded differently than expected in the order of Close, Open, High and Low
  • Loading branch information
serkor1 committed Oct 13, 2023
1 parent af935b6 commit 7c21822
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
28 changes: 21 additions & 7 deletions R/api_kucoin.R
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,27 @@ kucoinQuote <- function(

# 3.1) set column
# names
column_names <- c(
'Open',
'High',
'Low',
'Close',
'Volume'
)
if (futures) {

column_names <- c(
'Open',
'High',
'Low',
'Close',
'Volume'
)

} else {

column_names <- c(
'Open',
'Close',
'High',
'Low',
'Volume'
)

}

# 3.2) format
# dates
Expand Down
4 changes: 3 additions & 1 deletion R/availableTickers.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ availableTickers <- function(
) {


ticker <- get(
ticker <- sort(
get(
paste0(
source,
'Tickers'
)
)(futures = futures)
)

return(
ticker
Expand Down
7 changes: 7 additions & 0 deletions R/helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ generate_data <- function(exchanges = c('binance', 'kucoin')) {

}

# internalTest <- generate_data()
# usethis::use_data(
# internalTest,
# internal = TRUE,
# overwrite = TRUE
#
# )


convertIndicator <- function(indicator) {
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.

0 comments on commit 7c21822

Please sign in to comment.