Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error when DIRECTION is all 1s. #99

Open
imitationsasquatch opened this issue Aug 9, 2023 · 2 comments
Open

Error when DIRECTION is all 1s. #99

imitationsasquatch opened this issue Aug 9, 2023 · 2 comments

Comments

@imitationsasquatch
Copy link

highfrequency::getLiquidityMeasures will report the following error when DIRECTION is all 1s:
Error in highfrequency::getLiquidityMeasures(matched, win = 300) :
DIRECTION provided, but is not -1 and 1
In addition: Warning message:
In if (sort(unique(tqData$DIRECTION)) != c(-1, 1)) { :
the condition has length > 1 and only the first element will be used

Can be reproduced with the following:
df <- data.table(DT = c(as_datetime("2018-09-01 12:00:00"), as_datetime("2018-09-01 12:00:01"), as_datetime("2018-09-01 12:00:06")),
SYMBOL = c("AAA", "AAA", "AAA"),
BID = c( 2, 3, 3),
OFR = c(1, 2, 3),
OFRSIZ = c( 10, 10 ,10),
BIDSIZ = c(10, 10 ,10),
QUOTEXX = c("A"),
MIDQUOTE = c(1.5, 2.5, 3),
EX = c("A"),
PRICE = c(2, 2, 2),
SIZE = c(10, 10 ,10),
DIRECTION = c(1, 1, 1)
)
liq <- getLiquidityMeasures(df, win = 300)

@onnokleen
Copy link
Contributor

Thanks for reporting the bug. It will be fixed in the next release!

@onnokleen
Copy link
Contributor

@kboudt Can you close this issue as the new version is on CRAN?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants