From 66d43d6548f1211d27d14a009c7b026e1c763ac1 Mon Sep 17 00:00:00 2001 From: yutiansut Date: Fri, 1 Mar 2019 09:28:18 +0800 Subject: [PATCH 1/3] #update --- QUANTAXIS/QAARP/QAAccount.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/QUANTAXIS/QAARP/QAAccount.py b/QUANTAXIS/QAARP/QAAccount.py index 438ccb5ca..793a8ed56 100755 --- a/QUANTAXIS/QAARP/QAAccount.py +++ b/QUANTAXIS/QAARP/QAAccount.py @@ -346,6 +346,7 @@ def __init__( """ self.frozen = {} # 冻结资金(保证金) + self.finishedOrderid = [] if auto_reload: self.reload() @@ -414,7 +415,9 @@ def message(self): 'end_date': self.end_date, 'frozen': - self.frozen + self.frozen, + 'finished_id': + self.finishedOrderid } @property @@ -815,7 +818,11 @@ def receive_simpledeal( """ self.datetime = trade_time - + if realorder_id in self.finishedOrderid: + pass + else: + self.finishedOrderid.append(realorder_id) + market_towards = 1 if trade_towards > 0 else -1 # value 合约价值 unit 合约乘数 if self.allow_margin: @@ -1522,6 +1529,7 @@ def from_message(self, message): RUNNING_ENVIRONMENT.BACKETEST ) self.frozen = message.get('frozen', {}) + self.finishedOrderid = message.get('finished_id', []) self.settle() return self From 70978147c85af4d832e6343fdbb7b1cd3b91f4c2 Mon Sep 17 00:00:00 2001 From: yutiansut Date: Sun, 3 Mar 2019 20:23:53 +0800 Subject: [PATCH 2/3] #update to 1.3.0.dev16 --- QUANTAXIS/QAARP/QARisk.py | 2 +- QUANTAXIS/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/QUANTAXIS/QAARP/QARisk.py b/QUANTAXIS/QAARP/QARisk.py index 4018ba9dc..42ea9a5e1 100755 --- a/QUANTAXIS/QAARP/QARisk.py +++ b/QUANTAXIS/QAARP/QARisk.py @@ -359,7 +359,7 @@ def volatility(self): @property def ir(self): - return self.calc_IR() + return round(self.calc_IR(),2) @property @lru_cache() diff --git a/QUANTAXIS/__init__.py b/QUANTAXIS/__init__.py index e67541f66..2c96fece4 100755 --- a/QUANTAXIS/__init__.py +++ b/QUANTAXIS/__init__.py @@ -31,7 +31,7 @@ 2017/4/8 """ -__version__ = '1.3.0.dev15' +__version__ = '1.3.0.dev16' __author__ = 'yutiansut' # fetch methods From 792510673cc1aa2fb04f91b0c976af7d77fbb63c Mon Sep 17 00:00:00 2001 From: yutiansut Date: Sun, 3 Mar 2019 21:24:24 +0800 Subject: [PATCH 3/3] #update 1.3.0 --- QUANTAXIS/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QUANTAXIS/__init__.py b/QUANTAXIS/__init__.py index 2c96fece4..3f46c3a3c 100755 --- a/QUANTAXIS/__init__.py +++ b/QUANTAXIS/__init__.py @@ -31,7 +31,7 @@ 2017/4/8 """ -__version__ = '1.3.0.dev16' +__version__ = '1.3.0' __author__ = 'yutiansut' # fetch methods