-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathGenerateSimpleEquityGraph.R
executable file
·122 lines (90 loc) · 3.87 KB
/
GenerateSimpleEquityGraph.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
suppressMessages(library(knitr))
suppressMessages(library(markdown))
suppressMessages(library(getopt))
suppressMessages(library(xts))
suppressMessages(library(PerformanceAnalytics))
suppressMessages(library(ROneTick))
suppressMessages(library(foreach))
suppressMessages(library(quantmod))
suppressMessages(library(car))
suppressMessages(library(urca))
suppressMessages(library(compiler))
source("tsdPlotCoint.R")
enableJIT(3)
options(scipen=15,digits.secs=6)
spec = matrix(c(
'output' , 'o', 1, "character"
), byrow=TRUE, ncol=4);
opt = getopt(spec);
outputDir <- '.'
if(!is.null(opt$output)){
outputDir <<- opt$output
}
print(paste(outputDir,'\\all_index.html',sep=''))
print(paste(outputDir,'\\cor_index18.html',sep=''))
print(paste(outputDir,'\\cor_index.html',sep=''))
source('GraphBase.R')
source('GraphData.R')
maxIndex <- length(resultCor[,1])
symbolNames <- resultCor[,1][1:50]
html <- paste(outputDir,'/cor_index1.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- resultCor[,1][51:100]
html <- paste(outputDir,'/cor_index2.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- resultCor[,1][101:150]
html <- paste(outputDir,'/cor_index3.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- resultCor[,1][151:200]
html <- paste(outputDir,'/cor_index4.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- resultCor[,1][201:250]
html <- paste(outputDir,'/cor_index5.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- resultCor[,1][251:300]
html <- paste(outputDir,'/cor_index_6.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- resultCor[,1][301:maxIndex]
html <- paste(outputDir,'/cor_index_7.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
##### sorted by alphabet
maxIndex <- length(instruments)
symbolNames <- instruments[1:50]
html <- paste(outputDir,'/all_index1.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- instruments[51:100]
html <- paste(outputDir,'/all_index2.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- instruments[101:150]
html <- paste(outputDir,'/all_index3.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- instruments[151:200]
html <- paste(outputDir,'/all_index4.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- instruments[201:250]
html <- paste(outputDir,'/all_index5.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- instruments[251:300]
html <- paste(outputDir,'/all_index_6.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
symbolNames <- instruments[301:maxIndex]
html <- paste(outputDir,'/all_index_7.html',sep='')
knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)
#html <- paste(outputDir,'/cor_index18.html',sep='')
#knit2html(input="CorOrderSimpleEquityGraph.Rmd", output=html)
#
# html <- paste(outputDir,'/cor_index183.html',sep='')
# knit(input="CorOrderSimpleEquityGraph.Rmd",envir=new.env())
#
# html <- paste(outputDir,'/cor_index184.html',sep='')
# knit(input="CorOrderSimpleEquityGraph.Rmd",envir=new.env())
#
# html <- paste(outputDir,'/cor_index185.html',sep='')
# knit(input="CorOrderSimpleEquityGraph.Rmd",envir=new.env())
#knit2html("CorOrderSimpleEquityGraph.Rmd",output=html, envir=parent.frame())
#knit("CorOrderSimpleEquityGraph.Rmd",output="graph.md")
#html <- paste(outputDir,'/cor_index.html',sep='')
#knit2html("CorOrderSimpleEquityGraph.Rmd",output=html,envir=parent.frame())
#html <- paste(outputDir,'/all_index.html',sep='')
#knit(input="AlphaOrderSimpleEquityGraph.Rmd")
#knit2html(input="AlphaOrderSimpleEquityGraph.Rmd",output=html)