[PYTHON]為何用pel_history_bars取到的數據都是時間為毫秒的數據?
作者:金字塔 來源:cxh99.com 發布時間:2021年01月23日
-
咨詢內容:
[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線時間對應上?
?
?來源: CXH99.COM
-
金字塔客服:
這個不是時間,是你記錄log時候的電腦時間你輸出的是close價格并沒有輸出時間
?
-
用戶回復:
明白了,謝謝!