Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update stochastics.R #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update stochastics.R #63

wants to merge 1 commit into from

Conversation

davft
Copy link

@davft davft commented Apr 4, 2018

added try.xts(HLC) in the SMI function

added try.xts(HLC) in the SMI function
@joshuaulrich
Copy link
Owner

joshuaulrich commented Apr 4, 2018

Why? What was this supposed to address?

@davft
Copy link
Author

davft commented Apr 4, 2018 via email

@joshuaulrich
Copy link
Owner

Thanks for explaining! I can't confirm your claim with a simple example:

library(quantmod)  # for HLC
data(ttrc)

x <- ttrc
rownames(x) <- x$Date
x$Date <- NULL
hlc <- HLC(x)

# both of these should return a data.frame
str(stoch(hlc))  # error
str(SMI(hlc))    # matrix

The output of both functions should be the same class as the input. But that is not the case for both... so it looks like you've uncovered a few issues. I would appreciate if you would take a look, but I can investigate if you don't. I would also greatly appreciate if you could add tests that catch these two cases (and any others you may uncover). Thanks!

@davft
Copy link
Author

davft commented Apr 4, 2018 via email

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

Successfully merging this pull request may close these issues.

2 participants