Clean up (#1423)
This commit is contained in:
parent
d147a66dcd
commit
fc1507de4f
@ -53,7 +53,7 @@ Ghostfolio is for you if you are...
|
||||
|
||||
- ✅ Create, update and delete transactions
|
||||
- ✅ Multi account management
|
||||
- ✅ Portfolio performance: Time-weighted rate of return (TWR) for `Today`, `YTD`, `1Y`, `5Y`, `Max`
|
||||
- ✅ Portfolio performance for `Today`, `YTD`, `1Y`, `5Y`, `Max`
|
||||
- ✅ Various charts
|
||||
- ✅ Static analysis to identify potential risks in your portfolio
|
||||
- ✅ Import and export transactions
|
||||
|
@ -917,12 +917,8 @@ export class PortfolioCalculator {
|
||||
const investmentValues: { [date: string]: Big } = {};
|
||||
const maxInvestmentValues: { [date: string]: Big } = {};
|
||||
let lastAveragePrice = new Big(0);
|
||||
// let lastTransactionInvestment = new Big(0);
|
||||
// let lastValueOfInvestmentBeforeTransaction = new Big(0);
|
||||
let maxTotalInvestment = new Big(0);
|
||||
const netPerformanceValues: { [date: string]: Big } = {};
|
||||
// let timeWeightedGrossPerformancePercentage = new Big(1);
|
||||
// let timeWeightedNetPerformancePercentage = new Big(1);
|
||||
let totalInvestment = new Big(0);
|
||||
let totalInvestmentWithGrossPerformanceFromSell = new Big(0);
|
||||
let totalUnits = new Big(0);
|
||||
@ -1128,55 +1124,8 @@ export class PortfolioCalculator {
|
||||
.minus(totalInvestment)
|
||||
.plus(grossPerformanceFromSells);
|
||||
|
||||
// if (
|
||||
// i > indexOfStartOrder &&
|
||||
// !lastValueOfInvestmentBeforeTransaction
|
||||
// .plus(lastTransactionInvestment)
|
||||
// .eq(0)
|
||||
// ) {
|
||||
// const grossHoldingPeriodReturn = valueOfInvestmentBeforeTransaction
|
||||
// .minus(
|
||||
// lastValueOfInvestmentBeforeTransaction.plus(
|
||||
// lastTransactionInvestment
|
||||
// )
|
||||
// )
|
||||
// .div(
|
||||
// lastValueOfInvestmentBeforeTransaction.plus(
|
||||
// lastTransactionInvestment
|
||||
// )
|
||||
// );
|
||||
|
||||
// timeWeightedGrossPerformancePercentage =
|
||||
// timeWeightedGrossPerformancePercentage.mul(
|
||||
// new Big(1).plus(grossHoldingPeriodReturn)
|
||||
// );
|
||||
|
||||
// const netHoldingPeriodReturn = valueOfInvestmentBeforeTransaction
|
||||
// .minus(fees.minus(feesAtStartDate))
|
||||
// .minus(
|
||||
// lastValueOfInvestmentBeforeTransaction.plus(
|
||||
// lastTransactionInvestment
|
||||
// )
|
||||
// )
|
||||
// .div(
|
||||
// lastValueOfInvestmentBeforeTransaction.plus(
|
||||
// lastTransactionInvestment
|
||||
// )
|
||||
// );
|
||||
|
||||
// timeWeightedNetPerformancePercentage =
|
||||
// timeWeightedNetPerformancePercentage.mul(
|
||||
// new Big(1).plus(netHoldingPeriodReturn)
|
||||
// );
|
||||
// }
|
||||
|
||||
grossPerformance = newGrossPerformance;
|
||||
|
||||
// lastTransactionInvestment = transactionInvestment;
|
||||
|
||||
// lastValueOfInvestmentBeforeTransaction =
|
||||
// valueOfInvestmentBeforeTransaction;
|
||||
|
||||
if (order.itemType === 'start') {
|
||||
feesAtStartDate = fees;
|
||||
grossPerformanceAtStartDate = grossPerformance;
|
||||
@ -1204,12 +1153,6 @@ export class PortfolioCalculator {
|
||||
}
|
||||
}
|
||||
|
||||
// timeWeightedGrossPerformancePercentage =
|
||||
// timeWeightedGrossPerformancePercentage.minus(1);
|
||||
|
||||
// timeWeightedNetPerformancePercentage =
|
||||
// timeWeightedNetPerformancePercentage.minus(1);
|
||||
|
||||
const totalGrossPerformance = grossPerformance.minus(
|
||||
grossPerformanceAtStartDate
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user