From ac83787ea98f4e73accafaded6f9f38bc3a4e00f Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 28 Jun 2024 18:26:31 +0200 Subject: [PATCH] Fix all time high --- apps/api/src/app/benchmark/benchmark.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/api/src/app/benchmark/benchmark.service.ts b/apps/api/src/app/benchmark/benchmark.service.ts index f4f2d7848..6008746d1 100644 --- a/apps/api/src/app/benchmark/benchmark.service.ts +++ b/apps/api/src/app/benchmark/benchmark.service.ts @@ -161,7 +161,10 @@ export class BenchmarkService { performances: { allTimeHigh: { date: allTimeHigh?.date, - performancePercent: performancePercentFromAllTimeHigh + performancePercent: + performancePercentFromAllTimeHigh >= 0 + ? 0 + : performancePercentFromAllTimeHigh } }, symbol: benchmarkAssetProfiles[index].symbol, @@ -419,7 +422,7 @@ export class BenchmarkService { private getMarketCondition( aPerformanceInPercent: number ): Benchmark['marketCondition'] { - if (aPerformanceInPercent === 0) { + if (aPerformanceInPercent >= 0) { return 'ALL_TIME_HIGH'; } else if (aPerformanceInPercent <= -0.2) { return 'BEAR_MARKET';