https://github.com/doppelgunner/doppelgunner-stock-node
library for stock analysis
https://github.com/doppelgunner/doppelgunner-stock-node
Last synced: 11 months ago
JSON representation
library for stock analysis
- Host: GitHub
- URL: https://github.com/doppelgunner/doppelgunner-stock-node
- Owner: doppelgunner
- License: mit
- Created: 2017-12-10T06:21:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-10T11:03:46.000Z (about 8 years ago)
- Last Synced: 2025-02-14T12:41:02.042Z (11 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# doppelgunner-stock api
Api for getting historical-prices and analyzing its data.
## Installation
```
npm install --save doppelgunner-stock
```
## Samples
### Loading of historical prices from WSJ.
* Note: internet is required
* Note: important to pass function callback to execute when downloading finished
```javascript
import { HP, HPCommons, HPModel } from 'doppelgunner-stock';
HP.load(HP.downloadWSJ('X',false,'PH'), funcCallback);
```
OR
```javascript
HP.load(HP.downloadWSJ('X',false,'PH'), () => {/*something to do here*/});
```
### Function callback
* Note: better to make promise for chaining
* Note: This sample extracts and displays all dates
```javascript
function funcCallback(hpModel) {
new Promise((resolve,reject) => {
resolve(hpModel);
}).then(xurpas => HPCommons.getColumn(xurpas, 'date'))
.then(dateColumn => console.log(dateColumn));
}
```
## Limitations
* Downloads from WSJ as of now
* Only historical-prices