For more than a quarter of a century Microsoft Excel has been the preferred “desktop” for traders and fund managers to develop financial models for Bond and derivatives trades. Excel provides integration for market data vendors to provide Real-Time Data (RTD) directly into spreadsheets; and integration for advanced finance libraries to build models.
Spreadsheet models were/are a key enabler for the development of models for financing contracts, but for more than ten years there has been programmes to replace these models with applications that are controlled by the product control, compliant with regulatory commitments and re-valued for risk exposure at market close.
There has been considerable resistance to this process because the applications do not provide the flexibility of building on a desktop and tested with live prices.
Cephei was conceived from the perspective that Excel is not inherently evil - it is unrevealed for the ability prototype and test models – but conversion to reliable models is difficult: If we can we automate the process of generating code from models, we don’t necessarily need to re-implement in impetrative languages.
The Cephei solution is replicate the good facets of spreadsheet, and design the finance libraries enable the automatic generation of code from models
Cell
can contain a value or a formula, and that the formulas and are updated automatically whenever an underlying value changes. The Cell
framework is faster than imperative calculation because calculations are performed in parallelCephei.XL uses (RTD) as an object cache to avoid the need for complex logic to track formula changes as functions are called over-and-over-and-over-again by the Excel calculation engine.
The Cephei Cell Framework ensures that when a formula is changed, all dependant cells are re-calculated in parallel with updates passed back to Excel as RTD data change notifications.
Irrespective of the complexity of the model, interactive performance of Excel (apart from the initial start-up time of adding 15000 functions to Excel) remains responsive – all calculation is performed in parallel by the Cell
thread-pool.
While Cephei.XL can be used as an efficient Quant library that interoperates well with Bloomberg, it is designed from the foundation with code generation “save as code” in mind: Cephei.XL does not create handle-references, all functions take a Mnemonic parameter that is used as a property name when code is generated.
Cephei.XL exports 15,000 worksheet functions from 600,000 lines of code, all of which start _
, the simplest of which is _clock()
and _today()
which update every second or every time the machine clock rolls into another day.
All functions (except _value(mnemonic)
and _value_range(mnemonic, layout)
) return the handle provided.
_value_range()
layout is one of:
Bond
) all properties (dirtyprice, cleanprice, yield, cash, etc) are provide in a table.
The alpha code can be downloaded from Cepheis
• Excel (32-bit)
• Excel (64-bit)
• Excel (32-bit debug)
• Excel (64-bit debug)
• Source codeCephei.XL is designed to be used like an interactive editor – when the model is complete, you can click generate to translate to an F# model that can be deployed to a server (Cephei.Orleans
will provide a “Financial Digital Twin” for hosting active cloud models).
Quantlib is a fairly comprehensive library of financial methods that are widely used or copied in Investment Banking, buy-side valuation or IPV. It can be used directly or as proof-of-concept of how Quant addin’s should be done.
Cephei.QL and Cephei.XL are examples of the benefit of using model driven architecture: most of the code has been produced using code-generation from a Sparx Enterprise Architect software model of the underlying Quantlib Functions.