Tulip Node is the official node.js wrapper for Tulip Indicators. It provides 100+ technical analysis indicator functions, such as: simple moving average, Bollinger Bands, MACD, Parabolic SAR, Stochastic Oscillator, and many more.
Installation should just be:
npm install tulind
It should work on Windows, Os X, and Linux. Node versions 4, 5, 6, 7, 8, and 9 are tested and supported on each platform.
Note that pre-compiled binaries are available for Windows. For other platforms
you will need a C++ build environment installed. On Linux based distributions
this can be achieved by installing
You can force building from source with:
npm install tulind --build-from-source
If you run into problems, let me know. I want this to be easy for everyone to use.
Tulip Node is very easy to use.
var tulind = ;console;console;
In these examples, we assume you already have price data loaded such as:
//Examples assume you have some price data like this://Data order is from oldest to newset (index 0 is the oldest)var open = 4555444666;var high = 9787887787;var low = 1233212223;var close = 4566655564;var volume = 123232212232111232212321232321;
Calculating a simple moving average is as easy as:
//Do a simple moving average on close prices with period of 3.tulindindicatorssma;
Example of calculating the Stochastic Oscillator:
//Functions that take multiple inputs, options, or outputs use arrays.//Call Stochastic Oscillator, taking 3 inputs, 3 options, and 2 outputs.tulindindicatorsstoch;
It's also easy to discover argument types at run-time:
//Discover argument types at run-time:console;//Produces:name: 'stoch'full_name: 'Stochastic Oscillator'type: 'indicator'inputs: 3options: 3outputs: 2input_names: 'high' 'low' 'close'option_names: '%k period' '%k slowing period' '%d period'output_names: 'stoch_k' 'stoch_d'indicator: Functionstart: Function
Many (most) indicators return an output array length smaller than the input length. You can get the difference like this:
Hopefully it's obvious, but you can see all the available indicators by doing:
You can also see a full list of the available indicators on the Tulip Indicators website here.