| 
						
						
							
								
							
						
						
					 | 
					@ -8,6 +8,8 @@ import { PropertyService } from '@ghostfolio/api/services/property/property.serv | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service'; | 
					 | 
					 | 
					import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { | 
					 | 
					 | 
					import { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  DATA_GATHERING_QUEUE, | 
					 | 
					 | 
					  DATA_GATHERING_QUEUE, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  DATA_GATHERING_QUEUE_PRIORITY_HIGH, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  DATA_GATHERING_QUEUE_PRIORITY_LOW, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  GATHER_HISTORICAL_MARKET_DATA_PROCESS, | 
					 | 
					 | 
					  GATHER_HISTORICAL_MARKET_DATA_PROCESS, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  GATHER_HISTORICAL_MARKET_DATA_PROCESS_OPTIONS, | 
					 | 
					 | 
					  GATHER_HISTORICAL_MARKET_DATA_PROCESS_OPTIONS, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  PROPERTY_BENCHMARKS | 
					 | 
					 | 
					  PROPERTY_BENCHMARKS | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -61,24 +63,35 @@ export class DataGatheringService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public async gather7Days() { | 
					 | 
					 | 
					  public async gather7Days() { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    const dataGatheringItems = await this.getSymbols7D(); | 
					 | 
					 | 
					    const dataGatheringItems = await this.getSymbols7D(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    await this.gatherSymbols(dataGatheringItems); | 
					 | 
					 | 
					    await this.gatherSymbols({ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      dataGatheringItems, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      priority: DATA_GATHERING_QUEUE_PRIORITY_LOW | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public async gatherMax() { | 
					 | 
					 | 
					  public async gatherMax() { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    const dataGatheringItems = await this.getSymbolsMax(); | 
					 | 
					 | 
					    const dataGatheringItems = await this.getSymbolsMax(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    await this.gatherSymbols(dataGatheringItems); | 
					 | 
					 | 
					    await this.gatherSymbols({ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      dataGatheringItems, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      priority: DATA_GATHERING_QUEUE_PRIORITY_LOW | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public async gatherSymbol({ dataSource, symbol }: UniqueAsset) { | 
					 | 
					 | 
					  public async gatherSymbol({ dataSource, symbol }: UniqueAsset) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    await this.marketDataService.deleteMany({ dataSource, symbol }); | 
					 | 
					 | 
					    await this.marketDataService.deleteMany({ dataSource, symbol }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    const symbols = (await this.getSymbolsMax()).filter((dataGatheringItem) => { | 
					 | 
					 | 
					    const dataGatheringItems = (await this.getSymbolsMax()).filter( | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      (dataGatheringItem) => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return ( | 
					 | 
					 | 
					        return ( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          dataGatheringItem.dataSource === dataSource && | 
					 | 
					 | 
					          dataGatheringItem.dataSource === dataSource && | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          dataGatheringItem.symbol === symbol | 
					 | 
					 | 
					          dataGatheringItem.symbol === symbol | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        ); | 
					 | 
					 | 
					        ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    await this.gatherSymbols({ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      dataGatheringItems, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      priority: DATA_GATHERING_QUEUE_PRIORITY_HIGH | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    }); | 
					 | 
					 | 
					    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    await this.gatherSymbols(symbols); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public async gatherSymbolForDate({ | 
					 | 
					 | 
					  public async gatherSymbolForDate({ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -230,9 +243,15 @@ export class DataGatheringService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ); | 
					 | 
					 | 
					    ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  public async gatherSymbols(aSymbolsWithStartDate: IDataGatheringItem[]) { | 
					 | 
					 | 
					  public async gatherSymbols({ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    dataGatheringItems, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    priority | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  }: { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    dataGatheringItems: IDataGatheringItem[]; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    priority: number; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  }) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    await this.addJobsToQueue( | 
					 | 
					 | 
					    await this.addJobsToQueue( | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					      aSymbolsWithStartDate.map(({ dataSource, date, symbol }) => { | 
					 | 
					 | 
					      dataGatheringItems.map(({ dataSource, date, symbol }) => { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        return { | 
					 | 
					 | 
					        return { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          data: { | 
					 | 
					 | 
					          data: { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            dataSource, | 
					 | 
					 | 
					            dataSource, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -242,6 +261,7 @@ export class DataGatheringService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          name: GATHER_HISTORICAL_MARKET_DATA_PROCESS, | 
					 | 
					 | 
					          name: GATHER_HISTORICAL_MARKET_DATA_PROCESS, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          opts: { | 
					 | 
					 | 
					          opts: { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            ...GATHER_HISTORICAL_MARKET_DATA_PROCESS_OPTIONS, | 
					 | 
					 | 
					            ...GATHER_HISTORICAL_MARKET_DATA_PROCESS_OPTIONS, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            priority, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            jobId: `${getAssetProfileIdentifier({ | 
					 | 
					 | 
					            jobId: `${getAssetProfileIdentifier({ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					              dataSource, | 
					 | 
					 | 
					              dataSource, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					              symbol | 
					 | 
					 | 
					              symbol | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |