Browse Source
			
			
			Bugfix/fix all time high in benchmarks (#3527)
			
				* Fix all time high
* Update changelog
			
			
				pull/3525/head^2
			
			
		 
		
			
				
					
						
						Thomas Kaul
					
					1 year ago
					
						
							committed by
							
								
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B5690EEEBB952194
						
					
				
			
		
		
		
	
		
			
				 2 changed files with 
11 additions and 
2 deletions
			 
			
		 
		
			
				- 
					
					
					 
					CHANGELOG.md
				
 
			
				- 
					
					
					 
					apps/api/src/app/benchmark/benchmark.service.ts
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | 
					 | 
					 | 
					The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | 
					 | 
					 | 
					and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					## Unreleased | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					### Fixed | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					- Fixed an issue with the all time high in the benchmarks of the markets overview | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					## 2.91.0 - 2024-06-26 | 
					 | 
					 | 
					## 2.91.0 - 2024-06-26 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					### Added | 
					 | 
					 | 
					### Added | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -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'; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |