activetick
Activetick API addon for NodeJS
Last updated 3 years ago by dchem .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install activetick 
SYNC missed versions from official npm registry.

node-activetick-addon

Build Status

ActiveTick API addon for Node.js

Author: Jae Yang - [dchem] (https://keybase.io/dchem)

Change Notes:

  • 2017-07-06 - 1.2.0 - Fixes segfault on invalid symbols
  • 2017-06-10 - 1.1.7 - Fixes for Node 6.11 installation
  • 2015-09-26 - 1.0.11 - Adds Node 4.0 support
  • 2015-09-09 - 1.0.10 - Removes github nonsense
  • 2015-06-27 - 1.0.8 - Fixes build (removed sourceforge)
  • 2015-05-25 - 1.0.0 - Working 1.0 version
  • 2015-02-18 - 0.0.1 - Initial commit

Installation dependency

  • Download Activetick cppsdk from Activetick.com website, unpack into working directory where you will run npm install activetick.
  • Install Python
  • Install node-gyp
npm install node-gyp -g
  • Install unzip if Linux
sudo apt-get install unzip

Additional installation dependency for Windows:

  • Install MinGW
  • Install msys-unzip instead of unzip
  • Install msys-wget
mingw-get install msys-unzip
mingw-get install msys-wget
  • Install Microsoft Visual Studio

Installation from NPM:

npm install activetick

For Windows with MSVS 2013:

npm install activetick --msvs_version=2013

For Windows with MSVS 2012:

npm install activetick --msvs_version=2012

Alternatively, include GYP_MSVS_VERSION=2012 or GYP_MSVS_VERSION=2013 in environment variables for Windows.

Additional installation dependency for OS X:

  • Install xcode command line tools
  • Install homebrew
  • Install wget through homebrew

Installation from git repo:

  1. Make sure to have Activetick API package downloaded to two directories up from this project
  2. Run the preinstall.sh which does the following:
  • Copies the Activetick API package and places them in the import directory
  • Download libjson 7.6.1
  1. node-gyp rebuild
  2. If build fails because you have VS2012, use node-gyp --msvs_version=2012 rebuild

Usage

  1. Require activetick
  2. Create event handlers
  3. Register event handlers for messageIds
  4. Incoke connect
  5. ...
  6. Profit!
var addon = require('activetick');
var messageIds = addon.messageIds;
var api = new addon.NodeActivetick();

var activetickCb = function (data) {
  console.log(JSON.stringify(data,null,2));
};

// See messageId.js for message types to be tracked
Object.keys(messageIds).forEach(function (messageId) {
  api.handlers[messageId] = activetickCb;
});

// Don't put credentials in your scripts. Make sure you export
//   them as environment variables
var connected = api.connect( process.env.ATAPIKEY,
                             "activetick1.activetick.com",
                             5000,
                             process.env.ATUID,
                             process.env.ATPWD );

if (connected) {
  api.beginProcessing();
}

Activetick API Methods

For more details, see activetick.js or run jsdoc on the package directory

.getSessionHandle()
.closeAllATRequests()
.closeATRequest()
.sendATBarHistoryDbRequest( request )
.sendATLoginRequest( request )
.sendATMarketHolidaysRequest( request )
.sendATMarketMoversDbRequest( request )
.sendATMarketMoversStreamRequest( request )
.sendATQuoteDbRequest( request )
.sendATQuoteStreamRequest( request )
.sendATTickHistoryDbRequest( request )
.sendATSectorListRequest( request )
.sendATConstituentListRequest( request )
.connect( apiKey, serverAddr, port, userid, passwd )

Issues:

License

Copyright (c) 2016 Jae Yang. See LICENSE file for license rights and limitations (MIT).

Current Tags

  • 1.2.0                                ...           latest (3 years ago)

20 Versions

  • 1.2.0                                ...           3 years ago
  • 1.1.7                                ...           3 years ago
  • 1.1.6                                ...           3 years ago
  • 1.1.5                                ...           4 years ago
  • 1.1.4                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.10                                ...           5 years ago
  • 1.0.9                                ...           5 years ago
  • 1.0.8                                ...           5 years ago
  • 1.0.7                                ...           5 years ago
  • 1.0.6                                ...           5 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |