Browse Source

Fix all time high

pull/3527/head
Thomas Kaul 1 year ago
parent
commit
ac83787ea9
  1. 7
      apps/api/src/app/benchmark/benchmark.service.ts

7
apps/api/src/app/benchmark/benchmark.service.ts

@ -161,7 +161,10 @@ export class BenchmarkService {
performances: { performances: {
allTimeHigh: { allTimeHigh: {
date: allTimeHigh?.date, date: allTimeHigh?.date,
performancePercent: performancePercentFromAllTimeHigh performancePercent:
performancePercentFromAllTimeHigh >= 0
? 0
: performancePercentFromAllTimeHigh
} }
}, },
symbol: benchmarkAssetProfiles[index].symbol, symbol: benchmarkAssetProfiles[index].symbol,
@ -419,7 +422,7 @@ export class BenchmarkService {
private getMarketCondition( private getMarketCondition(
aPerformanceInPercent: number aPerformanceInPercent: number
): Benchmark['marketCondition'] { ): Benchmark['marketCondition'] {
if (aPerformanceInPercent === 0) { if (aPerformanceInPercent >= 0) {
return 'ALL_TIME_HIGH'; return 'ALL_TIME_HIGH';
} else if (aPerformanceInPercent <= -0.2) { } else if (aPerformanceInPercent <= -0.2) {
return 'BEAR_MARKET'; return 'BEAR_MARKET';

Loading…
Cancel
Save