Skip to content

Commit

Permalink
- add : 修正 clock_engine 初始化的错误,_init_clock_handler 必须在任何情况下启动时都要执行
Browse files Browse the repository at this point in the history
  • Loading branch information
lamter committed Jul 13, 2016
1 parent 5072a57 commit 12c4f41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ __pycache__/
account.json
# C extensions
*.so
tmp/
log/

# Distribution / packaging
.Python
Expand Down
3 changes: 1 addition & 2 deletions easyquant/push_engine/clock_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ def __init__(self, event_engine, now=None, tzinfo=None):
self.clock_moment_handlers = deque()
self.clock_interval_handlers = set()

if self.trading_state:
self._init_clock_handler()
self._init_clock_handler()

def _init_clock_handler(self):
"""
Expand Down
3 changes: 2 additions & 1 deletion unitest_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

__author__ = 'Shawn'

main_engine = MainEngine('ht')
# 需要制定一个有效的证券账户信息
main_engine = MainEngine('ht', "tmp/ht.json")


class BaseTest(unittest.TestCase):
Expand Down

0 comments on commit 12c4f41

Please sign in to comment.