|
|
@ -14,6 +14,7 @@ import {
|
|
|
|
calculateBenchmarkTrend
|
|
|
|
calculateBenchmarkTrend
|
|
|
|
} from '@ghostfolio/common/helper';
|
|
|
|
} from '@ghostfolio/common/helper';
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
|
|
|
|
Benchmark,
|
|
|
|
BenchmarkMarketDataDetails,
|
|
|
|
BenchmarkMarketDataDetails,
|
|
|
|
BenchmarkProperty,
|
|
|
|
BenchmarkProperty,
|
|
|
|
BenchmarkResponse,
|
|
|
|
BenchmarkResponse,
|
|
|
@ -339,7 +340,15 @@ export class BenchmarkService {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private getMarketCondition(aPerformanceInPercent: number) {
|
|
|
|
private getMarketCondition(
|
|
|
|
return aPerformanceInPercent <= -0.2 ? 'BEAR_MARKET' : 'NEUTRAL_MARKET';
|
|
|
|
aPerformanceInPercent: number
|
|
|
|
|
|
|
|
): Benchmark['marketCondition'] {
|
|
|
|
|
|
|
|
if (aPerformanceInPercent === 0) {
|
|
|
|
|
|
|
|
return 'ALL_TIME_HIGH';
|
|
|
|
|
|
|
|
} else if (aPerformanceInPercent <= -0.2) {
|
|
|
|
|
|
|
|
return 'BEAR_MARKET';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return 'NEUTRAL_MARKET';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|