Recursive Loop for Compound Interest, Portfolio, etc.
I am trying to do something that is simple and I think recursive loops should help, but so far they don’t. I can do this in Excel, but it is tedious and I’m hoping KNIME is the answer.
Basically I have a portfolio of 10 stocks with an initial investment of some number, say 100,000. Then at the end of the week it is sold. The amount of cash at the end of the week is reinvested in 10 other stocks, using the ending value of the previous week. This process continues for many weeks.
It is the ending value that I want to carry over to the next week, so that it is the starting value for the portfolio the next week. I could do the work on the portfolio by week using the Group Loop, but of course the value of the first week doesn’t feed back to the second week when it starts in the Group Loop.
I put a Recursive Loop within the Group Loop, but I must have done something wrong because the result is no different – the value of the portfolio does not get used by the next batch of rows in the Group Loop.
It seems this is like doing compound interest calculations, but I couldn’t find any examples using KNIME. I looked at all of the posts in the Forum about recursive loops, but couldn’t find something similar that would help.
Does anyone have any understandable examples of this kind of thing in KNIME? Thank you.