统计符合价格波动上下限的记录数

假设有如下表,有没函数能统计出符合条件的close的个数

ts=2024.04.01T09:30:00.000 +(1..6)*1000*60 close=121.043 120.906 120.516 120.924 121.008 121.012 t=table(ts, close)

attachments-2024-04-lc0YNwyy6612547e04037.png


以各自行的close为准,符合波动在0.1%的close的

请先 登录 后评论

1 个回答

peter

方法一:

sum:E close between:R pair:E(0.999*close, 1.001*close)

方法二:

def ft(close, c): sum(0.999*c<close<c*1.001)
select each(ft{close}, close) as cnt from t


output:

[4,4,1,5,5,5]

请先 登录 后评论
  • 1 关注
  • 0 收藏,89 浏览
  • wfHuang 提出于 2024-04-07 16:35

相似问题