Candlestick.js with some new features

The Candlestick.js project on github has some new features already and others are in development.

There are 3 live demos,

  1. The first is very short, just the minimal code needed to create a nice looking chart.
  2. The second is a simple explorer with an embeded history of tickers the user looked at.
  3. The last one includes some data analysis or technical analysis, a search was done to find candles where the close price crossed the simple moving average from below to above. On these events the code to draw a purple line to highlight the event is shown.

There are a lot of small details to work on and improve the Candlestick.js project and I’m working on it as fast as I can.

One major change I hope to accomplish is switch from an object parameter with all the settings to a more general free text language spec where you’ll be able to write something like:

Panels(50,30,30) // define 3 panels with proportional sizes.

// the main candlestic panel plus a special moving average
// based on the average of the high and low.
Panel0( candlestick, sma(20), sma((h+l)/2, 20) )

// 2nd panel with MACD default values of close,12,26,9
Panel1(macd)

// of course you can get crazy with customizing
// the MACD in panel1
//Panel1( macd( (h+l+c)/3,10,22,6) )

Panel2(volume,sma(volume,50))

I will develop the language in the coming weeks. To use it you will write the code in a string variable or a text file and put it in the main line instead of the options object.

var options = [
  'Panels(50,30,30)',
  'Panel0(candlestick,sma(20),sma((h+l)/2,20))',
  'Panel1(macd)',
  'Panel2(v,sma(v,50)'
].join('\n');
Candlestick(canvasID, data, options);