{"id":28364026,"url":"https://github.com/chrisfosterelli/invest-timer","last_synced_at":"2025-07-21T07:04:34.075Z","repository":{"id":66581292,"uuid":"94163963","full_name":"chrisfosterelli/invest-timer","owner":"chrisfosterelli","description":"Simple Haskell simulation to determine best interval to invest in ETF's","archived":false,"fork":false,"pushed_at":"2017-06-13T16:17:14.000Z","size":66,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T00:35:50.123Z","etag":null,"topics":["haskell","investment-portfolio","simulation"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisfosterelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-06-13T03:15:50.000Z","updated_at":"2020-09-11T07:50:12.000Z","dependencies_parsed_at":"2023-06-01T23:45:37.060Z","dependency_job_id":null,"html_url":"https://github.com/chrisfosterelli/invest-timer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chrisfosterelli/invest-timer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisfosterelli%2Finvest-timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisfosterelli%2Finvest-timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisfosterelli%2Finvest-timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisfosterelli%2Finvest-timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisfosterelli","download_url":"https://codeload.github.com/chrisfosterelli/invest-timer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisfosterelli%2Finvest-timer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266255262,"owners_count":23900102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","investment-portfolio","simulation"],"created_at":"2025-05-28T19:41:09.704Z","updated_at":"2025-07-21T07:04:34.063Z","avatar_url":"https://github.com/chrisfosterelli.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Invest Timer\n============\n\nIt is often mentioned that, when using ETF's for a passive investing strategy,\nit is better to contribute infrequent lump sums instead of small monthly \npayments, primarily due to the fees associated with purchases of ETF's. Most \nbrokerages charge between $5-$35, so if you are only contributing small monthly \namounts the charge is eating away at a large portion of that.\n\nHowever, on the other hand every month you wait is investment return you are\nnot receiving. I couldn't find any concrete info on what amounts or with what\nregularity we should actually be contributing to ETF's -- is it once per year,\nonce every five months, once every month? What is most optimal?\n\nThis is a short Haskell script that simulates an investment portfolio based on\na given brokerage fee, time range, monthly savings, and average return to \ndetermine what schedule is the most efficient to buy with. The reality is the\nbest time is going to be somewhere in the middle of the month most of the time,\nbut I only wanted to consider the end of each month for practicality reasons.\n\nAll of the simulations assume a 10 year estimation window.\n\nI played with a bunch of different configurations and the vast majority of the\ntime the most optimal window is to invest every 2 - 5 months, depending on the\nparticular settings. For most situations, choosing to invest every three months\nis a relatively safe bet that will either be optimal or relatively close to it.\n\n## Basic Estimate\n\nThis assumes a fee of $10, an average return of 4%, and a monthly contribution\nof $1,000. You can see that, in this case, the best time to invest is every \ntwo or three months.\n\n![Chart 1](graphs/1.png)\n\n## High Return Estimate\n\nIf you're young you may have a more aggressive portfolio and consider 4% a low\nreturn, but we can increase it to 8% for a different graph. As you'd expect,\nthis skews the graph toward investing more often -- as your return goes up it \nwill be more valuable to invest earlier. For our settings this causes every\nsecond month to be the optimal choice.\n\n![Chart 2](graphs/2.png)\n\n## Low Savings Estimate\n\nMay $1,000 a month is a bit aggressive and you may not be able to make that \ncontribution every single month. Let's take our average way down to a $500/month\ncontribution and see how that changes the results. Fee's will now take a bigger\ncut of the contribution so it will be better to invest every fourth month.\n\n![Chart 3](graphs/3.png)\n\n## High Fees Estimate\n\nWhat if we are using an online brokerage with very high fees? Most are in the\nrange of $5-$10 but some are as high as $35/trade. At $35 we can see this\naffects the optimal month and it now makes the most sense to invest every five \nmonths. It's interesting to note that, even if you invest optimally in both \nsituations, the higher fees work out to about $1,000 (~0.7%) less value in the \nportfolio.\n\n![Chart 4](graphs/4.png)\n\n## Shifted Estimate\n\nLet's try changing a bunch of fields and see how that affects the result. This\ngraph is a $2,000 monthly investment with a $15 fee and an average return of 8%.\nThis returns every second month as the most optimal.\n\n![Chart 5](graphs/5.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisfosterelli%2Finvest-timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisfosterelli%2Finvest-timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisfosterelli%2Finvest-timer/lists"}