Archive Page 10
November 12th, 2013 by John Dempster
qStudio is an IDE for kdb+ database by kx systems that allows querying kdb+ servers, charting results and browsing server objects from within the GUI.
Version 1.29 of qStudio is now available:
http://www.timestored.com/qstudio/
Changes in the latest version include a new dark theme for charts and the ability to run multiple instances of qStudio.
The changes were added as a few people had asked for a dark theme due to eye strain from staring at the white charts.
If you have any ideas for what you would like to see in the next version please let me know.
john AT timestored DOT com
Here’s a preview of a time series graph:

qStudio with a dark time series chart


October 29th, 2013 by John Dempster
The Annual kdb+ London User Group Conference has been scheduled for Tuesday November 12th 2013. The speaker Line up includes:
-
Simon Garland – Kx -Things you might have missed in 3.1
-
NYSE Technologies – Tick as a Service & Data Dispatch
-
David Fallon – Credit Agricole – Using kdb+ for FX Trade Analysis
-
Andy Wisbey –First Derivatives plc – Using kdb+ for Real-Time Surveillance
FD kdb+ Consultants
- Efficient portfolio analysis using linked columns in kdb+
-
Permissions in kdb+
-
Multi-threading in kdb+: performance optimisations and use cases
October 28th, 2013 by John Dempster
Typical feed handlers for kdb+ are for market data and trade data such as bloomberg B-Pipe or reuters market feeds. These feeds typically contain ticker symbol, bid price, ask price and the time. We’ve been working on something a little different, a twitter feed handler. With this feed handler you can subscribe to:
- A random sample of all tweets
- Certain search queries
- Locations, tweets for any trending queries will be downloaded for those areas
For each tweet we have associated meta data that includes: location, language, time of posting and number of favourites/retweets.
Now that we have our data in kdb+ we can analyse it like any other time-series data and look for interesting patterns. If you have worked on anything similar I would love to hear about it (john AT timestored.com). I find treating social media data as time-series data throws up many interesting possibilities, in future blog posts I’ll start digging into the data..
At TimeStored we have previously implemented a number of market data feed handlers. Handling reconnections, failover, data backfilling and data enrichment can be a tricky problem to get right, if you need a feed handler developed we provide kdb+ development, consulting and support services, please contact us.
Basic examples of Java kdb+ Feed handlers and C Feed Handlers are available on the site.
July 8th, 2013 by Ryan Hamilton
qStudio is an editor for kdb+ database by kx systems. Version 1.28 of qStudio is now available for download:
http://www.timestored.com/qstudio/
Changes in the latest version include:
- Added Csv Loader (pro)
- Added qUnit unit testing (pro)
- Bugfix to database management column copying.
- Export selection/table bugs fixed and launches excel (thanks Jeremy / Ken)
The Kdb+ Csv Loader allows loading local files onto a remote kdb+ server easily from within a GUI.

For step-by-step instructions see the qStudio loader help.
qUnit allows writing unit tests for q code in a format that will be familiar to all those who have used junit,cunit or a similar xunit based test framework. Tests depend on assertions and the results of a test run are shown as a table like so:

