Skip to content
/ kdbplus Public
forked from shahrzl/kdbplus

A repository for q/kdb+ programs.

License

Notifications You must be signed in to change notification settings

fmvin/kdbplus

 
 

Repository files navigation

kdbplus

A repository for q/kdb+ programs. For more details on q/kdb+ visit www.kx.com.

Keywords: Binomial Model, Black-Scholes Equation, Implied Volatility, Smile, Options Pricing, Delta Hedging, Risk Neutral Distribution, Physical Distribution, Statistics, Portfolio Tracking, Tickerplant, Web Socket, JQuery UI.

Blog: https://arjunadelta.wordpress.com

###What's New?

Portfolio Tracker version 0.4 is now available under /portfolioTracker directory.

New features in version 0.4:

  • Enhancements to support strategy backtesting by replaying historical tick data.
  • Historical tick data is sourced from http://www.netfonds.no. Of course you can use other sources, but may require editing of timersvc.q under /histTickData directory.

Screenshot: ptr0 2-2

Delta Hedging Simulator is now available under /deltaHedging directory.

Screenshot:

deltahedge3

###Projects:

  1. Binary and Barrier Options Pricing.
  • Here we tried to price two types of options. The Higher and the No Touch which are available on binary.com website.
  • Volatility are considered to be constant. Here I used Implied Volatility calibrated based on price available from binary.com website.
  • 1-month LIBOR is used as risk free rate.
  • FX rates data is sourced from Yahoo Finance.
  • Communication between back end and front end is done using Web Socket.

References:

  1. Implied Risk Neutral Distribution.

References:

  • Shimko, David C(1993): "Bounds of Probability", Risk, 6, 33-7

Screenshot:

irnd

  1. Portfolio Tracker.
  • Demonstrate the use of feed handler, tickerplant as well as tick subscriber.
  • Market data is sourced from Yahoo Finance. Please note that it is a delayed tick data.
  • A feed handler based on Random Walk Simulation is also available so that application can be tested during market close. This simulator can be found under feedHandler/randomWalkSim directory. The file is feedsimR.q.
  • PnL is calculated based on the difference between average bought/sold price and last price.
  • Charts are rendered using Google Chart Api.
  • Web Socket is used to push data to GUI.

Screenshot: ptr0 2-2

ptr0 2agg

  1. Physical Distribution Estimation.
  • An estimation of physical distribution based on historical data using Gaussian Kernel.
  • Here I am using Nikkei 225 daily historical data for year 2014. This data was downloaded from Yahoo Finance.

Screenshot: gaussian

  1. BS Model Viewer.
  • A graphical viewer for Black-Scholes model for European Call Option.
  • The GUI allows user to change parameters and see how the Greek letters change.

Screenshot: bs

About

A repository for q/kdb+ programs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 54.5%
  • HTML 44.2%
  • Other 1.3%