ACCOUNTING & FAS 133
ASK DR. RISK!
IF ONLY ...
Java for Derivatives Last
revised: March 02, 2002
Do you think that "Java Chips"
will soon displace doughnut's from the policeman's diet? If so,
then you might benefit from a quick introduction to the new
computer language, Java, and some of its applications to
A Taste of Java
In Richard Karpinski's concise language,
"Java is a simple, object-oriented, distributed,
interpreted, secure, architecture-neutral, portable,
high-performance, multi-threaded, and dynamic language. (Netguide,
February 1997, p. 135.) Let me elaborate in my own words,
- Simple. Simplicity is
relative and subjective. If you think C++ is simple, then
Java will bore you to death.
- Object-Oriented. Although
Java allows sequential procedures, it shares with C++ an
ability to "morph" abstract general objects
into useful special cases.
- Distributed. Applets can sit
anywhere on the Internet. You grab them when you need
- Interpreted. This is tricky.
In order to put Java source code to work, you must
compile it at what we'll call level 1. Your Java-enabled
web browser has a Java "Virtual Machine" that
can interpret this code. In addition, some CPUs can run
what we'll call a level 2, "just in time"
compiler that compiles level 1 code, as needed to run the
- Secure. You don't have to
worry so much that an applet will give your computer a
virus, because Java's design makes it difficult for the
applet to write to the usual vulnerable places on your
computer. Of course, an applet could still do a great
deal of "nonviral" damage.
- Portable. You can port an
applet to any computer Mac, PC, Sun, mainframe,
etc. that has an operating system with a Java
"Virtual Machine". Then you can run the applet
with a "Java-enabled" browser. For example, Daniel Sigrist wrote a Black-Scholes Option Pricing
Calculator on his Mac, and I've
run it flawlessly from my Netscape and Microsoft Internet
Explorer browsers on Compaq and Dell PCs. I'm waiting
word that it runs on a Sun.
- Multi-Threaded. Java suits
multitasking well. You can run several programs
simultaneously along separate "threads of
execution". (Java Programming for Dummies, p.
- Dynamic. The document you
produce with HTML just sits there and sleeps. Java can
wake it up and start it singing and dancing. If you've studied bipolar disorders in
abnormal psychology, Java is to Mania (note the large M)
what HTML is to depression (with a small d).
In addition to Mr. Karpinski's points,
let me add:
- Memory Management. You can't
notice from the application, but Java manages memory
better than C++.
- Use of Internet. Java lets
you use the Internet that the government built for
billions as your own international communications network
at a fraction of what the big boys now pay.
- Novelty. We don't know how
well it will work, or if superior approaches will evolve.
If you want to know more about Java, I'm
particularly fond of two introductory books Java for
Dummies and Java Programming for Dummies (both, Foster
City, CA: IDG Books, 1996). Don't let their condescending names
mislead you into thinking that they are too elementary. They
contain information that you can understand and bring to life
right off the page and attached CD-Rom. You can find much
additional information at computer store's newstand.
The Future of Java
We at the William Margrabe Group, Inc.
think that systems for pricing derivatives and managing their
market and credit risk will make increasing use of portable
and ActiveX. Moreover, we await Microsoft's countermoves to
incorporate Java's advantages directly into its Office Suite. The
battle has just begun, the stakes are enormous, and we users will
Currently, C++ is the dominant language
of choice for financial calculators and systems, because C-coders
can build systems quickly (largely due to C's object orientation
and large libraries) and running speed (because it is so close to
the machine's language). Today, Java falls noticeably behind in
running speed, matches C++ in coding speed, and races ahead in
usefulness on the World Wide Web and portability from one
combination of hardware and software to another. When "Java
chips" on PCs, workstations (Sun's main interest), and
mainframes replace "virtual Java machines" Java will
dominate today's C++. Will the developers of C++ see their
market share shrink, or they will make C++ as portable and
"networthy" as Java? Purveyors of office suites, such
as Office 97 and Corel Office 7 are already offering better
connections with the Internet mainly with HTML. How long
before they wake up and smell the Java? Since I wrote these
words, originally, I found the the answer: Corel has a beta
version of an all Java office suite almost ready. Will people be
using it before you read these words?
While we sit comfortably in safe zones
and await the outcomes of these battles and the war, let's look
at some simple Java applications in the worlds of games and
- Axone Services and Developpement S.A. Option
- Interactive Quote. Option calculator: from
vol to price and price to vol.
- J.F.O.X. The home
page and E-mail address
for the Java (TM) Financial Object Xchange
(SM) (J.F.O.X.), which promotes Java and distributed
object development in the Financial Services industry.
- Numa Financial Systems. Derivatives calculators
- Random Walk Computing, Inc. Black-Scholes and
- [Daniel] Sigrist. A downloadable, Black-Scholes calculator (for European
Put and Call prices and Greeks) that he wrote in Java for
the William Margrabe Group, Inc.
- WebRisk. Black-Scholes on-line calculators
(Java applets) for (1) option pricing, Greeks, and graph,
(2) day counts for computing (swap, etc.) payments, and
(3) yield curve.
Fun and Games
here to email Dr. Risk or the William Margrabe Group
CONSULTING AT THE WILLIAM MARGRABE GROUP, INC.:
Our other web sites:
Free option pricing calculators from here and around the world.
of the best articles
from the best publications
in the risk management trade press.
of the best articles from the best publications
in the derivatives trade press.
Answers to your questions about Investment,