Skip to content

Commit

Permalink
fix python2双均线类型转换
Browse files Browse the repository at this point in the history
  • Loading branch information
bbfamily committed Sep 26, 2017
1 parent 3eb9f5d commit ac92f70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions abupy/FactorBuyBu/ABuFactorBuyDM.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ def fit_month(self, today):
def fit_day(self, today):
"""双均线买入择时因子,信号快线上穿慢行形成金叉做为买入信号"""
# 计算快线
fast_line = calc_ma_from_prices(self.xd_kl.close, self.ma_fast, min_periods=1)
fast_line = calc_ma_from_prices(self.xd_kl.close, int(self.ma_fast), min_periods=1)
# 计算慢线
slow_line = calc_ma_from_prices(self.xd_kl.close, self.ma_slow, min_periods=1)
slow_line = calc_ma_from_prices(self.xd_kl.close, int(self.ma_slow), min_periods=1)

if len(fast_line) >= 2 and len(slow_line) >= 2:
# 今天的快线值
Expand Down

0 comments on commit ac92f70

Please sign in to comment.