下面的代码取85根2h的K线,测试时间指定20240501~20240530,1号出来的bar的数量第一天只有7根,往后每天能多取到2根2h(多一天),请问这是为什么?
[Python] 复制代码
bars = history_bars(stock, 85, context.frequency, ['open','high','low','close','datetime'], True, True) # skip_paused=true, include_now=true
print("%s Bars: ask %d (got %d)" % (stock,85,len(bars)))
print("Time open high low close")
for i in range(len(bars)):
print("%s : %.2f %.2f %.2f %.2f" % (str(int(bars[i,4])),bars[i,0],bars[i,1],bars[i,2],bars[i,3]))
15:10:45 > 300308 Bars: ask 85 (got 7)
15:10:45 > Time open high low close
15:10:45 > 20240429113000 : 187.96 189.99 185.59 188.16
15:10:45 > 20240429150000 : 188.17 188.90 185.90 187.70
15:10:45 > 20240430113000 : 187.50 192.70 186.56 187.74
15:10:45 > 20240430150000 : 187.85 188.49 186.13 186.31
15:10:45 > 20240506113000 : 191.00 192.53 184.15 186.82
15:10:45 > 20240506150000 : 187.00 187.00 182.85 183.22
15:10:45 > 20240507113000 : 187.78 188.65 172.50 173.16
补充内容 (2024-5-31 15:32):
15:10:45 > 300308 Bars: ask 85 (got 9)
15:10:45 > Time open high low close
15:10:45 > 20240429113000 : 187.96 189.99 185.59 188.16
15:10:45 > 20240429150000 : 188.17 1... |