浏览代码

不能要绝对值

skyffire 7 月之前
父节点
当前提交
2356ca5f88
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/trend14400.rs

+ 1 - 1
src/trend14400.rs

@@ -29,7 +29,7 @@ pub fn generate_14400trend_by_records(records: &Vec<Record>) -> Indicators {
         // 计算比率
         // 计算比率
         let trend = records.last().unwrap().close / mean;
         let trend = records.last().unwrap().close / mean;
 
 
-        indicators.trend_strength = (trend - Decimal::ONE).abs();
+        indicators.trend_strength = trend - Decimal::ONE;
         indicators.trend_strength.rescale(6);
         indicators.trend_strength.rescale(6);
     }
     }