@barchart/portfolio-api-common 1.0.106 → 1.0.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,7 +94,7 @@ module.exports = (() => {
94
94
  this._dataFormat.quoteHigh = formatNumber(quote.highPrice, precision);
95
95
  this._dataFormat.quoteLow = formatNumber(quote.lowPrice, precision);
96
96
  this._dataFormat.quoteChange = formatNumber(quote.priceChange, precision);
97
- this._dataFormat.quoteChangePercent = formatPercent(quote.percentChange, 2);
97
+ //this._dataFormat.quoteChangePercent = formatPercent(new Decimal(quote.percentChange), 2);
98
98
  this._dataFormat.quoteTime = quote.timeDisplay;
99
99
  this._dataFormat.quoteVolume = formatNumber(quote.volume, 0);
100
100
  } else {
@@ -255,7 +255,7 @@ module.exports = (() => {
255
255
  format.summaryTotalPreviousNegative = updates.summaryTotalPrevious.getIsNegative();
256
256
 
257
257
  if (group.single) {
258
- format.quantity = formatDecimal(group.position.snapshot.open, 2);
258
+ format.quantity = formatDecimal(group._items[0].position.snapshot.open, 2);
259
259
  }
260
260
  }
261
261
 
@@ -84,7 +84,7 @@ module.exports = (() => {
84
84
  setQuote(quote) {
85
85
  assert.argumentIsRequired(quote, 'quote', Object);
86
86
 
87
- if (this._data.price !== price) {
87
+ if (this._previousQuote === null || this._previousQuote.lastPrice !== quote.lastPrice) {
88
88
  this._previousQuote = this._currentQuote;
89
89
  this._currentQuote = quote;
90
90
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.106",
3
+ "version": "1.0.110",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -1097,7 +1097,7 @@ module.exports = (() => {
1097
1097
  this._dataFormat.quoteHigh = formatNumber(quote.highPrice, precision);
1098
1098
  this._dataFormat.quoteLow = formatNumber(quote.lowPrice, precision);
1099
1099
  this._dataFormat.quoteChange = formatNumber(quote.priceChange, precision);
1100
- this._dataFormat.quoteChangePercent = formatPercent(quote.percentChange, 2);
1100
+ //this._dataFormat.quoteChangePercent = formatPercent(new Decimal(quote.percentChange), 2);
1101
1101
  this._dataFormat.quoteTime = quote.timeDisplay;
1102
1102
  this._dataFormat.quoteVolume = formatNumber(quote.volume, 0);
1103
1103
  } else {
@@ -1258,7 +1258,7 @@ module.exports = (() => {
1258
1258
  format.summaryTotalPreviousNegative = updates.summaryTotalPrevious.getIsNegative();
1259
1259
 
1260
1260
  if (group.single) {
1261
- format.quantity = formatDecimal(group.position.snapshot.open, 2);
1261
+ format.quantity = formatDecimal(group._items[0].position.snapshot.open, 2);
1262
1262
  }
1263
1263
  }
1264
1264
 
@@ -1464,7 +1464,7 @@ module.exports = (() => {
1464
1464
  setQuote(quote) {
1465
1465
  assert.argumentIsRequired(quote, 'quote', Object);
1466
1466
 
1467
- if (this._data.price !== price) {
1467
+ if (this._previousQuote === null || this._previousQuote.lastPrice !== quote.lastPrice) {
1468
1468
  this._previousQuote = this._currentQuote;
1469
1469
  this._currentQuote = quote;
1470
1470