Aurelien Roussille
December 23,2017
The analyse focus on the CAC 40 and about its mains stocks. Analyse how each stock and the index behave.
To get the evolution of stock, we use the package quantmod, which go to yahoo to get the prices and we put its in a data.frame and the all in a list
{r, eval=FALSE}
comp<-c("CAC40","Total","Sanofi","BNP",
"LVMH","Airbus","Axa","L'Oreal",
"Air Liquide","Danone","Vinci",
"Schneider","Societe Generale",
"Kering","Orange")
ref<-data.frame("^FCHI","FP.PA","SAN.PA",
"BNP.PA","MC.PA","AIR.PA","CS.PA","OR.PA",
"AI.PA","BN.PA","DG.PA","SU.PA","GLE.PA",
"KER.PA","ORA.PA")
colnames(ref)<-comp
for (i in 1:length(comp)){
stock<-ref[1,i]
stock<-as.character(stock)
getSymbols(stock,src="yahoo",from=trim-15,to=Sys.Date())
}
for (i in 1:length(comp)){
ref[,i]<-as.character(ref[,i])
}
ref[,1]<-c("FCHI")
data<-list()
for (i in 1:length(comp)){
data[[i]]<-get(ref[,i])
}
names(data)<-comp
We stop the loading at 3 months for a time gain and use an easy useness of the app.
You can generate the Simple Moving Average with the checkbox on the left. The SMA loaded are 2 days, 5 days and 10 days, because we load only 3 month, and it's just for small analyse, get the trend in a short horizon.