Giter Site home page Giter Site logo

laomouzi / node-activetick-addon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ritesh25/node-activetick-addon

0.0 2.0 0.0 415 KB

ActiveTick API addon for Node.js

License: MIT License

C++ 83.16% Objective-C 0.18% JavaScript 16.29% Shell 0.37%

node-activetick-addon's Introduction

node-activetick-addon

Gitter

ActiveTick API addon for Node.js

Author: Jae Yang - [dchem] (https://github.com/dchem/)

Change Notes:

  • 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 2.7
  • 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 the same directory as 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) 2015 Jae Yang. See LICENSE file for license rights and limitations (MIT).

node-activetick-addon's People

Contributors

dchem avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.