QLW -- high level interface to QuantLib in Java
We are pleased to announce QLW -- a high level interface that makes QuantLib conveniently accessible from the Java platform. The product is available from BN Algorithms Ltd with full commercial support and access to all of the source code.
An evaluation version is available for download
Using QLW has following advantages:
- Direct one-to-one mapping to functions in the QuantLib Excel Addin (see our documentation), making easy and quick migration from spread-sheet-based to programmatic processes
- High-level interface appropriate for application development
- Access to source code and based on open-source technologies -- guarantees very long life within your organisation, low risk and low costs of ownership
- Full commercial support available -- we can even develop your applications for you from your spreadsheets
- Excellent parallel capabilities with ready-made Cloud-based solutions
- Runs on Linux servers
- Low cost site licensing available
Here is an example QLW application:
import co.uk.bnikolic.qlw.property_t;
import co.uk.bnikolic.qlw.qlw;
import co.uk.bnikolic.qlw.StringVector;
import co.uk.bnikolic.qlw.LongVector;
import co.uk.bnikolic.qlw.PropertyVector;
public class AmericanOptionExample {
public static void main(String[] args) throws Exception {
property_t today=new property_t(35930);
property_t settlementdate=new property_t(35932);
property_t exercisedate=new property_t(36297);
property_t dcc=new property_t("Actual/365 (Fixed)");
qlw.qlSettingsSetEvaluationDate(today,
qlw.OH_NULL());
String payoff=qlw.qlStrikedTypePayoff("payoff",
"Vanilla",
"Put",
40.0,
qlw.OH_NULL(),
qlw.OH_NULL(),
qlw.OH_NULL(),
false
);
String exercise=qlw.qlAmericanExercise("exercise",
settlementdate,
exercisedate,
new property_t(false),
qlw.OH_NULL(),
qlw.OH_NULL(),
false);
String option=qlw.qlVanillaOption("option",
payoff,
exercise,
qlw.OH_NULL(),
qlw.OH_NULL(),
false);
String vol=qlw.qlBlackConstantVol("vol",
settlementdate,
"TARGET",
0.2,
dcc,
qlw.OH_NULL(),
qlw.OH_NULL(),
false);
String process=qlw.qlGeneralizedBlackScholesProcess("process",
"vol",
36.0,
dcc,
settlementdate,
0.06,
0.00,
qlw.OH_NULL(),
qlw.OH_NULL(),
false) ;
String AmericanEngines[] = { "BAWA", "BSA", "FDA", "JR", "CRR", "AEQPB", "TRI", "TIAN", "LR", "JOSHI"};
for (String ename : AmericanEngines ) {
String pengine;
if ( ename == "BAWA" || ename == "BSA")
{
pengine=qlw.qlPricingEngine("pengine-"+ename,
ename,
process,
qlw.OH_NULL(),
qlw.OH_NULL(),
false);
}
else
{
pengine=qlw.qlBinomialPricingEngine("pengine-"+ename,
ename,
process,
50,
qlw.OH_NULL(),
qlw.OH_NULL(),
false);
}
qlw.qlInstrumentSetPricingEngine(option, pengine,
qlw.OH_NULL());
System.out.println("NPV using " + ename +": "+ qlw.qlInstrumentNPV(option,
qlw.OH_NULL()));
}
}
}
For many more examples see the code snippets in our QuantLib Addin documentation .