mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-02 11:58:21 +08:00
改进 sys_performance,在query日期不在stock的有效日期范围内时,抛出异常
This commit is contained in:
parent
cca00a548c
commit
4aae90134c
@ -754,6 +754,7 @@ def sys_performance(sys, ref_stk=None):
|
||||
if ref_stk is None:
|
||||
ref_stk = get_stock('sh000300')
|
||||
ref_k = ref_stk.get_kdata(sys.query)
|
||||
hku_check(len(ref_k) > 0, "The length of ref_k is zero! Maybe The query date is out of the ref-stock range!\n ref_k: {}", ref_k)
|
||||
|
||||
query = Query(ref_k[0].datetime.start_of_day(), ref_k[-1].datetime.start_of_day() + TimeDelta(1), Query.DAY)
|
||||
ref_k = ref_stk.get_kdata(query)
|
||||
|
Loading…
Reference in New Issue
Block a user