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
Prediction algorithms can return negative stock prices #45
Comments
I think the more natural solution is to (have an options to) use logarithmic/exponential fit rather than linear fit. Fit to y=np.log(price) and then predict y. Return to the user price=np.exp(y). You could still get a price of 0.00 by rounding, say, 0.002 down to 0.00. It is a more realistic model for compound losses or compound gains. 75% loss is twice as bad as 50% loss. 100% loss is infinitely worse. And 100% gain offsets a 50% loss. I'd also like to make predictions on volatility measures rather than just price. I would guess that sometimes it is easier to figure out just that a price may move more than usual rather than which direction. Volatility measures might also be bounded by zero. I see we also get negative numbers for the lower bollinger bands curve for GME recently. Doing Bollinger Bands within a logarithmic/exponential pre-/post-processing framework could fix that such that you get useful levels not just zero. Having that as some kind of optional flag would allow users to use it only when they want it, and maybe use it modularly across different TA and prediction options with very little code modification. |
Hey guys, Thank you @Bainsbe for pointing this out! And thank you @jamesphillipturpin for this solution. I'll label this ticker as a new feature and will work on that flag as well soon. Regardless, I think that the right thing to do if the prediction of the stock price is negative, is to output "Invalid prediction" or similar. As realistically, a stock wouldn't go to 0 either. |
Assuming this has been addressed in PR #436 |
Issue outlined in the title, may be worth setting a bottom bound on the prices to default to 0 if prediction is <0
The text was updated successfully, but these errors were encountered: