参照demo执行时报All argumentsmust have the same length.

参照https://ask.dolphindb.net/article/16的demo执行下列代码:

edifier=select * from loadTable("E:/DolphinDB/data(20230616)/Stocks_Kline","usstock_daily_line_yh") where Code='TSLA'date(Date between 2916.89.1:2916.9.39
num=exec count(*) from edifierstock=selectfrom loadTable("E:/DolphinDB/data(20230616)/stocks Kline""usstock_daily_line_yh"
defg square sum(x,y)return sum2(x-y)
corrTablel-select (ode, movedate(Date),num-1) as beginDate, date(Date) as endbate, moving(sqvare sum,(edifier.Pct_changePct change), num) as distance from stock context by Code

attachments-2023-10-NBAldiq9651c3829baca2.png

报错:

attachments-2023-10-cyvsIEkI651c37e3119ee.png不明白错在哪里了

请先 登录 后评论

1 个回答

wale

利用部分应用把edifier.pct_change作为square_sum的固定参数,例如:



def square_sum(x,y):sum2(x-y)
corrTable1=select ts_code,move(date(trade_date),num-1)as beginDate,date(trade_date) as endDate,moving(square_sum{edifier.pct_change},pct_change,num) as distance from stock context by ts_code
请先 登录 后评论