Thursday, May 14, 2020

CB Prosperity Diaries #10 - More coding goodness

Apparently, some friend has started coding again thanks to my efforts levelling up my Python skills. And I still have a long way to go.

One of my students from Batch 1 sent me a file with a strange extension. I did some googling and found out that it is a Jupyter Notebook file. I immediately gave myself a 30-minute tutorial and starting installing Jupyter on my machine before digging into the code my ex-student wrote.

My student's code was very compact and elegant. It was also able to generate a Markovitz Efficient Frontier within various stock instruments chosen by the coder. Thus began one of the toughest tutorials I ever had where the trainer now get to be the apprentice.

My most immediate instinct is to make sure that the work my student did was not wasted and I can add value to his Python program, so I made some modifications to it to reflect actual instead of logarithmic returns. After that, I added some code to figure out which combination of security weights could maximise the Sharpe ratio.

The final product is an efficient frontier consisting of STI index, local government bonds, the Gold ETF and an S-REIT ETF.


I would not advise anyone to actually invest in this portfolio, as it has an underwhelming proportion of equities.

More importantly, we have the basic code snippets to play around to generate efficient frontiers, something I guess not all CFAs or Master students are able to do.

We're well within striking distance of a program that can produce a Risk Parity Fund upon command with a few keystrokes.

My student hopes to build a series of Web Apps for my community.

This will really allow our community to have tools that have never been accessible by retail investors before.

After my class tonight, I will have more time to plan a major community webinar that will unleash our full financial programming skills into the world of investment training.

I hope this will put the ERM program as a leading one in the very competitive market we have for investment training.



No comments:

Post a Comment