DolphinDB技术分析模块查询select子句出错
Error occurs in select clause querying for technical analysis module in DolphinDB
图片显示 table 架构:
查询数据时该行报错:
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
为什么会出现错误,如何在我的代码中避免它?
出现此错误是因为列的名称与布林带的上行和下行一致。
您可以使用以下代码:
select *,bBands(close, 5, 2, 2, 0) as `bBand_high`mid`bBand_low from kline.
图片显示 table 架构:
查询数据时该行报错:
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
为什么会出现错误,如何在我的代码中避免它?
出现此错误是因为列的名称与布林带的上行和下行一致。
您可以使用以下代码:
select *,bBands(close, 5, 2, 2, 0) as `bBand_high`mid`bBand_low from kline.