Using Computing Power for Hedging

We used stocks from NASDAQ100, CAC40, IBOVESPA and the PSI20 to calculate all the possible 5 stock portfolio variances, and search for the lowest one.

Why ? Because an investor can reduce portfolio risk by holding combinations of instruments that arenot positively correlated. So what's the safest portfolio we can come up with ?

With 131 stocks from different markets, we have 297 602 656 possible 5 company portfolios. Let's see which has the lowest variance!

Calculating a portfolio variance itself (of 5 stocks) is not heavy, so we'll calculate 40000 per task and return the lowest 20. You would need at least 7440 tasks to cover all 297602656 possible portfolios.

Because that is somewhat heavy and this is a demo, we'll limit you to 2000 tasks. That's enough for you to compute 80 million portfolio variances. If you however, can compute more tasks and try out combinations of bigger portfolios.

Why CrowdProcess ?

This is an embarrassingly parallel CPU-intensive job and CrowdProcess has thousands of workers.

Get in Touch

This demo is a naïve application designed to show CrowdProcess' potential in massively parallel computations.

If you want to know more about how you could use CrowdProcess in your own applications, feel free to

contact us

0% Complete



What's happening here ?

You're running a job that will be scheduled to thousands of workers.

After we load all the data of stock weekly returns, all workers compute more than 40k variances at once.

As results are streamed back, we update the rank on the left with the lowest portfolio variances found.

If you'd like to know more about how CrowdProcess works and how you can create your own highly parallel jobs, you should check the overview and guide.

Final Remarks

This is a toy and must not be taken as financial advice.

We used stocks from different markets (NASDAQ100, CAC40, IBOVESPA and the PSI20) because those probably behave differently and would yield better hedging opportunities. We started off with all the S&P500 stocks but because those were more homogeneous, the results were a bit boring.

The source code is simple enough for you to fiddle with it and do much bigger things. We don't actually know anything about finance, we're software developers, so if you know of a better way to rank a portfolio, please contact us so we can make a better demo.