--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at https://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
Hi Roni,There is a good general purpose function that Stephen Dempsey posted a few years back based on moving windows:fwv:{x/'[flip reverse prev\[y-1;z]]}// Moving medianfwv[med;3;til 10]// Raw data outputfwv[(::);3;til 10]Thanks,Kevin
On 13 April 2018 at 15:21, Roni Hoffman <hoffm...@gmail.com> wrote:
Hello All,Is there a good way to get the moving median? I see mavg, but would like to get the moving median by sym and can't quite figure out the best way to do it. I'm sure its pretty easy but I'm missin it.Thanks!
--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbpl...@googlegroups.com.
To post to this group, send email to personal...@googlegroups.com.
update mmed:med each {[w;s] {(neg &[x;count t])#t:y,z}[w]\[s]}[3;price] by sym from quote
time sym src price mmed
----------------------------------
00:00:00.152 APPL GETGO 100 100
00:00:00.179 APPL GETGO 300 200
00:00:00.293 NYSE DB 100 100
00:00:00.378 NYSE SUN 300 200
00:00:00.494 NYSE BARX 100 100
00:00:00.577 APPL GETGO 300 300
00:00:00.951 CAT GETGO 200 200
00:00:01.041 CAT GETGO 200 200
00:00:01.149 APPL SUN 100 300
00:00:01.173 NYSE BARX 300 300
00:00:01.194 CAT DB 200 200
00:00:01.276 NYSE GETGO 50 100
00:00:01.417 GOOG DB 200 200
00:00:01.944 APPL DB 200 200
00:00:02.157 APPL GETGO 100 100
00:00:02.490 GOOG GETGO 300 250
00:00:02.688 CAT DB 200 200
00:00:02.741 CAT DB 200 200
00:00:02.809 APPL SUN 200 200
00:00:03.037 NYSE DB 50 50