indicator
indicator copied to clipboard
Better documentation
I was looking at using a new (to me) function and struggling to understand what it required, even after looking at the output of Indicator.info, TA-Lib's XML file and the Java version's code. In particular, what's the difference between arguments and inputs?
Anyway, I thought it would be cool to have every single indicator call on the project's currently unused homepage (http://mlamby.github.com/indicator). I'm willing to start.
I was thinking of auto-generating some HTML for each function, adding the examples that already exist, then more examples can be added over time.
Thoughts?
I think that sounds like a good idea. Generating rdoc or markdown files might be easier though than HTML, that way we can either use the GitHub wiki system or GitHub pages.
Arguments are the settings for the indicator whilst inputs are the values that you want to perform the calculation on. For example on a sma the arguments setup how long the average is, whilst the inputs are the values to average. Which indicator are looking into?
I've added you as a collaborator to this repo as it sounds like you use it more than I do. Is that ok?
I think that sounds like a good idea. Generating rdoc or markdown files might be easier though than HTML, that way we can either use the GitHub wiki system or GitHub pages.
That's a better idea.
Arguments are the settings for the indicator whilst inputs are the values that you want to perform the calculation on. For example on a sma the arguments setup how long the average is, whilst the inputs are the values to average.
Thanks for that explanation.
Which indicator are looking into?
Average true range. It takes several inputs, so can I still use indicator/mixin on an array or is it best to instantiate the indicator myself?
I've added you as a collaborator to this repo as it sounds like you use it more than I do. Is that ok?
That's cool. Generating technical analysis charts is a significant part of my current project. We've used a handful of functions so far and probably more to come.
I've added a file to the examples directory that uses the ATR class. It shows two different ways of using it, the factory and direct instantiation.
The mixin will work too, but I didn't show it in the example code. If you want to use the mixin do the following to calculate a 14 day ATR on the downloaded stock data:
cba.indicator(:atr_14)
The mixin works because CBA it an array of hashes that contain 'low', 'high', 'close' entries (the required inputs for the ATR indicator). It would also work if CBA was an array of objects that respond to :low, :high and :close messages.