Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/increase fear and greed index to 30 days (#571)

Thomas Kaulffaaa14dba0e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5bbf8f58f9..c31e65a0e2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## Unreleased
+
+### Changed
+
+- Increased the historical data chart of the _Fear & Greed Index_ (market mood) to 30 days
+
## 1.93.0 - 21.12.2021
### Added
diff --git a/apps/api/src/app/symbol/symbol.service.ts b/apps/api/src/app/symbol/symbol.service.ts
index 2649ef5d03..b120d7ea21 100644
--- a/apps/api/src/app/symbol/symbol.service.ts
+++ b/apps/api/src/app/symbol/symbol.service.ts
@@ -8,7 +8,7 @@ import { MarketDataService } from '@ghostfolio/api/services/market-data.service'
import { PrismaService } from '@ghostfolio/api/services/prisma.service';
import { DATE_FORMAT } from '@ghostfolio/common/helper';
import { Injectable, Logger } from '@nestjs/common';
-import { DataSource, MarketData } from '@prisma/client';
+import { DataSource } from '@prisma/client';
import { format, subDays } from 'date-fns';
import { LookupItem } from './interfaces/lookup-item.interface';
@@ -36,17 +36,17 @@ export class SymbolService {
let historicalData: HistoricalDataItem[];
if (includeHistoricalData) {
- const days = 10;
+ const days = 30;
const marketData = await this.marketDataService.getRange({
dateQuery: { gte: subDays(new Date(), days) },
symbols: [dataGatheringItem.symbol]
});
- historicalData = marketData.map(({ date, marketPrice }) => {
+ historicalData = marketData.map(({ date, marketPrice: value }) => {
return {
- date: date.toISOString(),
- value: marketPrice
+ value,
+ date: date.toISOString()
};
});
}
diff --git a/apps/client/src/app/components/home-market/home-market.html b/apps/client/src/app/components/home-market/home-market.html
index c721d4c783..0ef4b5ef8c 100644
--- a/apps/client/src/app/components/home-market/home-market.html
+++ b/apps/client/src/app/components/home-market/home-market.html
@@ -12,7 +12,7 @@
<div class="no-gutters row w-100">
<div class="col-xs-12 col-md-8 offset-md-2">
<div class="mb-2 text-center text-muted">
- <small i18n>Last 10 Days</small>
+ <small i18n>Last 30 Days</small>
</div>
<gf-line-chart
class="mb-5"