@barchart/portfolio-api-common 1.2.134 → 1.2.135
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.
|
@@ -581,7 +581,7 @@ module.exports = (() => {
|
|
|
581
581
|
}
|
|
582
582
|
|
|
583
583
|
const valueChange = endValue.subtract(startValue);
|
|
584
|
-
const tradeChange = currentSummary.period.sells.subtract(currentSummary.period.buys);
|
|
584
|
+
const tradeChange = currentSummary.period.sells.subtract(currentSummary.period.buys.opposite());
|
|
585
585
|
const incomeChange = currentSummary.period.income;
|
|
586
586
|
|
|
587
587
|
returnRef = valueChange.add(tradeChange).add(incomeChange);
|
|
@@ -604,7 +604,7 @@ module.exports = (() => {
|
|
|
604
604
|
startValue = Decimal.ZERO;
|
|
605
605
|
}
|
|
606
606
|
|
|
607
|
-
returnRef = startValue.add(currentSummary.period.buys);
|
|
607
|
+
returnRef = startValue.add(currentSummary.period.buys.opposite());
|
|
608
608
|
} else {
|
|
609
609
|
returnRef = Decimal.ZERO;
|
|
610
610
|
}
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -4087,7 +4087,7 @@ module.exports = (() => {
|
|
|
4087
4087
|
}
|
|
4088
4088
|
|
|
4089
4089
|
const valueChange = endValue.subtract(startValue);
|
|
4090
|
-
const tradeChange = currentSummary.period.sells.subtract(currentSummary.period.buys);
|
|
4090
|
+
const tradeChange = currentSummary.period.sells.subtract(currentSummary.period.buys.opposite());
|
|
4091
4091
|
const incomeChange = currentSummary.period.income;
|
|
4092
4092
|
|
|
4093
4093
|
returnRef = valueChange.add(tradeChange).add(incomeChange);
|
|
@@ -4110,7 +4110,7 @@ module.exports = (() => {
|
|
|
4110
4110
|
startValue = Decimal.ZERO;
|
|
4111
4111
|
}
|
|
4112
4112
|
|
|
4113
|
-
returnRef = startValue.add(currentSummary.period.buys);
|
|
4113
|
+
returnRef = startValue.add(currentSummary.period.buys.opposite());
|
|
4114
4114
|
} else {
|
|
4115
4115
|
returnRef = Decimal.ZERO;
|
|
4116
4116
|
}
|