This class teaches Visual Basic for Applications via the construction of an option pricer. The use of the main statements (“if” condition, “for” loop …) of this programming language is mastered at the end of the class. Students also learn how to properly indent and comment their codes, and to structure them within VBA modules.
The VBA case study that is jointly built with students is an American put option pricer. Students learn how to plot trees in XL that are controlled from VBA modules. Interfaces are also implemented that allow the students to construct a realistic option pricer. The code computes option prices but also option Greeks.