-
Notifications
You must be signed in to change notification settings - Fork 220
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
Error thrown at numpy_rolling_window #464
Comments
Considering qtpylib is a vendored library we use (mostly) "as is" - I'd rather prefer to not mess with it too much. We've disabled a few methods we know are lookahead-biased - but that's about it. If we see us being disturbed by that - i think it should be reworked completely - as i think it does some things a bit oddly - not necessarily in a way you'd do it if you're looking at it from a pure performance point of view) ( To be quite fair - raising |
For example. If you are doing ta.SMA of 100 but you have only 50 rows, it would just give you NaN for all the rows, so I assume same thing can be applied here? Getting NaN should equate to "the calculation failed". Ofc this is a very rare case, when we throw less than 34 rows of data to the awesome_oscilator, but it can happen when one trying to test lookahead by cutting the timerange to just 10 candles and the strategy using no startup_candle_count 😁 I'll look at another way of dealing with the issue then, and not changing the lib. |
well my point is - IF we assume that we'll take over qtpylib's indicators (we vendor them - but upstream has been archived earlier this year, so there won't be any fixes anymore) - then we'll need to
|
When function numpy_rolling_window is called, if length of data is less than the supplied
window
value, this error will be thrownThe error above was thrown when I tried to calculate qptylib.awesome_oscilator with the default fast and slow values. The issue is the supplied data was only 10 rows. When I changed the
slow
parameter to something less than 10 (for example 7), there was no error,Is is possible to add a check at the beginning of numpy_rolling_window and maybe return NaN when the length of data is smaller than the
window
value?The text was updated successfully, but these errors were encountered: