@barchart/portfolio-api-common 1.0.64 → 1.0.65

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.
@@ -40,6 +40,8 @@ module.exports = (() => {
40
40
  this._dataFormat.marketPercent = null;
41
41
  this._dataFormat.unrealizedToday = null;
42
42
 
43
+ this._dataFormat.unrealizedTodayPositive = true;
44
+
43
45
  this._items.forEach((item) => {
44
46
  item.registerPriceChangeHandler((data, sender) => {
45
47
  if (this._single) {
@@ -168,6 +170,7 @@ module.exports = (() => {
168
170
  format.market = formatCurrency(updates.market, currency);
169
171
  format.marketPercent = formatPercent(updates.unrealizedToday, 2);
170
172
  format.unrealizedToday = formatCurrency(updates.unrealizedToday, currency);
173
+ format.unrealizedTodayPositive = actual.unrealizedToday.getIsPositive();
171
174
  }
172
175
 
173
176
  return PositionGroup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.64",
3
+ "version": "1.0.65",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -858,6 +858,8 @@ module.exports = (() => {
858
858
  this._dataFormat.marketPercent = null;
859
859
  this._dataFormat.unrealizedToday = null;
860
860
 
861
+ this._dataFormat.unrealizedTodayPositive = true;
862
+
861
863
  this._items.forEach((item) => {
862
864
  item.registerPriceChangeHandler((data, sender) => {
863
865
  if (this._single) {
@@ -986,6 +988,7 @@ module.exports = (() => {
986
988
  format.market = formatCurrency(updates.market, currency);
987
989
  format.marketPercent = formatPercent(updates.unrealizedToday, 2);
988
990
  format.unrealizedToday = formatCurrency(updates.unrealizedToday, currency);
991
+ format.unrealizedTodayPositive = actual.unrealizedToday.getIsPositive();
989
992
  }
990
993
 
991
994
  return PositionGroup;