Any other geeks working on software to manage their investme

Discuss all general (i.e. non-personal) investing questions and issues, investing news, and theory.
Post Reply
User avatar
Topic Author
PapaGeek
Posts: 322
Joined: Sun Nov 02, 2014 8:00 am
Location: North East, Maryland
Contact:

Any other geeks working on software to manage their investme

Post by PapaGeek »

I retired a year ago. I was a software engineer, hence the logon name of papageek, and I was working for a Hedge Fund that used trend following as one of the methods for investing in foreign currencies.

Naturally, once I was free of the SEC looking at everything I do, I’ve started writing my own trend following software for mutual funds and I was wondering if there are any other computer geeks in this forum who are doing the same thing.

On Edit: 11/3 I thought I’d give those reading this post a picture of what I am doing and why I’m doing it.

This all started because as I was investigating the websites of the various brokers, I found them to be lacking. On each you could create a list of funds, such as those that can be traded with no loads, and then sort the lists on the current returns for 1 month, 3 months, 1 year, YTD, etc. The problem was that after sorting the data on a single column, I could not see how the fund compared to other funds when sorted on another column.

So, I wrote a program to do the investigation and present it the way I wanted to look at the data. My program uses an external list of funds for comparison. The current list is over 380 funds and takes about 30 minutes to produce the report shown below. My plan is to the run the program every weekend and most likely move one or two funds around every couple of months.

Image

The first 3 rows show the performance of the top 3 market indexes for the illustrated list of timeframes. The rest of the rows show the funds I am following listed in an order which the program calculates.

The first column shows the fund symbol. Column 2 shows the monthly returns for each of the last 6 months. Column 3 shows the percentage that I have invested in that fund. I will talk about the next 3 columns in the next paragraph. The Sector column is used to insure that my investments are spread out over multiple sectors. Each of the time frame columns show the data I wanted to see on the broker websites. Each column is broken into 2 sub columns. The second sub column shows the rate of return on that fund for that time period and the first shows the order of that fund if the page was sorted just on that column’s rate of return. Each column pair is color coded. The darker red of the 1W data for FBIOX indicates that the ROR was lower than the lowest ROR of the indexes. The dark green of the remainder of that row says that the ROR was better than the best ROR for the indexes. The 6M entry for JAVTX is light green saying that it is not better than the best but is better than the average index ROR and the light red of the 1Y data says that is was less than the average but not less than the lowest index ROR.

Now back to the 3 columns I skipped. As I said before, I do not like looking at the list sorted on a single column as shown on the broker websites. My program creates different “views” of the data which can be seen by clicking the all and top links at the top of these columns. Each view is based on the sum of each fund’s 1M, 3M, 6M, and 1Y ranks. The long view ( 0111 ) ignores the 1M rank, while the short view ( 1110 ) ignores the 1Y rank. The numbers shown in each column are the order in which each fund appears in each of the views and this composite view is then presented in the order of the sum of the individual views.

I sure hope that what I just said can be easily translated from geek-speak to human language. I love talking about the software and will follow this post and answer any PMs. I’d also like to hear any suggestions on how to improve the software or presentation.
Last edited by PapaGeek on Mon Nov 03, 2014 11:55 am, edited 4 times in total.
User avatar
LadyGeek
Site Admin
Posts: 95466
Joined: Sat Dec 20, 2008 4:34 pm
Location: Philadelphia
Contact:

Re: Any other geeks working on software to manage their inve

Post by LadyGeek »

This thread is now in the Investing - Theory, News & General forum (general investing).

I suppose I should respond. :wink:

Welcome! You've come to the right place. For starters: Using a spreadsheet to maintain a portfolio

For a real challenge, check this out: Using open source software for portfolio analysis

If you have anything useful and it's not proprietary, supply a link and I'll incorporate it in the wiki. Uploading to Google Drive is fine.
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.
livesoft
Posts: 85971
Joined: Thu Mar 01, 2007 7:00 pm

Re: Any other geeks working on software to manage their inve

Post by livesoft »

Of course there are folks on the forum writing market timing software.

Here is one post about that: http://www.bogleheads.org/forum/viewtop ... 85#p877285
The same thread shows a possible user interface.
Wiki This signature message sponsored by sscritic: Learn to fish.
User avatar
Raybo
Posts: 2243
Joined: Tue Feb 20, 2007 10:02 am
Location: San Francisco
Contact:

Re: Any other geeks working on software to manage their inve

Post by Raybo »

I started managing and projecting my investments using spreadsheets back in the 90s. When I needed more sophistication, I turned to Java to create a complete financial management system that

Holds all my investments categorized by type (i.e. 70% Large Cap, 30% Small Cap)
Holds my estimated expenses
Would handle mortgage payments, if I had any
Allow me to estimate my yearly income
Identify my social security payment and when it will start
Allows me to specify my asset allocation to Stock components (Large Cap, International, etc), Bonds (TIPs, Short-term, etc), and Cash
Calculates my up to date asset allocation
Updates my fund NAVs every day after the market closes(4pm west coast time)

Since one thing I did was computer simulation, I added an engine to combine all this with estimated inflation, investment returns, interest, (using various distributions) and current taxes to estimate when I run out of money.

This program is incredibly useful for keeping track of my investments and comparing it to my desired AA. It even has a window based interface that is easy to use.
No matter how long the hill, if you keep pedaling you'll eventually get up to the top.
User avatar
Topic Author
PapaGeek
Posts: 322
Joined: Sun Nov 02, 2014 8:00 am
Location: North East, Maryland
Contact:

Re: Any other geeks working on software to manage their inve

Post by PapaGeek »

Thank you for your replies and sorry I put this in the wrong forum. And I’ll also say I’m sorry in advance for the long winded reply I’m about to make!

I ran my software this morning and just published the results at http://www.papageek.com/funds/index.html so I could create this link to let others see what I’m trying to do. This software takes a lot of steps to create the reports. Each step is not that complex, but does take time which is why I wrote a computer program to do it.

As I said in the original post this is software to follow investment trends. I run the software about twice a month to see if the trends are changing and then make personal decisions on where to move my investments.

It starts off by loading into memory over 380 funds that my broker will trade with no transaction fees. I then enhance the list with my current holdings and change the amounts into percentages for privacy. I then look up the historical adjusted closing prices for each fund for each timeframe I am interested in to create rate of return percentages.

After I create all of the percentages for all of the funds I sort the list for each return and assign a rank, 1 for the best return and so forth. Then the trend following part begins:

I combine various ranks such as the 3, 6 and 12 months for a long term view and 1, 3, and 6 months for a short term view to create an HTML report of each view. I then create a sub list of the top 30 funds expanded to include any funds I am invested in that are not in the top 30 and produce a second HTML report of the shorter list and again rank the funds based on their order in each top 30 report.

The final step is to combine the top 30 report ranks of all funds that appear in at least one top 30 report to create the http://www.papageek.com/funds/index.html report. The top of that report includes a line for each of the three primary market indexes which include links to the actual full and top 30 reports that were used to create the composite report. The invested funds are highlighted in green and the individual ranks are highlighted in yellow if that fund was added to a top 30 report even when it was ranked higher.

I use the composite report to see what sectors of the economy are currently returning the highest returns. I use the yellow flags to see which funds to investigate for possible changes in my investments. The small bar graph on each fund line shows the trend. It is divided into six segments to show how each fund performed in each of the past 6 months, each bar maxes out at plus and minus 10 percent.

It is interesting to note that none of the funds in the top 30 reports shows a negative return (red numbers) for any of the categories. If you click any of the “all” links in the top 3 lines and scroll to the bottom of those reports you will see plenty of negative returns. Also, the top 30 reports that I ran two weeks ago had a few negative returns do to the market correction since all of my returns are calculated date to date and do not use beginning of month as start and stop points.

Again, sorry if this is a long post, but the process does take several steps to produce the final report. The post would have been much longer if I got into the specifics, just hope I put down enough for everyone to understand. I’d love to hear the opinions of others and I’m definitely open to suggestions.
User avatar
kramer
Posts: 1952
Joined: Wed Feb 21, 2007 1:28 am
Location: World Traveler

Re: Any other geeks working on software to manage their inve

Post by kramer »

Before I retired in 2007, I wrote my own Monte Carlo simulation tool in Matlab. I found it very helpful in deciding if I was really ready to retire with respect to finances and it was simple to do what-if scenarios, especially with respect to variable spending in retirement.
Leeraar
Posts: 4109
Joined: Tue Dec 10, 2013 7:41 pm
Location: Nowhere

Re: Any other geeks working on software to manage their inve

Post by Leeraar »

PapaGeek wrote:I retired a year ago. I was a software engineer, hence the logon name of papageek, and I was working for a Hedge Fund that used trend following as one of the methods for investing in foreign currencies.

Naturally, once I was free of the SEC looking at everything I do, I’ve started writing my own trend following software for mutual funds and I was wondering if there are any other computer geeks in this forum who are doing the same thing.
I'd be interested in how you fared over the last month. What were the trends?

L.
You can get what you want, or you can just get old. (Billy Joel, "Vienna")
User avatar
jwillis77373
Posts: 395
Joined: Mon Jun 25, 2007 9:52 pm
Location: Texas

Re: Any other geeks working on software to manage their inve

Post by jwillis77373 »

I don't write software or spreadsheets to do this [anymore].

My reasoning is not as elegant as "someone can do it better" or "has more experience".

But more around the idea that trying to treat the market or any corner of the market as an abstract "black box" and to spot abstract "patterns" is probably not worth the time. The model is an approximate "fit" not exact, and will fail at the most costliest moment. Its an elegant thought experiment. And people do it for fun, and for a living.. but its just as Buffet and Bogle say.. "not my thing".

On the whole patterns are also rather like "fishing" in a pond or a lake, sooner or later another group of fishermen are going to spot them as well and change the behavior of the market. If there is one predictable characteristic, its that as technology and people become more "mindful" of the market it becomes "less predictable".. or "predictable" in a manner that minimizes "your" gains and maximizes "your" losses.

People can delude themselves into taking risk for all kinds of reasons, the well never runs dry of "rationales".. and desperation can also lead to taking ridiculous risks. These are things we can see and "work" to minimize in our best interests. The mistakes we make while "learning" however is the cost of doing business and its the tuition every investor pays.

Buffet and Bogle seem to both understand things like this and offer up words of wisdom from time to time. And people try to skewer them with their own logic.. but it matters not to them, they take some sort of pride in being proven right time after time.

If its your thing and you really analyze the market on an ongoing basis you might be able to make a living being a "fisherman" even Buffet says so, but if its not your thing and you'd rather solve intractable or abstract problems.. and seek profit, not entertainment.. I'd say spend the time otherwise.
User avatar
Topic Author
PapaGeek
Posts: 322
Joined: Sun Nov 02, 2014 8:00 am
Location: North East, Maryland
Contact:

Re: Any other geeks working on software to manage their inve

Post by PapaGeek »

Leeraar wrote:
PapaGeek wrote:I retired a year ago. I was a software engineer, hence the logon name of papageek, and I was working for a Hedge Fund that used trend following as one of the methods for investing in foreign currencies.

Naturally, once I was free of the SEC looking at everything I do, I’ve started writing my own trend following software for mutual funds and I was wondering if there are any other computer geeks in this forum who are doing the same thing.
I'd be interested in how you fared over the last month. What were the trends?

L.
My actual retirement date was Sept 30, 2013. I started my software back then but kept most of my holdings in my 401K with the rest in TD-Ameritrade, Amerivest account, letting someone else make the decisions so the SEC could not complain! I did not catch the July / August dip which did not reach the full 10% correction level. When the market came back an leveled out in early September, I chose that leveling market period, the recent short dip, and the 9/11 upcoming date, as the timing for moving my 401k to a self-directed IRA and I also liquidated the Amerivest account holdings.

The SEC says you can’t move your holdings from a 401K to an IRA, not sure why, you have to liquidate them and move them as cash. I did all the liquidations at the close on Sept 10. Naturally the market did bump back up shortly after nothing happened on the 11th and I was stuck in cash for a couple weeks while the transfers occurred. By the time I could get back in the 9/19 to 10/8 slow drop was happening and I decided to wait, glad I did because I was 83% cash when the big correction started.

When the market was low the software was telling me (short term) that muni bonds were good, but I ignored that because of the correction, waited till 10/21 and got back in. I ignored the muni bond suggestions because I knew we were just in a correction and used the longer term reports to choose the holdings that you are seeing on the pages I published.

FYI, the two questionable investments: GASFX was something I transferred over in kind from my previous broker and DNP is a select income fund that I’m thinking about for a more level sort of guaranteed source of income as part of what I’m leaving in the market.

I just modified my software to force it to run with a predefined date. As I am writing this reply I am also running the software for 10/16/14, a low point in the correction. The run is being done with my current investment, not what I was invested in on that date.

The run is complete and I posted it at www.papageek.com/funds16/index.html so you can see how the software indicated that you should be invested in municipal bonds. As I stated before, the software does not make the trades, it merely gives you information. I knew we were in a correction, so I ignored the bond recommendations and looked at what other sectors were recommended. My actual investments were made a few days later. Because of the correction situation caused the results to be clogged with bonds I also created a temporary smaller list of funds which did not include the bonds when I ran the software at that time.

If you look at the 10/2 output ( www.papageek.com/funds/index.html ) using the full fund list you can see that the choices were good. I’ll say it again, the software only gives you a view of the mutual fund market. You still have to look at it and make your own decisions.
User avatar
LadyGeek
Site Admin
Posts: 95466
Joined: Sat Dec 20, 2008 4:34 pm
Location: Philadelphia
Contact:

Re: Any other geeks working on software to manage their inve

Post by LadyGeek »

PapaGeek wrote:The SEC says you can’t move your holdings from a 401K to an IRA, not sure why, you have to liquidate them and move them as cash...
I don't know why either, but I'll bet we've got a member who does. Post a question in the Personal Finance (Not Investing) and ask. Don't give away any personally identifiable info, like the fund's name or people you've worked with.
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.
User avatar
warner25
Posts: 929
Joined: Wed Oct 29, 2014 4:38 pm

Re: Any other geeks working on software to manage their inve

Post by warner25 »

Nothing fancy but years ago as a beginning investor I wrote a quick and dirty (command line interface) Java application to back-test PE10-based market timing algorithms over various historical time periods. Shortly thereafter I read Four Pillars and abandoned the concept for a more sensible fixed AA. I'd like to do more programming but the simplicity of Bogleheadism leaves me with few ideas. Raybo's application sounds great, though.
Beliavsky
Posts: 1233
Joined: Sun Jun 29, 2014 10:21 am

Re: Any other geeks working on software to manage their inve

Post by Beliavsky »

R is a free statistical programming language used by some people in finance http://cran.r-project.org/web/views/Finance.html . There are packages such as TTR that enable you to download historical data from Yahoo Finance. I have used R, Excel, and Fortran to simulate investment strategies. Fortran has been around since the 1950s, but it has been modernized in successive standards such as Fortran 90 and Fortran 2003. For many financial simulations the data can be stored in a matrix (one row for each date, one column for each stock or fund), so a language with good support for matrices, such as R, Matlab, or Fortran 90+ is convenient. There are free Fortran compilers such as g95 and gfortran.

I want a program that will calculate the volatility of a portfolio, given its holdings, over various time periods, using daily data. Writing one is on my to-do list. IIRC the spreadsheets and sites that have been mentioned on this site for backtesting use annual or monthly returns, not daily returns.
User avatar
Hexdump
Posts: 1626
Joined: Fri Oct 10, 2008 7:28 am
Location: Houston, Texas

Re: Any other geeks working on software to manage their inve

Post by Hexdump »

When I was fooling around with buying and selling stocks and options, I put together a spreadsheet to filter stocks based upon the formula in the book by Ben Graham.

After all the filtering it recommended that I buy Presto, so I bought a ton of it.

I made a killing in that right after I bought it, Peter Lynch recommended it.
Maybe he was using my spreadsheet. :D
User avatar
Ged
Posts: 3944
Joined: Mon May 13, 2013 1:48 pm
Location: Roke

Re: Any other geeks working on software to manage their inve

Post by Ged »

Twenty-five years ago my father and I had a small business selling software that in combination with a data subscription allowed subscribers to investigate market trends.

The business made a small profit and more importantly it helped me better understand the futility of trying to outguess the market. The development of the internet gradually killed the business model.

Nowadays I just go with a simple portfolio of index stocks and worry how to minimize taxes during my retirement.
ctreada
Posts: 97
Joined: Tue Jun 10, 2014 1:35 pm

Re: Any other geeks working on software to manage their inve

Post by ctreada »

@PapaGeek very cool -- similar thoughts in some ways to something that my business partner and I are building and possibly launching for broader use/consumption.

From some basic tests we've run, there probably are ways to combine indexing, market timing, and rebalancing to better inform what to buy when.
leonard
Posts: 5993
Joined: Wed Feb 21, 2007 10:56 am

Re: Any other geeks working on software to manage their inve

Post by leonard »

Excel gets close enough for me.
Leonard | | Market Timing: Do you seriously think you can predict the future? What else do the voices tell you? | | If employees weren't taking jobs with bad 401k's, bad 401k's wouldn't exist.
placeholder
Posts: 8371
Joined: Tue Aug 06, 2013 12:43 pm

Re: Any other geeks working on software to manage their inve

Post by placeholder »

leonard wrote:Excel gets close enough for me.
I agree even though I'm a software engineer because for me the only useful information is how my asset allocation is doing and a spreadsheet works fine for that.
User avatar
Topic Author
PapaGeek
Posts: 322
Joined: Sun Nov 02, 2014 8:00 am
Location: North East, Maryland
Contact:

Re: Any other geeks working on software to manage their inve

Post by PapaGeek »

Leeraar wrote:
PapaGeek wrote:I retired a year ago. I was a software engineer, hence the logon name of papageek, and I was working for a Hedge Fund that used trend following as one of the methods for investing in foreign currencies.

Naturally, once I was free of the SEC looking at everything I do, I’ve started writing my own trend following software for mutual funds and I was wondering if there are any other computer geeks in this forum who are doing the same thing.
I'd be interested in how you fared over the last month. What were the trends?

L.
I wanted to wait a while before I answered this question, LOL didn't want to embarrass myself !

Here are my monthly results as of 12/11/2014. In January to September we had all of our IRAs with TD and our 401Ks with Principal and T Rowe Price. I started writing my software in August and began paper trading while I looked for a better broker, we chose Fidelity. Since we had to convert all of the 401Ks to cash to move them to Fidelity IRAs, we chose early September for the move so we would be in cash on 9/11. After the move, all of our re-investments and movement has been with the aid of my software.

The chart shows each calendar month, how our investments performed during that month, the average market performance for the month, and how our performance compared to the market. For average market I take the percentage returns of the S&P, DOW, and NASDAQ, add them together and divide by 3. Our goal is not necessarily to always make money each month, but to beat the market averages each month, and we have managed to do that each month since starting to use the software.

Code: Select all

as of 12/11     Me      Market      Delta
  Dec 14     -0.63%     -1.53%      0.90%
  Nov 14      3.40%      2.81%      0.59%
  Oct 14      4.19%      2.47%      1.71%
  Sep 14     -1.02%     -1.26%      0.24%
  Aug 14      2.65%      3.94%     -1.29%
  Jul 14     -1.87%     -1.31%     -0.55%
  Jun 14      1.50%      2.15%     -0.66%
  May 14      0.91%      2.01%     -1.11%
  Apr 14      0.51%     -0.21%      0.73%
  Mar 14      0.54%     -0.34%      0.63%
  Feb 14      3.10%      4.42%     -1.49%
  Jan 14     -0.72%     -3.53%      2.81%
Leeraar
Posts: 4109
Joined: Tue Dec 10, 2013 7:41 pm
Location: Nowhere

Re: Any other geeks working on software to manage their inve

Post by Leeraar »

Thank you. Good luck!

October 2014 will be the panic that never existed, since it does not show in the monthly data.

L.
You can get what you want, or you can just get old. (Billy Joel, "Vienna")
User avatar
Topic Author
PapaGeek
Posts: 322
Joined: Sun Nov 02, 2014 8:00 am
Location: North East, Maryland
Contact:

Re: Any other geeks working on software to manage their inve

Post by PapaGeek »

Leeraar wrote:Thank you. Good luck!

October 2014 will be the panic that never existed, since it does not show in the monthly data.

L.
Sorry Leeraar, I forgot to show you the trends that my software reported.

