Feature/add performance calculation type to user settings (#4567)
* Add performance calculation type to user settings * Update changelogpull/4583/head
parent
26b705cfea
commit
71fc3906c7
@ -0,0 +1,29 @@
|
||||
import { PortfolioCalculator } from '@ghostfolio/api/app/portfolio/calculator/portfolio-calculator';
|
||||
import {
|
||||
AssetProfileIdentifier,
|
||||
SymbolMetrics
|
||||
} from '@ghostfolio/common/interfaces';
|
||||
import { PortfolioSnapshot } from '@ghostfolio/common/models';
|
||||
import { PerformanceCalculationType } from '@ghostfolio/common/types/performance-calculation-type.type';
|
||||
|
||||
export class RoiPortfolioCalculator extends PortfolioCalculator {
|
||||
protected calculateOverallPerformance(): PortfolioSnapshot {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected getPerformanceCalculationType() {
|
||||
return PerformanceCalculationType.ROI;
|
||||
}
|
||||
|
||||
protected getSymbolMetrics({}: {
|
||||
end: Date;
|
||||
exchangeRates: { [dateString: string]: number };
|
||||
marketSymbolMap: {
|
||||
[date: string]: { [symbol: string]: Big };
|
||||
};
|
||||
start: Date;
|
||||
step?: number;
|
||||
} & AssetProfileIdentifier): SymbolMetrics {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
export enum PerformanceCalculationType {
|
||||
MWR = 'MWR', // Money-Weighted Rate of Return
|
||||
ROAI = 'ROAI', // Return on Average Investment
|
||||
ROI = 'ROI', // Return on Investment
|
||||
TWR = 'TWR' // Time-Weighted Rate of Return
|
||||
}
|
||||
Loading…
Reference in new issue