0.1.1 • Published 8 years ago

node-tradeking v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

node-tradeking

About

Build Status

Build Status

Description

A node module for interfacing with the TradeKing REST API.

Disclaimer

Alpha at best and in flux.

Contributing

Pull requests and issues are encouraged!

Author

Chris Dituri - csdituri@gmail.com

Getting Started

Installation

npm install --production --save node-tradeking

Examples

See the examples directory for some ideas. You'll need to adjust examples/config.js with your relevant OAuth information:

node ./examples/accountSummary.js
node ./examples/streamingPortfolioTicker.js

Instantiate

Instantiate a new Tradeking object.

const config = require('./config')
const Tradeking = require('tradeking');
const tk = new Tradeking(config);

Account Summary

tk.accountSummary((error, data) => console.log(data));

Account Balances

tk.accountBalances((error, data) => console.log(data));

Streaming Quotes

const msecs = 10 * 1000;
const symbols = ['msft', 'twtr', 'jcp', 'kors', 'uvxy'];

const stream =
  tk.streamQuote(symbols,
      (error, data) => {
          if (error) {
              console.error(error);
          } else {
              const obj = JSON.parse(data);
              console.log(JSON.stringify(obj, null, 4));
          }
      }
  );

// stream for `msecs` milliseconds
setTimeout(c => c.abort(), msecs, stream);
0.1.1

8 years ago

0.1.0

8 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago