r - Sort stock price volatility data into deciles on a monthly rolling basis and calculate the return on outcoming portfolios -


as title suggests doing research low volatility stocks bachelor thesis.

i compiled stock price quotes of german listed companies 15 year , goal build deciles of stocks based on volatility of stock prices in prior month. should happen on rolling basis, i.e. every month new deciles. deciles represent portfolios , code should able give out return of different deciles on 15 year period. weighting of single stocks same beginning.

my professor suggests use r monthly rebalancing of portfolios , else connected quantitative part of thesis.

now comes problem. unfortunately, have absolutely experience in coding , though watched tutorials , able basic stuff in r, developing code necessary problem far beyond knowledge.

i appreciate can on problem , massively thankful every hint.

kind regard

edit:

to have more precise explanation of problem, try illustrate problem below:

we have 100 stocks right now.

month 1:

1.decile: 10 stocks highest volatility in prior month grouped in 1 portfolio.
.
.
.
10.decile: 10 stocks lowest volatility in prior month grouped in 1 portfolio.

month 2:

1.decile: 10 stocks highest volatility in prior month grouped in 1 portfolio.
.
.
.
10.decile: 10 stocks lowest volatility in prior month grouped in 1 portfolio.

this sorting goes on every month in 15 year period. obviously, every single stock can in different deciles every month set prior volatility.

furthermore, code should if invest example 1 dollar in highest volatility portfolio, i.e. 10 cents in every stock. hold stock on month , code needs check whether there change in 10 stocks in highest vola portfolio , divest stocks out , invest in new in. in end, code should give out return have generated following investment strategy.

also, should done every of deciles compare results different volatility deciles.

hopefully, bit more clear now. if there still problems understanding it, feel free tell me.

thank much.


Comments