|
|
@@ -201,7 +201,7 @@ impl Predictor {
|
|
|
|
|
|
// 拟合,60s拟合一次
|
|
|
let before_fitting = Utc::now().timestamp_millis();
|
|
|
- if Decimal::from(before_fitting) - self.prev_fitting_time > dec!(60_000) {
|
|
|
+ if Decimal::from(before_fitting) - self.prev_fitting_time > dec!(60_000) || self.prices[mid_index][0].len() < 1000 {
|
|
|
if let Some((k, b)) = self.linear_least_squares(mid_index).await {
|
|
|
self.ks[mid_index] = k;
|
|
|
self.bs[mid_index] = b;
|