Feature/convert errors to warnings in portfolio calculator (#562)

* Convert errors to warnings

* Update changelog
This commit is contained in:
Thomas Kaul 2021-12-20 21:03:12 +01:00 committed by GitHub
parent 4bf4c1a8a3
commit 1602f976f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -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
- Converted errors to warnings in portfolio calculator
## 1.92.0 - 19.12.2021 ## 1.92.0 - 19.12.2021
### Added ### Added

View File

@ -238,9 +238,7 @@ export class PortfolioCalculator {
if (!marketSymbolMap[nextDate]?.[item.symbol]) { if (!marketSymbolMap[nextDate]?.[item.symbol]) {
invalidSymbols.push(item.symbol); invalidSymbols.push(item.symbol);
hasErrors = true; hasErrors = true;
Logger.error( Logger.warn(`Missing value for symbol ${item.symbol} at ${nextDate}`);
`Missing value for symbol ${item.symbol} at ${nextDate}`
);
continue; continue;
} }
let lastInvestment: Big = new Big(0); let lastInvestment: Big = new Big(0);
@ -271,7 +269,7 @@ export class PortfolioCalculator {
if (!initialValue) { if (!initialValue) {
invalidSymbols.push(item.symbol); invalidSymbols.push(item.symbol);
hasErrors = true; hasErrors = true;
Logger.error( Logger.warn(
`Missing value for symbol ${item.symbol} at ${currentDate}` `Missing value for symbol ${item.symbol} at ${currentDate}`
); );
continue; continue;
@ -515,7 +513,7 @@ export class PortfolioCalculator {
currentPosition.netPerformancePercentage.mul(currentInitialValue) currentPosition.netPerformancePercentage.mul(currentInitialValue)
); );
} else if (!currentPosition.quantity.eq(0)) { } else if (!currentPosition.quantity.eq(0)) {
Logger.error( Logger.warn(
`Missing initial value for symbol ${currentPosition.symbol} at ${currentPosition.firstBuyDate}` `Missing initial value for symbol ${currentPosition.symbol} at ${currentPosition.firstBuyDate}`
); );
hasErrors = true; hasErrors = true;