reverse aj aka find the next element after a time

436 views
Skip to first unread message

naveen sharma

unread,
May 31, 2016, 12:13:48 AM5/31/16
to Kdb+ Personal Developers
I frequently face the need to find the next element (bid/ask/trade) after an event/signal. I was wondering if there is a reverse aj trick which i am missing.
currently I use a hackish approach where I subtract time from a large/eod time and then do an aj which I think gives me the needful. Has some one tried anything similar, wanted to confirm also if my approach is sound.

Regards

David Demner

unread,
May 31, 2016, 12:22:29 AM5/31/16
to Kdb+ Personal Developers
Usually I define ajr to be exactly aj but with binr instead of bin
--
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.
Visit this group at https://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.

This e-mail message is intended to be received only by persons entitled to receive the confidential information it may contain. E-mail messages to clients of AquaQ Analytics may contain information that is confidential and legally privileged. Please do not read, copy, forward, or store this message unless you are an intended recipient of it. If you have received this message in error, please forward it to the sender and delete it completely from your computer system

naveen sharma

unread,
May 31, 2016, 12:24:30 AM5/31/16
to Kdb+ Personal Developers
thanks! that's a much better approach imo


On Tuesday, May 31, 2016 at 9:52:29 AM UTC+5:30, David D wrote:
Usually I define ajr to be exactly aj but with binr instead of bin

From: naveen sharma
Sent: Monday, May 30, 2016 21:13
To: Kdb+ Personal Developers
Subject: [personal kdb+] reverse aj aka find the next element after a time

I frequently face the need to find the next element (bid/ask/trade) after an event/signal. I was wondering if there is a reverse aj trick which i am missing.
currently I use a hackish approach where I subtract time from a large/eod time and then do an aj which I think gives me the needful. Has some one tried anything similar, wanted to confirm also if my approach is sound.

Regards

--
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 persona...@googlegroups.com.

naveen sharma

unread,
May 31, 2016, 12:37:20 AM5/31/16
to Kdb+ Personal Developers
Hi David, 
need a little more help, I tried doing the below but it gives an error saying "/"
Is there any escaping or low level changes I need to do?

ajr: {.Q.ft[{d:x_z;$[&/j:-1<i:(x#z)binr x#y;y,'d i;+.[+.Q.ff[y]d;(!+d;j);:;.+d i j:&j]]}[x,();;0!z]]y}

Jack Andrews

unread,
May 31, 2016, 12:41:44 AM5/31/16
to Kdb+ Personal Developers
prefix with k)

k)ajr:{ ..

To post to this group, send email to personal...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages