I mentioned in a previous post on how to get (nearly) live stock data from Google Finance. However, if you start pulling data from different markets, daily historical rates won’t make sense as different markets are closed on different days. This causes problems when trying to figure out the correlation between stocks. A solution to this is to pull monthly rates as the adjusted stock price for each month will be a better indicator of correlation.
Python has a great library called pandas_datareader that allows you to pull in historical information right into a pandas dataframe. The only downside is if an API is deprecated, your code breaks. Hence, I’ve elected to create this tutorial using Yahoo Finance’s Historical data download function. The objective of this article is to pull a large amount of worldwide historical data (over 20 years worth) and then use Modern Portfolio Theory (Mean Variance Optimization) to create an efficient frontier. The efficient frontier can help decide asset allocations in your portfolio based on a given risk tolerance and expected return.
For this tutorial we will be using Google Sheets. Google Sheets is a great resource for scraping data from the internet and it’s free!
First, we need to set up our Google Sheet in a format that will make pulling the data easy and accessible for future analysis. In the first row, add in the number of historical work days you’d like to go back into cell A1. We chose to go back 470 days which is just under two years of data. Then, on every next column, add in the Tickers for the stocks/ETFs that you’d like to pull data for. Keep in mind that the number of days back must be less than the lifetime of each your stocks have been on the market. Otherwise, the dates will not correspond with the stock prices for certain newer stocks. By lifetime of a stock I mean the difference between today’s date and the date that the stock had an IPO (went into the market).
The GoPro was one of the biggest revolutions when it came to shooting live action footage. Unfortunately, what many people weren’t aware of was with any camera, shooting video is incredibly difficult without a stabilizer. You end up with a lot of shaky cam and unusable footage, even with a warp stabilizer during post production. So now that the GoPro fad is starting to die down and cellphones are powerful enough to shoot, store and upload our home videos, what is a traveler on a budget supposed to do? No, I don’t think it’s the best idea to hook up my Pixel 2 with a DJI Osmo Mobile 2 and walk around foreign streets with a target placed on my back. A great travel action camera + gimbal should be able to be discrete, easy to pack/carry, and have a long battery life to avoid having to find an outlet.
I’m creating this comparison because my GoPro Hero 4 silver and FeiyuTech G4 stabilizer succumbed to water damage and now I need to decide on what Action Camera+Stabilizer combo I’d like to use to create my travel videos. Although I could find articles on the web praising each camera and videos trying to compare them, I couldn’t find a one solution check list that would list all the specifications in one place. Keep in mind that the specs are not the only things you should look for in a camera. Some shoot better in low lighting and others have more vivid colours. Unfortunately my specs table will not go that granular when it comes to detail. Rather, it will approach the problem as someone who is a hobbyist videographer and what they might want in a camera.
A few months ago I had a genius idea. I could create a personal website with Ruby on Rails and host it on Heroku for free using a Free Plan and a monitor robot to keep the website awake. The only thing I’d have to pay for is a domain name that I could get from Hover with free WhoIs Privacy.
Recently, I got a lot of public attention for a dashboard that I created tracking the Toronto Real Estate Market. This brought more people to my site, but unfortunately caused heroku to decide that my site was disqualified for the free plan and would need to be updated to a hobby developer plan for $7 USD.
Being frugal as always, I started to shop for other options. I knew I’d eventually like to start a blog and although I had a blog on the heroku site, the images were hosted via Amazon S3 and I was paying pennies monthly to keep them up. I’ve had some experience developing custom wordpress sites so I decided to go the shared hosting route with IWFHosting so I could easily install wordpress and have some addon domains/emails for future web development ideas. The total price: $4.91 USD. Guess I couldn’t sustain on the free-99 model forever, but this sure does beat other hosting sites ridiculous monthly pricing.
So now I have a bunch of static html files of all my individual projects and a wordpress installation that is run on php. I also need a common header nav-bar so that when someone visits my site everything looks fluid. The problem can be broken done into smaller tasks to create my website:
- Add in static html files
- Hide .html extension when accessing static pages
- Make a shared header nav-bar that’s accessible on any webpage of the website