INNER CODE UNIT · Python
int_to_
ibaihuo/chanvis · api/chanapi.py:169
int_to_ = (current_ts // tf_sec - 1) * tf_sec
col_tf = db[f'{symbol}_{tf}']
res = col_tf.find({'ts': {'$gte': int(from_),
'$lte': int(int_to_)},
},
sort=[('ts', ASCENDING)]
)
# pprint(list(res))
res = list(res)
"""
实现完全的线上回测效果
以1分钟的数据为最小的;当小级别前进的时候,大级别也只走对应1分钟(部分K线)
"""
if use_partial_k:
col = db[f'{symbol}']