@stoqey/ibkr
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -55,2 +55,3 @@ "use strict"; | ||
var isEmpty_1 = __importDefault(require("lodash/isEmpty")); | ||
var find_1 = __importDefault(require("lodash/find")); | ||
var connection_1 = require("../connection"); | ||
@@ -105,3 +106,7 @@ var events_1 = require("../events"); | ||
function (tickerId, tickType, price, _canAutoExecute) { | ||
var thisSymbol = that.subscribersWithTicker.find(function (symbol) { return symbol.tickerId === tickerId; }); | ||
var thisSymbol = find_1.default(that.subscribersWithTicker, { tickerId: tickerId }); | ||
log_1.log('PriceUpdates.tickPrice', "tickerId=" + tickerId + ", price=" + price + " " + JSON.stringify({ | ||
s: thisSymbol.symbol, | ||
ticker: thisSymbol.tickerId, | ||
})); | ||
var currentTickerType = thisSymbol.tickType; | ||
@@ -137,3 +142,3 @@ var currentSymbol = thisSymbol && thisSymbol.symbol; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var that, ib, opt, contractArg, tickType, symbol, contractObj, contract, includesForexOrOpt; | ||
var that, ib, opt, contractArg, tickType, symbol, contractObj, contract, includesForexOrOpt, tickerIdToUse; | ||
return __generator(this, function (_b) { | ||
@@ -182,8 +187,8 @@ switch (_b.label) { | ||
} | ||
// Assign random number for symbol | ||
this.subscribers[symbol] = text_utils_1.getRadomReqId(); | ||
tickerIdToUse = text_utils_1.getRadomReqId(); | ||
that.subscribers[symbol] = tickerIdToUse; | ||
// Add this symbol to subscribersTicker | ||
this.subscribersWithTicker.push(__assign(__assign({}, contract), { symbol: symbol, tickerId: that.subscribers[symbol], tickType: tickType })); | ||
that.subscribersWithTicker.push(__assign(__assign({}, contract), { symbol: symbol, tickerId: tickerIdToUse, tickType: tickType })); | ||
setImmediate(function () { | ||
that.ib.reqMktData(that.subscribers[symbol], contract, '', false, false); | ||
that.ib.reqMktData(tickerIdToUse, contract, '', false, false); | ||
return log_1.log('PriceUpdates.subscribe', symbol.toLocaleUpperCase() + " is successfully subscribed"); | ||
@@ -190,0 +195,0 @@ }); |
{ | ||
"name": "@stoqey/ibkr", | ||
"private": false, | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "NodeJS Interactive Brokers wrapper & utilities", | ||
@@ -98,3 +98,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@stoqey/ib": "^0.1.0", | ||
"@stoqey/ib": "^0.1.1", | ||
"@stoqey/timeout-manager": "^0.0.2", | ||
@@ -101,0 +101,0 @@ "debug": "^4.1.1", |
Sorry, the diff of this file is not supported yet
264025
2766
Updated@stoqey/ib@^0.1.1