andredumas / techan.js

A visual, technical analysis and charting (Candlestick, OHLC, indicators) library built on D3.
http://techanjs.org/
MIT License
2.39k stars 533 forks source link

API Reference Documentation #1

Open andredumas opened 10 years ago

andredumas commented 10 years ago

Comment and vote here if you want documentation, otherwise I'll just be focusing on adding new features and enhancements.

txgo commented 9 years ago

Wonderful work! I wonder how to update the plots in real-time? Thanks

andredumas commented 9 years ago

I'll put up rough documentation outline soon. In the meantime, have a look at the examples gallery. They cover just about everything the library can do at the moment and will give you an idea how to construct the charts.

By real-time plots I assume you mean data that updates frequently and the chart redrawn to reflect? I've been meaning do a simulated example of this. Will probably be the next one I do.

andredumas commented 9 years ago

@behr328 I've made a start. Only very high level outline at the moment.

andredumas commented 9 years ago

@xi3 Have a look at TechanJS Feed Example. I think that may cover what you were after.

rajeshmukkala commented 9 years ago

@andredumas Exactly what I'm looking for. It would be great help if the complete example made real time.

http://bl.ocks.org/andredumas/edf630690c10b89be390

bigterminal commented 9 years ago

I've made the complete example work with real time updates, labels and indicators, its a bit of a hack though and an issue remains relative to the pan + zoom so the chart basically resets on every update, instead of preserving your zoom range. I'll try get an example hosted but would love to see @andredumas make an attempt at bringing it all together.

rajeshmukkala commented 9 years ago

@bigterminal can you share example link.

@andredumas I hope you have seen our request.

andredumas commented 9 years ago

@bigterminal Could you share your example so I can have a look? This could be a bug/undesired feature. Currently zoom + pan will be reset when financetime.domain([values]) is called. Either way I would like it to align with the way other d3 scales work. You can see in the feeds example here I manually set the zoom after setting the domain each time the data is updated. You could potentially cache the current zoom setting, update the domain, then restore the zoom setting which will work.

sandeepy02 commented 9 years ago

Great Work. Would love to see the annotation inside chart too (for a point inside a series)

GodRtio commented 9 years ago

@andredumas Amazing Work Andre!!!

Please write a document on how to write an indicator. So i could help you add some. Or Could you write a template with comment?

Merry Christmas, Andre!

ernestocr commented 9 years ago

Awesome work. Hoping more documentation is to come soon. Thanks!

prionkor commented 9 years ago

I will help on adding new doc. Just started with the lib. Need some more time to get familiarized with it.

jreim commented 9 years ago

This is awesome stuff, i will help with documentation. I am also working on custom kockout js bindings, to make the charts dynamic. Maybe i can fork this project and share that once it is completed?

andredumas commented 9 years ago

That would be great! Re custom bindings and other extensions, I want to keep techanjs pure, light and simple with minimal dependencies (only d3). Other than core D3 patterns I didn't want to impose particular style or integration onto the user.

To support custom extensions I was thinking of creating separate adapter projects for this. Eg, techan-angular, techan-knockout, techan-ext-indicators, techan-indicator-seed, techan-angular-seed, etc. The only change I would make in the core is to ensure it plays nicely with other adapters, but I would not want the core design to be dictated by this. Everything can be brought together via bower or npm.

Feel free to create other issues as discussion points for all to contribute. Maybe kick one off... techan-knockout?

jreim commented 9 years ago

yes i totally agree that it should be forked and keep the core in tact. it is a REALLY nice library. I just started working on this a few days ago, so i will keep you posted as to my progress and as soon as i get something semi stable i will throw it out on git for others to play with and check out.

thanks! Jesse

On Wed, Apr 1, 2015 at 6:37 AM, André Dumas notifications@github.com wrote:

That would be great! Re custom bindings and other extensions, I want to keep techanjs pure, light and simple with minimal dependencies (only d3). Other than core D3 patterns I didn't want to impose particular style or integration onto the user.

To support custom extensions I was thinking of creating separate adapter projects for this. Eg, techan-angular, techan-knockout, techan-ext-indicators, techan-indicator-seed, techan-angular-seed, etc. The only change I would make in the core is to ensure it plays nicely with other adapters, but I would not want the core design to be dictated by this. Everything can be brought together via bower or npm.

Feel free to create other issues as discussion points for all to contribute. Maybe kick one off... techan-knockout?

— Reply to this email directly or view it on GitHub https://github.com/andredumas/techan.js/issues/1#issuecomment-88435303.

jreim commented 9 years ago

Hey Andre,

I had a quick question about your library. I am trying to plot my own algos and indicators (Bollinger bands) for example. But i can quite seem to figure out how to get them integrated. I have started to add the studies in the techan.js file (the big unified one) but keep running into an issue when trying to set up the accessor, specifically setting up the accessor.d value for the x plot.

Basically what i am doing is the algo calculations server side and then pulling them in (with a dime field that corresponds to the study). and then plot the line. Maybe this is already there and i am just not properly using it.

i added this inside the plot

upperBand: line(accessor.value, plot, plotMixin)

and then i set teh accessor in my code, but i then it barfs at svgLine.init(p.accessor.d, p.xScale, p.accessor, p.yScale); b/c p.accessor.d is undefined.

anyways, i know this is a side thing for you and i really appreciate all of the work and any help, i think this is a really great lib and hope to contribute to it with teh knock stuff i am making at some point (when its less hacked up).

thanks! Jesse jessereim@gmail.com

On Wed, Apr 1, 2015 at 8:50 AM, jesse reim jessereim@gmail.com wrote:

yes i totally agree that it should be forked and keep the core in tact. it is a REALLY nice library. I just started working on this a few days ago, so i will keep you posted as to my progress and as soon as i get something semi stable i will throw it out on git for others to play with and check out.

thanks! Jesse

On Wed, Apr 1, 2015 at 6:37 AM, André Dumas notifications@github.com wrote:

That would be great! Re custom bindings and other extensions, I want to keep techanjs pure, light and simple with minimal dependencies (only d3). Other than core D3 patterns I didn't want to impose particular style or integration onto the user.

To support custom extensions I was thinking of creating separate adapter projects for this. Eg, techan-angular, techan-knockout, techan-ext-indicators, techan-indicator-seed, techan-angular-seed, etc. The only change I would make in the core is to ensure it plays nicely with other adapters, but I would not want the core design to be dictated by this. Everything can be brought together via bower or npm.

Feel free to create other issues as discussion points for all to contribute. Maybe kick one off... techan-knockout?

— Reply to this email directly or view it on GitHub.

andredumas commented 9 years ago

Hi @jreim

Prob best if you open up a specific issue for your question so it doesn't get lost in this one.

My advice if you're creating your own custom plots is to not rely on techanjs' internal APIs. They could change at any time. If you already have data for Bollinger Bands, plotting the 3 lines would be really simple d3. You also don't need the added complexity of accessors as you already know the format of your data. Accessors are there so that techanjs plots can work with any backing data structure.

In short, I wouldn't 'integrate' your plots with the core, use the core to setup some basics (financetime, candlestick) then use standard d3 for your plots.

cheers andre

Kurtas commented 9 years ago

The API documentation is necessary for any open source project. If there isn't api documentation then it will be always a "one man project". I really want to participate in development, but it's hard without documentation.

thomashan commented 8 years ago

@Kurtas Maybe you can help out on the documentation :+1:

Chidan commented 8 years ago

+1, yes please documentation is very much required and appreciated..

yuezhizizhang commented 7 years ago

TechanJS is so amazing! Yes, we need Bollinger Band