I want to calculate value of mavg with every tick. I have OHLCV data which updates in real time with every tick. Please help me.
I have saved it in this file x.zip
Now I want to calculate mavg(om5,3),mavg(hm5,3),mavg(lm5,3),mavg(cm5,3),mavg(vm5,3).
If I calculate directly on tick data (in x.zip) It wont get the desired results.
I want output as under. Here you can see at ts=2022.01.15T16:06:01.139 mavg of 3 places for the column vm5 is (72.9278+36.4143+5.7554) / 3 = 38.3659
y=select * from x limit 26705
select symbol,ts,ts_m5,om5,hm5,lm5,cm5,vm5,mavg(om5,3),mavg(hm5,3),mavg(lm5,3),mavg(cm5,3),mavg(vm5,3 ) from y where isDuplicated([ts_m5,symbol],LAST)==false
And it updates at ts= 2022.01.15T16:06:01.648 to (72.9278+36.4143+5.7559) / 3 = 38.366
select symbol,ts,ts_m5,om5,hm5,lm5,cm5,vm5,mavg(om5,3),mavg(hm5,3),mavg(lm5,3),mavg(cm5,3),mavg(vm5,3 ) from x where isDuplicated([ts_m5,symbol],LAST)==false
I have tried many thing like using tmavg for 15min but it did not work. The results are very different. As shown under.
please refer https://ask.dolphindb.net/question/1140 for updates and / or solutions