mhxiang
mhxiang

性别: 注册于 2021-12-09

向TA求助
15金币数
1230 经验值
0个粉丝
主页被访问 2198 次

最近动态

2022-11-24 17:36 回答问题

取第nextN行的P值用下标索引,取未来nextN行记录中的最大值可以使用dolphindb的eachRight函数和loop函数实现 p = 100..105 nextN = 1 2 3 1 1 1 tb=select * ,p[ nextN + til(p.size())] as nextNp,eachRight(def(x,range)->x.subarray(range).max(), p, loop(pair, 1..p.size(), 1..p.size() + nextN)) as

2022-11-24 11:06 回答问题

可以通过元编程sqlColAlias实现 sql(sqlColAlias(makeCall(ff,sqlCol(`s)),`a+string(1..60)),table(rand(1.0,10) as s)).eval() a1 a2 a3 a4 a5 a6 ... ----------------- ------------

2022-11-24 10:51 回答问题

通过tb[`col][2]获取b列的第3行 tb=table(rand(1.,50) as a,rand(2.,50) as b,rand(2.,50) as c) tb[`b][2] print(tb[`b][2])

2022-11-24 10:10 回答问题

把AskPriceBook和AskVolumeBook转化为DOUBLE[] 再append 例 result = table(10:0, `SecurityID`BidPriceBook`AskPriceBook `BidVolumeBook`AskVolumeBook`Time, [SYMBOL,DOUBLE[], DOUBLE[], INT[], INT[], TIME]) SecurityID = string(100000) BidPriceBook = array(DOUBLE[], 0,

2022-11-15 17:20 回答问题

可以使用binaryExpr和unifiedExpr实现以上的功能 n=10 colNames=`wd_nBidPrice+string(1..n) weights=1..n\10 weights_ = array(ANY, size(weights)).fill!(1..size(weights)-1, weights) selects = sqlColAlias(unifiedExpr(binaryExpr(sqlCol(colNames), weights_, *), take(+, size(we

2022-11-04 17:03 发起提问

2022-11-04 11:12 发起提问

2022-11-03 16:39 回答问题

可以使用ffill实现前值填充,如下 date=2022.01.01+1..50 factor=1..50*1.0 code =take(`A`B,50) select date,code,factor,ffill(iif(0..(size(date)-1) in (5*(0..(size(date)/5))),factor,NULL)) from table(date,code,factor) context by code date code factor ffill ---------

2022-10-20 09:32 回答问题

在dolphindb中可以通过concat函数实现,动态生成字符数组可以通过each实现 periods=1..5 concat(each(x->string(x)+`D,periods),',') 1D,2D,3D,4D,5D

2022-10-19 14:39 回答问题

矩阵转化为表时会丢失行标签。先通过join把行标签连接起来,再用unpivot t = table(2022.10.18 2022.10.19 2022.10.20 as Date, `sh600000`sh600002`sh600003 as Code, 1.0 2.0 3.0 as Price) m = exec Price from t pivot by Date, Code t=table(m.rowNames() as date) join table(m) t=t.unpivot(`d