ta模块 select查询为什么会出错?

数据结构是这样 select *  from klineattachments-2021-12-w5oqJQg661c3f36e38e85.png

 

查询就会报错

select *,bBands(close, 5, 2, 2, 0) as `high`mid`low  from kline


错误信息:

The calculated column was not initialized or an exception was raised.


以下案例不会出错 请问是为什么?

close = 7.2 6.97 7.08 6.74 6.49 5.9 6.26 5.9 5.35 5.63 3.81 3.935 4.04 3.74 3.7 3.33 3.64 3.31 2.69 2.72
date = (2020.03.02 + 0..4 join 7..11).take(20)
symbol = take(`F,10) join take(`GPRO,10)
t = table(symbol, date, close) 
select *, bBands(close, 5, 2, 2, 2) as `high`mid`low from t context by symbol
请先 登录 后评论

最佳答案 2021-12-24 10:20

主要问题你的上轨和下轨命名与表中的最高价,最低价字段重名了,如下就可以了:

select *,bBands(close, 5, 2, 2, 0) as `bBand_high`mid`bBand_low  from kline

请先 登录 后评论

其它 0 个回答