问题一报错原因应该是你原始分钟线数据造成的,你的time列数据应该是DATETIME格式,也就是2020.10.06T13:01:00,而不是TIMESTAMP格式2020.10.06T13:01:00.000
解决方法:price_min[`timestamp]=[timestamp(price_min.time)];
sessionsStart=09:30:00.000 13:00:00.000
barMinutes = 30
OHLC = select first(open) as open, max(high) as high, min(low) as low, last(close) as close from price_min group by symbol, dailyAlignedBar(timestamp, sessionsStart, barMinutes*60*1000) as barStart
问题二 你改成sessionsStart=09:30:00 13:00:00 后面的barMinutes601000就不能*1000
sessionsStart=09:30:00 13:00:00
barMinutes = 30
OHLC = select first(open) as open, max(high) as high, min(low) as low, last(close) as close from price_min group by symbol, dailyAlignedBar(time, sessionsStart, barMinutes*60) as barStart
还有个问题,你要看看你的分钟线数据起始第一根bar是什么时间点,如果类似聚宽分钟线2020.10.06T09:31:00这样的。就必须改为sessionsStart=09:31:00 13:01:00
现在dolphindb的技术迭代很快,很多新的高级函数用起来方便很多,去年初实现上述数据处理还得自编函数来实现。
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…