diff --git a/Q-Q Plot/Mean-SD.R b/Q-Q Plot/Mean-SD.R new file mode 100644 index 0000000..101cd26 --- /dev/null +++ b/Q-Q Plot/Mean-SD.R @@ -0,0 +1,21 @@ +## 일간/주간 수익률 - 표준편차 비교 + +avg = NULL; avg2 = NULL +sd = NULL; sd2 = NULL +g <- c("2-A", "2-B1", "2-B2", "2-C", "3-A") + +for (i in 1:5) { + avg <- c(avg, mean(money[,9][money$Group==g[i]])) + avg2 <- c(avg2, mean(money2[,6][money2$Group==g[i]])) + sd <- c(sd, sd(money[,9][money$Group==g[i]])) + sd2 <- c(sd2, sd(money2[,6][money2$Group==g[i]])) +} + +windows(width=9, height=5) +par(mfrow=c(1,2)) +plot(avg, sd, names=g, main="일간 수익률 평균-표준편차", + xlim=c(-0.010,0.010), ylim=c(0,0.100)) + text(x=avg, y=sd, label=g, pos=3, adj=1, cex=1) +plot(avg2, sd2, names=g, main="주간 수익률 평균-표준편차", + xlim=c(-0.03,0.03), ylim=c(0,0.100)) + text(x=avg2, y=sd2, label=g, pos=3, adj=1, cex=1) diff --git a/Q-Q Plot/QQ Plot.R b/Q-Q Plot/QQ Plot.R new file mode 100644 index 0000000..568a057 --- /dev/null +++ b/Q-Q Plot/QQ Plot.R @@ -0,0 +1,42 @@ +## 일일수익률 QQ Plot ## + +money <- read.csv("longshort_150118.csv", header=T, na.strings=".") +summary(money[,-c(2,3,5,6,7)]) + +attach(money[,-c(2,3,5,6,7)]) + +library(lattice) + +windows(width=7, height=5) +xyplot(수익률~rank(수익률)|Group, + main="주식선물 일간수익률 Q-Q Plot (20140421~20150116)", + panel=function(x,y) { + panel.xyplot(x,y) + panel.abline(h=mean(y), col="red") + panel.abline(h=0, lty=3) + } +) + +detach(money) + + +## 주간수익률 QQ Plot ## + +money2 <- read.csv("longshort_150118_2.csv", header=T, na.strings=".") +summary(money2)[,c(1,2,5,6,7)] + +attach(money2[,c(1,2,5,6,7)]) + +library(lattice) + +windows(width=7, height=5) +xyplot(수익률~rank(수익률)|Group, abline=c(h=0), + main="주식선물 주간수익률 Q-Q Plot (20140421~20150116)", + panel=function(x,y){ + panel.xyplot(x,y) + panel.abline(h=mean(y), col="red") + panel.abline(h=0, lty=3) + } +) + +detach(money2) diff --git a/README.md b/README.md index 1ae9530..a04102f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,12 @@ # Investment-Monitoring-Modules Someday these will be an integrated trading system, but not now. So I am sad. -# R_Monte_Carlo_Simulation (2018.3.28) +## R_Monte_Carlo_Simulation (2018.3.28) +A simulation by the Monte Carlo method -# Boxplot.R (2018.1.11) +## Boxplot (2018.1.11) Drawing boxplots divided by groups and months for monitoring multi-strategy investment performance + +## Q-Q Plot (2015.1) +Drawing Q-Q plots for monitoring daily/weekly investment performance +Drawing scatterplot of mean and stadard error