Question: write a R code for Portfolio Optimisation using genetic algorithm using R language using Rmarkdown format: Part 1 The focus of the first part of

write a R code for Portfolio Optimisation using genetic algorithm using R language using Rmarkdown format: Part 1
The focus of the first part of the assignment is on the optimisation of the portfolio using a GA. To begin with, manually choose a set of assets to work with - which ones you select are entirely up to you, but aim to work with around 10 and also try to pick ones which don't all exhibit the same behaviour (e.g. maybe take them from different sectors).
Then use a genetic algorithm (and the GA package) to identify the optimal set of weights for your portfolio which gives the best balance of risk versus return.
Having done this you then need to conduct a detailed evaluation of the portfolio by looking at how well it might perform in the "future", and comparing it with other possible portfolios (particularly a balanced portfolio, where all weights are even, and a set of randomly generated portfolios).
Finally (for this part) try exploring different weightings of risk and return. The idea behind this it to try and emulate a multi-objective approach and you will need to think about how it is possible to modify the fitness function to create differently balanced portfolios - e.g. at the extremes might be ones which only care about maximising returns or are very risk averse, and in between might be ones which prioritise risk over return and vice-versa. How do the weights and the performance of these portfolios compare with each other and your other solutions? I want to use these stocks symbols<- c("KFH.KW","NBK.KW", "AGLTY.KW", "ZAIN.KW", "BOUBYAN.KW",
"WARBABANK.KW", "OOREDOO.KW","STC.KW", "NAPESCO.KW", "ABAR.KW") getSymbols(symbols, src = "yahoo" , from ="2022-01-01", to ="2023-01-1")
ReturnData <- data.frame(merge(dailyReturn(KFH.KW),
dailyReturn(NBK.KW), dailyReturn(AGLTY.KW), dailyReturn(ZAIN.KW),
dailyReturn(BOUBYAN.KW),dailyReturn(WARBABANK.KW),
dailyReturn(OOREDOO.KW), dailyReturn(STC.KW), dailyReturn(NAPESCO.KW),
dailyReturn(ABAR.KW))) meanofReturns <- apply(ReturnData,2,mean) covOfReturn <- cov(ReturnData) I did only this for part one and I don't know what fitness function to use and how to do the rest of part one and two. Part 2
Once you have done this successfully, then try extending your solution to select the set of assets for your GA to work on. The pool from which you select should be reasonably large (minimum of 50) and to begin with you may identify the selection criteria so that this GA operates independently of the one in part 1(but would pass on the set of identified assets to be weighted by the GA from part 1). Once you have this working (and if you are feeling ambitious!) then investigate how these might work together (working out an efficient evaluation mechanism is the key to this part).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!