the following pages, we will be demonstrating how to make a
simple but useful option price calculator, using Visual Basic.
(Or see the Downloads page for
other ways to get the program.)
We will then expand on the
option calculator by adding three more option "legs" and a
stock leg, plus a chart and some other features, which will
turn the option price calculator into an option graphing
program capable of showing entry prices and three time lines
for any option strategy with up to four legs and a stock leg,
such as bull calls, butterflys, iron condors, covered calls,
collars, and so on.
We will be using Visual
Basic because it is a very approachable programming language,
with a syntax that almost looks like plain English
instructions. Other programming languages such as C or C# use
a syntax and other conventions that require a steeper learning
You do not need to know any
complicated mathematics to complete these projects. We will be
showing all the necessary functions, and all you need to do as
far as math is copy and paste to make a working program.
However, if you are interested in learning programming, or
want to see just what goes on behind the scenes when an option
price is calculated, then you can study the code and/or the
mathematics as much as you wish.
Visual Basic Express Edition is
available for FREE - see the page "Get
started with Visual Basic". Visual Basic Express can
make stand-alone Windows programs (.exe files) that work just
like any other Windows program on your computer. You will be
able to compile your completed option calculators and run them
by double-clicking an icon on your desktop, or by pinning them
to your taskbar and running them with a single click.
Just because Visual Basic
Express is easy to use and free, does not mean it is slow. On
a modern desktop computer, the finished graphing program will
be able to calculate option prices for four option legs and a
stock leg, across a range of $10 in stock prices in 1 cent
increments, and draw three colored lines on the chart
representing the position gain or loss on three different
dates, all in a fraction of a second.
So let's get started! Just
follow the steps given below, in order, and you will be on
your way to your own useful option pricing and graphing