Benchmarking
Posted: August 14th, 2020, 8:08 pm
I decided that it would be interesting to benchmark my portfolio against other things.
In this case TRIUKX (FTSE total return).
A google search found a website that I could view the last 5 years of how it performed.
Unfortunately You could not download it as a csv.
So, cut and paste to a text editor (not word processor).
Ok so now to the processing.
I use *nix command line tools, you may think of them as linux tools, though they often predate linux.
The date format was odd. I used a combination of awk and sed to produce a date in the same format as the csv file containing my back history.
While I was at it I extracted the dates from my records using awk.
I then used grep and a "diff" package to identify dates that the two sets didn't share. It seems that the website giving me TRIUKX is missing a month!
Ok I ensured that I had two data sets that contained the same dates in the same order. I had to use tac, as the website worked most recent first while HYPTUSS puts the most recent at the end.
After that is was easy.
Tools used.
awk, available to run on windows if you search. Possibly known as gawk.
sed, dito.
grep, also available but often installed with any compiler.
diff, I used Kdiff3, also available for windows but you might like WinMerge instead.
tac, simply reverses the order of a file. It's cat spelt backwards. cat is the routine to list a file in *nix. You may use sort in the spreadsheet package instead.
I hope this is of some use to those who wish to produce csv files to benchmark their portfolio. A search will provide info about how easy awk and sed are to use, though human nature means that nobody remembers and we always have to look it up again.
Ps, I didn't use it but the "paste" command would enable a single csv to be produced containing both data sets, rather than load each into its own sheet in a spreadsheet workbook.
In this case TRIUKX (FTSE total return).
A google search found a website that I could view the last 5 years of how it performed.
Unfortunately You could not download it as a csv.
So, cut and paste to a text editor (not word processor).
Ok so now to the processing.
I use *nix command line tools, you may think of them as linux tools, though they often predate linux.
The date format was odd. I used a combination of awk and sed to produce a date in the same format as the csv file containing my back history.
While I was at it I extracted the dates from my records using awk.
I then used grep and a "diff" package to identify dates that the two sets didn't share. It seems that the website giving me TRIUKX is missing a month!
Ok I ensured that I had two data sets that contained the same dates in the same order. I had to use tac, as the website worked most recent first while HYPTUSS puts the most recent at the end.
After that is was easy.
Tools used.
awk, available to run on windows if you search. Possibly known as gawk.
sed, dito.
grep, also available but often installed with any compiler.
diff, I used Kdiff3, also available for windows but you might like WinMerge instead.
tac, simply reverses the order of a file. It's cat spelt backwards. cat is the routine to list a file in *nix. You may use sort in the spreadsheet package instead.
I hope this is of some use to those who wish to produce csv files to benchmark their portfolio. A search will provide info about how easy awk and sed are to use, though human nature means that nobody remembers and we always have to look it up again.
Ps, I didn't use it but the "paste" command would enable a single csv to be produced containing both data sets, rather than load each into its own sheet in a spreadsheet workbook.