get_current_kline_count - 获取股票业务当前时间的分钟bar数量
get_current_kline_count 是 PTrade 中用于获取股票业务当前时间的分钟bar数量的接口。
原型
get_current_kline_count()
释义
get_current_kline_count 是 PTrade 中用于获取股票业务当前时间的分钟bar数量的接口。
研究:支持;回测:支持;模拟:官方目录未明确;实盘:支持。
参数
官方结构化目录未列出独立参数。请以本页函数签名和下方官方原文为准。
返回值
当前时间的分钟bar数量(int)
示例
def initialize(context):
g.security = '600570.SS'
set_universe(g.security)
def handle_data(context, data):
log.info(get_current_kline_count())
详细说明
get_current_kline_count()
使用场景
该函数在回测、交易、研究模块可用
接口说明
该接口获取当前时间股票的k线根数。
注意事项
回测中返回回测日当前时间的分钟bar数量。
研究中返回最新交易日当前时间的分钟bar数量,非交易日执行均返回0。
交易中返回最新交易日当前时间的分钟bar数量。
参数详细说明
无
返回值
当前时间的分钟bar数量(int)