CodeDotNet

This site is often under construction as it is used to expand my skills by exploring ideas and techniques for .NET, combining ASP.NET, Silverlight applications, web services, and a VB/C# desktop client to access selfsame web services.

Updates and Announcements

2017-07-20

Tips for Staying Employed as an Older Developer

A response to an article Tips for Staying Employed as an Older Developer:

A bit about myself, older and working as a developer, team lead and project manager, writing here to add to the options for staying relevant, and how to let the world know about it.

Some Tips
  • GitHub - I have several libraries in C# and F#, so that others can directly use and evaluate my code
  • NuGet - Packaged versions of code shared on GitHub
  • Blogs - lately I have been learning data languages, and have several, focused on design patterns and algorithms, as well as one focused on data analysis using R, Python, and F#
  • Websites - I have several sites, along with blogs, all accessible from a primary site, James Igoe. This site has links to other sites and blogs, one of which is an older site where I share code as downloads - this site predates GitHub - in my core languages, VBA, C# and SQL, tools for doing programming interviews, as well as cheat sheets.
  • Reposts of career and tech-related articles on LinkedIn, GooglePlus (communities), Twitter, Facebook (page)
  • Training - Yes, like others I am always learning, but I also share the material I work through and my opinion about it, meaning writing book reviews and sharing my opinion on courses from Pluralsight.

2017-07-11

Value-at-Risk (VaR) Calculator Class in Python

As part of my self-development, I wanted to rework a script, which are typically one-offs, and turn it into a reusable component, although there are existing packages for VaR. As such, this is currently a work in progress. This code is a Python-based class for VaR calculations, and for those unfamiliar with VaR, it is an acronym for value at risk, the worst case loss in a period for a particular probability. It is a reworking of prior work with scripted VaR calculations, implementing various high-level good practices, e.g., hiding/encapsulation, do-not-repeat-yourself (DRY), dependency injection, etc.

Features:
  • Requires data frame of stock returns, factor returns, and stock weights
  • Calculate and return a single VaR number for different variance types
  • Calculate and return an array of VaR values by confidence level
  • Calculate and plot an array of VaR values by confidence level
Still to do:
  • Dynamic factor usage
Note: Data to validate this class is available from my Google Drive Public folder.

2017-07-10

Calculating Value at Risk (VaR) with Python or R

The following modules linked below are based on a Pluralsight course, Understanding and Applying Financial Risk Modeling Techniques, and while the code itself is nearly verbatim, this is mostly for my own development, working through the peculiarities of Value at Risk (VaR) in both R and Python, and adding commentary as needed.

The general outline of this process is as follows:
  • Load and clean Data
  • Calculate returns
  • Calculate historical variance
  • Calculate systemic, idiosyncratic, and total variance
  • Develop a range of stress variants, e.g. scenario-based possibilities
  • Calculate VaR as the worst case loss in a period for a particular probability
The modules: