As the title suggests I am doing some research about low volatility stocks for my Bachelor thesis.
I compiled the stock price quotes of German listed companies for 15 year and my goal is to build deciles of the stocks based on the volatility of stock prices in the prior month. This should happen on a rolling basis, i.e. every month new deciles. The deciles represent the portfolios and the code should also be able to give out the return of the different deciles over the 15 year period. Weighting of single stocks would be the same for the beginning.
My professor suggests to use R for the monthly rebalancing of the portfolios and everything else connected with the quantitative part of the thesis.
Now comes the problem. Unfortunately, I have absolutely now experience in coding and even though I watched some tutorials and am able to do some basic stuff in R, developing the code necessary for my problem is by far beyond my knowledge.
I really appreciate any help I can get on my problem and would be massively thankful for every hint.
Kind regard
Edit:
To have a more precise explanation of the problem, I will try to illustrate the problem below:
We have 100 stocks right now.
Month 1:
1.Decile: 10 Stocks with highest volatility in prior month grouped in one portfolio.
.
.
.
10.Decile: 10 Stocks with lowest volatility in prior month grouped in one portfolio.
Month 2:
1.Decile: 10 Stocks with highest volatility in prior month grouped in one portfolio.
.
.
.
10.Decile: 10 Stocks with lowest volatility in prior month grouped in one portfolio.
This sorting goes on for every month in the 15 year period. Obviously, every single stock can be in different deciles every month as it is set by its prior volatility.
Furthermore, the code should do as if I invest for example 1 dollar in the highest volatility portfolio, i.e. 10 cents in every stock. Then I hold the stock over the month and then the code needs to check whether there was a change in the 10 stocks in the highest vola portfolio and divest the stocks which are out and invest in the new in. In the end, the code should give out the return I would have generated by following this investment strategy.
Also, this should be done for every of the deciles to compare the results for the different volatility deciles.
Hopefully, it is a bit more clear now. If there are still problems understanding it, feel free to tell me.
Thank you very much.