The title describes the question. Below provides more details. Kindly let me know how industry is working on this.

I am a heavy user of Bloomberg excel API, including WAPI and DTK (formula such as bstructure and bprice). Recently I am working on backtesting that relies on a strike solver. (OVME strike solver feature is not available through WAPI so I have to write a solver in python) This recursion process that pulls option prices (through DTK) is easier to be done in python than excel.

Given that, anyone has used DTK/DLIB BLAN in python before? Does Bloomberg provide API to DLIB BLAN? If yes, is it through Bloomberg BLPAPI package (and we need to write a wrapper)?

Appreciate your comments.

  • 1
    $\begingroup$ Have you tried askig F1 F1? $\endgroup$ May 11 at 23:32
  • $\begingroup$ Yeah there is unfortunately no readily support on python. $\endgroup$
    – QChen
    May 14 at 15:17

1 Answer 1


That is a classic F1 F1 question. It's proprietary software and BBG offers a dedicated help desk.

DTK is not available for free via BLPAPI. Connecting DLIB to an API requires a premium service called Mars API (which will work via DAPI, but also BPIPE and the like, depending on your needs). I suggest you reach out to your sales rep and ask him / her about this feature if you are willing to pay (this service is quite expensive as it is an enterprise solution).

You can have a look at some code snippets if you search for DOCS MARS API on the terminal. DOCS 2097583 is for MARS API in general (architecture, delivery channels, ...)

MARS API leverages the same libraries when setting elements and making requests as BLPAPI, just that DLIB (BLAN) has a LOT more handle parameters and overrides compared to standard BLPAPI. DOCS 2096689 is for MARS API with DLIB specifically.

When you say you need a strike solver, for what products exactly? I find it hard to believe BLAN will help you here, because hand written BLAN has no solver capabilities as much as I know. Also pulling option prices with BLAN will be substantially simpler with DTK (it is already a wrapper) because there are no available wrappers for Mars API (it is not widely available like the standard BLAPI desktop requests that are "free" for every BBG user).

I am not sure about OVME but the infrastructure should be similar to OVML. For OVML, you can request an override for strike and expiry date (I think your eligibility to use this and potential costs depend on some criteria, but F1 F1 or your sales rep should be able to help with that too). Aftwards, you can use any saved deal, change expiry and strike as you wish, and iterate that way to a desired option value. This will not only be easier to implement but also substantually faster and more reliable compared to DLIB which relies on Monte Carlo runs. Below is an example (bear in mind, it WILL NOT work if you do not have the override priviledge granted).

The field for expiry date is called OP002 – OPT_EXPIRE_DT.

enter image description here

Edit DLIB BLAN is essentially OCAML. You can use while loops.

let sum = ref 0; 
let cnt = ref 1; 
while !cnt <= 10 do 
  let i = !cnt; 
  sum := !sum + i; 
  cnt := i + 1; 

Should work for example.

BLPAPI has a very detailed documentation on WAPI. However, I reiterate that you could simply use the OV override instead of DLIB. It also works directly with existing BLAPI wrappers on the web (it is a simple BDP formula with overrides). All you need is a dummy ticker (saved OV deal) for each underlying and product (call, digital etc). Afterwards you can override dates and strike to retrieve the corresponding value. For example like this.

=BDP("Ticker","OPT_THEOR_VALUE", "OPT_STRIKE_PX=3930.0800", "OPT_VALUATION_DT=20220520", "OPT_EXPIRE_DT=20220811")

where Ticker refers to either "OVME_ID Index" or "OVME_ID Equity". You can refresh whenever you tell the API. It is miles faster than an equivalent BLAN solution (and almost surely more accurate too).

  • $\begingroup$ Thanks AKdemy for your comments. This doc is exactly what I am looking for "DOCS 2096689". Our firm has MARS API subscription. Next step is to find a resource to write wrapper functions based on BLPAPI package. $\endgroup$
    – QChen
    May 19 at 18:36
  • $\begingroup$ To comment on solver and OV - you are right there is no "while" loop or solver function in DLIB (have confirmed this with enterprise risk team in BBG); if I can extract prices from DLIB programmatically, I can build a solver in excel or python. OV has a strike solver (and other solver) in 12 <Go> but I need this solver in a programmatical way so manual copy from OV page wont be my solution. (I also have the override field enabled as a user on OV, which is a very helpful feature for backtesting.) $\endgroup$
    – QChen
    May 19 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.