{"id":18743065,"url":"https://github.com/kxsystems/kdb-taq","last_synced_at":"2026-01-26T23:37:03.921Z","repository":{"id":77768906,"uuid":"89848816","full_name":"KxSystems/kdb-taq","owner":"KxSystems","description":"Latest source files for the kdb+taq package","archived":false,"fork":false,"pushed_at":"2025-06-24T14:06:10.000Z","size":15,"stargazers_count":17,"open_issues_count":5,"forks_count":141,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-02T01:43:45.979Z","etag":null,"topics":["kdb","kdb-taq","nyse","nyse-taq","q","quotes","taq"],"latest_commit_sha":null,"homepage":"https://code.kx.com/q","language":"q","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KxSystems.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-30T12:14:48.000Z","updated_at":"2025-06-24T14:06:10.000Z","dependencies_parsed_at":"2025-05-22T06:32:37.174Z","dependency_job_id":null,"html_url":"https://github.com/KxSystems/kdb-taq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KxSystems/kdb-taq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdb-taq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdb-taq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdb-taq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdb-taq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KxSystems","download_url":"https://codeload.github.com/KxSystems/kdb-taq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2Fkdb-taq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28791194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kdb","kdb-taq","nyse","nyse-taq","q","quotes","taq"],"created_at":"2024-11-07T16:09:55.727Z","updated_at":"2026-01-26T23:37:03.909Z","avatar_url":"https://github.com/KxSystems.png","language":"q","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kdb+taq\n\nkdb-taq is a tool for processing and analyzing historical NYSE Daily TAQ (Trade and Quote) data using kdb+/q. This repository contains scripts and utilities to parse, load, and query TAQ datasets efficiently.\n\n## Prerequisites\n\n- [kdb+](https://kx.com/kdb-personal-edition-download/) installed on your machine\n- NYSE Daily TAQ files from [ftp.nyse.com](https://ftp.nyse.com/Historical%20Data%20Samples/DAILY%20TAQ/)\n\n## Getting Started\n\nFollow the steps below to set up and process a TAQ file:\n\n### 1. Download a Sample TAQ File\n\nObtain TAQ data files from the NYSE FTP link. For example:\n\n```bash\nexport DATE=$(curl -s https://ftp.nyse.com/Historical%20Data%20Samples/DAILY%20TAQ/| grep -oE 'EQY_US_ALL_TRADE_2[0-9]{7}' | grep -oE '2[0-9]{7}'|head -1)\nwget https://ftp.nyse.com/Historical%20Data%20Samples/DAILY%20TAQ/EQY_US_ALL_TRADE_$DATE.gz\n```\n\nThese files are ~2GB each so may take significant time to download.\n\n### 2. Clone the Repository\n\nClone the kdb-taq repository to your server:\n\n```bash\ngit clone https://github.com/KxSystems/kdb-taq.git\ncd kdb-taq\n```\n\n### 3. Prepare the Data\n\nCreate a source directory and move the downloaded TAQ file to this and decompress it:\n\n```bash\nmkdir SRC\nmv /path/to/EQY_US_ALL_TRADE_$DATE.gz SRC/\ngzip -d SRC/*\n```\n\n### 4. Process the TAQ Data\n\nRun the `tq.q` script to process the data. Replace `SRC` with the full path to the source directory if necessary:\n\n```bash\nq tq.q -s 8 SRC\n```\n\nThe `-s` option specifies the number of threads (optional).\n\n### 5. Load the Processed Data\n\nLoad the data into the kdb+ environment:\n\n```bash\nq)\\l tq\n```\n\n### 6. Query the Data\n\nYou can now query the loaded data. For example runnning `meta` to see the table schema and datatypes:\n\n```q\nq)meta trade\n\nc                                 | t f a\n----------------------------------| -----\ndate                              | d    \nTime                              | n    \nExchange                          | c    \nSymbol                            | s   p\nSaleCondition                     | s    \nTradeVolume                       | i    \nTradePrice                        | e    \nTradeStopStockIndicator           | b    \nTradeCorrectionIndicator          | h    \nSequenceNumber                    | i    \nTradeId                           | C    \nSourceofTrade                     | c    \nTradeReportingFacility            | b    \nParticipantTimestamp              | n    \nTradeReportingFacilityTRFTimestamp| n    \nTradeThroughExemptIndicator       | b   \n```\n\nAnd run aggregations on the data, for example get the number of trades and the max prices for each hour:\n\n```q\nq)select numTrade:count i,maxPrice:max TradePrice by Time.hh from trade\n\nhh| numTrade maxPrice\n--| -------------------\n1 | 14019    15.0399   \n2 | 28475    15.04391  \n3 | 28535    15.04839  \n4 | 194690   7465      \n5 | 122619   3880      \n6 | 117835   7475      \n7 | 281648   7460      \n8 | 676191   7458.8    \n9 | 7657888  611225.6  \n10| 11303243 611071.8  \n11| 8726594  610600    \n12| 7114388  610980    \n13| 7039454  611065    \n14| 7512397  611679.9  \n15| 16510252 613149.4  \n16| 385603   612600.2  \n17| 145800   7460      \n18| 121943   610668    \n19| 96918    610668    \n20| 6655     8662.955\n\n```\n\n## Changelog\nDetailed update history can be found in [CHANGELOG.md](CHANGELOG.md).\n\n## Best Practices for Integration\n\nYou are welcome to download and use this code according to the terms of the licence.\n\n[KX](kx.com) recommends you do not link your application to this repository,\nwhich would expose your application to various risks:\n\n- This is not a high-availability hosting service\n- Updates to the repo may break your application\n- Code refactoring might return 404s to your application\n\n### Recommendation:\nInstead, download code and subject it to the version control and regression testing\nyou use for your application.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkxsystems%2Fkdb-taq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkxsystems%2Fkdb-taq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkxsystems%2Fkdb-taq/lists"}