Tests are specified as functions that begin with the test** prefix and can have time or memory limits specified.
June 24th, 2013 by admin
http://www.kx.com/press-releases-130610.php
Palo Alto (10 Jun 2013) – Kx Systems, the leader in high-performance database and time-series analysis, has announced today the release of kdb+ v3.1 as well as its latest benchmark results for the STAC (Securities Technology Analysis Center) summit in Chicago. The results of the STAC M3™ vendor-independent market data benchmark suite demonstrate very significant performance improvements in v3.1, with results up to 8x faster than any previous STAC M3 benchmarks.
STAC ReportThe tests highlighted Kx’s unparalleled performance in such real-world calculations as generating the complete NBBO (National Best Bid and Offer) for one day, on thousands of symbols. Compared to previous best results, v3.1 runs over 4x faster, taking about half a minute to read, calculate, and write the entire table. In other benchmarks, calculations such as VWAPs (Volume Weighted Average Prices) on tick data were more than 8x faster….
It’s great to see kx continue to make speed improvements.
May 26th, 2013 by admin
Andrey Zholos announced a new version of q Math Library:
qml 0.4 is out:
http://althenia.net/qml
Now compatible with kdb+ 3.0 and whatever implementation of LAPACK your
distro provides.
Thanks to everyone who prompted me to continue working on this, and
especially to Jim Schmitz for his invaluable ideas, Kim Kuen Tang
for providing an interim version, and Kx for making a binary-
incompatible change to the interface
If there’s a permissively-licensed numerical library you’d like to see
included in the next version, let Andrey know. Or just submit a patch.
May 15th, 2013 by Ryan Hamilton
Sanket Agrawal just posted some very cool code to the k4 mailing list for finding the longest common sub-sequences. This actually solves a problem that some colleagues had where they wanted to combine two tickerplant feeds that never seemed to match up. Here’s an example:
q)/ assuming t is our perfect knowledge table
q)t
time sym size price
------------------------
09:00 A 8 7.343062
09:01 A 0 5.482385
09:02 B 5 8.847715
09:03 A 1 6.78881
09:04 B 5 3.432312
09:05 A 0 0.2801381
09:06 A 2 3.775222
09:07 B 3 1.676582
09:08 B 7 7.163578
09:09 B 4 3.300548
Let us now create two tables, u and v, neither of which contain all the data.
q)u:t except t 7 8
q)v:t except t 1 2 3 4
q)u
time sym size price
------------------------
09:00 A 8 7.343062
09:01 A 0 5.482385
09:02 B 5 8.847715
09:03 A 1 6.78881
09:04 B 5 3.432312
09:05 A 0 0.2801381
09:06 A 2 3.775222
09:09 B 4 3.300548
q)v
time sym size price
------------------------
09:00 A 8 7.343062
09:05 A 0 0.2801381
09:06 A 2 3.775222
09:07 B 3 1.676582
09:08 B 7 7.163578
09:09 B 4 3.300548
We can find the indices that differ using Sankets difftables function
q)p:diffTables[u;v;t `sym;`price`size]
q)show p 0; / rows in u that are not in v
1 2 3 4
q)show p 1; / rows in v that are not in u
3 4
/ combine together again
q)`time xasc (update src:`u from u),update src:`v from v p 1
time sym size price src
----------------------------
09:00 A 8 7.343062 u
09:01 A 0 5.482385 u
09:02 B 5 8.847715 u
09:03 A 1 6.78881 u
09:04 B 5 3.432312 u
09:05 A 0 0.2801381 u
09:06 A 2 3.775222 u
09:07 B 3 1.676582 v
09:08 B 7 7.163578 v
09:09 B 4 3.300548 u
q)t~`time xasc u,v p 1
1b
The code can be downloaded at:
http://code.kx.com/wsvn/code/contrib/sagrawal/lcs/miller.q
http://code.kx.com/wsvn/code/contrib/sagrawal/lcs/myers.q
Thanks Sanket.
Algorithm details:
Myers O(ND): http://www.xmailserver.org/diff2.pdf
Miller O(NP): http://www.bookoff.co.jp/files/ir_pr/6c/np_diff.pdf
April 2nd, 2013 by admin
The excellent Q For Mortals: A Tutorial In Q Programming by Jeffry Borror will soon be updated to version 3.
Jeff mentioned it at the recent NY user meeting.
You can read q for mortals online for free at: http://code.kx.com/wiki/JB:QforMortals2/contents
version 2 – added a new chapter on kdb database disk storage.
He said to get in touch if there’s anything you feel you would really like added.
UPDATE December 2015
q for mortals 3 is now out.
Q for Mortals Version 3 is a thorough presentation of the q programming language and an introduction to the kdb+ database. It is a complete rewrite of the original Q for Mortals that is current with q3.3. The presentation is derived from classes taught by the author at international financial institutions over the last decade. It is a series of tutorials based on q snippets intended to be entered interactively into the q console by the reader. The text takes its subject seriously but not itself. Technical explanations are augmented by mathematical observations, references to general programming concepts and other programming languages, and bad jokes. Coding style recommendations and advice to avoid gotchas appear liberally throughout. Examples are as simple as they can be but no simpler.
- Chapter 1, Q Shock and Awe, provides a piquant panorama of the power of q and its dazzling zen-like nature.
- Chapter 2 describes the base data types of q.
- Chapter 3 discusses lists, the fundamental data structure of q
- Chapter 4 presents the basic operators.
- Chapter 5 introduces dictionaries, which associate keys and values.
- Chapter 6 presents an in-depth description of functions and q’s constructs for functional programming.
- Chapter 7 demonstrates transforming data from one type to another.
- Chapter 8 introduces tables and keyed tables, the fundamental data structures for kdb.
- Chapter 9 describes q-sql and all the methods to manipulate tables.
- Chapter 10 presents ways to control execution of q programs.
- Chapter 11 covers file and interprocess communication I/O
- Chapter 12 describes workspace organization and management.
- Chapter 13 discusses system commands and command line parameters.
- Chapter 14 serves as an introduction to the kdb+ database. M
Available at all good bookstores.
http://www.amazon.com/For-Mortals-Version-Introduction-Programming/dp/0692573674
qTips is also good: http://www.amazon.co.uk/Tips-Fast-Scalable-Maintainable-Kdb/dp/9881389909
April 2nd, 2013 by admin
Added four new tutorials for those starting to learn kdb:
March 27th, 2013 by admin
q Code File Browser and Adding Multiple Kdb Servers

Added IDE Features:
- Add File Tree that allows browsing directory and providing autocomplete
- qDoc supports custom user tags (Thanks Aaron)
- Allow adding/exporting whole lists of servers at once (much quicker)
- Installers are now signed.
- Ctrl-D “goto definition” of function to open that file/position
- (PRO) Unit Testing and function profiling partially integrated.