An algorithm for inserting a sorted vector of pairs into a map In a naively programmed map this causes worst case performance for the tree. For a binary tree, which does not rebalance, inserting a sorted list, causes the binary tree to have a depth of N, where N is the number of items in the sorted vector.
Stable Quick Sort algorithm encoded as a template class.
The Newton Raphson algorithm coded as a class template. This encapsulation allows for:
The Secant algorithm coded as a class template. This encapsulation allows for:
The Grid Search algorithm coded as a class template. This encapsulation allows for:
The Black Scholes formula coded as a class. This encapsulation allows for:
This class, "american_fudge" is a child class of the European_option_pair with a fudge factor so that the exercise boundaries match up with American options. This approximation is much faster than the binomial method.
This class, "american_option_approximation" is a child class of the European_option_pair . The option value is determined by do a grid search on T, in the range 0<=T<=Tau, and using the European option, with the maximum value.
The binomial option pricing algorithm . This encapsulation is a very minimual version of the binomial option pricing algorithm, with many virtual functions, which can be overloaded for more specilized option pricing methods. Alpha is an input variable, so stocks, stock indexes, futures and currencies, can all be the underlying.
Sample Program which illustrates 4 different option valuation models.
Sample Program which illustrates how to calculate implied volatility with 4 different option valuation models.
Sample Program which illustrates the Newton Raphson algorithm.
Sample Program which illustrates the Secant algorithm.