npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gdax-candles

v1.7.1

Published

A package to connect get event-based candlestick price models from the GDAX cryptocurrency exchange

Readme

GDAX Candles

Synopsis

GDAX Candles is a simple module used to stream numeric models of the GDAX cryptocurrency charts in candlestick form. Users of this module can use this tool to get event-driven data models of price charts on the GDAX exchange.

Code Example

Installation and instantiation is very easy to get started. Here is a basic usage example:

const Chart = require('gdax-candles');

const product = 'ETH-USD';
const timeframe = '1m'; // supports second, minute and hour intervals (i.e. 1h, 30s, 10m, etc)
const accumulation = true; // Tell the module to collect all candles in memory (**WARNING** this is kind of a memory leak so only do this if you know what you are doing.  Set to false or dont specify it if you don't!)
const ethereumChart = new Chart({ product, timeframe, accumulation }).start();

ethereumChart.on('close', candle => {
  console.log(candle);
});

/*
Candlestick {
  timestamp: 2018-07-04T16:38:31.004Z,
  product: 'ETH-USD',
  open: 472.13,
  price: 472.13,
  close: 472.13,
  high: 472.13,
  low: 472.13,
  closed: true,
  height: 0,
  spread: 0,
  volume: 0,
  sma: 
   { '10': 472.13599999999997,
     '20': 472.134,
     '50': 472.13579999999985 },
  ema: 
   { '10': 472.134909090909,
     '20': 472.13361904761905,
     '50': 472.13557254901946 },
  color: 'green',
  regression: 
   { '10': 
      { slope: -0.001454545454524,
        intercept: 472.14254545454537,
        r2: 0.727272727272211 },
     '20': 
      { slope: 0.000240601503756,
        intercept: 472.1317142857144,
        r2: 0.080200501253026 },
     '50': 
      { slope: -0.000161824729885,
        intercept: 472.13976470588204,
        r2: 0.223870829119643 } } }
*/

ethereumChart.on('change', candle => {
  console.log(candle);
});

/*
Candlestick {
  timestamp: 2018-07-04T16:41:25.577Z,
  product: 'ETH-USD',
  open: 472.14,
  price: 472.14,
  close: 472.14,
  high: 472.14,
  low: 472.14,
  closed: false,
  height: 0,
  spread: 0,
  volume: 0.2122,
  sma: {},
  ema: {},
  color: 'green',
  regression: {} }
*/

console.log(ethereumChart.candles); // ==> An array of closed candlesticks: [{Candlestick}, {Candlestick}, ...]  If you set `accumulation` to false in Chart constructor then this will always be an empty array!!!

Motivation

This module was created to help cryptocurrency traders to implement chart-based algorithmic trading strategies based on candlestick patterns. With the numeric models of the candlesticks provided by this library, many quantitative trading strategies can be derived easily.

Installation

Installation into a Node project is as simple as:

npm i gdax-candles --save

API Reference

See code example above.

Tests

Will be implementing a testing framework when the module reaches a high level of popularity on npm

Contributors

Contributors are welcome to send pull requests on the project. Please write a short synopsis of any enhancements or defect fixing is being proposed in the PR.

License

This software is made public by way of the GNU General Public Licence. No warranties are given and software is made available "as-is."