Could someone point me in the right directions of how to right the excel VBA code to auomatically get the desired results as shown in column D for an indefinite amount of rows of the attached spreadsheet image. I am pretty much trying to figure out how to buy a stock on Date A (column A) and Sell the stock on Day B (column B) and make a profit of C % (column C) and then i want to take the profit + my initial investmentment and reinvest it the next row if the previous row sell date is less then the current row buy date. If the previous row sell date is greater than the current row buy date, i want the code to only invest 2k in the current row, but it should also know how much and when any funds are available to be invested and invest the funds accordingly.
See example in attached image. Thanks a bunch
Bookmarks