Skip to content

Commit

Permalink
Added get_quote filter on Kraken
Browse files Browse the repository at this point in the history
Kraken doesnt support "to" parameters in spot.
  • Loading branch information
serkor1 committed Mar 9, 2024
1 parent 9bfb1a9 commit de9d3e9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
19 changes: 16 additions & 3 deletions R/getQuote.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ getQuote <- function(

}

# 3) fetch and format
# the quote and return
fetch(


ohlc <- fetch(
ticker = ticker,
source = source,
futures= futures,
Expand All @@ -169,6 +169,19 @@ getQuote <- function(
from = from
)

# Kraken doesnt have a to
# parameter on spot market
if (source == "kraken" & !futures) {

ohlc <- ohlc[paste(c(from, to), collapse = "/")]

}

attributes(ohlc)$source <- paste0(
to_title(source), if (futures) " (PERPETUALS)" else " (SPOT)"
)

ohlc

}

Expand Down
8 changes: 8 additions & 0 deletions R/get_quote.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ get_quote <- function(
from = from
)

# Kraken doesnt have a to
# parameter on spot market
if (source == "kraken" & !futures) {

ohlc <- ohlc[paste(c(from, to), collapse = "/")]

}

attributes(ohlc)$source <- paste0(
to_title(source), if (futures) " (PERPETUALS)" else " (SPOT)"
)
Expand Down

0 comments on commit de9d3e9

Please sign in to comment.