apply ema & similar function on array vector

Hi, I want to apply ema and similar functions (like mmad, mavg, mwavg, msum etc.) on array vector. (ie suppose a row of table as array vector is  [1,4,1,2], now I want to calculate  msum with 3 places the desired result will be  [NULL,NULL,6,7])


1) Please guide me how to do.

2) Is it possible to apply these functions on array vector in reactive state engine ?


Code:-

t = table(1:0, `id`price`val, [INT, DOUBLE[], INT[]]);

t.tableInsert([1,2,3,4], [[1.1,1.2,1.3,1.2], [1.3,1.2,1.0,1.4], [1.0,1.4,1.1, 1.4], [1.1, 1.4, 1.0,1.4]], [[1,2,4,1],[1,4,1,2],[2,5,4,1],[3,7,5,6]])

Now I want to calculate ema(price,2) and msum(val,3) for each array vector. The input table and desired output is shown below.

attachments-2022-02-bvVJPaBn6201103bb96ec.png


Reply as soon as possible.

请先 登录 后评论

最佳答案 2022-02-10 21:25

refer to https://ask.dolphindb.net/question/1157

array Vector in reactiveStateEngine will supported by next version. However, adding the function of calculating msum among array vector is not part of the plan of next version. It may be realized at least after next version.

请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,1157 浏览
  • Vishvesh Upadhyay 提出于 2022-02-07 20:28

相似问题