Shena Mao
Shena Mao

性别: 注册于 2021-07-23

向TA求助
20金币数
640 经验值
1个粉丝
主页被访问 2573 次

46 个回答

0 赞同

How to do ema on reactive state engine excluding NULL values

Happy Lunar New Year! What kind of result do you want to get? As you know that if you drop null value, there would be only 9 records. However, other columns contain thousand. If you want your result filling each row, you could do ema(filter condition to drop null value when subscribe) and other me...

回答于 2022-02-02 14:27

0 赞同

Need suggestion to improve my code for Real Time OHLCV

2) you could do "(msum(close,4)-close)\3" in metrics 3) why you want to join all the results with different time levels? It feels better to show the results separately. And if you want to share your experience on using DolphinDB, we would like you write some blogs and share them in our community.

回答于 2022-01-25 18:00

0 赞同

Select last n rows of data from keyedTable and append to rea...

Using keyedTable and append to Engine is really hard, since every update needs to be appended to Engine. You can write a for loop to do that. If you want to keep last data, try this: share streamTable(10:0,`symbol`ts`ts_m5`om5`hm5`lm5`cm5`vm5,[SYMBOL,TIMESTAMP,TIMESTAMP,DOUBLE,DOUBLE,DOUBLE,DOUBLE...

回答于 2022-01-25 17:12

0 赞同

Please understand my problem and help me solve it 请理解我的...

here is a sample of how to get mavg using updated close price. Firstly using CrossSectionalEnginge to get the last records and then using RSE to calculate mavg. x is the data you shared. share streamTable(10:0,`symbol`ts`ts_m5`om5`hm5`lm5`cm5`vm5,[SYMBOL,TIMESTAMP,TIMESTAMP,DOUBLE,DOUBLE,DOUBLE,DO...

回答于 2022-01-19 12:15

1 赞同

need suggestion on how to achieve this

1. You are using "first(price)" to caluculate open price(o5), therefore, the output data is correct. The window size is 5 minutes and it slides on each record(your step is 1min). Just using multiple engines with subscribing the same source data and you could get outputs over multiple time horizons....

回答于 2022-01-14 10:51

0 赞同

dolphindn version:1.30.0.12 streamTable无法找到,无法被解析...

你好,你这边用的是DolphinDB的Python API,1.30.0.12是Python API的版本,而非DolphinDB server的版本。Python API的调用也是基于server的,所以你这边要确保server是正常打开的状态。具体Python API的用法请参考这篇教程:dolphindb/api_python3 (gitee.com) 在python端创建流表的方法可以参考以下两种: import dolphi...

回答于 2022-01-13 17:05

0 赞同

full join时,如何将matchingCols合并,并且避免列出所有列名?

可以通过dropColumns!这个函数,drop多余的列。这样就不用列出所有列名了。参考下面的例子: t1= table(1 2 3 3 as id, 7.8 4.6 5.1 0.1 as value);t2 = table(5 3 1 as id,  300 500 800 as qty);a = (select iif(id==NULL, t2.id,id) as id, * from fj(t1, t2, `id)).dropColumns!(`t2_id`t1_id)a

回答于 2022-01-13 11:11

0 赞同

DolphinDB有窗口函数,每个窗口包含前几行以及后几行吗?

1.30.16以及2.00.4版本开始有这样的函数的,window: 可以参考:https://www.dolphindb.cn/cn/help/200/Functionalprogramming/TemplateFunctions/window.html 。 这个需求的写法可以参考以下,运用iif和window,赋值得到结果: t = table(rand(1..100,20) as id, rand(`a`b`c, 20) as v)select *, iif(id==window(min, id...

回答于 2022-01-12 10:05

0 赞同

create daily timeseries engine for 30 mins which aligns data...

using forceTriggerTime = 60, and waiting for 2 more minutes, you could get what you want. share streamTable(1000:0, `ts`sym`volume, [DATETIME, SYMBOL, INT]) as tradesoutput1 = table(10000:0, `time`sym`sumVolume, [DATETIME, SYMBOL, INT])agg1 = createDailyTimeSeriesEngine(name="agg1", windowSize=60*3...

回答于 2022-01-11 18:21

0 赞同

如何在update中动态传参,包括复杂表达式

可以参考下面的例子,sqlUpdate和sqlColAlias连用来解决。更多用法可以参照元编程:https://www.dolphindb.cn/cn/help/200/Objects/Metaprogramming.html t1=table(`A`A`B`B as symbol, 2021.04.15 2021.04.16 2021.04.15 2021.04.16 as date, 12 13 21 22 as price)b = `pricec = t1.pricedef ufunc(b){ return b+1}sqlUp...

回答于 2022-01-06 16:06