@stoqey/ibkr
Advanced tools
Comparing version 1.6.11 to 1.7.0
@@ -54,10 +54,10 @@ "use strict"; | ||
exports.PriceUpdates = void 0; | ||
var lodash_1 = require("lodash"); | ||
var find_1 = __importDefault(require("lodash/find")); | ||
var isEmpty_1 = __importDefault(require("lodash/isEmpty")); | ||
var find_1 = __importDefault(require("lodash/find")); | ||
var connection_1 = require("../connection"); | ||
var contracts_1 = require("../contracts"); | ||
var events_1 = require("../events"); | ||
var log_1 = require("../log"); | ||
var text_utils_1 = require("../_utils/text.utils"); | ||
var log_1 = require("../log"); | ||
var contracts_1 = require("../contracts"); | ||
var lodash_1 = require("lodash"); | ||
var ibEvents = events_1.IbkrEvents.Instance; | ||
@@ -107,3 +107,4 @@ var PriceUpdates = /** @class */ (function () { | ||
var thisSymbol = find_1.default(that.subscribersWithTicker, { tickerId: tickerId }); | ||
log_1.log('PriceUpdates.tickPrice', "tickerId=" + tickerId + ", price=" + price + " " + JSON.stringify({ | ||
var tickTypeWords = ib.util.tickTypeToString(tickType); | ||
log_1.log('PriceUpdates.tickPrice', "tickerId=" + tickerId + ", tickType=" + tickType + "/" + tickTypeWords + ", price=" + price + " " + JSON.stringify({ | ||
s: thisSymbol.symbol, | ||
@@ -114,3 +115,2 @@ ticker: thisSymbol.tickerId, | ||
var currentSymbol = thisSymbol && thisSymbol.symbol; | ||
var tickTypeWords = ib.util.tickTypeToString(tickType); | ||
if (isEmpty_1.default(currentSymbol)) { | ||
@@ -122,13 +122,11 @@ log_1.log('PriceUpdates.tickPrice', "Symbol not found " + JSON.stringify(thisSymbol)); | ||
// Matches as requested | ||
if ((typeof currentTickerType === 'string' && | ||
currentTickerType === tickTypeWords) || | ||
if (currentTickerType === undefined || | ||
(typeof currentTickerType === 'string' && | ||
currentTickerType === tickTypeWords) || | ||
(lodash_1.isArray(currentTickerType) && currentTickerType.includes(tickTypeWords))) { | ||
log_1.log('PriceUpdates.tickPrice', tickTypeWords + ":PRICE " + currentSymbol + " => $" + price + " tickerId = " + tickerId); | ||
if (price === -1) { | ||
return log_1.log('PriceUpdates.tickPrice', tickTypeWords + ":PRICE NULL " + currentSymbol + " $" + price); | ||
} | ||
var dataToPublish = { | ||
tickType: tickTypeWords, | ||
symbol: currentSymbol, | ||
price: price, | ||
price: price === -1 ? null : price, | ||
date: new Date(), | ||
@@ -162,3 +160,3 @@ }; | ||
} | ||
tickType = (args && args.tickType) || (opt && opt.tickType) || 'ASK'; | ||
tickType = (args && args.tickType) || (opt && opt.tickType); | ||
symbol = (contractArg && contractArg.symbol) || contractArg; | ||
@@ -165,0 +163,0 @@ log_1.log('contract before getting details', symbol); |
{ | ||
"name": "@stoqey/ibkr", | ||
"private": false, | ||
"version": "1.6.11", | ||
"version": "1.7.0", | ||
"description": "NodeJS Interactive Brokers wrapper & utilities", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
266278
2815