qoutes
A continues stream of qoutes for each day.
Installation
npm install qoutes
Example
var quotes = ;var inspectpoint = ; // Stream qoutes since 2013-01-01 from IBM until now and beyond ;
Documentation
qoutes
is a standard Readable stream. It pulls qoutes from Yahoo Finance for
a given symbol, since a specified date. When all data from the past is collected
it will begin to do live pulling, so new data will be send to you when available.
var qoutes = ;
stream = qoutes(symbol, since, [options])
symbol
is the company symbol (not name).since
is aDate
object specifying from when the data stream should start.options
is an object, it can contain the following properties:timeout
is a number given in milliseconds. Because Yahoo don't support a streaming interfaceqoutes
performs pulling using HTTP request. When fetching data from the past, this will go as fast as you can read it, but once the data becomes live there is a delay between each HTTP request. This delay is defined by this property. (Default is43200000
= 12 hour)interval
is a number given in days. Because data from Yahoo is outputted in a now = first past = last order, it can not be stream parsed and piped. Instead it is stored internally and then reversed. This means that there will be a high memory usage for large amount of data. To prevent thisqoutes
fetches the data in small interval. This internal is given by this propery. (Default is180
= ½ year) Do not set this to anything less than 5, this is to prevent getting stocked in periodes where the stock market is closed.
// !! Very expencivevar stream = ;
stream.read()
qoutes
is a standard Readable stream, and supports all the methods and events
there are to follow. The read data there can also be piped are objects with the
following format:
date: Date open: Number high: Number low: Number close: Number volume: Number adjClose: Number
stream.close()
To stop the data flow and the HTTP pulling, simply call this method. Note that
the end
event will be followed by this call.
stream;
License
The software is license under "MIT"
Copyright (c) 2013 Andreas Madsen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.