April 2019
Intermediate to advanced
426 pages
11h 13m
English
The implementation of the binomial CRR model remains the same as the binomial tree we discussed earlier, with the exception of the u and d model parameters.
In Python, let's create a class named BinomialCRROption and simply inherit the BinomialTreeOption class. Then, all that we need to do is override the setup_parameters() method with values from the CRR model.
Instances of the BinomialCRROption object will invoke the price() method, which invokes all other methods of the parent BinomialTreeOption class, except the overwritten setup_parameters() method:
In [ ]: import math """ Price an option by the binomial CRR model """ class BinomialCRROption(BinomialTreeOption): def setup_parameters(self): ...
Read now
Unlock full access