Cloud computing with Python and Excel : picloud integration

March 12, 2010

Further to my previous post about making Python GUI interact with Excel, we thought it would be interesting to test how cloud computing could be easily accessible from Excel using Python and the picloud library.

We have just added interfaced some Python code that do compute the put and call price of a stock based on a Black & Scholes Monte-Carlo simulation. We end up with one function call in Excel :

Pyxll integration with picloud

Implementation details
Read the rest of this entry »

Improving Python speed using Cython : Binomial option valuation example

February 12, 2010

For the last LFPUG meeting, I have developed a simple example showing how Cython could be used to improve the performance of Python. The idea here is not to find the best way to do it but just to try to get a great speed up without digging into the hard stuff.

1. The model

The theoretical binomial model can be used to value options. “Paul Wilmott’s introduces Quantitative Finance” shows a VB example of a call valuation with such model. The following code is inspired by the VB code and gives you a pure Python version of it.
Read the rest of this entry »

mdb-export and decimal values

September 19, 2008

mdb-export is a very nice tool to manage MsAccess database under Linux. For one of my project, I have to automate the import of a mdb file into a mysql database.

You need to pay attention to the data type of the original Access file, especially to decimal values

In our case, the decimal values were truncated just as integer values. They were defined a “réel simple” in french, thus probably “simple real” in english. Changing the type as “réel double” (“real double” ) solved the problem !