fix: 修复计算机未按权重计算的问题
This commit is contained in:
@@ -133,6 +133,7 @@ class Calculator:
|
||||
}
|
||||
|
||||
def run(self):
|
||||
self._get_weight()
|
||||
self.price_ftb, self.fluctuating_ftb = self._get_ftb_price()
|
||||
self.price_ss, self.fluctuating_ss = self._get_ss_price()
|
||||
self.price_fhb, self.fluctuating_fhb = self._get_fhb_price()
|
||||
@@ -204,8 +205,6 @@ class Calculator:
|
||||
return result
|
||||
|
||||
def _get_recommend_price(self, round_by=10):
|
||||
self._get_weight()
|
||||
|
||||
if not self.previous_prices:
|
||||
return 0, 0
|
||||
|
||||
@@ -231,7 +230,7 @@ class Calculator:
|
||||
|
||||
def _get_weight(self):
|
||||
# 如果有上月数据按上月权重计算 无则平均数
|
||||
if self._previous_prices:
|
||||
if self.previous_prices:
|
||||
self.weight_ftb = self._previous_prices.weight_ftb
|
||||
self.weight_ss = self._previous_prices.weight_ss
|
||||
self.weight_fhb = self._previous_prices.weight_fhb
|
||||
|
Reference in New Issue
Block a user