kdb+ and q
Q+A on all things kdb+ database and the q language
cancel
Showing results for 
Search instead for 
Did you mean: 

Forum Posts

peach type error

Hello,Wondering if someone can tell me whats wrong with this. I have 2 slavesthis works{ (neg .z.w) [((count x) ; x)] } each (100000 cut (select from trade where date=2015.07.23, sym in `AAPL`GOOG))but this gives a type error{ (neg .z.w) [((count x) ...

getting the last 2 rows of each group

how do i go about getting the last two rows in a group?q)show t:flip `a`b!(1 1 2 3 3 3;til 6);a b---1 01 12 23 33 43 5q)select[-2] by a from ta| b-| -2| 23| 5q)select b by a from ta| b -| -----1| 0 1 2| ,2 3| 3 4 5the result i'd like is:a b---1 01 12...

effbiae by New Contributor
  • 463 Views
  • 1 replies
  • 0 kudos

Wilder's Directional Indicators

I'm trying to get the DI+ and DI- from High Low and Close as described here:http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:average_directional_index_adxBut I don't know how to calculate differently the first rows than the...

Francisco by New Contributor
  • 1542 Views
  • 7 replies
  • 0 kudos

Dictionary Bug?

q)d:(0 1;(0 1;2 3);4)!`a`b`cq)d0 1 | a(0 1;2 3)| b4 | cq)a[0 1]'aq)a[0 1;2 3] / bug ?'aq)a[(0 1;2 3)] / bug ?'aq)a[4] / bug'aq)a[5] / bug?'a

q insight pad setup

Hi friends,I have installed kdb on my local machine and now I am trying to connect with it with q pad.While I try to set new server (the very first step), I am specifying server name as blank (nothing) and 5000 as a port value but I am not able to co...

N_V by New Contributor
  • 1062 Views
  • 3 replies
  • 0 kudos