Replies: 1 comment
-
Hi @andreltr, Thank you for another great question. I have moved your question to Your question is a good example of restrictions imposed on exchange-level as we have discussed in this post. Binance only supports A work around is to use Bybit for this instead, below is an example, library(cryptoQuotes) # get long-short
# ratioes
ticker <- get_lsratio(
ticker = "BTCUSDT",
source = "bybit",
from = Sys.Date() - 750,
to = Sys.Date()
) # see oldest record
head(ticker)
#> long short ls_ratio
#> 2023-02-11 01:00:00 0.5259 0.4741 1.1092596
#> 2023-02-12 01:00:00 0.5253 0.4747 1.1065936
#> 2023-02-13 01:00:00 0.5255 0.4745 1.1074816
#> 2023-02-14 01:00:00 0.5273 0.4727 1.1155067
#> 2023-02-15 01:00:00 0.5092 0.4908 1.0374898
#> 2023-02-16 01:00:00 0.4945 0.5055 0.9782394 # count records
nrow(ticker)
#> [1] 500 Please note that we have used
Created on 2024-06-24 with reprex v2.1.0 |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm getting a very different number of records result when using get_quote and get_lsratio. See below, please.
tail(
BTC <- get_quote(
ticker = 'BTCUSDT',
source = 'binance',
interval = '1d',
from = Sys.Date() %m-% months(48),
to = Sys.Date()
)
)
tail(
BTC_LS <- get_lsratio(
ticker = 'BTCUSDT',
source = 'binance',
interval = '1d',
from = Sys.Date() %m-% months(48),
to = Sys.Date()
)
)
R> nrow(BTC)
[1] 1462
R> nrow(BTC_LS)
[1] 29
R>
Is this expected? I was considering creating a dataframe including the BTC_LS fields joined with the BTC dataframe but it didn't work as intended.
One thing I imagined was to add the BTC_LS records in the common index BTC records but that would leave empty records in most of the new BTC columns which were joined from the BTC_LS dataframe.
The objective is to have a BTC dataframe that includes all the information required for a more chart, such as one including the bollinger_bands(), ema(), sma(), and wma() indicators along with volume() and long-short ratio. The graph I get depicts the L-S ratio compressed with all its itens very close or on top of each other and I guess it should be spread out through the common range.
TIA,
André Luiz
Beta Was this translation helpful? Give feedback.
All reactions