Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Q-Q Plot/Mean-SD.R
Original file line number Diff line number Diff line change
@@ -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)
42 changes: 42 additions & 0 deletions Q-Q Plot/QQ Plot.R
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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