Page 1 of 1


Posted: Fri Nov 03, 2017 3:14 pm
by blippy
Yahoo Finance had a good service that allowed you to download share prices. Unfortunately, it seems to have been acting up lately, and is going the way of all things Yahoo, namely downhill.

The good news is that Mathematica can download share prices. If anyone is interested in learning how Mathematica can be used as a portfolio tracker, then let me know, and I'll do a write-up on it.

I'm very happy that Mathematica is included in the Raspberry Pi distro. I hope it continues!

Re: Portfolio

Posted: Wed Mar 14, 2018 12:10 pm
by Daveawalker
Yes I would be interested. What stockmarkets can it download from?

Re: Portfolio

Posted: Fri Mar 16, 2018 12:32 pm
by blippy
Daveawalker wrote:
Wed Mar 14, 2018 12:10 pm
Yes I would be interested. What stockmarkets can it download from?
I am new to Mathematica, so I can give very little in the way of advice. It uses Mathematica's Financial Entity, so I assume that its coverage is extensive.

Yahoo Finance is effectively defunct, but Mathematica still works. It's not 100%, though. Opening prices seems quite stable, but latest trades don't seem to work particularly well. Closing prices are 99% OK, but seem to fail on some stocks for whatever reason. L:IAG (International Airline Group) is a large company quoted on the London Stock Exchange, but its closing price always seems to be unavailable.

You'll probably need to experiment.

Here is a script that values your portfolio: ... 7817b5c7eb

What you need to do is create the file ~/tmp/port.tsv. Each line in the file should contain a record of the stocks you hold. Each record should contain:
* the ticker symbol
* a tab separator
* the quantity of stock held
in that order.

Ticker symbols should be qualified with the relevant exchange. For example, Vodafone is listed on the LSE (London Stock Exchange), so it would have the symbol L:VOD . On the NYSE or NASDAQ you can possibly avoid qualifying the exchange. Try it and see.

You can make things fancier, if you like, by, for example, trying to calculate the gain for the day. You'd have to adjust the output by taking the latest trade from the opening price, and multiplying by the number of share shares held.

Hope that helps.

Let me know how you get on.