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 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..3f46c3a3c 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' __author__ = 'yutiansut' # fetch methods