bitmart
has updated their futures API. The backend
have been updated accordingly.
Unit-tests have been updated and now all
get_quote()
-functions are being tested for equality in
passed and inferred interval.
xts
-objectsread_xts()
and write_xts()
reads and
stores xts
-objects. These functions are essentially just
wrappers of zoo::read.zoo()
and
zoo::write.zoo()
. Thank you @gokberkcan7 for the suggestion.chart()
-function are now exported as
.svg
-images in 4k resolution via the
modebar
.chart()
-function are now more interactive and
supports drawing lines and rectangles via the modebar
. It
is also possible to interactively change the title
and
subtitle
by double clicking these (Thank you @andreltr for the
suggestion. See Discussion).chart()
-function now has a new option
static
that is equal to FALSE
by default. If
FALSE
the chart can be edited, annotated and explored
interactively.chart()
-function now has a new option
palette
that is set to “hawaii” by default. See
hcl.pals()
for accepted values.chart()
-function now has a new option
scale
that is set to 1 by default. Scales all fonts on the
chart.chart()
-function now has a new option
width
that is set to 0.9 by default. Sets the overall
linewidth
of the chart. (Thank you @andreltr for the suggestion. See Discussion)# static = FALSE
chart(
ticker = BTC,
main = kline(),
indicator = line(
sma(n = 7),
sma(n = 14),
sma(n = 21)
),options = list(
static = FALSE,
palette = "hawaii"
) )
# static = TRUE
chart(
ticker = BTC,
main = kline(),
indicator = line(
sma(n = 7),
sma(n = 14),
sma(n = 21)
),options = list(
static = TRUE,
palette = "Set 3"
) )
{cryptoQuotes} now supports the following exchanges:
chart()
-function where a warning
would be given if called using namespace qualified function calls (Issue
#13)chart()
-function where a
legend
wouldn’t show unless a main-chart indicator were
included. (Issue #13)1s
from Binance spot3m
, 6h
and 3d
in
Bitmart spotThese intervals have been removed as they have either been discontinued, or were non-existent.
NOTE: With this update the package is no longer considered
experimental
.
Removed deprecated functions getQuote()
-,
getFGIndex()
- and
getLSRatio()
-functions.
Removed decprecated functions availableExchanges()
-,
availableIntervals()
- and
availableTickers()
-functions.
These functions were planned to be deleted in 1.4.0
-
however, we have decided to aim for an JOSS
- and
rOpenSci
-subscription which requires some degree of
stability. Hence the deletion of these function at
1.3.0
.
We expect 1.4.0
to be released after
rOpenSci
-submission and acceptance :pray:
smi()
-function, a subchart
-indicator built
on the TTR::SMI()
-function.donchian_channel()
-function, a
main chart
-indicator built on the
TTR::DonchianChannel()
-functionchart(
ticker = BTC,
main = kline(),
indicator = list(
donchian_channel()
),sub = list(
smi()
) )
get_openinterest()
is now supported by
kraken
tail(
get_openinterest(
ticker = "PF_XBTUSD",
interval = "1h",
source = "kraken"
) )
#> open_interest
#> 2024-11-02 10:00:00 2394.876
#> 2024-11-02 11:00:00 2389.595
#> 2024-11-02 12:00:00 2396.225
#> 2024-11-02 13:00:00 2403.175
#> 2024-11-02 14:00:00 2418.193
#> 2024-11-02 15:00:00 2398.648
chart()
-function now has proper
light
-theme available that isn’t the default
plotly
-values.bollinger_bands()
-function now accepts a
color
-argument. These can be passed as
Hexadecimal
-colors or as is, "blue"
for
example.pline()
which is a univariate price chart based on either open, high, low or
close prices.chart(
ticker = BTC,
main = pline(price = "close"),
indicator = list(
bollinger_bands(
color = "steelblue"
)
),sub = list(
volume()
),options = list(
dark = FALSE
) )
get_*
-functions.chart()
-functions no longer depend on
rlang
.Note: we are generally moving away from
rlang
,purrr
andtidyverse
in general. We are, however, keeping thetidyverse
styleguide.
conflicted
-package.Prior to version 1.3.0
the get*
-functions
were following the syntax of {quantmod} closely,
and this goes for the function naming too. With the adoption of the
tidyverse
style guide, there is no conflicts that needs to
be resolved on stable
- and
experimental
-functions.
pull()
-functionvar_ly()
-functionbuild()
-functionget_fgindex()
-function now returns columns in lower
case.get_fgindex()
where labelled as
deprecated
limitations
-article where the
desired number of observations werent compatible with the
kraken
-exchange.get_lsratio()
-function with
source = "binance"
lsr()
-indicator which broke the
chart()
-function when included.get_quote()
-function where if
to = NULL
and from != NULL
the returned
quote
would be filtered according to UTC
and
not Sys.timezone()
chart()
-function where the inferred
intervals would be incorrect for leap years, and months different from
30 days.get_lsratio
and getLSratio()
supports
kraken
and bybit
as
source
available_
-functions are more adaptive to the
calling environments
## charting the klines
## with indicators as
## subcharts
available_exchanges(type = 'ohlc')
Now returns all available exhanges that supports Open, High, Low and
Close market data. The type
-argument can be changed to, for
example, lsratio
to get all available exchanges that
supports Long to Shorts ratios. Similar changes have been made to
remaining available_
-functions.
All get_*
- and available_*
-functions are
now more robust to API and input errors.
quotes
and fear and greed index
now
returns 200
rows instead of 100
charts
now has a dark
and
light
theme. Its passed into the
options = list(dark = TRUE)
of the
chart()
-function.charts
are now more color deficiency compliant, and
the deficiency
parameter in
options = list(deficiency = TRUE)
now applies to all
chart
-elementscharts
are now constructed without
%>%
and, should, be more intuitive to navigate in. See
example below,## charting the klines
## with indicators as
## subcharts
chart(
ticker = BTC,
main = kline(),
sub = list(
volume()
),indicator = list(
bollinger_bands(),
sma(),
alma()
),options = list(
dark = TRUE,
deficiency = FALSE
) )
The following exchanges have been added to list of
exchanges
available,
get_fundingrate()
## get funding rate
tail(
get_fundingrate(
ticker = "BTCUSDT",
source = "binance"
) )
#> funding_rate
#> 2024-10-31 17:00:00 1.730390e+12
#> 2024-11-01 01:00:00 1.730419e+12
#> 2024-11-01 09:00:00 1.730448e+12
#> 2024-11-01 17:00:00 1.730477e+12
#> 2024-11-02 01:00:00 1.730506e+12
#> 2024-11-02 09:00:00 1.730534e+12
get_openinterest()
## get funding rate
tail(
get_openinterest(
ticker = "BTCUSDT",
source = "binance"
) )
#> open_interest
#> 2024-10-28 01:00:00 82206.35
#> 2024-10-29 01:00:00 89115.04
#> 2024-10-30 01:00:00 90242.98
#> 2024-10-31 01:00:00 89315.49
#> 2024-11-01 01:00:00 89544.93
#> 2024-11-02 01:00:00 84087.60
charting
-functions have been reworked without
backwards compatibility, or
lifecycle::deprecated()
-warnings. The
charting
-functions were, and still is, in an
experimental
-stage.dates
passed to get_*
-functions
assumed the dates were given in UTC
, and were retrieved as
UTC
. These have now been changed; all functions now uses
Sys.timezone()
as default
upon request and
retrieval.As {cryptoQuotes} has
moved to the tidyverse
style guide, the
getFoo
-functions are now deprecated
. These
will be permanently deleted, and removed from the {cryptoQuotes}, at
version 1.4.0!
1m
chart, around Elon Musks Tweet.UTC
, again.Bitmart
API where weekly candles
would throw an error.All from
and to
arguments are now more
flexible, and supports passing Sys.Date()
and
Sys.time()
directly into the
get
-functions.
getQuote()
now returns up to 100 pips preceding the
specified to
date, when from = NULL
. It
returns 100 pips, or up to Sys.Date()
, from the specified
from
date.
The getQuote()
-function can now be used as follows;
## Specifying from
## date only;
##
## Returns 10 pips
getQuote(
ticker = 'BTCUSDT',
interval = '1d'
from = as.character(Sys.Date() - 10)
)
## Specifying to
## date only;
##
## Returns 100 pips
getQuote(
ticker = 'BTCUSDT',
interval = '1d'
to = as.character(Sys.Date())
)
Four new functions are added,
getFGIndex()
which returns the daily Fear and Greed
Index.addFGIndex()
which adds the Fear and Greed Index as a
subplot to price charts.getLSRatio()
which returns the long-short ratio with
varying granularity. Contributor has been credited.addLSRatio()
which adds the long-short ratio as a
subplot to price charts.Three new convinience functions are added applicable to some situations,
removeBound()
splitWindow()
calibrateWindow()
getQuote()
now returns up to 100 pips when
to
and from
is NULL
1.0.0
.In the next release, three more exchanges will be supported.
The returned quotes
are in local timezone, this is an
unintentional feature and will be fixed in a bugfix.