mirror of https://github.com/ghostfolio/ghostfolio
committed by
GitHub
26 changed files with 180 additions and 94 deletions
@ -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