I am working on a research paper, but I am quite bad at programming. Actually, I have no experience in it. What I need is the following.
-To buy a stock that's part of the S&P the day after its price fell for 10% or more, hold it for 21 days and then sell it.
-To sell a stock that's part of the S&P the day after its price rose for 10% or more and hold it for 21 days.
Each investment will be 10% of the portfolio. If there are 10 stocks in the portfolio and there is a stock that fell/rose for 10% or more, its ignored.
I'm looking forward for your code.