From a7c0e3273b7d2a0acedcb186357295ee40c7cb85 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Wed, 25 Mar 2020 20:58:55 +0800 Subject: [PATCH] [bug fix] --- vnpy/component/cta_line_bar.py | 6 +++--- vnpy/trader/util_pid.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vnpy/component/cta_line_bar.py b/vnpy/component/cta_line_bar.py index 7e7e864e..53a57bf7 100644 --- a/vnpy/component/cta_line_bar.py +++ b/vnpy/component/cta_line_bar.py @@ -2548,7 +2548,7 @@ class CtaLineBar(object): if hhv == llv: rsv = 50 else: - rsv = (self.close_array - llv) / (hhv - llv) * 100 + rsv = (self.close_array[-1] - llv) / (hhv - llv) * 100 self.line_rsv.append(rsv) @@ -2622,7 +2622,7 @@ class CtaLineBar(object): # 发生金叉 self.cur_kd_count = 1 self.cur_kd_cross = round((self.line_k[-1] + self.line_k[-2]) / 2, 2) - self.cur_kd_cross_price = self.line_bar[-1].close + self.cur_kd_cross_price = self.cur_price # K值小于D值 else: @@ -2633,7 +2633,7 @@ class CtaLineBar(object): # 发生死叉 self.cur_kd_count = -1 self.cur_kd_cross = round((self.line_k[-1] + self.line_k[-2]) / 2, 2) - self.cur_kd_cross_price = self.line_bar[-1].close + self.cur_kd_cross_price = self.cur_price def __count_macd(self): """ diff --git a/vnpy/trader/util_pid.py b/vnpy/trader/util_pid.py index dee0a54c..00279137 100644 --- a/vnpy/trader/util_pid.py +++ b/vnpy/trader/util_pid.py @@ -14,7 +14,7 @@ if not os.path.isdir(logs_path): assert os.path.isdir(logs_path) # 记录pid得文件 -pid_file = os.path.abspath(os.path.join(logs_path, 'pid.txt')) +pid_file = os.path.abspath(os.path.join(logs_path, 'gpid.txt')) def _check_pid(pid): """