Automate your pricing chores with Bloomberg’s MARS API and Python
Bloomberg Market Specialists Francesco Tonin and Samuel Popper contributed to this article. The original version appeared first on the Bloomberg Terminal.
Repetitive pricing tasks have been part of the job for salespeople and traders for decades. It used to be that they had to compile indicative prices by hand when clients would call in with a request. Then computers picked up the chore of running the numbers, while the salespeople and traders focused on selecting the instruments for the computer to price, inputting market parameters and compiling options for the client to choose from.
Consider foreign exchange, the most liquid market in the world. Typically a client request would specify the currency, the intent to buy or sell and the value date for the transactions — for example, “buy euros a week from today.” The salesperson would be expected to quickly reply with prices for a number of structures — in this case perhaps the options would include the forward rate for the EUR-USD currency pair, the premium of an at-the-money euro vanilla option (maybe a call to buy euros at a set exchange rate on or before expiration) and the price of a euro call spread (to indemnify the client for any euro appreciation above a specified level, up to a ceiling amount).
Seasoned traders and salespeople often price lists like this a few times each day. But even those who are really good at it will still need to spend 15 minutes on the task each time — and there’s always the possibility of a clerical error.
However, with more and more computer-savvy graduates entering the financial workplace, coding skills are widespread. You can easily use an open-source computer language such as Python to automate the pricing of all of these structures. If you’re not familiar with coding, chances are one of your colleagues is.
The code needed to price the above structures and many others is pretty basic if you have access to Bloomberg’s extensive library of pricing functions and portfolio manipulation via its Multi-Asset Risk System API. The MARS API provides consistent pricing and risk data to model every deal in a portfolio, and offers programmatic access to that pricing and risk infrastructure. This makes it easy to set up an automatic pricer.
Here’s a sample of how you can use Python to perform pricing tasks:

What’s the advantage of using Python instead of a manual process for pre-trade indications? It can save time, eliminate clerical errors and improve the quality of your output. In addition, Python makes it easy to create state-of-the-art term sheets that contain pricing charts and indications for a set of structures. This means you can focus on adding value for clients rather than just juggling numbers.
For more information on this or other functionality on the Bloomberg Professional Service, click below to request a demo with a Bloomberg sales representative. Existing clients can press <HELP HELP> on their Bloomberg keyboard.