This picture only shows you the top 22 funds / sectors at the top of the list each month, which is what fits on the screen at the resolution I use. The actual report started off with the 289 funds that Fidelity will trade with No Load and No Transaction Fees. Since there are only 22 fund listed, it does not show all of my holdings. Each Ticker shows the percentage of my holdings in that fund and also the total percentage in that sector. As you move lower down the list it does show where I invested in funds that did not turn out to be the best, but the idea is the beat the market on average, not every time.

Image
Leeraar
Posts: 4109
Joined: Tue Dec 10, 2013 7:41 pm
Location: Nowhere

Re: Any other geeks working on software to manage their inve

Post by Leeraar »

I'll be sticking with VSMGX. :D

L.
You can get what you want, or you can just get old. (Billy Joel, "Vienna")
invst65
Posts: 644
Joined: Thu Nov 27, 2014 10:04 am

Re: Any other geeks working on software to manage their inve

Post by invst65 »

I'm also a software engineer (aka programmer) but not retired yet. Still writing code at 65 and plan to do it for about 2 more years.

I wasn't satisfied with any of the retirement planning software so I wrote my own using Visual Studio C++ earlier this year (I'm married to a 17-years younger wife for one thing and none of the available planners allow for that situation).

Also, didn't trust the other planners, truth be told. I have observed some major bugs in some of them.
Leeraar
Posts: 4109
Joined: Tue Dec 10, 2013 7:41 pm
Location: Nowhere

Re: Any other geeks working on software to manage their inve

Post by Leeraar »

invst65 wrote:I'm married to a 17-years younger wife for one thing
Wow. I hope you've considered that delaying your claim on Social Security to age 70 is probably an incredibly good choice for your wife.

L.
You can get what you want, or you can just get old. (Billy Joel, "Vienna")
invst65
Posts: 644
Joined: Thu Nov 27, 2014 10:04 am

Re: Any other geeks working on software to manage their inve

Post by invst65 »

Leeraar wrote:
invst65 wrote:I'm married to a 17-years younger wife for one thing
Wow. I hope you've considered that delaying your claim on Social Security to age 70 is probably an incredibly good choice for your wife.

L.
Yes, I've considered this but the program I wrote, that I am referring to, does not bear this out in cold hard facts. She has more money after I die, if I collect earlier, even using conservative estimates of growth on our own non-governmental investments.
User avatar
Topic Author
PapaGeek
Posts: 322
Joined: Sun Nov 02, 2014 8:00 am
Location: North East, Maryland
Contact:

Re: Any other geeks working on software to manage their inve

Post by PapaGeek »

invst65 wrote:
Leeraar wrote:
invst65 wrote:I'm married to a 17-years younger wife for one thing
Wow. I hope you've considered that delaying your claim on Social Security to age 70 is probably an incredibly good choice for your wife.

L.
Yes, I've considered this but the program I wrote, that I am referring to, does not bear this out in cold hard facts. She has more money after I die, if I collect earlier, even using conservative estimates of growth on our own non-governmental investments.
I’ve done a bit of research on Social Security, [link removed by admin LadyGeek]
Key points you should remember about when to start Social Security.

If you start before your full retirement age: You monthly benefit check will be reduced by a 5/12 of 1 percent for each month that you retire before your full retirement age. Also, to stop you from taking your benefit while you continue to work, they limit your earned income to about $15,400. They literally take more than 100% of any income over that back in a combination of benefit penalties, taxes, and fees.

If you retire after your full retirement age: A little known fact is that your benefit DOES NOT increase 8/12 of 1 percent on a “monthly” basis. It goes up in chunks every January. For example if you were born in September and your full retirement age is exactly age 66. Your benefit would increase 8/12 of 1 percent for 3 months so in January of age 66 you would get 102% of your benefit. The following January your benefit would go up the full 8% to 110%, and so forth each January until you reach age 70, and the September you reach age 70 your benefit would be increased to the full 132%.

In other words, if you delay taking your benefits, the best months of the year to do it are February or March (?), wait for the new COLA to take effect, then make your claim, and ask for the other less know item: you can ask for up to 6 months of retroactive payments. But remember if you ask for any retro payments that take you past January, your benefit will be reduced to the prior year’s benefit level.
Post Reply