2020-06-25 18:22:51 +08:00
|
|
|
|
#
|
2020-06-26 21:39:53 +08:00
|
|
|
|
# 对 C++ 引出类和函数进行扩展
|
2020-06-25 18:22:51 +08:00
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
from hikyuu.cpp.core import *
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
# 常量定义,各种C++中Null值
|
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
constant = Constant()
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
# 增加Datetime、Stock的hash支持,以便可做为dict的key
|
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
Datetime.__hash__ = lambda self: self.number * 1000000 + self.millisecond * 1000 + self.microsecond
|
|
|
|
|
TimeDelta.__hash__ = lambda self: self.ticks
|
|
|
|
|
Stock.__hash__ = lambda self: self.id
|