|
|
@@ -80,24 +80,27 @@ pub fn generate_rank_by_indicator_map(indicator_map: &MutexGuard<HashMap<String,
|
|
|
liquidity_avg.rescale(0);
|
|
|
|
|
|
// msv_score计算规则
|
|
|
- let mut msv_score = if msv_abs_total > Decimal::ZERO {
|
|
|
- (epr_total / msv_abs_total) * SIXTY
|
|
|
+ let mut msv_score = if msv_abs_total > Decimal::ZERO && epr_total > Decimal::ZERO {
|
|
|
+ (epr_total / msv_abs_total).ln() * SIXTY
|
|
|
} else {
|
|
|
Decimal::ZERO
|
|
|
};
|
|
|
msv_score.rescale(2);
|
|
|
|
|
|
// liquidity_score
|
|
|
- let mut liquidity = (liquidity_avg / Decimal::ONE_THOUSAND) * TWENTY;
|
|
|
- let mut liquidity_score = if liquidity == Decimal::ZERO {
|
|
|
- Decimal::ZERO
|
|
|
+ let mut liquidity_score = if liquidity_avg > Decimal::ZERO {
|
|
|
+ (liquidity_avg / Decimal::ONE_THOUSAND).ln() * TWENTY
|
|
|
} else {
|
|
|
- liquidity.log10()
|
|
|
+ Decimal::ZERO
|
|
|
};
|
|
|
liquidity_score.rescale(2);
|
|
|
|
|
|
// frequency_score计算规则
|
|
|
- let mut frequency_score = (effective_count / Decimal::ONE_HUNDRED) * TWENTY;
|
|
|
+ let mut frequency_score = if effective_count > Decimal::ZERO {
|
|
|
+ (effective_count).ln() * TWENTY
|
|
|
+ } else {
|
|
|
+ Decimal::ZERO
|
|
|
+ };
|
|
|
frequency_score.rescale(2);
|
|
|
|
|
|
let mut score = msv_score * liquidity_score * frequency_score;
|