Love scripts, where did you learn them? I'm trying to pick the skill as well.
Ricchan wrote: ↑
Sat Oct 26, 2019 1:16 pm
I wrote a script to calculate the cost in terms of additional days of lost interest for any given starting day for any given time period. Click the "run" button at the top of the page produce output. https://repl.it/@ricchan/RecurringContributionDay
For each starting day (e.g. 2019-10-31), it prints two lines. The first is a list of single letter abbreviations for which day of the week the recurring date falls into each month. "R" is Thursday, "U" is Sunday. The second is a list of the number of additional days of lost interest, assuming the funds need to arrive in the non-interest bearing account the day before the recurring transaction. So, for Sunday, the cost is 1; Monday is 2; all other days are 0.
The total cost of additional days of lost interest for each starting date is shown at the start of the second line.
You can tweak the script by changing any of the variables. Some that might be of interest are:
- date_first: The first date candidate to consider. I use 10/31/2019. You can change it to e.g. 11/01/2019 if you don't care about October.
- date_max: Basically the maturity date of the CD. I use 10/30/2022 for the 3 year CD.
I didn't consider holidays because it would require importing some library that has knowledge of not only the holidays, but also which ones are considered banking holidays. Either that, or manually add them in. Both of those sound like a pain to me, but if anyone knows of a better way to do it (or is willing to just do it themselves), feel free to fork/edit the code and share.