|
@@ -76,7 +76,7 @@ fn calc_volatility_div_price_diff(records: Value) -> Decimal {
|
|
|
let volume = Decimal::from_str(record["volume"].as_str().unwrap().to_string().as_str()).unwrap();
|
|
let volume = Decimal::from_str(record["volume"].as_str().unwrap().to_string().as_str()).unwrap();
|
|
|
let mid = (record_high + record_low) / Decimal::TWO;
|
|
let mid = (record_high + record_low) / Decimal::TWO;
|
|
|
|
|
|
|
|
- volatility += if volume * mid == Decimal::ZERO {
|
|
|
|
|
|
|
+ volatility += if volume * mid <= Decimal::ONE {
|
|
|
Decimal::ZERO
|
|
Decimal::ZERO
|
|
|
} else {
|
|
} else {
|
|
|
((volume * mid).ln() * Decimal::ONE_HUNDRED * (record_high - record_low) / mid).ln()
|
|
((volume * mid).ln() * Decimal::ONE_HUNDRED * (record_high - record_low) / mid).ln()
|