Awesome Open Source
Awesome Open Source

Python_Portfolio__VaR_Tool

Python-based risk management tool which sources data from Yahoo Finance and calculates different types of Value-at-Risk (VaR) metrics and many other risk/return characteristics both on an individual stock and portfolio-basis, stand-alone and vs. a benchmark of choice (constructed with wxPython)

This wxPython Notebook-app / widget allows one to retrieve stock / index data from Yahoo Finance through Pandas Datareader which are in turn combined with initial portfolio weights and a benchmark of choice to calculate the following risk / return metrics:


  • Historic returns (annual & daily - both an individual stock-, benchmark- and portfolio basis)

  • Historic standard deviation of returns (annual & daily - both an individual stock-, benchmark- and portfolio basis)

  • Annual Sharpe ratios (both an individual stock-, benchmark- and portfolio basis)

  • Beta's (both an individual stock-, benchmark- and portfolio basis)

  • Ex-post tracking error vs. the benchmark of choice

  • Daily return histograms on an individual stock- and portfolio basis

  • Indexed performance charts on an individual stock- and portfolio basis

  • 5% (daily) Historical Simulation Value-at-Risk (VaR) on an individual stock- and portfolio basis

  • 5% (daily) Variance-Covariance Value-at-Risk (VaR) on an individual stock- and portfolio basis

  • 5% (daily) Monte Carlo simulated (along Geometric Brownian Motion) Value-at-Risk (VaR) on an individual stock basis

  • stock return correlation heatmap


In addition, the data retrieved from Yahoo Finance can be exported in CSV-format through the checkbox on the MainFrame.

Screenshot MainFrame

alt text

Please note - this app requires the following packages / modules in order to function properly:

Screenshot Value-at-Risk data

alt text

Screenshot Descriptive Data

alt text

Screenshot Correlation heatmap

alt text


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (1,121,268
Portfolio (4,422
Benchmark (1,892
Stock (1,283
Heatmap (412
Beta (312
Monte Carlo Simulation (300
Investment (222
Wxpython (163
Risk (135
Related Projects