Giter Club home page Giter Club logo

kdb-tick-risk's Introduction

kdb-tick-risk

This is a kdb repo for persisting own private data (pnl, risk position, trades, orders). It is an adaptation from https://github.com/KxSystems/kdb-tick/tree/master/tick and https://code.kx.com/q/wp/rt-tick/.

Set up

This project expects you to have kdb+/q installed and the below folder structure:

C:/dev/kdb-tick-marketdata/
├── tick/
│   ├── rtdb.q
│   ├── hdb.q
│   ├── sym.q
│   └── u.q
├── TPlogs/
└── tick.q
└── README.md

To setup the kdb instances, open your command line and go to C:/dev/kdb-tick-risk

  • to start the TP, run: q tick.q sym C:/dev/kdb-tick-risk/TPlogs -p 8000
  • to start the RTDB, run: q tick/rtdb.q localhost:8000 localhost:5002 -p 8001
  • to start the HDB, run: q tick/hdb.q C:/dev/kdb-tick-risk/TPlogs/sym -p 8002

Tables

Tables are defined in tick/sym.q.

How does it work?

You need to setup a Feedhandler (like https://github.com/Arthurim/feedHandlerMarketData) that writes data to the TP. The RTDB subscribes to the TP and the data in the TP is published to the RTDB. At the end of the day the RTDB data is rolled to the HDB. You can create realtime applications that subscribe to the TP as well.

In case the RTDB goes down just restart it and it will replay the TP log files located in TPlogs/.

NB: The RTDB is in memory so it's fast to be queried while the HDB is partitioned so when querying it, always filter by date and sym first.

kdb-tick-risk's People

Contributors

illuvatareru avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.