Skip to content
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

Better documentation #7

Open
mwanji opened this issue Jan 24, 2013 · 3 comments
Open

Better documentation #7

mwanji opened this issue Jan 24, 2013 · 3 comments

Comments

@mwanji
Copy link
Collaborator

mwanji commented Jan 24, 2013

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?

@mlamby
Copy link
Owner

mlamby commented Jan 25, 2013

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?

@mwanji
Copy link
Collaborator Author

mwanji commented Jan 25, 2013

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.

@mlamby
Copy link
Owner

mlamby commented Jan 25, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants