• TIME TO 2024 UK RANKINGS

  • C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Python UDFs in Excel

Joined
6/17/09
Messages
34
Points
18
I was asked recently about the Python embedding that is shipped as part of XLW v4. For people who are interested here are a few details

We have been able to embed the the IronPython interpreter into an Excel xll addin allowing one to write Python functions straight onto a Excel spreadsheet which can then be used to evaluate the values of cells.

This embedding is demonstrated in one of the 'Extra Examples' shipped with the free and open source software xlw.

xlw ( v4 ) can be downloaded from here :

http://sourceforge.net/project/showfiles.php?group_id=45222&package_id=37893&release_id=690866


The example was created as a demo of IronPython on a spreadsheet and is intended to be extended by the user for his/her own needs.



You need to have IronPython 2.0.1 installed which can be downloaded from here :
http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=12481

In the example project you may need to re-reference the IronPython assemblies to where you install them.

I think it would be interesting to see a generic Monte Carlo engine extened the Python example to evaluate payoffs written in Python directly onto the Excel spreadsheet.

Happy Pythoning
 
Back
Top