4.07K 浏览
0

https://doc.shinnytech.com/tqsdk/latest/reference/tqsdk.objs.html?highlight=%E5%A4%9C%E7%9B%98

classtqsdk.objs.TradingTime(api)

TradingTime 是一个交易时间对象 它不是一个可单独使用的类,而是用于定义 Qoute 的 trading_time 字段的类型

(每个连续的交易时间段是一个列表,包含两个字符串元素,分别为这个时间段的起止点)

day= None
白盘

night= None
夜盘(注意:本字段中过了 24:00 的时间则在其基础往上加,如凌晨1点为 ’25:00:00′ )

因为没有示例程序,没搞懂其具体用法。

yg1025 已回答的问题 2020年12月6日
0

这么久才看到这个帖子,想必你已经找到答案了。如果没有,不妨使用下面两个函数当中的一个来自己界定日盘和夜盘。

如:if (datetime()>(日盘START时的时间戳) and datetime()<(日盘END时的时间戳)

<span class="pre">time_to_ns_timestamp</span>(input_time)
将传入的时间转换为int类型的纳秒级时间戳

<span class="pre">time_to_s_timestamp</span>(input_time)
将传入的时间转换为int类型的秒级时间戳

yg1025 已回答的问题 2020年12月6日
0

它不是一个可单独使用的类,而是用于定义 Qoute 的 trading_time 字段的类型

west 已回答的问题 2020年6月29日