以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://222.73.7.161/bbs/index.asp) -- 高级功能研发区 (http://222.73.7.161/bbs/list.asp?boardid=5) ---- [PYTHON]为何用pel_history_bars取到的数据都是时间为毫秒的数据? (http://222.73.7.161/bbs/dispbbs.asp?boardid=5&id=183543) |
-- 作者:joe1328 -- 发布时间:2020/12/20 10:29:55 -- [PYTHON]为何用pel_history_bars取到的数据都是时间为毫秒的数据? [PYTHON]为何用pel_history_bars取到的数据都是时间为毫秒的数据?
代码如下
def handle_bar(context):
close = pel_history_bars(context.long_period+1 ,\'close\')
#调试打印输出
log_debug_info(\'d:\\pel_test_log.txt\',str(close[context.long_period:]))
pel_test_log.txt的文件内容截取如下:
2020-12-20 10:22:45.775 []
2020-12-20 10:22:45.776 []
2020-12-20 10:22:45.776 []
2020-12-20 10:22:45.777 []
2020-12-20 10:22:45.777 []
2020-12-20 10:22:45.778 [2547.16357422]
2020-12-20 10:22:45.778 [2551.25708008]
2020-12-20 10:22:45.779 [2553.30371094]
2020-12-20 10:22:45.779 [2552.28051758]
2020-12-20 10:22:45.780 [2553.30371094]
2020-12-20 10:22:45.780 [2552.28051758]
2020-12-20 10:22:45.781 [2554.32714844]
2020-12-20 10:22:45.782 [2555.35058594]
2020-12-20 10:22:45.782 [2549.21020508]
2020-12-20 10:22:45.783 [2551.25708008]
2020-12-20 10:22:45.783 [2554.32714844]
2020-12-20 10:22:45.784 [2560.46728516]
2020-12-20 10:22:45.784 [2559.4440918]
2020-12-20 10:22:45.785 [2557.3972168]
2020-12-20 10:22:45.785 [2557.3972168]
2020-12-20 10:22:45.786 [2557.3972168]
2020-12-20 10:22:45.786 [2558.4206543]
2020-12-20 10:22:45.787 [2555.35058594]
2020-12-20 10:22:45.787 [2554.32714844]
2020-12-20 10:22:45.788 [2552.28051758]
2020-12-20 10:22:45.788 [2554.32714844]
2020-12-20 10:22:45.789 [2552.28051758]
2020-12-20 10:22:45.789 [2555.35058594]
2020-12-20 10:22:45.790 [2554.32714844]
2020-12-20 10:22:45.790 [2556.3737793]
2020-12-20 10:22:45.791 [2556.3737793]
2020-12-20 10:22:45.791 [2555.35058594]
2020-12-20 10:22:45.792 [2559.4440918]
2020-12-20 10:22:45.792 [2558.4206543]
2020-12-20 10:22:45.793 [2558.4206543]
2020-12-20 10:22:45.793 [2559.4440918]
2020-12-20 10:22:45.794 [2560.46728516]
2020-12-20 10:22:45.794 [2557.3972168]
2020-12-20 10:22:45.795 [2555.35058594] 设想中在PEL调用时,在3分钟界面应该出现的是每根3分钟K的收盘价数据,但实际出来的是毫秒数据.仔细核对了一下,又发现数据其实是对的(也就是取出来的收盘价数据能和K线图的数据对得上),只是时间不对,请问我是哪里没处理好?要怎么样才能和3分钟的K线时间对应上? |
-- 作者:yukizzc -- 发布时间:2020/12/20 18:30:05 -- 这个不是时间,是你记录log时候的电脑时间 你输出的是close价格并没有输出时间
|
-- 作者:joe1328 -- 发布时间:2020/12/20 19:16:21 -- 明白了,谢谢! |