|
@ -37,7 +37,7 @@ export class CurrencyClusterRiskCurrentInvestment extends Rule<Settings> { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const maxValueRatio = maxItem.value / totalValue; |
|
|
const maxValueRatio = maxItem?.value / totalValue || 0; |
|
|
|
|
|
|
|
|
if (maxValueRatio > ruleSettings.threshold) { |
|
|
if (maxValueRatio > ruleSettings.threshold) { |
|
|
return { |
|
|
return { |
|
@ -52,7 +52,7 @@ export class CurrencyClusterRiskCurrentInvestment extends Rule<Settings> { |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
evaluation: `The major part of your current investment is in ${ |
|
|
evaluation: `The major part of your current investment is in ${ |
|
|
maxItem.groupKey |
|
|
maxItem?.groupKey ?? ruleSettings.baseCurrency |
|
|
} (${(maxValueRatio * 100).toPrecision(3)}%) and does not exceed ${ |
|
|
} (${(maxValueRatio * 100).toPrecision(3)}%) and does not exceed ${ |
|
|
ruleSettings.threshold * 100 |
|
|
ruleSettings.threshold * 100 |
|
|
}%`,
|
|
|
}%`,
|
|
|