mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
Rename types of portfolio calculator to HoldingPerformance, PortfolioCalculatorHolding and PortfolioSnapshotHoldingpull/7914/head
committed by
GitHub
14 changed files with 93 additions and 135 deletions
@ -1,29 +1,28 @@ |
|||
import { PortfolioCalculator } from '@ghostfolio/api/app/portfolio/calculator/portfolio-calculator'; |
|||
import { |
|||
AssetProfileIdentifier, |
|||
SymbolMetrics |
|||
} from '@ghostfolio/common/interfaces'; |
|||
import { HoldingPerformance } from '@ghostfolio/api/app/portfolio/interfaces/holding-performance.interface'; |
|||
import { PortfolioCalculatorHolding } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-calculator-holding.interface'; |
|||
import { AssetProfileIdentifier } from '@ghostfolio/common/interfaces'; |
|||
import { PortfolioSnapshot } from '@ghostfolio/common/models'; |
|||
import { PerformanceCalculationType } from '@ghostfolio/common/types/performance-calculation-type.type'; |
|||
|
|||
export class MwrPortfolioCalculator extends PortfolioCalculator { |
|||
protected calculateOverallPerformance(): PortfolioSnapshot { |
|||
protected calculateOverallPerformance([]: PortfolioCalculatorHolding[]): PortfolioSnapshot { |
|||
throw new Error('Method not implemented.'); |
|||
} |
|||
|
|||
protected getPerformanceCalculationType() { |
|||
return PerformanceCalculationType.MWR; |
|||
} |
|||
|
|||
protected getSymbolMetrics({}: { |
|||
protected getHoldingPerformance({}: { |
|||
chartDateMap: { [date: string]: boolean }; |
|||
end: Date; |
|||
exchangeRates: { [dateString: string]: number }; |
|||
marketSymbolMap: { |
|||
[date: string]: { [assetProfileIdentifier: string]: Big }; |
|||
}; |
|||
start: Date; |
|||
step?: number; |
|||
} & AssetProfileIdentifier): SymbolMetrics { |
|||
} & AssetProfileIdentifier): HoldingPerformance { |
|||
throw new Error('Method not implemented.'); |
|||
} |
|||
|
|||
protected getPerformanceCalculationType() { |
|||
return PerformanceCalculationType.MWR; |
|||
} |
|||
} |
|||
|
|||
@ -1,29 +1,28 @@ |
|||
import { PortfolioCalculator } from '@ghostfolio/api/app/portfolio/calculator/portfolio-calculator'; |
|||
import { |
|||
AssetProfileIdentifier, |
|||
SymbolMetrics |
|||
} from '@ghostfolio/common/interfaces'; |
|||
import { HoldingPerformance } from '@ghostfolio/api/app/portfolio/interfaces/holding-performance.interface'; |
|||
import { PortfolioCalculatorHolding } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-calculator-holding.interface'; |
|||
import { AssetProfileIdentifier } 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 { |
|||
protected calculateOverallPerformance([]: PortfolioCalculatorHolding[]): PortfolioSnapshot { |
|||
throw new Error('Method not implemented.'); |
|||
} |
|||
|
|||
protected getPerformanceCalculationType() { |
|||
return PerformanceCalculationType.ROI; |
|||
} |
|||
|
|||
protected getSymbolMetrics({}: { |
|||
protected getHoldingPerformance({}: { |
|||
chartDateMap: { [date: string]: boolean }; |
|||
end: Date; |
|||
exchangeRates: { [dateString: string]: number }; |
|||
marketSymbolMap: { |
|||
[date: string]: { [assetProfileIdentifier: string]: Big }; |
|||
}; |
|||
start: Date; |
|||
step?: number; |
|||
} & AssetProfileIdentifier): SymbolMetrics { |
|||
} & AssetProfileIdentifier): HoldingPerformance { |
|||
throw new Error('Method not implemented.'); |
|||
} |
|||
|
|||
protected getPerformanceCalculationType() { |
|||
return PerformanceCalculationType.ROI; |
|||
} |
|||
} |
|||
|
|||
@ -1,29 +1,28 @@ |
|||
import { PortfolioCalculator } from '@ghostfolio/api/app/portfolio/calculator/portfolio-calculator'; |
|||
import { |
|||
AssetProfileIdentifier, |
|||
SymbolMetrics |
|||
} from '@ghostfolio/common/interfaces'; |
|||
import { HoldingPerformance } from '@ghostfolio/api/app/portfolio/interfaces/holding-performance.interface'; |
|||
import { PortfolioCalculatorHolding } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-calculator-holding.interface'; |
|||
import { AssetProfileIdentifier } from '@ghostfolio/common/interfaces'; |
|||
import { PortfolioSnapshot } from '@ghostfolio/common/models'; |
|||
import { PerformanceCalculationType } from '@ghostfolio/common/types/performance-calculation-type.type'; |
|||
|
|||
export class TwrPortfolioCalculator extends PortfolioCalculator { |
|||
protected calculateOverallPerformance(): PortfolioSnapshot { |
|||
protected calculateOverallPerformance([]: PortfolioCalculatorHolding[]): PortfolioSnapshot { |
|||
throw new Error('Method not implemented.'); |
|||
} |
|||
|
|||
protected getPerformanceCalculationType() { |
|||
return PerformanceCalculationType.TWR; |
|||
} |
|||
|
|||
protected getSymbolMetrics({}: { |
|||
protected getHoldingPerformance({}: { |
|||
chartDateMap: { [date: string]: boolean }; |
|||
end: Date; |
|||
exchangeRates: { [dateString: string]: number }; |
|||
marketSymbolMap: { |
|||
[date: string]: { [assetProfileIdentifier: string]: Big }; |
|||
}; |
|||
start: Date; |
|||
step?: number; |
|||
} & AssetProfileIdentifier): SymbolMetrics { |
|||
} & AssetProfileIdentifier): HoldingPerformance { |
|||
throw new Error('Method not implemented.'); |
|||
} |
|||
|
|||
protected getPerformanceCalculationType() { |
|||
return PerformanceCalculationType.TWR; |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,6 @@ |
|||
import { PortfolioSnapshotHolding } from '@ghostfolio/common/models'; |
|||
|
|||
export interface PortfolioCalculatorHolding extends PortfolioSnapshotHolding { |
|||
includeInHoldings: boolean; |
|||
includeInPerformance: boolean; |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
import { TimelinePosition } from '@ghostfolio/common/models'; |
|||
|
|||
export interface PortfolioCalculatorPosition extends TimelinePosition { |
|||
includeInHoldings: boolean; |
|||
includeInPerformance: boolean; |
|||
} |
|||
@ -1,4 +1,4 @@ |
|||
import { PortfolioSnapshot } from './portfolio-snapshot'; |
|||
import { TimelinePosition } from './timeline-position'; |
|||
import { PortfolioSnapshotHolding } from './portfolio-snapshot-holding'; |
|||
|
|||
export { PortfolioSnapshot, TimelinePosition }; |
|||
export { PortfolioSnapshot, PortfolioSnapshotHolding }; |
|||
|
|||
Loading…
Reference in new issue