-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
"Series contains non-leading NAs" on stoch() #113
Comments
Found it. It freaks out if High == Low == Close. Is that expected behavior? |
Yes, that is expected behavior. There is no volatility, so the math doesn't work. You get div by zero. |
Fair enough. May I make a gentle recommendation as a package builder to "capture that error" perhaps using You may close if you wish. |
These technical indicators were developed on daily bars. I think NA is the appropriate result. how you choose to handle those NA's is up to you. It seems that there are multiple different arguably reasonable responses to an indicator returning an NA. You as an analyst need to decide what the proper handling is for the analysis or strategy that you are trying to create. Thanks for the report, closing. |
While that's true, At minimum, I agree with @DataStrategist that the error should be more informative. |
Yeah, I was gonna let it rest because it doesn't really matter, but the reason Anyway, thanks for a great package, and good luck trading! |
The error is because the I may add a warning to let the user know that their series isn't well-suited to using |
Hello, |
Description
I'm trying to run the
stoch
function on some data but I'm getting the above referenced error.Expected behavior
I'm expecting the function to return expected output of 3 columns
Minimal, reproducible example
Session Info
The text was updated successfully, but these errors were encountered: