Coder Social home page Coder Social logo

laranea / derivat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rwev/derivat

0.0 0.0 0.0 3.59 MB

Desktop application for theoretical visualization of financial derivatives, using PyQT, Cython, and OpenGL.

License: GNU General Public License v3.0

Python 100.00%

derivat's Introduction

DeriVAT (derivative visual analysis tool)

Desktop application for theoretical visualization of financial derivatives, using PyQT, Cython, and OpenGL.

Getting Started

To run the application,

1.Verify working installation of Python 2.7 with pip and (optionally) virtualenv packages installed 2. Clone the repository

$ git clone https://github.com/rwev/derivat.git
  1. Navigate to the repository with CLI

    $ cd derivat
  2. Create an isolated virtual environment (optional, but recommended)

    $ virtualenv <name>

    This is to mitigate version conflicts with the global system Python installation. This project intentionally relies on some former package versions.

  3. Install dependencies

    Windows:

    PyQt4: download the Windows wheel (.whl) file here (be sure to select cp27 for Python 2.7) and and manually install:

    \derivat > pip install PyQt4-4.11.4-cp27-<bit-system>.whl

    All other dependencies can be automatically installed with

    \derivat > pip install -r requirements.txt

    Linux:

    /derivat $ sudo apt-get install python-qt4 python-qt4-gl python-tk
    /derivat $ pip install -r requirements.txt --user
  4. Compile Cython valuation module with the following command.

    /derivat $ python ./components/libs/setup.py build_ext --inplace

    Note: On Windows, this step requires a working installation of VCforPython27, Microsoft Visual C++ Compiler for Python 2.7

  5. Execute

    /derivat $ python derivat.py 

Controls

The 3D visualization on the Graphs tab can be manipulated with the following interactions:

  • Left button drag: Rotates the scene around central focus point
  • Middle button drag: Pan the scene by moving the central look-at point within the x-y plane
  • Middle button drag + CTRL: Pan the scene by moving the central look-at point along the z axis
  • Wheel spin: zoom in/out
  • Wheel + CTRL: change field-of-view angle

Contribution

To-date development has been done with the assistance of a custom execute-on-change tool resurgence.py.

Setting up resurgence.py

For development is VSCode, the following "Run" configuration can be used:

    {
        "name": "Python: Resurgence",
        "type": "python",
        "request": "launch",
        "program": "${path}/resurgence.py",
        "args": [
            "--cwd",
            "--extensions=*.py",
            "--dirs=./components", 
            "--command=${path}/derivat/python.exe derivat.py"
        ],
    }

Or simply start the following process in your terminal:

$ python resurgence.py --cwd --extensions=*.py --dirs=./components
--command=python derivat.py

While running this configuration, a change of one of the .py source files in either the project directory or the components/ subdirectory will trigger a forceful restart of the python derivat.py process.

Resurgence thus shortens the visual feedback loop in the development of GUI applications like derivat.py. However, debugging with resurgence.py isn't possible, because it spawns a child process.

See python resurgence.py --help or read the source for more details on this mechanism.

Debug Configuration

To debug derivat.py in VSCode, specify a debug configuration that starts execution of derivat.py directly.

        {
            "name": "Python: derivat",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/derivat.py"
        }

TODO

  • lock save, calculate buttons
    • when at least one input section isn't valid
    • after calculation when same (valid) inputs remain
  • add axis labels
  • add mesh to value surface
  • add ability to further specify axis, instruments
    • e.g. time on one axis, underlying price on another, holding the instrument constant
    • custom instruments as a combination of vanilla options
  • refactor display constants / serialization path mechanism

derivat's People

Contributors

dependabot[bot] avatar rwev 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.