Bloomberg puts the power of Python in hedgers’ hands
Once upon a time, finance was finance. Portfolio managers picked stocks based on price-earnings ratios and gut feel, and traders tried to read the market to find entry points. Not anymore. Today humans have to slug it out with computer algorithms and other aspects of technology.
As the cohort of portfolio managers and traders with computer science degrees has grown, so has their preference for writing code instead of using old-fashioned spreadsheets. The lingua franca of finance is shifting from Microsoft Excel to the open-source programming language Python. And now Bloomberg is offering its extensive market price database and pricing analytics in a Python environment through the Bloomberg Python MARS API.
The issue
To illustrate the power of the offering, Bloomberg analysts wrote some sample code to test five algorithmic hedging options for minimizing losses during the market rout Oct. 9-11, when the S&P 500 dropped 5.3 percent. What’s the best way to determine the most effective hedging strategy for those three days? Running those numbers programmatically, instead of manually punching keys on the terminal, allowed the analysts to simulate a large number of hedges. The ultimate solution is much more robust than would be seen by someone just trying out a couple of ideas.
The sample code ran the portfolio and five hedges — a put option on an ETF that tracks the S&P 500, a put spread, a collar, a VIX futures contract and a VIX option — through a shock to simulate the October volatility and output the market value of the portfolio and each hedge. The analysis found that the best hedge was the put spread, which produced a gain of $292,792 after three tumultuous days. In terms of total return, the VIX call option was the best performer, with a massive $92 million gain over the period.
Tracking
Use the Bloomberg Python MARS API to uncover effective hedging structures and other actions for robust algorithmic trading.

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.