From 678deb74675d4752d30717af5298e6c709c013b5 Mon Sep 17 00:00:00 2001 From: Kangrok Kim Date: Sat, 22 Jun 2019 20:24:53 +0900 Subject: [PATCH 1/4] Create QQ Plot.R --- Q-Q Plot/QQ Plot.R | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Q-Q Plot/QQ Plot.R 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) From dd7f4d3b0e3192cf950de6bcaa56bfd116a84d6b Mon Sep 17 00:00:00 2001 From: Kangrok Kim Date: Sat, 22 Jun 2019 20:28:29 +0900 Subject: [PATCH 2/4] Create Mean-SD.R --- Q-Q Plot/Mean-SD.R | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Q-Q Plot/Mean-SD.R 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) From 14e6ba332f273e942d394b6c8ce8311bd6fca2cf Mon Sep 17 00:00:00 2001 From: Kangrok Kim Date: Sat, 22 Jun 2019 20:37:47 +0900 Subject: [PATCH 3/4] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ae9530..53ea197 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ Someday these will be an integrated trading system, but not now. So I am sad. # 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 From c1a89ebd4086678fb2f5b9ec3c87727cc521402f Mon Sep 17 00:00:00 2001 From: Kangrok Kim Date: Sun, 15 Mar 2020 23:49:17 +0900 Subject: [PATCH 4/4] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53ea197..a04102f 100644 --- a/README.md +++ b/README.md @@ -1,12 +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 (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) +## Q-Q Plot (2015.1) Drawing Q-Q plots for monitoring daily/weekly investment performance Drawing scatterplot of mean and stadard error