As we roll out JuliaPro v0.6.0.1 (now supporting Julia 0.6), we see it as the best time to introduce our old users and new to our product JuliaFin, and also briefly introduce the enhanced suite of Julia packages it is now shipped with.
JuliaFin is a specialized Julia Computing product used in asset management, risk management, algorithmic trading, backtesting, and many other areas of computational finance, including the modelling of financial contracts.
Miletus is one of the core components of JuliaFin. Essentially a Domain Specific Language written on top of Julia, it can be used for financial contract definition and modelling. It is also used as a valuation framework.
Financial contracts are typically modelled in a functional programming style with languages like Haskell or OCaml, and the implementation of the valuation processes is then done in a second language like C++ or Java. Miletus on the other hand, leverages on Julia’s strong type system and multiple dispatch capabilities to both express these contract primitive constructs and generate efficient valuation code, solving yet another “two language problem”.
Milteus lets you construct complex contracts with a combination of simple primitive components and operations.
Example Contract Definition and Valuation
In the example below, we define and value a contract for a European call option, defined both in terms of a set of primitive contract types, as well as convenient, high-level constructors.
The first step would be to import the Miletus library.
# Import the library
In: using Miletus
import Miletus: When, Give, Receive, Buy, Both, At, Either, Zero
The type constructors provided by Miletus lets you perform a few basic operations.
# Receive an amount of 100 USD
# Pay is the opposite of Receive
# Models are constructed and valued on a generic SingleStock type
This is where it really gets interesting. These basic primitives can now be combined into higher level operations.
# Acquisition of a stock by paying 100USD
In: x=Both(s, Pay(100USD))
# Which is equivalent to buying the stock
In: x=Buy(s, 100USD)
# The notion of optionality is expressed by a choice of two outcomes
In: x=Either(s, Zero())
Another important aspect of any contract is the notion of time. Below we define a temporal condition on which to receive a payment of 100USD.
In: x=When(At(Date("2017-12-25")), Receive(100USD))
Combining that temporal condition with optionality defines a basic European Call option.
In: x=When(At(Date("2017-12-25")), Either(Buy(s, 100USD), Zero()))
In: eucall = EuropeanCall(Date("2017-12-25"), SingleStock(), 100USD)
And that would just be the beginning of the things you can do with Miletus. Read the documentation for more, and if we really did get you started, try it out for yourself!
About Julia Computing and Julia
Julia Computing was founded in 2015 by the co-creators of the Julia language to provide support to businesses and researchers who use Julia.
Julia is the fastest modern high performance open source computing language for data and analytics. It combines the functionality and ease of use of Python, R, Matlab, SAS and Stata with the speed of Java and C++. Julia delivers dramatic improvements in simplicity, speed, scalability, capacity and productivity. Julia provides parallel computing capabilities out of the box and literally infinite scalability with minimal effort. With more than 1 million downloads and +161% annual growth, Julia adoption is growing rapidly in finance, energy, robotics, genomics and many other fields.
Need help with Julia?
We also provide training and consulting services
and build open source or proprietary packages
for our customers on a consulting basis. Mail us:
Julia Computing was founded by all the creators
of the language to provide commercial support
to Julia users. We are based in Boston, New York,
San Francisco, London and Bangalore with
customers across the world.
© 2016 - 2020 Julia Computing, Inc. All Rights Reserved.