Skip to content

Commit

Permalink
Add example.iced and LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
sheldonth committed Oct 13, 2015
1 parent 8cd39d0 commit a487b4b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 106 deletions.
19 changes: 1 addition & 18 deletions ActiveTick.iced
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,5 @@ class ActiveTick
if (c = @callbacks[msgID])?
c(msg)

main = () ->
await a = new ActiveTick(defer())
await a.connect config.url, config.port, config.api_key, config.username, config.password, defer(result)
await a.listRequest ATConstituentRequestTypes[2], 'fb', defer(yang)
await a.listRequest ATConstituentRequestTypes[2], 'aapl', defer(aapl)
getQuote = (quote) ->
console.log 'getQuote'
console.log quote
sym1 = '.' + yang.symbols[22].symbol
sym2 = '.' + yang.symbols[4].symbol
sym3 = '.' + yang.symbols[188].symbol
sym4 = '.' + yang.symbols[588].symbol
sym5 = '.' + aapl.symbols[118].symbol
sym6 = '.' + aapl.symbols[277].symbol
module.exports = {ActiveTick}

a.beginQuoteStream [sym1, sym2, sym3, sym4, sym5, sym6], 'StreamRequestSubscribe', getQuote, (result) ->
console.log result

main() if not module.parent
91 changes: 3 additions & 88 deletions ActiveTick.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
The MIT License (MIT)

Copyright (c) 2015 Sheldon Thomas

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.
*/
26 changes: 26 additions & 0 deletions example/example.iced
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ActiveTick = require('../ActiveTick').ActiveTick
fs = require 'fs'

config = require '../config.js'

main = () ->
await a = new ActiveTick(defer())
await a.connect config.url, config.port, config.api_key, config.username, config.password, defer(result)
await a.listRequest 'ATConstituentListOptionChain', 'fb', defer(yang)
await a.listRequest 'ATConstituentListOptionChain', 'aapl', defer(aapl)
getQuote = (quote) ->
console.log 'getQuote'
console.log quote
sym1 = '.' + yang.symbols[22].symbol
sym2 = '.' + yang.symbols[4].symbol
sym3 = '.' + yang.symbols[188].symbol
sym4 = '.' + yang.symbols[588].symbol
sym5 = '.' + aapl.symbols[118].symbol
sym6 = '.' + aapl.symbols[277].symbol


a.beginQuoteStream [sym1, sym2, sym3, sym4, sym5, sym6], 'StreamRequestSubscribe', getQuote, (result) ->
console.log result

main() if not module.parent

0 comments on commit a487b4b

Please sign in to comment.