"Exchange.GetRecords (Exchange.GetRecords) "と"Log (Log) "の"現在のKライン (Line) "と"最新の (Line) "の"Log (Line) "と"Log (Line) "の"Line (Line) "と"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "と"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line) "の"Line (Line (Line) "の"Line (Line (Line) "の"Line (Line (Line (Line) "["K線を上線する"[-2])
記録はここにある[-1]は最新k線です. 最近k線は,何ですか? 例えば,周期を5分に設定すると,現在9時32分だとしたら, record=exchange.GetRecords(PERIOD_M5) record[-1][閉店の最新価格は9時32分ですか? それとも9時30分ですか?
つまり,もし私が設定した周期が終わらなかったら,価格はどうなるでしょうか?
我还想问一个问题,我record[-1]['Time']获得是时间戳怎么转换成本地时间啊,我百度了结果搞出来不对,大佬帮我看看,我用的python
'''
start: 2021-08-02 00:00:00
end: 2021-08-03 00:00:00
period:1h
exchanges: [{"eid":"okex","currency":"BTC_USDT","stocks":0}]
'''
import numpy as np
import pandas as pd
import time
import datetime
from fmz import* # 导入所有FMZ函数
task = VCtx(doc) # 初始化
while True :
record = exchange.GetRecords()
time1 = record[-1]['Time']
time_local = time.localtime(time1)
time2 = time.strftime("%Y-%m-%d %H:%M:%S",time_local)
print(time2)
输出结果是这个53554-11-28 00:00:00
- 1
