-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTBLE_READ2.R
More file actions
50 lines (35 loc) · 742 Bytes
/
Copy pathTBLE_READ2.R
File metadata and controls
50 lines (35 loc) · 742 Bytes
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
library(data.table)
library(TTR)
library(dplyr)
library(plyr)
library(quantmod)
library(PerformanceAnalytics)
library(xts)
library(MASS)
#_____________
WINDOW <- 10
MAX<-last(cumsum(count.fields("STOCK_1.txt", sep = "")))
inputFile <- "STOCK_1.txt"
con <- file(inputFile, open = "r")
line <- as.numeric(readLines(con, n = MAX))
#read.table(con,skip=-1,nrow=2)
#LIBRIARIES
B <- (WINDOW:MAX)
for(i in B )
{ Sys.sleep(1)
beg = Sys.time()
#_____________________
DATS= NULL
# NEXT= union(c(1:i-1), c(i-1))+1
N =tail(union(c(1:i-1), c(i-1))+1, n = WINDOW )
x <- line[N]
DATS <- data.frame(N,x)
end = Sys.time()
print(DATS)
print(end-beg)
beg = NULL
end = NULL
N = NULL
X = NULL
#_____________________
}