-
Notifications
You must be signed in to change notification settings - Fork 83
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
Crossany and crossover resulting in differing size arrays than original data #23
Comments
What seem odd about it? It's not possible on the first bar to know if they've crossed or not. |
Ah, got it. The docs sounded (to me) like any row (following my example above) in which That said, it seems like it would be valuable to clarify in the docs that the array returned from a For my purposes, I accomplished this like so:
|
I think the docs are pretty clear: https://tulipindicators.org/crossover It shows in the formula that must be input1 > input2 and that it wasn't the case on the previous bar. The shorter output array thing is true for most of the functions. For example, if you call a simple moving average with a period of 10, your output will be 9 bars shorter. There's really no way around it. |
Certainly the formula is clear! I suppose I expect the text surrounding the math notation to explain in plain speech alongside the formula.
Definitely is the case. I do think it would be helpful for the uninitiated to have a basic example of how to use the indicators in a typical Python data science environment. I'd be happy to make a Jupyter notebook and contribute it, if you're open to the idea. |
I'm certainly open to it. I'm not sure padding the output arrays is always the most useful thing, though. When I use it, I just index from the end, rather than the beginning. Looking over the Readme, I think it would also be nice to add that data arrays start with the oldest data in the first position, and end with the newest data in the last position. I've been asked this several times. It's really confusing if someone does it backwards. Tulip Indicators (the C library tulipy is a wrapper of) also has functions to tell how much shorter the outputs will be compared to the inputs. In Python, it wasn't necessary because arrays store their lengths. You might want to take a look at https://tulipindicators.org/usage if you haven't already. |
Closing as there's no bug. Created #40 to follow-up on documentation updates. |
From my Jupyter notebook:
This seems odd!
The text was updated successfully, but these errors were encountered: