SlideShare a Scribd company logo
1 of 33
Untitled7
In [45]:
library(readxl)
library(ggplot2)
library(tidyr)
library(lattice)
library(lubridate)
library(quantmod)
In [46]:
ss<-read.csv('C:UsersvinodDownloadsSHAREitLe
X507filestock_AAPL.csv',header=TRUE)
stock_AAPL <- as.data.frame(ss)
colnames(stock_AAPL) <-
c('Date','Symbol','Open','High','Low','Close','Volume','Macd','Mfi','Rsi','Wi
lliam_r','Stochastic_fast','Stochastic_slow','Bollinger_bands','Chaikin_money
_flow','Obv','Log_timestamp','Datasource')
stock_AAPL$Date <- as.integer(gsub('-','',stock_AAPL$Date))
ss <- stock_AAPL
ss
Da
te
S
y
m
b
ol
O
p
e
n
H
ig
h
L
o
w
Cl
o
s
e
Vo
lu
m
e
M
a
c
d
M
fi
R
si
Wi
lli
a
m_
r
Stoc
hast
ic_f
ast
Stoc
hast
ic_sl
ow
Bolli
nger
_ban
ds
Chaik
in_m
oney_
flow
Ob
v
Log_
time
stam
p
Da
tas
ou
rce
20
16
06
28
A
A
P
L
9
2.
9
0
9
3.
6
6
9
2.
1
4
9
3.
5
9
40
44
49
14
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
06
29
A
A
P
L
9
3.
9
7
9
4.
5
5
9
3.
6
3
9
4.
4
0
36
53
10
06
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20 A 9 9 9 9 35 N N N N NA NA NA NA NA 201
16
06
30
A
P
L
4.
4
4
5.
7
7
4.
3
0
5.
6
0
83
63
56
A A A A 7-
12-
28
06:0
9:09.
664
752
20
16
07
01
A
A
P
L
9
5.
4
9
9
6.
4
6
9
5.
3
3
9
5.
8
9
26
02
65
40
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
05
A
A
P
L
9
5.
3
9
9
5.
4
0
9
4.
4
6
9
4.
9
9
27
70
52
10
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
06
A
A
P
L
9
4.
6
0
9
5.
6
6
9
4.
3
7
9
5.
5
3
30
94
90
90
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
07
A
A
P
L
9
5.
7
0
9
6.
5
0
9
5.
6
2
9
5.
9
4
25
13
95
58
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
08
A
A
P
L
9
6.
4
9
9
6.
8
9
9
6.
0
5
9
6.
6
8
28
91
21
03
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
11
A
A
P
L
9
6.
7
5
9
7.
6
5
9
6.
7
3
9
6.
9
8
23
79
49
45
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
12
A
A
P
L
9
7.
1
7
9
7.
7
0
9
7.
1
2
9
7.
4
2
24
16
74
63
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
13
A
A
P
L
9
7.
4
1
9
7.
6
7
9
6.
8
4
9
6.
8
7
25
89
21
71
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
14
A
A
P
L
9
7.
3
9
9
8.
9
9
9
7.
3
2
9
8.
7
9
38
91
89
97
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
15
A
A
P
L
9
8.
9
2
9
9.
3
0
9
8.
5
0
9
8.
7
8
30
13
69
90
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20 A 9 1 9 9 36 N N N N NA NA NA NA NA 201
16
07
18
A
P
L
8.
7
0
0
0.
1
3
8.
6
0
9.
8
3
49
38
67
A A A A 7-
12-
28
06:0
9:09.
664
752
20
16
07
19
A
A
P
L
9
9.
5
6
1
0
0.
0
0
9
9.
3
4
9
9.
8
7
23
77
99
24
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
20
A
A
P
L
1
0
0.
0
0
1
0
0.
4
6
9
9.
7
4
9
9.
9
6
26
27
59
68
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
21
A
A
P
L
9
9.
8
3
1
0
1.
0
0
9
9.
1
3
9
9.
4
3
32
70
20
28
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
22
A
A
P
L
9
9.
2
6
9
9.
3
0
9
8.
3
1
9
8.
6
6
28
31
36
69
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
25
A
A
P
L
9
8.
2
5
9
8.
8
4
9
6.
9
2
9
7.
3
4
40
38
29
21
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
26
A
A
P
L
9
6.
8
2
9
7.
9
7
9
6.
4
2
9
6.
6
7
56
23
98
22
N
A
N
A
N
A
N
A
NA NA NA NA NA 201
7-
12-
28
06:0
9:09.
664
752
20
16
07
27
A
A
P
L
1
0
4.
2
6
1
0
4.
3
5
1
0
2.
7
5
1
0
2.
9
5
92
34
48
20
N
A
6
4
.
3
4
7
5
.
3
1
-
0.
17
0.8
3
49.1
5
NA 0.67 24
82
42
74
0
201
7-
12-
28
06:0
9:09.
664
752
20
16
07
28
A
A
P
L
1
0
2.
8
3
1
0
4.
4
5
1
0
2.
8
2
1
0
4.
3
4
39
86
98
39
N
A
6
5
.
2
7
7
7
.
5
4
-
0.
01
0.9
9
67.0
9
NA 0.72 28
81
12
57
9
201
7-
12-
28
06:0
9:09.
664
752
20
16
07
29
A
A
P
L
1
0
4.
1
9
1
0
4.
5
5
1
0
3.
6
8
1
0
4.
2
1
27
73
36
88
N
A
6
5
.
6
6
7
6
.
8
4
-
0.
04
0.9
6
92.5
3
NA 0.53 26
03
78
89
1
201
7-
12-
28
06:0
9:09.
664
752
20
16
08
01
A
A
P
L
1
0
4.
4
1
1
0
6.
1
5
1
0
4.
4
1
1
0
6.
0
5
38
16
78
71
N
A
6
6
.
7
2
7
9
.
6
5
-
0.
01
0.9
9
97.8
1
NA 0.44 29
85
46
76
2
201
7-
12-
28
06:0
9:09.
664
752
20 A 1 1 1 1 33 N 6 7 - 0.8 92.5 103. 0.51 26 201
16
08
02
A
P
L
0
6.
0
5
0
6.
0
7
0
4.
0
0
0
4.
4
8
81
65
56
A 5
.
4
7
1
.
6
7
0.
17
3 4 54 47
30
20
6
7-
12-
28
06:0
9:09.
664
752
20
16
08
03
A
A
P
L
1
0
4.
8
1
1
0
5.
8
4
1
0
4.
7
7
1
0
5.
7
9
30
20
26
41
N
A
6
5
.
0
6
7
4
.
0
1
-
0.
04
0.9
6
92.7
0
104.
48
0.40 29
49
32
84
7
201
7-
12-
28
06:0
9:09.
664
752
20
16
08
04
A
A
P
L
1
0
5.
5
8
1
0
6.
0
0
1
0
5.
2
8
1
0
5.
8
7
27
40
86
50
N
A
6
5
.
0
1
7
4
.
1
5
-
0.
03
0.9
7
92.0
9
105.
23
0.42 32
23
41
49
7
201
7-
12-
28
06:0
9:09.
664
752
20
16
08
05
A
A
P
L
1
0
6.
2
7
1
0
7.
6
5
1
0
6.
1
8
1
0
7.
4
8
40
55
34
02
N
A
6
5
.
4
6
7
6
.
8
6
-
0.
02
0.9
8
97.3
0
105.
96
0.33 36
28
94
89
9
201
7-
12-
28
06:0
9:09.
664
752
20
16
08
08
A
A
P
L
1
0
7.
5
2
1
0
8.
3
7
1
0
7.
1
6
1
0
8.
3
7
28
03
72
20
N
A
6
5
.
8
7
7
8
.
2
2
0.
00
1.0
0
98.5
4
106.
73
0.30 39
09
32
11
9
201
7-
12-
28
06:0
9:09.
664
752
20
16
08
09
A
A
P
L
1
0
8.
2
3
1
0
8.
9
4
1
0
8.
0
1
1
0
8.
8
1
26
31
52
04
N
A
6
6
.
0
1
7
8
.
8
8
-
0.
01
0.9
9
99.1
5
107.
50
0.19 41
72
47
32
3
201
7-
12-
28
06:0
9:09.
664
752
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
20
17
12
19
A
A
P
L
1
7
4.
9
9
1
7
5.
3
9
1
7
4.
0
9
1
7
4.
5
4
27
43
64
47
1
.
7
6
6
5
.
3
1
5
9
.
6
5
-
0.
25
0.7
5
85.7
6
173.
62
-0.09 18
33
61
67
3
201
7-
12-
20
08:0
6:50.
807
963
20
17
12
20
A
A
P
L
1
7
4.
8
7
1
7
5.
4
2
1
7
3.
2
5
1
7
4.
3
5
23
38
69
69
1
.
7
5
5
7
.
7
4
5
9
.
0
2
-
0.
27
0.7
3
80.4
8
174.
24
-0.07 15
99
74
70
4
201
7-
12-
20
21:1
6:03.
532
777
20
17
12
21
A
A
P
L
1
7
4.
1
7
1
7
6.
0
2
1
7
4.
1
0
1
7
5.
0
1
20
63
30
18
1
.
7
8
6
6
.
1
7
6
0
.
5
9
-
0.
20
0.8
0
76.1
0
174.
69
0.05 18
06
07
72
2
201
7-
12-
21
21:1
5:04.
196
729
20
17
12
22
A
A
P
L
1
7
4.
6
8
1
7
5.
4
2
1
7
4.
5
0
1
7
5.
0
1
16
11
45
73
1
.
7
9
6
0
.
1
1
6
0
.
5
9
-
0.
20
0.8
0
77.5
6
175.
00
0.09 18
06
07
72
2
201
7-
12-
22
21:1
4:48.
764
248
20
17
12
26
A
A
P
L
1
7
0.
8
0
1
7
1.
4
7
1
6
9.
6
8
1
7
0.
5
7
33
04
36
78
1
.
4
2
5
9
.
1
5
4
6
.
6
8
-
0.
62
0.3
8
65.8
3
174.
67
0.13 14
75
64
04
4
201
7-
12-
26
21:1
4:04.
040
019
20
17
12
27
A
A
P
L
1
7
0.
1
0
1
7
0.
7
8
1
6
9.
7
1
1
7
0.
6
0
21
18
29
52
1
.
1
1
6
0
.
2
7
4
6
.
7
7
-
0.
78
0.2
2
46.4
7
173.
91
0.09 16
87
46
99
6
201
7-
12-
27
21:1
3:34.
457
973
20
17
12
28
A
A
P
L
1
7
1.
0
0
1
7
1.
8
5
1
7
0.
4
8
1
7
1.
0
8
16
39
45
50
0
.
9
0
5
9
.
2
5
4
8
.
2
6
-
0.
73
0.2
7
29.0
1
173.
05
0.14 18
51
41
54
6
201
7-
12-
28
21:1
3:59.
573
336
20
17
12
29
A
A
P
L
1
7
0.
5
2
1
7
0.
5
9
1
6
9.
2
2
1
6
9.
2
3
25
88
43
94
0
.
5
7
5
2
.
2
8
4
3
.
2
4
-
0.
95
0.0
5
17.9
9
172.
07
0.11 15
92
57
15
2
201
7-
12-
29
21:1
4:30.
732
403
20
18
01
02
A
A
P
L
1
7
0.
1
6
1
7
2.
3
0
1
6
9.
2
6
1
7
2.
2
6
25
25
80
93
0
.
5
5
5
1
.
1
6
5
2
.
0
3
-
0.
62
0.3
8
23.5
2
171.
46
-0.45 18
45
15
24
5
201
8-
01-
02
21:1
4:32.
266
367
20
18
01
03
A
A
P
L
1
7
2.
5
3
1
7
4.
5
5
1
7
1.
9
6
1
7
2.
2
3
29
37
16
98
0
.
5
3
5
2
.
6
0
5
1
.
9
5
-
0.
62
0.3
8
27.0
2
171.
24
-0.06 15
51
43
54
7
201
8-
01-
03
21:1
4:45.
766
853
20
18
01
04
A
A
P
L
1
7
2.
5
1
7
3.
4
1
7
2.
0
1
7
3.
0
22
28
46
67
0
.
5
7
4
6
.
1
5
4
.
1
-
0.
52
0.4
8
41.1
9
171.
37
-0.26 17
74
28
21
201
8-
01-
04
4 7 8 3 1 2 4 21:1
5:08.
649
981
20
18
01
05
A
A
P
L
1
7
3.
4
4
1
7
5.
3
7
1
7
3.
0
5
1
7
5.
0
0
23
32
90
04
0
.
7
5
5
2
.
3
4
5
9
.
0
3
-
0.
28
0.7
2
52.6
3
171.
91
-0.11 20
07
57
21
8
201
8-
01-
05
21:1
5:48.
667
525
20
18
01
08
A
A
P
L
1
7
4.
3
5
1
7
5.
6
1
1
7
3.
9
3
1
7
4.
3
5
20
22
52
88
0
.
8
3
4
9
.
5
1
5
6
.
8
7
-
0.
36
0.6
4
61.4
9
172.
60
0.16 18
05
31
93
0
201
8-
01-
08
21:1
5:50.
417
819
20
18
01
09
A
A
P
L
1
7
4.
5
5
1
7
5.
0
6
1
7
3.
4
1
1
7
4.
3
3
21
50
84
11
0
.
8
8
4
1
.
5
7
5
6
.
8
0
-
0.
25
0.7
5
70.6
2
173.
24
0.22 15
90
23
51
9
201
8-
01-
09
21:1
5:00.
237
552
20
18
01
10
A
A
P
L
1
7
3.
1
6
1
7
4.
3
0
1
7
3.
0
0
1
7
4.
2
9
23
67
20
19
0
.
9
1
4
2
.
0
7
5
6
.
6
5
-
0.
25
0.7
5
71.3
3
173.
74
0.10 13
53
51
50
0
201
8-
01-
10
21:1
6:02.
049
576
go
ogl
e
20
18
01
11
A
A
P
L
1
7
4.
5
9
1
7
5.
4
9
1
7
4.
4
9
1
7
5.
2
8
17
85
02
27
1
.
0
0
4
8
.
5
2
5
9
.
4
6
-
0.
11
0.8
9
79.6
1
174.
22
0.06 15
32
01
72
7
201
8-
01-
11
21:1
6:58.
080
465
go
ogl
e
20
18
01
12
A
A
P
L
1
7
6.
1
8
1
7
7.
3
6
1
7
5.
6
5
1
7
7.
0
9
25
22
60
44
1
.
2
1
4
9
.
3
0
6
4
.
0
6
-
0.
03
0.9
7
86.7
9
174.
85
-0.04 17
84
27
77
1
201
8-
01-
12
21:1
4:51.
689
705
go
ogl
e
20
18
01
16
A
A
P
L
1
7
7.
9
0
1
7
9.
3
9
1
7
6.
1
4
1
7
6.
1
9
29
47
75
32
1
.
2
8
5
6
.
2
7
6
0
.
3
9
-
0.
31
0.6
9
84.7
8
175.
44
-0.07 14
89
50
23
9
201
8-
01-
16
21:1
6:02.
657
499
go
ogl
e
20
18
01
17
A
A
P
L
1
7
6.
1
5
1
7
9.
2
5
1
7
5.
0
7
1
7
9.
1
0
33
88
84
77
1
.
5
6
6
6
.
2
2
6
6
.
9
7
-
0.
03
0.9
7
87.4
6
176.
24
-0.07 18
28
38
71
6
201
8-
01-
17
21:1
6:03.
011
461
go
ogl
e
20
18
01
18
A
A
P
L
1
7
9.
3
7
1
8
0.
1
0
1
7
8.
2
5
1
7
9.
2
6
31
03
53
39
1
.
7
7
7
3
.
2
9
6
7
.
2
9
-
0.
08
0.9
2
85.9
9
177.
15
-0.06 21
38
74
05
5
201
8-
01-
18
21:1
4:56.
659
790
go
ogl
e
20
18
01
19
A
A
P
L
1
7
8.
6
1
1
7
9.
5
8
1
7
7.
4
1
1
7
8.
4
6
31
26
96
06
1
.
8
5
6
5
.
6
2
6
3
.
9
4
-
0.
15
0.8
5
91.4
5
177.
91
-0.05 18
26
04
44
9
201
8-
01-
19
21:1
6:09.
843
121
go
ogl
e
20
18
01
22
A
A
P
L
1
7
7.
3
1
7
7.
7
1
7
6.
6
1
7
7.
0
26
59
98
29
1
.
7
8
6
5
.
2
5
8
.
2
-
0.
29
0.7
1
82.8
7
178.
27
0.07 15
60
04
62
201
8-
01-
22
go
ogl
e
0 8 0 0 9 4 0 21:1
5:10.
310
906
20
18
01
23
A
A
P
L
1
7
7.
3
0
1
7
9.
4
4
1
7
6.
8
2
1
7
7.
0
4
31
88
90
15
1
.
7
0
6
6
.
0
1
5
8
.
3
5
-
0.
38
0.6
2
72.9
1
178.
31
0.11 18
78
93
63
5
201
8-
01-
23
21:1
5:10.
009
916
go
ogl
e
20
18
01
24
A
A
P
L
1
7
7.
2
5
1
7
7.
3
0
1
7
3.
2
0
1
7
4.
2
2
51
12
01
93
1
.
4
0
5
4
.
8
9
4
8
.
6
5
-
0.
73
0.2
7
53.5
0
177.
83
0.15 13
67
73
44
2
201
8-
01-
24
21:1
5:45.
208
326
go
ogl
e
20
18
01
25
A
A
P
L
1
7
4.
5
0
1
7
4.
9
5
1
7
0.
5
3
1
7
1.
1
1
40
54
91
10
0
.
9
0
5
2
.
5
0
4
0
.
6
3
-
0.
94
0.0
6
31.7
2
176.
68
0.11 96
22
43
32
201
8-
01-
25
21:1
4:11.
129
730
go
ogl
e
20
18
01
26
A
A
P
L
1
7
2.
0
0
1
7
2.
0
0
1
7
0.
0
6
1
7
1.
5
1
37
68
75
44
0
.
5
3
4
5
.
3
2
4
1
.
9
5
-
0.
86
0.1
4
15.7
3
175.
27
0.16 13
39
11
87
6
201
8-
01-
26
21:1
5:31.
350
536
go
ogl
e
20
18
01
29
A
A
P
L
1
7
0.
1
6
1
7
0.
1
6
1
6
7.
0
7
1
6
7.
9
6
50
50
05
91
-
0
.
0
5
3
8
.
0
1
3
4
.
5
8
-
0.
93
0.0
7
9.11 173.
51
0.13 83
41
12
85
201
8-
01-
29
21:1
4:20.
006
246
go
ogl
e
20
18
01
30
A
A
P
L
1
6
5.
5
2
1
6
7.
3
7
1
6
4.
7
0
1
6
6.
9
7
45
39
65
99
-
0
.
5
9
3
6
.
2
6
3
2
.
8
4
-
0.
85
0.1
5
12.0
0
171.
59
0.16 38
01
46
86
201
8-
01-
30
21:1
5:53.
766
199
go
ogl
e
20
18
01
31
A
A
P
L
1
6
6.
8
7
1
6
8.
4
4
1
6
6.
5
0
1
6
7.
4
3
31
79
85
94
-
0
.
9
6
4
2
.
0
7
3
4
.
4
9
-
0.
82
0.1
8
13.1
0
169.
87
0.30 69
81
32
80
201
8-
01-
31
21:1
4:46.
099
019
go
ogl
e
20
18
02
01
A
A
P
L
1
6
7.
1
6
1
6
8.
6
2
1
6
6.
7
6
1
6
7.
7
8
38
42
88
26
-
1
.
2
2
4
4
.
2
7
3
5
.
7
8
-
0.
80
0.2
0
17.4
9
168.
56
-0.18 10
82
42
10
6
201
8-
02-
01
21:1
5:08.
802
228
go
ogl
e
Histogram of dates in the dataset¶
In [47]:
ggplot(stock_AAPL,aes(x=Date))+ geom_histogram()
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
In [58]:
stock_AAPL_filtered <- stock_AAPL %>% dplyr :: filter(Date >20170000)
ggplot(stock_AAPL_filtered,aes(x=Date)) + geom_histogram(aes(fill=
..count..),col="grey")+
ggtitle(' Histogram of dates after filtering for
2018')
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
In [6]:
ss<-read.csv('C:UsersvinodDownloadsSHAREitLe
X507filestock_AAPL.csv',header=TRUE)
stock_AAPL <- as.data.frame(ss)
stock_AAPL_s <- stock_AAPL[,1:7]
AAPL <- subset(stock_AAPL_s, select=-c(symbol))
AAPL
date_txn open high low close volume
2016-06-28 92.90 93.66 92.14 93.59 40444914
2016-06-29 93.97 94.55 93.63 94.40 36531006
2016-06-30 94.44 95.77 94.30 95.60 35836356
2016-07-01 95.49 96.46 95.33 95.89 26026540
2016-07-05 95.39 95.40 94.46 94.99 27705210
2016-07-06 94.60 95.66 94.37 95.53 30949090
2016-07-07 95.70 96.50 95.62 95.94 25139558
2016-07-08 96.49 96.89 96.05 96.68 28912103
2016-07-11 96.75 97.65 96.73 96.98 23794945
2016-07-12 97.17 97.70 97.12 97.42 24167463
2016-07-13 97.41 97.67 96.84 96.87 25892171
2016-07-14 97.39 98.99 97.32 98.79 38918997
2016-07-15 98.92 99.30 98.50 98.78 30136990
2016-07-18 98.70 100.13 98.60 99.83 36493867
2016-07-19 99.56 100.00 99.34 99.87 23779924
2016-07-20 100.00 100.46 99.74 99.96 26275968
2016-07-21 99.83 101.00 99.13 99.43 32702028
2016-07-22 99.26 99.30 98.31 98.66 28313669
2016-07-25 98.25 98.84 96.92 97.34 40382921
2016-07-26 96.82 97.97 96.42 96.67 56239822
2016-07-27 104.26 104.35 102.75 102.95 92344820
2016-07-28 102.83 104.45 102.82 104.34 39869839
2016-07-29 104.19 104.55 103.68 104.21 27733688
2016-08-01 104.41 106.15 104.41 106.05 38167871
2016-08-02 106.05 106.07 104.00 104.48 33816556
2016-08-03 104.81 105.84 104.77 105.79 30202641
2016-08-04 105.58 106.00 105.28 105.87 27408650
2016-08-05 106.27 107.65 106.18 107.48 40553402
2016-08-08 107.52 108.37 107.16 108.37 28037220
2016-08-09 108.23 108.94 108.01 108.81 26315204
... ... ... ... ... ...
2017-12-19 174.99 175.39 174.09 174.54 27436447
2017-12-20 174.87 175.42 173.25 174.35 23386969
2017-12-21 174.17 176.02 174.10 175.01 20633018
2017-12-22 174.68 175.42 174.50 175.01 16114573
2017-12-26 170.80 171.47 169.68 170.57 33043678
2017-12-27 170.10 170.78 169.71 170.60 21182952
2017-12-28 171.00 171.85 170.48 171.08 16394550
2017-12-29 170.52 170.59 169.22 169.23 25884394
2018-01-02 170.16 172.30 169.26 172.26 25258093
2018-01-03 172.53 174.55 171.96 172.23 29371698
2018-01-04 172.54 173.47 172.08 173.03 22284667
2018-01-05 173.44 175.37 173.05 175.00 23329004
2018-01-08 174.35 175.61 173.93 174.35 20225288
2018-01-09 174.55 175.06 173.41 174.33 21508411
2018-01-10 173.16 174.30 173.00 174.29 23672019
2018-01-11 174.59 175.49 174.49 175.28 17850227
2018-01-12 176.18 177.36 175.65 177.09 25226044
2018-01-16 177.90 179.39 176.14 176.19 29477532
2018-01-17 176.15 179.25 175.07 179.10 33888477
2018-01-18 179.37 180.10 178.25 179.26 31035339
2018-01-19 178.61 179.58 177.41 178.46 31269606
2018-01-22 177.30 177.78 176.60 177.00 26599829
2018-01-23 177.30 179.44 176.82 177.04 31889015
2018-01-24 177.25 177.30 173.20 174.22 51120193
2018-01-25 174.50 174.95 170.53 171.11 40549110
2018-01-26 172.00 172.00 170.06 171.51 37687544
2018-01-29 170.16 170.16 167.07 167.96 50500591
2018-01-30 165.52 167.37 164.70 166.97 45396599
2018-01-31 166.87 168.44 166.50 167.43 31798594
2018-02-01 167.16 168.62 166.76 167.78 38428826
In [ ]:
In [17]:
if (!require("quantmod")) {
install.packages("quantmod")
libary(quantmod)
}
start <- as.Date("2016-06-28")
end <- as.Date("2018-02-01")
In [18]:
getSymbols("AAPL", src='yahoo', from=start, to = end)
'AAPL'
In [19]:
class(AAPL)
1. 'xts'
2. 'zoo'
In [37]:
AAPL_s <- AAPL['2018']
AAPL_s
AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted
2018-01-02 170.16 172.30 169.26 172.26 25555900 172.26
2018-01-03 172.53 174.55 171.96 172.23 29517900 172.23
2018-01-04 172.54 173.47 172.08 173.03 22434600 173.03
2018-01-05 173.44 175.37 173.05 175.00 23660000 175.00
2018-01-08 174.35 175.61 173.93 174.35 20567800 174.35
2018-01-09 174.55 175.06 173.41 174.33 21584000 174.33
2018-01-10 173.16 174.30 173.00 174.29 23959900 174.29
2018-01-11 174.59 175.49 174.49 175.28 18667700 175.28
2018-01-12 176.18 177.36 175.65 177.09 25418100 177.09
2018-01-16 177.90 179.39 176.14 176.19 29565900 176.19
2018-01-17 176.15 179.25 175.07 179.10 34386800 179.10
2018-01-18 179.37 180.10 178.25 179.26 31193400 179.26
2018-01-19 178.61 179.58 177.41 178.46 32425100 178.46
2018-01-22 177.30 177.78 176.60 177.00 27108600 177.00
2018-01-23 177.30 179.44 176.82 177.04 32689100 177.04
2018-01-24 177.25 177.30 173.20 174.22 51105100 174.22
2018-01-25 174.51 174.95 170.53 171.11 41529000 171.11
2018-01-26 172.00 172.00 170.06 171.51 39143000 171.51
2018-01-29 170.16 170.16 167.07 167.96 50640400 167.96
2018-01-30 165.53 167.37 164.70 166.97 46048200 166.97
2018-01-31 166.87 168.44 166.50 167.43 32478900 167.43
In [38]:
head(AAPL_s)
AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted
2018-01-02 170.16 172.30 169.26 172.26 25555900 172.26
2018-01-03 172.53 174.55 171.96 172.23 29517900 172.23
2018-01-04 172.54 173.47 172.08 173.03 22434600 173.03
2018-01-05 173.44 175.37 173.05 175.00 23660000 175.00
2018-01-08 174.35 175.61 173.93 174.35 20567800 174.35
2018-01-09 174.55 175.06 173.41 174.33 21584000 174.33
TRADING DESCISION¶
Black colour in the plot indicates a day where the closing price was #
higher than the open = GAIN¶
red color in the plot indicates a day where the open was higher than
the # close = LOSS¶
let first do analysis with 2018¶
In [39]:
plot(AAPL_s[,'AAPL.Close'], main ='AAPL_s')
In [40]:
candleChart(AAPL_s, up.col ='black', dn.col='red', theme='white')
TRADING DESCISION¶
Black colour in the plot indicates a day where the closing price was #
higher than the open = GAIN¶
red color in the plot indicates a day where the open was higher than
the # close = LOSS¶
let do analysis with 2017¶
In [33]:
AAPL_c <- AAPL['2017']
AAPL_c
AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted
2017-01-03 115.80 116.33 114.76 116.15 28781900 114.3118
2017-01-04 115.85 116.51 115.75 116.02 21118100 114.1838
2017-01-05 115.92 116.86 115.81 116.61 22193600 114.7645
2017-01-06 116.78 118.16 116.47 117.91 31751900 116.0439
2017-01-09 117.95 119.43 117.94 118.99 33561900 117.1068
2017-01-10 118.77 119.38 118.30 119.11 24462100 117.2249
2017-01-11 118.74 119.93 118.60 119.75 27588600 117.8548
2017-01-12 118.90 119.30 118.21 119.25 27086200 117.3627
2017-01-13 119.11 119.62 118.81 119.04 26111900 117.1560
2017-01-17 118.34 120.24 118.22 120.00 34439800 118.1008
2017-01-18 120.00 120.50 119.71 119.99 23713000 118.0910
2017-01-19 119.40 120.09 119.37 119.78 25597300 117.8843
2017-01-20 120.45 120.45 119.73 120.00 32597900 118.1008
2017-01-23 120.00 120.81 119.77 120.08 22050200 118.1796
2017-01-24 119.55 120.10 119.50 119.97 23211000 118.0713
2017-01-25 120.42 122.10 120.28 121.88 32377600 119.9511
2017-01-26 121.67 122.44 121.60 121.94 26337600 120.0101
2017-01-27 122.14 122.35 121.60 121.95 20562900 120.0200
2017-01-30 120.93 121.63 120.66 121.63 30377500 119.7050
2017-01-31 121.15 121.39 120.62 121.35 49201000 119.4295
2017-02-01 127.03 130.49 127.01 128.75 111985000 126.7123
2017-02-02 127.98 129.39 127.78 128.53 33710400 126.4958
2017-02-03 128.31 129.19 128.16 129.08 24507300 127.0371
2017-02-06 129.13 130.50 128.90 130.29 26845900 128.2280
2017-02-07 130.54 132.09 130.45 131.53 38183800 129.4483
2017-02-08 131.35 132.22 131.22 132.04 23004100 129.9503
2017-02-09 131.65 132.45 131.12 132.42 28349900 130.8893
2017-02-10 132.46 132.94 132.05 132.12 20065500 130.5928
2017-02-13 133.08 133.82 132.75 133.29 23035400 131.7492
2017-02-14 133.47 135.09 133.25 135.02 33226200 133.4592
2017-02-15 135.52 136.27 134.62 135.51 35623100 133.9436
2017-02-16 135.67 135.90 134.84 135.35 22584600 133.7854
2017-02-17 135.10 135.83 135.10 135.72 22198200 134.1512
2017-02-21 136.23 136.75 135.98 136.70 24507200 135.1198
2017-02-22 136.43 137.12 136.11 137.11 20836900 135.5251
2017-02-23 137.38 137.48 136.30 136.53 20788200 134.9518
2017-02-24 135.91 136.66 135.28 136.66 21776600 135.0803
2017-02-27 137.14 137.44 136.28 136.93 20257400 135.3472
2017-02-28 137.08 137.44 136.70 136.99 23482900 135.4065
2017-03-01 137.89 140.15 137.60 139.79 36414600 138.1741
2017-03-02 140.00 140.28 138.76 138.96 26211000 137.3537
2017-03-03 138.78 139.83 138.59 139.78 21108100 138.1642
2017-03-06 139.37 139.77 138.60 139.34 21750000 137.7293
2017-03-07 139.06 139.98 138.79 139.52 17446300 137.9072
2017-03-08 138.95 139.80 138.82 139.00 18707200 137.3932
2017-03-09 138.74 138.79 137.05 138.68 22155900 137.0769
2017-03-10 139.25 139.36 138.64 139.14 19612800 137.5316
2017-03-13 138.85 139.43 138.82 139.20 17421700 137.5909
2017-03-14 139.30 139.65 138.84 138.99 15309100 137.3833
2017-03-15 139.41 140.75 139.03 140.46 25691800 138.8364
2017-03-16 140.72 141.02 140.26 140.69 19232000 139.0637
2017-03-17 141.00 141.00 139.89 139.99 43885000 138.3718
2017-03-20 140.40 141.50 140.23 141.46 21542000 139.8248
2017-03-21 142.11 142.80 139.73 139.84 39529900 138.2235
2017-03-22 139.85 141.60 139.76 141.42 25860200 139.7852
2017-03-23 141.26 141.58 140.61 140.92 20346300 139.2910
2017-03-24 141.50 141.74 140.35 140.64 22395600 139.0143
2017-03-27 139.39 141.22 138.62 140.88 23575100 139.2515
2017-03-28 140.91 144.04 140.62 143.80 33374800 142.1377
2017-03-29 143.68 144.49 143.19 144.12 29190000 142.4540
2017-03-30 144.19 144.50 143.50 143.93 21207300 142.2662
2017-03-31 143.72 144.27 143.01 143.66 19661700 141.9994
2017-04-03 143.71 144.12 143.05 143.70 19985700 142.0389
2017-04-04 143.25 144.89 143.17 144.77 19891400 143.0965
2017-04-05 144.22 145.46 143.81 144.02 27717900 142.3552
2017-04-06 144.29 144.52 143.45 143.66 21149000 141.9994
2017-04-07 143.73 144.18 143.27 143.34 16672200 141.6831
2017-04-10 143.60 143.88 142.90 143.17 18933400 141.5150
2017-04-11 142.94 143.35 140.06 141.63 30379400 139.9928
2017-04-12 141.60 142.15 141.01 141.80 20350000 140.1609
2017-04-13 141.91 142.38 141.05 141.05 17822900 139.4195
2017-04-17 141.48 141.88 140.87 141.83 16582100 140.1905
2017-04-18 141.41 142.04 141.11 141.20 14697500 139.5678
2017-04-19 141.88 142.00 140.45 140.68 17328400 139.0538
2017-04-20 141.22 142.92 141.16 142.44 23319600 140.7935
2017-04-21 142.44 142.68 141.85 142.27 17320900 140.6254
2017-04-24 143.50 143.95 143.18 143.64 17134300 141.9796
2017-04-25 143.91 144.90 143.87 144.53 18871500 142.8593
2017-04-26 144.47 144.60 143.38 143.68 20041200 142.0191
2017-04-27 143.92 144.16 143.31 143.79 14246300 142.1279
2017-04-28 144.09 144.30 143.27 143.65 20860400 141.9895
2017-05-01 145.10 147.20 144.96 146.58 33602900 144.8856
2017-05-02 147.54 148.09 146.84 147.51 45352200 145.8049
2017-05-03 145.59 147.49 144.27 147.06 45697000 145.3601
2017-05-04 146.52 147.14 145.81 146.53 23371900 144.8362
2017-05-05 146.76 148.98 146.76 148.96 27327700 147.2381
2017-05-08 149.03 153.70 149.03 153.01 48752400 151.2413
2017-05-09 153.87 154.88 153.45 153.99 39130400 152.2100
2017-05-10 153.63 153.94 152.11 153.26 25805700 151.4884
2017-05-11 152.45 154.07 152.31 153.95 27255100 152.7985
2017-05-12 154.70 156.42 154.67 156.10 32527000 154.9324
2017-05-15 156.01 156.65 155.05 155.70 26009700 154.5354
2017-05-16 155.94 156.06 154.72 155.47 20048500 154.3071
2017-05-17 153.60 154.57 149.71 150.25 50767700 149.1262
2017-05-18 151.27 153.34 151.13 152.54 33568200 151.3990
2017-05-19 153.38 153.98 152.63 153.06 26960800 151.9152
2017-05-22 154.00 154.58 152.91 153.99 22966400 152.8382
2017-05-23 154.90 154.90 153.31 153.80 19918900 152.6496
2017-05-24 153.84 154.17 152.67 153.34 19178000 152.1931
2017-05-25 153.73 154.35 153.03 153.87 19235600 152.7191
2017-05-26 154.00 154.24 153.31 153.61 21701100 152.4611
2017-05-30 153.42 154.43 153.33 153.67 20126900 152.5206
2017-05-31 153.97 154.17 152.38 152.76 24451200 151.6174
2017-06-01 153.17 153.33 152.22 153.18 16404100 152.0343
2017-06-02 153.58 155.45 152.89 155.45 27770700 154.2873
2017-06-05 154.34 154.45 153.46 153.93 25331700 152.7787
2017-06-06 153.90 155.81 153.78 154.45 26624900 153.2948
2017-06-07 155.02 155.98 154.48 155.37 21069600 154.2079
2017-06-08 155.25 155.54 154.40 154.99 21250800 153.8307
2017-06-09 155.19 155.19 146.02 148.98 64882700 147.8657
2017-06-12 145.74 146.09 142.51 145.42 72307300 144.3323
2017-06-13 147.16 147.45 145.15 146.59 34165400 145.4936
2017-06-14 147.50 147.50 143.84 145.16 31531200 144.0743
2017-06-15 143.32 144.48 142.21 144.29 32165400 143.2108
2017-06-16 143.78 144.50 142.20 142.27 50361100 141.2059
2017-06-19 143.66 146.74 143.66 146.34 32541400 145.2454
2017-06-20 146.87 146.87 144.94 145.01 24900100 143.9254
2017-06-21 145.52 146.07 144.61 145.87 21265800 144.7789
2017-06-22 145.77 146.70 145.12 145.63 19106300 144.5408
2017-06-23 145.13 147.16 145.11 146.28 35439400 145.1859
2017-06-26 147.17 148.28 145.38 145.82 25692400 144.7293
2017-06-27 145.01 146.16 143.62 143.73 24761900 142.6550
2017-06-28 144.49 146.11 143.16 145.83 22082400 144.7392
2017-06-29 144.71 145.13 142.28 143.68 31499400 142.6053
2017-06-30 144.45 144.96 143.78 144.02 23024100 142.9428
2017-07-03 144.88 145.30 143.10 143.50 14258300 142.4267
2017-07-05 143.69 144.79 142.72 144.09 21569600 143.0123
2017-07-06 143.02 143.50 142.41 142.73 24128800 141.6624
2017-07-07 142.90 144.75 142.90 144.18 19201700 143.1016
2017-07-10 144.11 145.95 143.37 145.06 21090600 143.9750
2017-07-11 144.73 145.85 144.38 145.53 19781800 144.4415
2017-07-12 145.87 146.18 144.82 145.74 24884500 144.6499
2017-07-13 145.50 148.49 145.44 147.77 25199400 146.6647
2017-07-14 147.97 149.33 147.33 149.04 20132100 147.9252
2017-07-17 148.82 150.90 148.57 149.56 23793500 148.4413
2017-07-18 149.20 150.13 148.67 150.08 17868800 148.9575
2017-07-19 150.48 151.42 149.95 151.02 20923000 149.8904
2017-07-20 151.50 151.74 150.19 150.34 17243700 149.2155
2017-07-21 149.99 150.44 148.88 150.27 26252600 149.1460
2017-07-24 150.58 152.44 149.90 152.09 21493200 150.9524
2017-07-25 151.80 153.84 151.80 152.74 18853900 151.5976
2017-07-26 153.35 153.93 153.06 153.46 15781000 152.3122
2017-07-27 153.75 153.99 147.30 150.56 32476300 149.4339
2017-07-28 149.89 150.23 149.19 149.50 17213700 148.3818
2017-07-31 149.90 150.33 148.13 148.73 19845900 147.6176
2017-08-01 149.10 150.22 148.41 150.05 35368600 148.9277
2017-08-02 159.28 159.75 156.16 157.14 69936800 155.9647
2017-08-03 157.05 157.21 155.02 155.57 27097300 154.4064
2017-08-04 156.07 157.40 155.69 156.39 20559900 155.2203
2017-08-07 157.06 158.92 156.67 158.81 21870300 157.6222
2017-08-08 158.60 161.83 158.27 160.08 36205900 158.8827
2017-08-09 159.26 161.27 159.11 161.06 26131500 159.8553
2017-08-10 159.90 160.00 154.63 155.32 40804300 154.7637
2017-08-11 156.60 158.57 156.07 157.48 26257100 156.9159
2017-08-14 159.32 160.21 158.75 159.85 22122700 159.2774
2017-08-15 160.66 162.20 160.14 161.60 29465500 161.0211
2017-08-16 161.94 162.51 160.15 160.95 27671600 160.3735
2017-08-17 160.52 160.71 157.84 157.86 27940600 157.2945
2017-08-18 157.86 159.50 156.72 157.50 27428100 156.9358
2017-08-21 157.50 157.89 155.11 157.21 26368500 156.6469
2017-08-22 158.23 160.00 158.02 159.78 21604600 159.2077
2017-08-23 159.07 160.47 158.88 159.98 19399100 159.4070
2017-08-24 160.43 160.74 158.55 159.27 19818900 158.6995
2017-08-25 159.65 160.56 159.27 159.86 25480100 159.2874
2017-08-28 160.14 162.00 159.93 161.47 25966000 160.8916
2017-08-29 160.10 163.12 160.00 162.91 29516900 162.3265
2017-08-30 163.80 163.89 162.61 163.35 27269600 162.7649
2017-08-31 163.64 164.52 163.48 164.00 26785100 163.4126
2017-09-01 164.80 164.94 163.63 164.05 16591100 163.4624
2017-09-05 163.75 164.25 160.56 162.08 29468500 161.4994
2017-09-06 162.71 162.99 160.52 161.91 21651700 161.3300
2017-09-07 162.09 162.24 160.36 161.26 21928500 160.6824
2017-09-08 160.86 161.15 158.53 158.63 28611500 158.0618
2017-09-11 160.50 162.05 159.89 161.50 31085900 160.9215
2017-09-12 162.61 163.96 158.77 160.86 71714000 160.2838
2017-09-13 159.87 159.96 157.91 159.65 44907400 159.0781
2017-09-14 158.99 159.40 158.09 158.28 23760700 157.7130
2017-09-15 158.47 160.97 158.00 159.88 49114600 159.3073
2017-09-18 160.11 160.50 158.00 158.67 28269400 158.1016
2017-09-19 159.51 159.77 158.44 158.73 20810600 158.1614
2017-09-20 157.90 158.26 153.83 156.07 52951400 155.5110
2017-09-21 155.80 155.80 152.75 153.39 37511700 152.8406
2017-09-22 151.54 152.27 150.56 151.89 46645400 151.3459
2017-09-25 149.99 151.83 149.16 150.55 44387300 150.0107
2017-09-26 151.78 153.92 151.69 153.14 36660000 152.5914
2017-09-27 153.80 154.72 153.54 154.23 25504200 153.6776
2017-09-28 153.89 154.28 152.70 153.28 22005500 152.7310
2017-09-29 153.21 154.13 152.00 154.12 26299800 153.5679
2017-10-02 154.26 154.45 152.72 153.81 18698800 153.2590
2017-10-03 154.01 155.09 153.91 154.48 16230300 153.9267
2017-10-04 153.63 153.86 152.46 153.48 20163800 152.9302
2017-10-05 154.18 155.44 154.05 155.39 21283800 154.8334
2017-10-06 154.97 155.49 154.56 155.30 17407600 154.7437
2017-10-09 155.81 156.73 155.49 155.84 16262900 155.2818
2017-10-10 156.06 158.00 155.10 155.90 15617000 155.3416
2017-10-11 155.97 156.98 155.75 156.55 16905600 155.9892
2017-10-12 156.35 157.37 155.73 156.00 16125100 155.4412
2017-10-13 156.73 157.28 156.41 156.99 16394200 156.4277
2017-10-16 157.90 160.00 157.65 159.88 24121500 159.3073
2017-10-17 159.78 160.87 159.23 160.47 18997300 159.8952
2017-10-18 160.42 160.71 159.60 159.76 16374200 159.1877
2017-10-19 156.75 157.08 155.02 155.98 42584200 155.4213
2017-10-20 156.61 157.75 155.96 156.25 23974100 155.6903
2017-10-23 156.89 157.69 155.50 156.17 21984300 155.6106
2017-10-24 156.29 157.42 156.20 157.10 17757200 156.5373
2017-10-25 156.91 157.55 155.27 156.41 21207100 155.8497
2017-10-26 157.23 157.83 156.78 157.41 17000500 156.8462
2017-10-27 159.29 163.60 158.70 163.05 44454200 162.4660
2017-10-30 163.89 168.07 163.72 166.72 44700800 166.1228
2017-10-31 167.90 169.65 166.94 169.04 36046800 168.4345
2017-11-01 169.87 169.94 165.61 166.89 33637800 166.2922
2017-11-02 166.60 168.50 165.28 168.11 41393400 167.5078
2017-11-03 174.00 174.26 171.12 172.50 59398600 171.8821
2017-11-06 172.37 174.99 171.72 174.25 35026300 173.6258
2017-11-07 173.91 175.25 173.60 174.81 24361500 174.1838
2017-11-08 174.66 176.24 174.33 176.24 24409500 175.6087
2017-11-09 175.11 176.10 173.14 175.88 29482600 175.2500
2017-11-10 175.11 175.38 174.27 174.67 25145500 174.6700
2017-11-13 173.50 174.50 173.40 173.97 16982100 173.9700
2017-11-14 173.04 173.48 171.18 171.34 24782500 171.3400
2017-11-15 169.97 170.32 168.38 169.08 29158100 169.0800
2017-11-16 171.18 171.87 170.30 171.10 23637500 171.1000
2017-11-17 171.04 171.39 169.64 170.15 21899500 170.1500
2017-11-20 170.29 170.56 169.56 169.98 16262400 169.9800
2017-11-21 170.78 173.70 170.78 173.14 25131300 173.1400
2017-11-22 173.36 175.00 173.05 174.96 25588900 174.9600
2017-11-24 175.10 175.50 174.65 174.97 14026700 174.9700
2017-11-27 175.05 175.08 173.34 174.09 20716800 174.0900
2017-11-28 174.30 174.87 171.86 173.07 26428800 173.0700
2017-11-29 172.63 172.92 167.16 169.48 41666400 169.4800
2017-11-30 170.43 172.14 168.44 171.85 41527200 171.8500
2017-12-01 169.95 171.67 168.50 171.05 39759300 171.0500
2017-12-04 172.48 172.62 169.63 169.80 32542400 169.8000
2017-12-05 169.06 171.52 168.40 169.64 27350200 169.6400
2017-12-06 167.50 170.20 166.46 169.01 28560000 169.0100
2017-12-07 169.03 170.44 168.91 169.32 25673300 169.3200
2017-12-08 170.49 171.00 168.82 169.37 23355200 169.3700
2017-12-11 169.20 172.89 168.79 172.67 35273800 172.6700
2017-12-12 172.15 172.39 171.46 171.70 19409200 171.7000
2017-12-13 172.50 173.54 172.00 172.27 23818400 172.2700
2017-12-14 172.40 173.13 171.65 172.22 20476500 172.2200
2017-12-15 173.63 174.17 172.46 173.97 40169300 173.9700
2017-12-18 174.88 177.20 174.86 176.42 29421100 176.4200
2017-12-19 175.03 175.39 174.09 174.54 27436400 174.5400
2017-12-20 174.87 175.42 173.25 174.35 23475600 174.3500
2017-12-21 174.17 176.02 174.10 175.01 20949900 175.0100
2017-12-22 174.68 175.42 174.50 175.01 16349400 175.0100
2017-12-26 170.80 171.47 169.68 170.57 33185500 170.5700
2017-12-27 170.10 170.78 169.71 170.60 21498200 170.6000
2017-12-28 171.00 171.85 170.48 171.08 16480200 171.0800
2017-12-29 170.52 170.59 169.22 169.23 25999900 169.2300
In [34]:
plot(AAPL_c[,'AAPL.Close'], main ='AAPL_c')
In [36]:
candleChart(AAPL_c, up.col ='black', dn.col='red', theme='white')
TRADING DESCISION¶
Black colour in the plot indicates a day where the closing price was #
higher than the open = GAIN¶
red color in the plot indicates a day where the open was higher than
the # close = LOSS¶
let do analysis with 2016¶
In [41]:
AAPL_i <- AAPL['2016']
AAPL_i
AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted
2016-06-28 92.90 93.66 92.14 93.59 40444900 91.14456
2016-06-29 93.97 94.55 93.63 94.40 36531000 91.93340
2016-06-30 94.44 95.77 94.30 95.60 35836400 93.10204
2016-07-01 95.49 96.47 95.33 95.89 26026500 93.38446
2016-07-05 95.39 95.40 94.46 94.99 27705200 92.50796
2016-07-06 94.60 95.66 94.37 95.53 30949100 93.03387
2016-07-07 95.70 96.50 95.62 95.94 25139600 93.43316
2016-07-08 96.49 96.89 96.05 96.68 28912100 94.15382
2016-07-11 96.75 97.65 96.73 96.98 23794900 94.44598
2016-07-12 97.17 97.70 97.12 97.42 24167500 94.87448
2016-07-13 97.41 97.67 96.84 96.87 25892200 94.33887
2016-07-14 97.39 98.99 97.32 98.79 38919000 96.20870
2016-07-15 98.92 99.30 98.50 98.78 30137000 96.19895
2016-07-18 98.70 100.13 98.60 99.83 36493900 97.22151
2016-07-19 99.56 100.00 99.34 99.87 23779900 97.26047
2016-07-20 100.00 100.46 99.74 99.96 26276000 97.34812
2016-07-21 99.83 101.00 99.13 99.43 32702000 96.83197
2016-07-22 99.26 99.30 98.31 98.66 28313700 96.08209
2016-07-25 98.25 98.84 96.92 97.34 40382900 94.79657
2016-07-26 96.82 97.97 96.42 96.67 56239800 94.14408
2016-07-27 104.27 104.35 102.75 102.95 92344800 100.26000
2016-07-28 102.83 104.45 102.82 104.34 39869800 101.61366
2016-07-29 104.19 104.55 103.68 104.21 27733700 101.48707
2016-08-01 104.41 106.15 104.41 106.05 38167900 103.27898
2016-08-02 106.05 106.07 104.00 104.48 33816600 101.75002
2016-08-03 104.81 105.84 104.77 105.79 30202600 103.02579
2016-08-04 105.58 106.00 105.28 105.87 27408700 103.66224
2016-08-05 106.27 107.65 106.18 107.48 40553400 105.23865
2016-08-08 107.52 108.37 107.16 108.37 28037200 106.11009
2016-08-09 108.23 108.94 108.01 108.81 26315200 106.54092
2016-08-10 108.71 108.90 107.76 108.00 24008500 105.74781
2016-08-11 108.52 108.93 107.85 107.93 27484500 105.67927
2016-08-12 107.78 108.44 107.78 108.18 18660400 105.92406
2016-08-15 108.14 109.54 108.08 109.48 25868200 107.19694
2016-08-16 109.63 110.23 109.21 109.38 33794400 107.09902
2016-08-17 109.10 109.37 108.34 109.22 25356000 106.94237
2016-08-18 109.23 109.60 109.02 109.08 21984700 106.80530
2016-08-19 108.77 109.69 108.36 109.36 25368100 107.07945
2016-08-22 108.86 109.10 107.85 108.51 25820200 106.24718
2016-08-23 108.59 109.32 108.53 108.85 21257700 106.58008
2016-08-24 108.57 108.75 107.68 108.03 23675100 105.77718
2016-08-25 107.39 107.88 106.68 107.57 25086200 105.32677
2016-08-26 107.41 107.95 106.31 106.94 27766300 104.70991
2016-08-29 106.62 107.44 106.29 106.82 24970300 104.59242
2016-08-30 105.80 106.50 105.50 106.00 24863900 103.78951
2016-08-31 105.66 106.57 105.64 106.10 29662400 103.88743
2016-09-01 106.14 106.80 105.62 106.73 26701500 104.50430
2016-09-02 107.70 108.00 106.82 107.73 26802500 105.48344
2016-09-06 107.90 108.30 107.51 107.70 26880400 105.45406
2016-09-07 107.83 108.76 107.07 108.36 42364300 106.10030
2016-09-08 107.25 107.27 105.24 105.52 53002000 103.31953
2016-09-09 104.64 105.72 103.13 103.13 46557000 100.97936
2016-09-12 102.65 105.72 102.53 105.44 45292800 103.24120
2016-09-13 107.51 108.79 107.24 107.95 62176200 105.69885
2016-09-14 108.73 113.03 108.60 111.77 110888700 109.43919
2016-09-15 113.86 115.73 113.49 115.57 89983600 113.15994
2016-09-16 115.12 116.13 114.04 114.92 79886900 112.52350
2016-09-19 115.19 116.18 113.25 113.58 47023000 111.21145
2016-09-20 113.05 114.12 112.51 113.57 34514300 111.20165
2016-09-21 113.85 113.99 112.44 113.55 36003200 111.18207
2016-09-22 114.35 114.94 114.00 114.62 31074000 112.22977
2016-09-23 114.42 114.79 111.55 112.71 52481200 110.35959
2016-09-26 111.64 113.39 111.55 112.88 29869400 110.52603
2016-09-27 113.00 113.18 112.34 113.09 24607400 110.73166
2016-09-28 113.69 114.64 113.43 113.95 29641100 111.57373
2016-09-29 113.16 113.80 111.80 112.18 35887000 109.84064
2016-09-30 112.46 113.37 111.80 113.05 36379100 110.69250
2016-10-03 112.71 113.05 112.28 112.52 21701800 110.17355
2016-10-04 113.06 114.31 112.63 113.00 29736800 110.64354
2016-10-05 113.40 113.66 112.69 113.05 21453100 110.69250
2016-10-06 113.70 114.34 113.13 113.89 28779300 111.51498
2016-10-07 114.31 114.56 113.51 114.06 24358400 111.68143
2016-10-10 115.02 116.75 114.72 116.05 36236000 113.62994
2016-10-11 117.70 118.69 116.20 116.30 64041000 113.87472
2016-10-12 117.35 117.98 116.75 117.34 37586800 114.89304
2016-10-13 116.79 117.44 115.72 116.98 35192400 114.54054
2016-10-14 117.88 118.17 117.13 117.63 35652200 115.17699
2016-10-17 117.33 117.84 116.78 117.55 23624900 115.09866
2016-10-18 118.18 118.21 117.45 117.47 24553500 115.02033
2016-10-19 117.25 117.76 113.80 117.12 20034600 114.67762
2016-10-20 116.86 117.38 116.33 117.06 24125800 114.61887
2016-10-21 116.81 116.91 116.28 116.60 23192700 114.16846
2016-10-24 117.10 117.74 117.00 117.65 23538700 115.19656
2016-10-25 117.95 118.36 117.31 118.25 48129000 115.78406
2016-10-26 114.31 115.70 113.31 115.59 66134200 113.17953
2016-10-27 115.39 115.86 114.10 114.48 34562000 112.09268
2016-10-28 113.87 115.21 113.45 113.72 37861700 111.34853
2016-10-31 113.65 114.23 113.20 113.54 26419400 111.17228
2016-11-01 113.46 113.77 110.53 111.49 43825800 109.16503
2016-11-02 111.40 112.35 111.23 111.59 28331700 109.26295
2016-11-03 110.98 111.46 109.55 109.83 26932600 108.09177
2016-11-04 108.53 110.25 108.11 108.84 30837000 107.11745
2016-11-07 110.08 110.51 109.46 110.41 32560000 108.66261
2016-11-08 110.31 111.72 109.70 111.06 24054500 109.30231
2016-11-09 109.88 111.32 108.05 110.88 59176400 109.12517
2016-11-10 111.09 111.09 105.83 107.79 57134500 106.08406
2016-11-11 107.12 108.87 106.55 108.43 34094100 106.71394
2016-11-14 107.71 107.81 104.08 105.71 51175500 104.03698
2016-11-15 106.57 107.68 106.16 107.11 32264500 105.41482
2016-11-16 106.70 110.23 106.60 109.99 58840500 108.24924
2016-11-17 109.81 110.35 108.83 109.95 27632000 108.20988
2016-11-18 109.72 110.54 109.66 110.06 28428900 108.31814
2016-11-21 110.12 111.99 110.01 111.73 29264600 109.96171
2016-11-22 111.95 112.42 111.40 111.80 25965500 110.03060
2016-11-23 111.36 111.51 110.33 111.23 27426400 109.46963
2016-11-25 111.13 111.87 110.95 111.79 11475900 110.02077
2016-11-28 111.43 112.47 111.39 111.57 27194000 109.80424
2016-11-29 110.78 112.03 110.07 111.46 28528800 109.69599
2016-11-30 111.60 112.20 110.27 110.52 36162300 108.77086
2016-12-01 110.37 110.94 109.03 109.49 37086900 107.75716
2016-12-02 109.17 110.09 108.85 109.90 26528000 108.16067
2016-12-05 110.00 110.03 108.25 109.11 34324500 107.38317
2016-12-06 109.50 110.36 109.19 109.95 26195500 108.20988
2016-12-07 109.26 111.19 109.16 111.03 29998700 109.27278
2016-12-08 110.86 112.43 110.60 112.12 27068300 110.34554
2016-12-09 112.31 114.70 112.31 113.95 34402600 112.14658
2016-12-12 113.29 115.00 112.49 113.30 26374400 111.50687
2016-12-13 113.84 115.92 113.75 115.19 43733800 113.36695
2016-12-14 115.04 116.20 114.98 115.19 34031800 113.36695
2016-12-15 115.38 116.73 115.23 115.82 46524500 113.98698
2016-12-16 116.47 116.50 115.65 115.97 44351100 114.13460
2016-12-19 115.80 117.38 115.75 116.64 27779400 114.79400
2016-12-20 116.74 117.50 116.68 116.95 21425000 115.09910
2016-12-21 116.80 117.40 116.78 117.06 23783200 115.20736
2016-12-22 116.35 116.51 115.64 116.29 26085900 114.44955
2016-12-23 115.59 116.52 115.59 116.52 14181200 114.67590
2016-12-27 116.52 117.80 116.49 117.26 18296900 115.40419
2016-12-28 117.52 118.02 116.20 116.76 20905900 114.91211
2016-12-29 116.45 117.11 116.40 116.73 15039500 114.88258
2016-12-30 116.65 117.20 115.43 115.82 30586300 113.98698
In [42]:
plot(AAPL_i[,'AAPL.Close'], main ='AAPL_i')
In [43]:
candleChart(AAPL_i, up.col ='black', dn.col='red', theme='white')
financial analytics of AAPL_stock markets

More Related Content

What's hot

Ceph Object Storage Performance Secrets and Ceph Data Lake Solution
Ceph Object Storage Performance Secrets and Ceph Data Lake SolutionCeph Object Storage Performance Secrets and Ceph Data Lake Solution
Ceph Object Storage Performance Secrets and Ceph Data Lake SolutionKaran Singh
 
Time Series Processing with Solr and Spark
Time Series Processing with Solr and SparkTime Series Processing with Solr and Spark
Time Series Processing with Solr and SparkJosef Adersberger
 
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...Altinity Ltd
 
Tiered storage intro. By Robert Hodges, Altinity CEO
Tiered storage intro. By Robert Hodges, Altinity CEOTiered storage intro. By Robert Hodges, Altinity CEO
Tiered storage intro. By Robert Hodges, Altinity CEOAltinity Ltd
 
ClickHouse materialized views - a secret weapon for high performance analytic...
ClickHouse materialized views - a secret weapon for high performance analytic...ClickHouse materialized views - a secret weapon for high performance analytic...
ClickHouse materialized views - a secret weapon for high performance analytic...Altinity Ltd
 
Testing multi outputformat based mapreduce
Testing multi outputformat based mapreduceTesting multi outputformat based mapreduce
Testing multi outputformat based mapreduceAshok Agarwal
 
Cascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGCascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGMatthew McCullough
 
20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdw20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdwKohei KaiGai
 
ClickHouse Materialized Views: The Magic Continues
ClickHouse Materialized Views: The Magic ContinuesClickHouse Materialized Views: The Magic Continues
ClickHouse Materialized Views: The Magic ContinuesAltinity Ltd
 
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...DataStax
 
Postgres performance for humans
Postgres performance for humansPostgres performance for humans
Postgres performance for humansCraig Kerstiens
 
Gruter_TECHDAY_2014_04_TajoCloudHandsOn (in Korean)
Gruter_TECHDAY_2014_04_TajoCloudHandsOn (in Korean)Gruter_TECHDAY_2014_04_TajoCloudHandsOn (in Korean)
Gruter_TECHDAY_2014_04_TajoCloudHandsOn (in Korean)Gruter
 
Implementation of k means algorithm on Hadoop
Implementation of k means algorithm on HadoopImplementation of k means algorithm on Hadoop
Implementation of k means algorithm on HadoopLamprini Koutsokera
 
Stefan Hochdörfer - The NoSQL Store everyone ignores: PostgreSQL - NoSQL matt...
Stefan Hochdörfer - The NoSQL Store everyone ignores: PostgreSQL - NoSQL matt...Stefan Hochdörfer - The NoSQL Store everyone ignores: PostgreSQL - NoSQL matt...
Stefan Hochdörfer - The NoSQL Store everyone ignores: PostgreSQL - NoSQL matt...NoSQLmatters
 
Hands on Data Grids - Stephen Milidge
Hands on Data Grids - Stephen MilidgeHands on Data Grids - Stephen Milidge
Hands on Data Grids - Stephen MilidgeJAXLondon2014
 
Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXzznate
 
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Altinity Ltd
 
glance replicator
glance replicatorglance replicator
glance replicatoririx_jp
 
Building a Fast, Resilient Time Series Store with Cassandra (Alex Petrov, Dat...
Building a Fast, Resilient Time Series Store with Cassandra (Alex Petrov, Dat...Building a Fast, Resilient Time Series Store with Cassandra (Alex Petrov, Dat...
Building a Fast, Resilient Time Series Store with Cassandra (Alex Petrov, Dat...DataStax
 

What's hot (20)

Ceph Object Storage Performance Secrets and Ceph Data Lake Solution
Ceph Object Storage Performance Secrets and Ceph Data Lake SolutionCeph Object Storage Performance Secrets and Ceph Data Lake Solution
Ceph Object Storage Performance Secrets and Ceph Data Lake Solution
 
Time Series Processing with Solr and Spark
Time Series Processing with Solr and SparkTime Series Processing with Solr and Spark
Time Series Processing with Solr and Spark
 
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
A Practical Introduction to Handling Log Data in ClickHouse, by Robert Hodges...
 
JEE on DC/OS
JEE on DC/OSJEE on DC/OS
JEE on DC/OS
 
Tiered storage intro. By Robert Hodges, Altinity CEO
Tiered storage intro. By Robert Hodges, Altinity CEOTiered storage intro. By Robert Hodges, Altinity CEO
Tiered storage intro. By Robert Hodges, Altinity CEO
 
ClickHouse materialized views - a secret weapon for high performance analytic...
ClickHouse materialized views - a secret weapon for high performance analytic...ClickHouse materialized views - a secret weapon for high performance analytic...
ClickHouse materialized views - a secret weapon for high performance analytic...
 
Testing multi outputformat based mapreduce
Testing multi outputformat based mapreduceTesting multi outputformat based mapreduce
Testing multi outputformat based mapreduce
 
Cascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUGCascading Through Hadoop for the Boulder JUG
Cascading Through Hadoop for the Boulder JUG
 
20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdw20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdw
 
ClickHouse Materialized Views: The Magic Continues
ClickHouse Materialized Views: The Magic ContinuesClickHouse Materialized Views: The Magic Continues
ClickHouse Materialized Views: The Magic Continues
 
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
The Best and Worst of Cassandra-stress Tool (Christopher Batey, The Last Pick...
 
Postgres performance for humans
Postgres performance for humansPostgres performance for humans
Postgres performance for humans
 
Gruter_TECHDAY_2014_04_TajoCloudHandsOn (in Korean)
Gruter_TECHDAY_2014_04_TajoCloudHandsOn (in Korean)Gruter_TECHDAY_2014_04_TajoCloudHandsOn (in Korean)
Gruter_TECHDAY_2014_04_TajoCloudHandsOn (in Korean)
 
Implementation of k means algorithm on Hadoop
Implementation of k means algorithm on HadoopImplementation of k means algorithm on Hadoop
Implementation of k means algorithm on Hadoop
 
Stefan Hochdörfer - The NoSQL Store everyone ignores: PostgreSQL - NoSQL matt...
Stefan Hochdörfer - The NoSQL Store everyone ignores: PostgreSQL - NoSQL matt...Stefan Hochdörfer - The NoSQL Store everyone ignores: PostgreSQL - NoSQL matt...
Stefan Hochdörfer - The NoSQL Store everyone ignores: PostgreSQL - NoSQL matt...
 
Hands on Data Grids - Stephen Milidge
Hands on Data Grids - Stephen MilidgeHands on Data Grids - Stephen Milidge
Hands on Data Grids - Stephen Milidge
 
Advanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMXAdvanced Apache Cassandra Operations with JMX
Advanced Apache Cassandra Operations with JMX
 
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
 
glance replicator
glance replicatorglance replicator
glance replicator
 
Building a Fast, Resilient Time Series Store with Cassandra (Alex Petrov, Dat...
Building a Fast, Resilient Time Series Store with Cassandra (Alex Petrov, Dat...Building a Fast, Resilient Time Series Store with Cassandra (Alex Petrov, Dat...
Building a Fast, Resilient Time Series Store with Cassandra (Alex Petrov, Dat...
 

Similar to financial analytics of AAPL_stock markets

Cassandra Summit 2013 Keynote
Cassandra Summit 2013 KeynoteCassandra Summit 2013 Keynote
Cassandra Summit 2013 Keynotejbellis
 
Oracle 10g Performance: chapter 00 sampling
Oracle 10g Performance: chapter 00 samplingOracle 10g Performance: chapter 00 sampling
Oracle 10g Performance: chapter 00 samplingKyle Hailey
 
Dynamic C++ Silicon Valley Code Camp 2012
Dynamic C++ Silicon Valley Code Camp 2012Dynamic C++ Silicon Valley Code Camp 2012
Dynamic C++ Silicon Valley Code Camp 2012aleks-f
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersKyle Hailey
 
From Postgres to Cassandra (Rimas Silkaitis, Heroku) | C* Summit 2016
From Postgres to Cassandra (Rimas Silkaitis, Heroku) | C* Summit 2016From Postgres to Cassandra (Rimas Silkaitis, Heroku) | C* Summit 2016
From Postgres to Cassandra (Rimas Silkaitis, Heroku) | C* Summit 2016DataStax
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Kyle Hailey
 
BlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for CephBlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for CephSage Weil
 
Ceph Tech Talk: Bluestore
Ceph Tech Talk: BluestoreCeph Tech Talk: Bluestore
Ceph Tech Talk: BluestoreCeph Community
 
active_session_history_oracle_performance.ppt
active_session_history_oracle_performance.pptactive_session_history_oracle_performance.ppt
active_session_history_oracle_performance.pptcookie1969
 
Parallel Computing with R
Parallel Computing with RParallel Computing with R
Parallel Computing with RPeter Solymos
 
Raw system logs processing with hive
Raw system logs processing with hiveRaw system logs processing with hive
Raw system logs processing with hiveArpit Patil
 
SequoiaDB Distributed Relational Database
SequoiaDB Distributed Relational DatabaseSequoiaDB Distributed Relational Database
SequoiaDB Distributed Relational Databasewangzhonnew
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQLKyle Hailey
 
Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Matthias Niehoff
 
Cassandra lesson learned - extended
Cassandra   lesson learned  - extendedCassandra   lesson learned  - extended
Cassandra lesson learned - extendedAndrzej Ludwikowski
 
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS InsightScylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS InsightScyllaDB
 

Similar to financial analytics of AAPL_stock markets (20)

Cassandra Summit 2013 Keynote
Cassandra Summit 2013 KeynoteCassandra Summit 2013 Keynote
Cassandra Summit 2013 Keynote
 
Oracle 10g Performance: chapter 00 sampling
Oracle 10g Performance: chapter 00 samplingOracle 10g Performance: chapter 00 sampling
Oracle 10g Performance: chapter 00 sampling
 
Dynamic C++ Silicon Valley Code Camp 2012
Dynamic C++ Silicon Valley Code Camp 2012Dynamic C++ Silicon Valley Code Camp 2012
Dynamic C++ Silicon Valley Code Camp 2012
 
Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmasters
 
From Postgres to Cassandra (Rimas Silkaitis, Heroku) | C* Summit 2016
From Postgres to Cassandra (Rimas Silkaitis, Heroku) | C* Summit 2016From Postgres to Cassandra (Rimas Silkaitis, Heroku) | C* Summit 2016
From Postgres to Cassandra (Rimas Silkaitis, Heroku) | C* Summit 2016
 
Intro to ASH
Intro to ASHIntro to ASH
Intro to ASH
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle
 
ash-1-130820122404-phpapp01.pdf
ash-1-130820122404-phpapp01.pdfash-1-130820122404-phpapp01.pdf
ash-1-130820122404-phpapp01.pdf
 
BlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for CephBlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for Ceph
 
Ceph Tech Talk: Bluestore
Ceph Tech Talk: BluestoreCeph Tech Talk: Bluestore
Ceph Tech Talk: Bluestore
 
active_session_history_oracle_performance.ppt
active_session_history_oracle_performance.pptactive_session_history_oracle_performance.ppt
active_session_history_oracle_performance.ppt
 
Parallel Computing with R
Parallel Computing with RParallel Computing with R
Parallel Computing with R
 
The Operation CloudBurst Attack
The Operation CloudBurst AttackThe Operation CloudBurst Attack
The Operation CloudBurst Attack
 
Raw system logs processing with hive
Raw system logs processing with hiveRaw system logs processing with hive
Raw system logs processing with hive
 
SequoiaDB Distributed Relational Database
SequoiaDB Distributed Relational DatabaseSequoiaDB Distributed Relational Database
SequoiaDB Distributed Relational Database
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQL
 
Rmoug ashmaster
Rmoug ashmasterRmoug ashmaster
Rmoug ashmaster
 
Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra
 
Cassandra lesson learned - extended
Cassandra   lesson learned  - extendedCassandra   lesson learned  - extended
Cassandra lesson learned - extended
 
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS InsightScylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
 

Recently uploaded

Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfRobertoOcampo24
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Valters Lauzums
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024patrickdtherriault
 
How to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsHow to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsBrainSell Technologies
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxStephen266013
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...ssuserf63bd7
 
MATERI MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI  MANAJEMEN OF PENYAKIT TETANUS.pptMATERI  MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI MANAJEMEN OF PENYAKIT TETANUS.pptRachmaGhifari
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证acoha1
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesBoston Institute of Analytics
 
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...BabaJohn3
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives23050636
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...yulianti213969
 
What is Insertion Sort. Its basic information
What is Insertion Sort. Its basic informationWhat is Insertion Sort. Its basic information
What is Insertion Sort. Its basic informationmuqadasqasim10
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshareraiaryan448
 
edited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdfedited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdfgreat91
 
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarjSCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarjadimosmejiaslendon
 
原件一样伦敦国王学院毕业证成绩单留信学历认证
原件一样伦敦国王学院毕业证成绩单留信学历认证原件一样伦敦国王学院毕业证成绩单留信学历认证
原件一样伦敦国王学院毕业证成绩单留信学历认证pwgnohujw
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证pwgnohujw
 
Sensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor NetworksSensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor NetworksBoston Institute of Analytics
 
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证a8om7o51
 

Recently uploaded (20)

Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdf
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024
 
How to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsHow to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data Analytics
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptx
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
 
MATERI MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI  MANAJEMEN OF PENYAKIT TETANUS.pptMATERI  MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI MANAJEMEN OF PENYAKIT TETANUS.ppt
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...Genuine love spell caster )! ,+27834335081)   Ex lover back permanently in At...
Genuine love spell caster )! ,+27834335081) Ex lover back permanently in At...
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives
 
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
obat aborsi Tarakan wa 081336238223 jual obat aborsi cytotec asli di Tarakan9...
 
What is Insertion Sort. Its basic information
What is Insertion Sort. Its basic informationWhat is Insertion Sort. Its basic information
What is Insertion Sort. Its basic information
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
edited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdfedited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdf
 
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarjSCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
SCI8-Q4-MOD11.pdfwrwujrrjfaajerjrajrrarj
 
原件一样伦敦国王学院毕业证成绩单留信学历认证
原件一样伦敦国王学院毕业证成绩单留信学历认证原件一样伦敦国王学院毕业证成绩单留信学历认证
原件一样伦敦国王学院毕业证成绩单留信学历认证
 
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
原件一样(UWO毕业证书)西安大略大学毕业证成绩单留信学历认证
 
Sensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor NetworksSensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
 
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
如何办理加州大学伯克利分校毕业证(UCB毕业证)成绩单留信学历认证
 

financial analytics of AAPL_stock markets

  • 1. Untitled7 In [45]: library(readxl) library(ggplot2) library(tidyr) library(lattice) library(lubridate) library(quantmod) In [46]: ss<-read.csv('C:UsersvinodDownloadsSHAREitLe X507filestock_AAPL.csv',header=TRUE) stock_AAPL <- as.data.frame(ss) colnames(stock_AAPL) <- c('Date','Symbol','Open','High','Low','Close','Volume','Macd','Mfi','Rsi','Wi lliam_r','Stochastic_fast','Stochastic_slow','Bollinger_bands','Chaikin_money _flow','Obv','Log_timestamp','Datasource') stock_AAPL$Date <- as.integer(gsub('-','',stock_AAPL$Date)) ss <- stock_AAPL ss Da te S y m b ol O p e n H ig h L o w Cl o s e Vo lu m e M a c d M fi R si Wi lli a m_ r Stoc hast ic_f ast Stoc hast ic_sl ow Bolli nger _ban ds Chaik in_m oney_ flow Ob v Log_ time stam p Da tas ou rce 20 16 06 28 A A P L 9 2. 9 0 9 3. 6 6 9 2. 1 4 9 3. 5 9 40 44 49 14 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 06 29 A A P L 9 3. 9 7 9 4. 5 5 9 3. 6 3 9 4. 4 0 36 53 10 06 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 A 9 9 9 9 35 N N N N NA NA NA NA NA 201
  • 2. 16 06 30 A P L 4. 4 4 5. 7 7 4. 3 0 5. 6 0 83 63 56 A A A A 7- 12- 28 06:0 9:09. 664 752 20 16 07 01 A A P L 9 5. 4 9 9 6. 4 6 9 5. 3 3 9 5. 8 9 26 02 65 40 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 05 A A P L 9 5. 3 9 9 5. 4 0 9 4. 4 6 9 4. 9 9 27 70 52 10 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 06 A A P L 9 4. 6 0 9 5. 6 6 9 4. 3 7 9 5. 5 3 30 94 90 90 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 07 A A P L 9 5. 7 0 9 6. 5 0 9 5. 6 2 9 5. 9 4 25 13 95 58 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 08 A A P L 9 6. 4 9 9 6. 8 9 9 6. 0 5 9 6. 6 8 28 91 21 03 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0
  • 3. 9:09. 664 752 20 16 07 11 A A P L 9 6. 7 5 9 7. 6 5 9 6. 7 3 9 6. 9 8 23 79 49 45 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 12 A A P L 9 7. 1 7 9 7. 7 0 9 7. 1 2 9 7. 4 2 24 16 74 63 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 13 A A P L 9 7. 4 1 9 7. 6 7 9 6. 8 4 9 6. 8 7 25 89 21 71 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 14 A A P L 9 7. 3 9 9 8. 9 9 9 7. 3 2 9 8. 7 9 38 91 89 97 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 15 A A P L 9 8. 9 2 9 9. 3 0 9 8. 5 0 9 8. 7 8 30 13 69 90 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 A 9 1 9 9 36 N N N N NA NA NA NA NA 201
  • 4. 16 07 18 A P L 8. 7 0 0 0. 1 3 8. 6 0 9. 8 3 49 38 67 A A A A 7- 12- 28 06:0 9:09. 664 752 20 16 07 19 A A P L 9 9. 5 6 1 0 0. 0 0 9 9. 3 4 9 9. 8 7 23 77 99 24 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 20 A A P L 1 0 0. 0 0 1 0 0. 4 6 9 9. 7 4 9 9. 9 6 26 27 59 68 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 21 A A P L 9 9. 8 3 1 0 1. 0 0 9 9. 1 3 9 9. 4 3 32 70 20 28 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 22 A A P L 9 9. 2 6 9 9. 3 0 9 8. 3 1 9 8. 6 6 28 31 36 69 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 25 A A P L 9 8. 2 5 9 8. 8 4 9 6. 9 2 9 7. 3 4 40 38 29 21 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0
  • 5. 9:09. 664 752 20 16 07 26 A A P L 9 6. 8 2 9 7. 9 7 9 6. 4 2 9 6. 6 7 56 23 98 22 N A N A N A N A NA NA NA NA NA 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 27 A A P L 1 0 4. 2 6 1 0 4. 3 5 1 0 2. 7 5 1 0 2. 9 5 92 34 48 20 N A 6 4 . 3 4 7 5 . 3 1 - 0. 17 0.8 3 49.1 5 NA 0.67 24 82 42 74 0 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 28 A A P L 1 0 2. 8 3 1 0 4. 4 5 1 0 2. 8 2 1 0 4. 3 4 39 86 98 39 N A 6 5 . 2 7 7 7 . 5 4 - 0. 01 0.9 9 67.0 9 NA 0.72 28 81 12 57 9 201 7- 12- 28 06:0 9:09. 664 752 20 16 07 29 A A P L 1 0 4. 1 9 1 0 4. 5 5 1 0 3. 6 8 1 0 4. 2 1 27 73 36 88 N A 6 5 . 6 6 7 6 . 8 4 - 0. 04 0.9 6 92.5 3 NA 0.53 26 03 78 89 1 201 7- 12- 28 06:0 9:09. 664 752 20 16 08 01 A A P L 1 0 4. 4 1 1 0 6. 1 5 1 0 4. 4 1 1 0 6. 0 5 38 16 78 71 N A 6 6 . 7 2 7 9 . 6 5 - 0. 01 0.9 9 97.8 1 NA 0.44 29 85 46 76 2 201 7- 12- 28 06:0 9:09. 664 752 20 A 1 1 1 1 33 N 6 7 - 0.8 92.5 103. 0.51 26 201
  • 6. 16 08 02 A P L 0 6. 0 5 0 6. 0 7 0 4. 0 0 0 4. 4 8 81 65 56 A 5 . 4 7 1 . 6 7 0. 17 3 4 54 47 30 20 6 7- 12- 28 06:0 9:09. 664 752 20 16 08 03 A A P L 1 0 4. 8 1 1 0 5. 8 4 1 0 4. 7 7 1 0 5. 7 9 30 20 26 41 N A 6 5 . 0 6 7 4 . 0 1 - 0. 04 0.9 6 92.7 0 104. 48 0.40 29 49 32 84 7 201 7- 12- 28 06:0 9:09. 664 752 20 16 08 04 A A P L 1 0 5. 5 8 1 0 6. 0 0 1 0 5. 2 8 1 0 5. 8 7 27 40 86 50 N A 6 5 . 0 1 7 4 . 1 5 - 0. 03 0.9 7 92.0 9 105. 23 0.42 32 23 41 49 7 201 7- 12- 28 06:0 9:09. 664 752 20 16 08 05 A A P L 1 0 6. 2 7 1 0 7. 6 5 1 0 6. 1 8 1 0 7. 4 8 40 55 34 02 N A 6 5 . 4 6 7 6 . 8 6 - 0. 02 0.9 8 97.3 0 105. 96 0.33 36 28 94 89 9 201 7- 12- 28 06:0 9:09. 664 752 20 16 08 08 A A P L 1 0 7. 5 2 1 0 8. 3 7 1 0 7. 1 6 1 0 8. 3 7 28 03 72 20 N A 6 5 . 8 7 7 8 . 2 2 0. 00 1.0 0 98.5 4 106. 73 0.30 39 09 32 11 9 201 7- 12- 28 06:0 9:09. 664 752 20 16 08 09 A A P L 1 0 8. 2 3 1 0 8. 9 4 1 0 8. 0 1 1 0 8. 8 1 26 31 52 04 N A 6 6 . 0 1 7 8 . 8 8 - 0. 01 0.9 9 99.1 5 107. 50 0.19 41 72 47 32 3 201 7- 12- 28 06:0
  • 7. 9:09. 664 752 ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 20 17 12 19 A A P L 1 7 4. 9 9 1 7 5. 3 9 1 7 4. 0 9 1 7 4. 5 4 27 43 64 47 1 . 7 6 6 5 . 3 1 5 9 . 6 5 - 0. 25 0.7 5 85.7 6 173. 62 -0.09 18 33 61 67 3 201 7- 12- 20 08:0 6:50. 807 963 20 17 12 20 A A P L 1 7 4. 8 7 1 7 5. 4 2 1 7 3. 2 5 1 7 4. 3 5 23 38 69 69 1 . 7 5 5 7 . 7 4 5 9 . 0 2 - 0. 27 0.7 3 80.4 8 174. 24 -0.07 15 99 74 70 4 201 7- 12- 20 21:1 6:03. 532 777 20 17 12 21 A A P L 1 7 4. 1 7 1 7 6. 0 2 1 7 4. 1 0 1 7 5. 0 1 20 63 30 18 1 . 7 8 6 6 . 1 7 6 0 . 5 9 - 0. 20 0.8 0 76.1 0 174. 69 0.05 18 06 07 72 2 201 7- 12- 21 21:1 5:04. 196 729 20 17 12 22 A A P L 1 7 4. 6 8 1 7 5. 4 2 1 7 4. 5 0 1 7 5. 0 1 16 11 45 73 1 . 7 9 6 0 . 1 1 6 0 . 5 9 - 0. 20 0.8 0 77.5 6 175. 00 0.09 18 06 07 72 2 201 7- 12- 22 21:1 4:48. 764 248 20 17 12 26 A A P L 1 7 0. 8 0 1 7 1. 4 7 1 6 9. 6 8 1 7 0. 5 7 33 04 36 78 1 . 4 2 5 9 . 1 5 4 6 . 6 8 - 0. 62 0.3 8 65.8 3 174. 67 0.13 14 75 64 04 4 201 7- 12- 26 21:1 4:04. 040 019
  • 8. 20 17 12 27 A A P L 1 7 0. 1 0 1 7 0. 7 8 1 6 9. 7 1 1 7 0. 6 0 21 18 29 52 1 . 1 1 6 0 . 2 7 4 6 . 7 7 - 0. 78 0.2 2 46.4 7 173. 91 0.09 16 87 46 99 6 201 7- 12- 27 21:1 3:34. 457 973 20 17 12 28 A A P L 1 7 1. 0 0 1 7 1. 8 5 1 7 0. 4 8 1 7 1. 0 8 16 39 45 50 0 . 9 0 5 9 . 2 5 4 8 . 2 6 - 0. 73 0.2 7 29.0 1 173. 05 0.14 18 51 41 54 6 201 7- 12- 28 21:1 3:59. 573 336 20 17 12 29 A A P L 1 7 0. 5 2 1 7 0. 5 9 1 6 9. 2 2 1 6 9. 2 3 25 88 43 94 0 . 5 7 5 2 . 2 8 4 3 . 2 4 - 0. 95 0.0 5 17.9 9 172. 07 0.11 15 92 57 15 2 201 7- 12- 29 21:1 4:30. 732 403 20 18 01 02 A A P L 1 7 0. 1 6 1 7 2. 3 0 1 6 9. 2 6 1 7 2. 2 6 25 25 80 93 0 . 5 5 5 1 . 1 6 5 2 . 0 3 - 0. 62 0.3 8 23.5 2 171. 46 -0.45 18 45 15 24 5 201 8- 01- 02 21:1 4:32. 266 367 20 18 01 03 A A P L 1 7 2. 5 3 1 7 4. 5 5 1 7 1. 9 6 1 7 2. 2 3 29 37 16 98 0 . 5 3 5 2 . 6 0 5 1 . 9 5 - 0. 62 0.3 8 27.0 2 171. 24 -0.06 15 51 43 54 7 201 8- 01- 03 21:1 4:45. 766 853 20 18 01 04 A A P L 1 7 2. 5 1 7 3. 4 1 7 2. 0 1 7 3. 0 22 28 46 67 0 . 5 7 4 6 . 1 5 4 . 1 - 0. 52 0.4 8 41.1 9 171. 37 -0.26 17 74 28 21 201 8- 01- 04
  • 9. 4 7 8 3 1 2 4 21:1 5:08. 649 981 20 18 01 05 A A P L 1 7 3. 4 4 1 7 5. 3 7 1 7 3. 0 5 1 7 5. 0 0 23 32 90 04 0 . 7 5 5 2 . 3 4 5 9 . 0 3 - 0. 28 0.7 2 52.6 3 171. 91 -0.11 20 07 57 21 8 201 8- 01- 05 21:1 5:48. 667 525 20 18 01 08 A A P L 1 7 4. 3 5 1 7 5. 6 1 1 7 3. 9 3 1 7 4. 3 5 20 22 52 88 0 . 8 3 4 9 . 5 1 5 6 . 8 7 - 0. 36 0.6 4 61.4 9 172. 60 0.16 18 05 31 93 0 201 8- 01- 08 21:1 5:50. 417 819 20 18 01 09 A A P L 1 7 4. 5 5 1 7 5. 0 6 1 7 3. 4 1 1 7 4. 3 3 21 50 84 11 0 . 8 8 4 1 . 5 7 5 6 . 8 0 - 0. 25 0.7 5 70.6 2 173. 24 0.22 15 90 23 51 9 201 8- 01- 09 21:1 5:00. 237 552 20 18 01 10 A A P L 1 7 3. 1 6 1 7 4. 3 0 1 7 3. 0 0 1 7 4. 2 9 23 67 20 19 0 . 9 1 4 2 . 0 7 5 6 . 6 5 - 0. 25 0.7 5 71.3 3 173. 74 0.10 13 53 51 50 0 201 8- 01- 10 21:1 6:02. 049 576 go ogl e 20 18 01 11 A A P L 1 7 4. 5 9 1 7 5. 4 9 1 7 4. 4 9 1 7 5. 2 8 17 85 02 27 1 . 0 0 4 8 . 5 2 5 9 . 4 6 - 0. 11 0.8 9 79.6 1 174. 22 0.06 15 32 01 72 7 201 8- 01- 11 21:1 6:58. 080 465 go ogl e
  • 10. 20 18 01 12 A A P L 1 7 6. 1 8 1 7 7. 3 6 1 7 5. 6 5 1 7 7. 0 9 25 22 60 44 1 . 2 1 4 9 . 3 0 6 4 . 0 6 - 0. 03 0.9 7 86.7 9 174. 85 -0.04 17 84 27 77 1 201 8- 01- 12 21:1 4:51. 689 705 go ogl e 20 18 01 16 A A P L 1 7 7. 9 0 1 7 9. 3 9 1 7 6. 1 4 1 7 6. 1 9 29 47 75 32 1 . 2 8 5 6 . 2 7 6 0 . 3 9 - 0. 31 0.6 9 84.7 8 175. 44 -0.07 14 89 50 23 9 201 8- 01- 16 21:1 6:02. 657 499 go ogl e 20 18 01 17 A A P L 1 7 6. 1 5 1 7 9. 2 5 1 7 5. 0 7 1 7 9. 1 0 33 88 84 77 1 . 5 6 6 6 . 2 2 6 6 . 9 7 - 0. 03 0.9 7 87.4 6 176. 24 -0.07 18 28 38 71 6 201 8- 01- 17 21:1 6:03. 011 461 go ogl e 20 18 01 18 A A P L 1 7 9. 3 7 1 8 0. 1 0 1 7 8. 2 5 1 7 9. 2 6 31 03 53 39 1 . 7 7 7 3 . 2 9 6 7 . 2 9 - 0. 08 0.9 2 85.9 9 177. 15 -0.06 21 38 74 05 5 201 8- 01- 18 21:1 4:56. 659 790 go ogl e 20 18 01 19 A A P L 1 7 8. 6 1 1 7 9. 5 8 1 7 7. 4 1 1 7 8. 4 6 31 26 96 06 1 . 8 5 6 5 . 6 2 6 3 . 9 4 - 0. 15 0.8 5 91.4 5 177. 91 -0.05 18 26 04 44 9 201 8- 01- 19 21:1 6:09. 843 121 go ogl e 20 18 01 22 A A P L 1 7 7. 3 1 7 7. 7 1 7 6. 6 1 7 7. 0 26 59 98 29 1 . 7 8 6 5 . 2 5 8 . 2 - 0. 29 0.7 1 82.8 7 178. 27 0.07 15 60 04 62 201 8- 01- 22 go ogl e
  • 11. 0 8 0 0 9 4 0 21:1 5:10. 310 906 20 18 01 23 A A P L 1 7 7. 3 0 1 7 9. 4 4 1 7 6. 8 2 1 7 7. 0 4 31 88 90 15 1 . 7 0 6 6 . 0 1 5 8 . 3 5 - 0. 38 0.6 2 72.9 1 178. 31 0.11 18 78 93 63 5 201 8- 01- 23 21:1 5:10. 009 916 go ogl e 20 18 01 24 A A P L 1 7 7. 2 5 1 7 7. 3 0 1 7 3. 2 0 1 7 4. 2 2 51 12 01 93 1 . 4 0 5 4 . 8 9 4 8 . 6 5 - 0. 73 0.2 7 53.5 0 177. 83 0.15 13 67 73 44 2 201 8- 01- 24 21:1 5:45. 208 326 go ogl e 20 18 01 25 A A P L 1 7 4. 5 0 1 7 4. 9 5 1 7 0. 5 3 1 7 1. 1 1 40 54 91 10 0 . 9 0 5 2 . 5 0 4 0 . 6 3 - 0. 94 0.0 6 31.7 2 176. 68 0.11 96 22 43 32 201 8- 01- 25 21:1 4:11. 129 730 go ogl e 20 18 01 26 A A P L 1 7 2. 0 0 1 7 2. 0 0 1 7 0. 0 6 1 7 1. 5 1 37 68 75 44 0 . 5 3 4 5 . 3 2 4 1 . 9 5 - 0. 86 0.1 4 15.7 3 175. 27 0.16 13 39 11 87 6 201 8- 01- 26 21:1 5:31. 350 536 go ogl e 20 18 01 29 A A P L 1 7 0. 1 6 1 7 0. 1 6 1 6 7. 0 7 1 6 7. 9 6 50 50 05 91 - 0 . 0 5 3 8 . 0 1 3 4 . 5 8 - 0. 93 0.0 7 9.11 173. 51 0.13 83 41 12 85 201 8- 01- 29 21:1 4:20. 006 246 go ogl e
  • 13. In [58]: stock_AAPL_filtered <- stock_AAPL %>% dplyr :: filter(Date >20170000) ggplot(stock_AAPL_filtered,aes(x=Date)) + geom_histogram(aes(fill= ..count..),col="grey")+ ggtitle(' Histogram of dates after filtering for 2018') `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
  • 14. In [6]: ss<-read.csv('C:UsersvinodDownloadsSHAREitLe X507filestock_AAPL.csv',header=TRUE) stock_AAPL <- as.data.frame(ss) stock_AAPL_s <- stock_AAPL[,1:7] AAPL <- subset(stock_AAPL_s, select=-c(symbol)) AAPL date_txn open high low close volume 2016-06-28 92.90 93.66 92.14 93.59 40444914 2016-06-29 93.97 94.55 93.63 94.40 36531006 2016-06-30 94.44 95.77 94.30 95.60 35836356 2016-07-01 95.49 96.46 95.33 95.89 26026540 2016-07-05 95.39 95.40 94.46 94.99 27705210
  • 15. 2016-07-06 94.60 95.66 94.37 95.53 30949090 2016-07-07 95.70 96.50 95.62 95.94 25139558 2016-07-08 96.49 96.89 96.05 96.68 28912103 2016-07-11 96.75 97.65 96.73 96.98 23794945 2016-07-12 97.17 97.70 97.12 97.42 24167463 2016-07-13 97.41 97.67 96.84 96.87 25892171 2016-07-14 97.39 98.99 97.32 98.79 38918997 2016-07-15 98.92 99.30 98.50 98.78 30136990 2016-07-18 98.70 100.13 98.60 99.83 36493867 2016-07-19 99.56 100.00 99.34 99.87 23779924 2016-07-20 100.00 100.46 99.74 99.96 26275968 2016-07-21 99.83 101.00 99.13 99.43 32702028 2016-07-22 99.26 99.30 98.31 98.66 28313669 2016-07-25 98.25 98.84 96.92 97.34 40382921 2016-07-26 96.82 97.97 96.42 96.67 56239822 2016-07-27 104.26 104.35 102.75 102.95 92344820 2016-07-28 102.83 104.45 102.82 104.34 39869839 2016-07-29 104.19 104.55 103.68 104.21 27733688 2016-08-01 104.41 106.15 104.41 106.05 38167871 2016-08-02 106.05 106.07 104.00 104.48 33816556 2016-08-03 104.81 105.84 104.77 105.79 30202641 2016-08-04 105.58 106.00 105.28 105.87 27408650 2016-08-05 106.27 107.65 106.18 107.48 40553402 2016-08-08 107.52 108.37 107.16 108.37 28037220 2016-08-09 108.23 108.94 108.01 108.81 26315204 ... ... ... ... ... ... 2017-12-19 174.99 175.39 174.09 174.54 27436447 2017-12-20 174.87 175.42 173.25 174.35 23386969 2017-12-21 174.17 176.02 174.10 175.01 20633018 2017-12-22 174.68 175.42 174.50 175.01 16114573 2017-12-26 170.80 171.47 169.68 170.57 33043678 2017-12-27 170.10 170.78 169.71 170.60 21182952 2017-12-28 171.00 171.85 170.48 171.08 16394550 2017-12-29 170.52 170.59 169.22 169.23 25884394 2018-01-02 170.16 172.30 169.26 172.26 25258093 2018-01-03 172.53 174.55 171.96 172.23 29371698
  • 16. 2018-01-04 172.54 173.47 172.08 173.03 22284667 2018-01-05 173.44 175.37 173.05 175.00 23329004 2018-01-08 174.35 175.61 173.93 174.35 20225288 2018-01-09 174.55 175.06 173.41 174.33 21508411 2018-01-10 173.16 174.30 173.00 174.29 23672019 2018-01-11 174.59 175.49 174.49 175.28 17850227 2018-01-12 176.18 177.36 175.65 177.09 25226044 2018-01-16 177.90 179.39 176.14 176.19 29477532 2018-01-17 176.15 179.25 175.07 179.10 33888477 2018-01-18 179.37 180.10 178.25 179.26 31035339 2018-01-19 178.61 179.58 177.41 178.46 31269606 2018-01-22 177.30 177.78 176.60 177.00 26599829 2018-01-23 177.30 179.44 176.82 177.04 31889015 2018-01-24 177.25 177.30 173.20 174.22 51120193 2018-01-25 174.50 174.95 170.53 171.11 40549110 2018-01-26 172.00 172.00 170.06 171.51 37687544 2018-01-29 170.16 170.16 167.07 167.96 50500591 2018-01-30 165.52 167.37 164.70 166.97 45396599 2018-01-31 166.87 168.44 166.50 167.43 31798594 2018-02-01 167.16 168.62 166.76 167.78 38428826 In [ ]: In [17]: if (!require("quantmod")) { install.packages("quantmod") libary(quantmod) } start <- as.Date("2016-06-28") end <- as.Date("2018-02-01") In [18]: getSymbols("AAPL", src='yahoo', from=start, to = end) 'AAPL' In [19]: class(AAPL) 1. 'xts' 2. 'zoo'
  • 17. In [37]: AAPL_s <- AAPL['2018'] AAPL_s AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted 2018-01-02 170.16 172.30 169.26 172.26 25555900 172.26 2018-01-03 172.53 174.55 171.96 172.23 29517900 172.23 2018-01-04 172.54 173.47 172.08 173.03 22434600 173.03 2018-01-05 173.44 175.37 173.05 175.00 23660000 175.00 2018-01-08 174.35 175.61 173.93 174.35 20567800 174.35 2018-01-09 174.55 175.06 173.41 174.33 21584000 174.33 2018-01-10 173.16 174.30 173.00 174.29 23959900 174.29 2018-01-11 174.59 175.49 174.49 175.28 18667700 175.28 2018-01-12 176.18 177.36 175.65 177.09 25418100 177.09 2018-01-16 177.90 179.39 176.14 176.19 29565900 176.19 2018-01-17 176.15 179.25 175.07 179.10 34386800 179.10 2018-01-18 179.37 180.10 178.25 179.26 31193400 179.26 2018-01-19 178.61 179.58 177.41 178.46 32425100 178.46 2018-01-22 177.30 177.78 176.60 177.00 27108600 177.00 2018-01-23 177.30 179.44 176.82 177.04 32689100 177.04 2018-01-24 177.25 177.30 173.20 174.22 51105100 174.22 2018-01-25 174.51 174.95 170.53 171.11 41529000 171.11 2018-01-26 172.00 172.00 170.06 171.51 39143000 171.51 2018-01-29 170.16 170.16 167.07 167.96 50640400 167.96 2018-01-30 165.53 167.37 164.70 166.97 46048200 166.97 2018-01-31 166.87 168.44 166.50 167.43 32478900 167.43 In [38]: head(AAPL_s) AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted 2018-01-02 170.16 172.30 169.26 172.26 25555900 172.26 2018-01-03 172.53 174.55 171.96 172.23 29517900 172.23 2018-01-04 172.54 173.47 172.08 173.03 22434600 173.03 2018-01-05 173.44 175.37 173.05 175.00 23660000 175.00 2018-01-08 174.35 175.61 173.93 174.35 20567800 174.35 2018-01-09 174.55 175.06 173.41 174.33 21584000 174.33
  • 18. TRADING DESCISION¶ Black colour in the plot indicates a day where the closing price was # higher than the open = GAIN¶ red color in the plot indicates a day where the open was higher than the # close = LOSS¶ let first do analysis with 2018¶ In [39]: plot(AAPL_s[,'AAPL.Close'], main ='AAPL_s')
  • 19. In [40]: candleChart(AAPL_s, up.col ='black', dn.col='red', theme='white')
  • 20.
  • 21. TRADING DESCISION¶ Black colour in the plot indicates a day where the closing price was # higher than the open = GAIN¶ red color in the plot indicates a day where the open was higher than the # close = LOSS¶ let do analysis with 2017¶ In [33]: AAPL_c <- AAPL['2017'] AAPL_c AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted 2017-01-03 115.80 116.33 114.76 116.15 28781900 114.3118 2017-01-04 115.85 116.51 115.75 116.02 21118100 114.1838 2017-01-05 115.92 116.86 115.81 116.61 22193600 114.7645 2017-01-06 116.78 118.16 116.47 117.91 31751900 116.0439 2017-01-09 117.95 119.43 117.94 118.99 33561900 117.1068 2017-01-10 118.77 119.38 118.30 119.11 24462100 117.2249 2017-01-11 118.74 119.93 118.60 119.75 27588600 117.8548 2017-01-12 118.90 119.30 118.21 119.25 27086200 117.3627 2017-01-13 119.11 119.62 118.81 119.04 26111900 117.1560 2017-01-17 118.34 120.24 118.22 120.00 34439800 118.1008 2017-01-18 120.00 120.50 119.71 119.99 23713000 118.0910 2017-01-19 119.40 120.09 119.37 119.78 25597300 117.8843 2017-01-20 120.45 120.45 119.73 120.00 32597900 118.1008 2017-01-23 120.00 120.81 119.77 120.08 22050200 118.1796 2017-01-24 119.55 120.10 119.50 119.97 23211000 118.0713 2017-01-25 120.42 122.10 120.28 121.88 32377600 119.9511 2017-01-26 121.67 122.44 121.60 121.94 26337600 120.0101 2017-01-27 122.14 122.35 121.60 121.95 20562900 120.0200 2017-01-30 120.93 121.63 120.66 121.63 30377500 119.7050 2017-01-31 121.15 121.39 120.62 121.35 49201000 119.4295 2017-02-01 127.03 130.49 127.01 128.75 111985000 126.7123 2017-02-02 127.98 129.39 127.78 128.53 33710400 126.4958 2017-02-03 128.31 129.19 128.16 129.08 24507300 127.0371 2017-02-06 129.13 130.50 128.90 130.29 26845900 128.2280 2017-02-07 130.54 132.09 130.45 131.53 38183800 129.4483 2017-02-08 131.35 132.22 131.22 132.04 23004100 129.9503 2017-02-09 131.65 132.45 131.12 132.42 28349900 130.8893 2017-02-10 132.46 132.94 132.05 132.12 20065500 130.5928 2017-02-13 133.08 133.82 132.75 133.29 23035400 131.7492 2017-02-14 133.47 135.09 133.25 135.02 33226200 133.4592
  • 22. 2017-02-15 135.52 136.27 134.62 135.51 35623100 133.9436 2017-02-16 135.67 135.90 134.84 135.35 22584600 133.7854 2017-02-17 135.10 135.83 135.10 135.72 22198200 134.1512 2017-02-21 136.23 136.75 135.98 136.70 24507200 135.1198 2017-02-22 136.43 137.12 136.11 137.11 20836900 135.5251 2017-02-23 137.38 137.48 136.30 136.53 20788200 134.9518 2017-02-24 135.91 136.66 135.28 136.66 21776600 135.0803 2017-02-27 137.14 137.44 136.28 136.93 20257400 135.3472 2017-02-28 137.08 137.44 136.70 136.99 23482900 135.4065 2017-03-01 137.89 140.15 137.60 139.79 36414600 138.1741 2017-03-02 140.00 140.28 138.76 138.96 26211000 137.3537 2017-03-03 138.78 139.83 138.59 139.78 21108100 138.1642 2017-03-06 139.37 139.77 138.60 139.34 21750000 137.7293 2017-03-07 139.06 139.98 138.79 139.52 17446300 137.9072 2017-03-08 138.95 139.80 138.82 139.00 18707200 137.3932 2017-03-09 138.74 138.79 137.05 138.68 22155900 137.0769 2017-03-10 139.25 139.36 138.64 139.14 19612800 137.5316 2017-03-13 138.85 139.43 138.82 139.20 17421700 137.5909 2017-03-14 139.30 139.65 138.84 138.99 15309100 137.3833 2017-03-15 139.41 140.75 139.03 140.46 25691800 138.8364 2017-03-16 140.72 141.02 140.26 140.69 19232000 139.0637 2017-03-17 141.00 141.00 139.89 139.99 43885000 138.3718 2017-03-20 140.40 141.50 140.23 141.46 21542000 139.8248 2017-03-21 142.11 142.80 139.73 139.84 39529900 138.2235 2017-03-22 139.85 141.60 139.76 141.42 25860200 139.7852 2017-03-23 141.26 141.58 140.61 140.92 20346300 139.2910 2017-03-24 141.50 141.74 140.35 140.64 22395600 139.0143 2017-03-27 139.39 141.22 138.62 140.88 23575100 139.2515 2017-03-28 140.91 144.04 140.62 143.80 33374800 142.1377 2017-03-29 143.68 144.49 143.19 144.12 29190000 142.4540 2017-03-30 144.19 144.50 143.50 143.93 21207300 142.2662 2017-03-31 143.72 144.27 143.01 143.66 19661700 141.9994 2017-04-03 143.71 144.12 143.05 143.70 19985700 142.0389 2017-04-04 143.25 144.89 143.17 144.77 19891400 143.0965 2017-04-05 144.22 145.46 143.81 144.02 27717900 142.3552 2017-04-06 144.29 144.52 143.45 143.66 21149000 141.9994 2017-04-07 143.73 144.18 143.27 143.34 16672200 141.6831 2017-04-10 143.60 143.88 142.90 143.17 18933400 141.5150 2017-04-11 142.94 143.35 140.06 141.63 30379400 139.9928 2017-04-12 141.60 142.15 141.01 141.80 20350000 140.1609 2017-04-13 141.91 142.38 141.05 141.05 17822900 139.4195 2017-04-17 141.48 141.88 140.87 141.83 16582100 140.1905 2017-04-18 141.41 142.04 141.11 141.20 14697500 139.5678 2017-04-19 141.88 142.00 140.45 140.68 17328400 139.0538 2017-04-20 141.22 142.92 141.16 142.44 23319600 140.7935 2017-04-21 142.44 142.68 141.85 142.27 17320900 140.6254 2017-04-24 143.50 143.95 143.18 143.64 17134300 141.9796 2017-04-25 143.91 144.90 143.87 144.53 18871500 142.8593 2017-04-26 144.47 144.60 143.38 143.68 20041200 142.0191 2017-04-27 143.92 144.16 143.31 143.79 14246300 142.1279
  • 23. 2017-04-28 144.09 144.30 143.27 143.65 20860400 141.9895 2017-05-01 145.10 147.20 144.96 146.58 33602900 144.8856 2017-05-02 147.54 148.09 146.84 147.51 45352200 145.8049 2017-05-03 145.59 147.49 144.27 147.06 45697000 145.3601 2017-05-04 146.52 147.14 145.81 146.53 23371900 144.8362 2017-05-05 146.76 148.98 146.76 148.96 27327700 147.2381 2017-05-08 149.03 153.70 149.03 153.01 48752400 151.2413 2017-05-09 153.87 154.88 153.45 153.99 39130400 152.2100 2017-05-10 153.63 153.94 152.11 153.26 25805700 151.4884 2017-05-11 152.45 154.07 152.31 153.95 27255100 152.7985 2017-05-12 154.70 156.42 154.67 156.10 32527000 154.9324 2017-05-15 156.01 156.65 155.05 155.70 26009700 154.5354 2017-05-16 155.94 156.06 154.72 155.47 20048500 154.3071 2017-05-17 153.60 154.57 149.71 150.25 50767700 149.1262 2017-05-18 151.27 153.34 151.13 152.54 33568200 151.3990 2017-05-19 153.38 153.98 152.63 153.06 26960800 151.9152 2017-05-22 154.00 154.58 152.91 153.99 22966400 152.8382 2017-05-23 154.90 154.90 153.31 153.80 19918900 152.6496 2017-05-24 153.84 154.17 152.67 153.34 19178000 152.1931 2017-05-25 153.73 154.35 153.03 153.87 19235600 152.7191 2017-05-26 154.00 154.24 153.31 153.61 21701100 152.4611 2017-05-30 153.42 154.43 153.33 153.67 20126900 152.5206 2017-05-31 153.97 154.17 152.38 152.76 24451200 151.6174 2017-06-01 153.17 153.33 152.22 153.18 16404100 152.0343 2017-06-02 153.58 155.45 152.89 155.45 27770700 154.2873 2017-06-05 154.34 154.45 153.46 153.93 25331700 152.7787 2017-06-06 153.90 155.81 153.78 154.45 26624900 153.2948 2017-06-07 155.02 155.98 154.48 155.37 21069600 154.2079 2017-06-08 155.25 155.54 154.40 154.99 21250800 153.8307 2017-06-09 155.19 155.19 146.02 148.98 64882700 147.8657 2017-06-12 145.74 146.09 142.51 145.42 72307300 144.3323 2017-06-13 147.16 147.45 145.15 146.59 34165400 145.4936 2017-06-14 147.50 147.50 143.84 145.16 31531200 144.0743 2017-06-15 143.32 144.48 142.21 144.29 32165400 143.2108 2017-06-16 143.78 144.50 142.20 142.27 50361100 141.2059 2017-06-19 143.66 146.74 143.66 146.34 32541400 145.2454 2017-06-20 146.87 146.87 144.94 145.01 24900100 143.9254 2017-06-21 145.52 146.07 144.61 145.87 21265800 144.7789 2017-06-22 145.77 146.70 145.12 145.63 19106300 144.5408 2017-06-23 145.13 147.16 145.11 146.28 35439400 145.1859 2017-06-26 147.17 148.28 145.38 145.82 25692400 144.7293 2017-06-27 145.01 146.16 143.62 143.73 24761900 142.6550 2017-06-28 144.49 146.11 143.16 145.83 22082400 144.7392 2017-06-29 144.71 145.13 142.28 143.68 31499400 142.6053 2017-06-30 144.45 144.96 143.78 144.02 23024100 142.9428 2017-07-03 144.88 145.30 143.10 143.50 14258300 142.4267 2017-07-05 143.69 144.79 142.72 144.09 21569600 143.0123 2017-07-06 143.02 143.50 142.41 142.73 24128800 141.6624 2017-07-07 142.90 144.75 142.90 144.18 19201700 143.1016 2017-07-10 144.11 145.95 143.37 145.06 21090600 143.9750
  • 24. 2017-07-11 144.73 145.85 144.38 145.53 19781800 144.4415 2017-07-12 145.87 146.18 144.82 145.74 24884500 144.6499 2017-07-13 145.50 148.49 145.44 147.77 25199400 146.6647 2017-07-14 147.97 149.33 147.33 149.04 20132100 147.9252 2017-07-17 148.82 150.90 148.57 149.56 23793500 148.4413 2017-07-18 149.20 150.13 148.67 150.08 17868800 148.9575 2017-07-19 150.48 151.42 149.95 151.02 20923000 149.8904 2017-07-20 151.50 151.74 150.19 150.34 17243700 149.2155 2017-07-21 149.99 150.44 148.88 150.27 26252600 149.1460 2017-07-24 150.58 152.44 149.90 152.09 21493200 150.9524 2017-07-25 151.80 153.84 151.80 152.74 18853900 151.5976 2017-07-26 153.35 153.93 153.06 153.46 15781000 152.3122 2017-07-27 153.75 153.99 147.30 150.56 32476300 149.4339 2017-07-28 149.89 150.23 149.19 149.50 17213700 148.3818 2017-07-31 149.90 150.33 148.13 148.73 19845900 147.6176 2017-08-01 149.10 150.22 148.41 150.05 35368600 148.9277 2017-08-02 159.28 159.75 156.16 157.14 69936800 155.9647 2017-08-03 157.05 157.21 155.02 155.57 27097300 154.4064 2017-08-04 156.07 157.40 155.69 156.39 20559900 155.2203 2017-08-07 157.06 158.92 156.67 158.81 21870300 157.6222 2017-08-08 158.60 161.83 158.27 160.08 36205900 158.8827 2017-08-09 159.26 161.27 159.11 161.06 26131500 159.8553 2017-08-10 159.90 160.00 154.63 155.32 40804300 154.7637 2017-08-11 156.60 158.57 156.07 157.48 26257100 156.9159 2017-08-14 159.32 160.21 158.75 159.85 22122700 159.2774 2017-08-15 160.66 162.20 160.14 161.60 29465500 161.0211 2017-08-16 161.94 162.51 160.15 160.95 27671600 160.3735 2017-08-17 160.52 160.71 157.84 157.86 27940600 157.2945 2017-08-18 157.86 159.50 156.72 157.50 27428100 156.9358 2017-08-21 157.50 157.89 155.11 157.21 26368500 156.6469 2017-08-22 158.23 160.00 158.02 159.78 21604600 159.2077 2017-08-23 159.07 160.47 158.88 159.98 19399100 159.4070 2017-08-24 160.43 160.74 158.55 159.27 19818900 158.6995 2017-08-25 159.65 160.56 159.27 159.86 25480100 159.2874 2017-08-28 160.14 162.00 159.93 161.47 25966000 160.8916 2017-08-29 160.10 163.12 160.00 162.91 29516900 162.3265 2017-08-30 163.80 163.89 162.61 163.35 27269600 162.7649 2017-08-31 163.64 164.52 163.48 164.00 26785100 163.4126 2017-09-01 164.80 164.94 163.63 164.05 16591100 163.4624 2017-09-05 163.75 164.25 160.56 162.08 29468500 161.4994 2017-09-06 162.71 162.99 160.52 161.91 21651700 161.3300 2017-09-07 162.09 162.24 160.36 161.26 21928500 160.6824 2017-09-08 160.86 161.15 158.53 158.63 28611500 158.0618 2017-09-11 160.50 162.05 159.89 161.50 31085900 160.9215 2017-09-12 162.61 163.96 158.77 160.86 71714000 160.2838 2017-09-13 159.87 159.96 157.91 159.65 44907400 159.0781 2017-09-14 158.99 159.40 158.09 158.28 23760700 157.7130 2017-09-15 158.47 160.97 158.00 159.88 49114600 159.3073 2017-09-18 160.11 160.50 158.00 158.67 28269400 158.1016 2017-09-19 159.51 159.77 158.44 158.73 20810600 158.1614
  • 25. 2017-09-20 157.90 158.26 153.83 156.07 52951400 155.5110 2017-09-21 155.80 155.80 152.75 153.39 37511700 152.8406 2017-09-22 151.54 152.27 150.56 151.89 46645400 151.3459 2017-09-25 149.99 151.83 149.16 150.55 44387300 150.0107 2017-09-26 151.78 153.92 151.69 153.14 36660000 152.5914 2017-09-27 153.80 154.72 153.54 154.23 25504200 153.6776 2017-09-28 153.89 154.28 152.70 153.28 22005500 152.7310 2017-09-29 153.21 154.13 152.00 154.12 26299800 153.5679 2017-10-02 154.26 154.45 152.72 153.81 18698800 153.2590 2017-10-03 154.01 155.09 153.91 154.48 16230300 153.9267 2017-10-04 153.63 153.86 152.46 153.48 20163800 152.9302 2017-10-05 154.18 155.44 154.05 155.39 21283800 154.8334 2017-10-06 154.97 155.49 154.56 155.30 17407600 154.7437 2017-10-09 155.81 156.73 155.49 155.84 16262900 155.2818 2017-10-10 156.06 158.00 155.10 155.90 15617000 155.3416 2017-10-11 155.97 156.98 155.75 156.55 16905600 155.9892 2017-10-12 156.35 157.37 155.73 156.00 16125100 155.4412 2017-10-13 156.73 157.28 156.41 156.99 16394200 156.4277 2017-10-16 157.90 160.00 157.65 159.88 24121500 159.3073 2017-10-17 159.78 160.87 159.23 160.47 18997300 159.8952 2017-10-18 160.42 160.71 159.60 159.76 16374200 159.1877 2017-10-19 156.75 157.08 155.02 155.98 42584200 155.4213 2017-10-20 156.61 157.75 155.96 156.25 23974100 155.6903 2017-10-23 156.89 157.69 155.50 156.17 21984300 155.6106 2017-10-24 156.29 157.42 156.20 157.10 17757200 156.5373 2017-10-25 156.91 157.55 155.27 156.41 21207100 155.8497 2017-10-26 157.23 157.83 156.78 157.41 17000500 156.8462 2017-10-27 159.29 163.60 158.70 163.05 44454200 162.4660 2017-10-30 163.89 168.07 163.72 166.72 44700800 166.1228 2017-10-31 167.90 169.65 166.94 169.04 36046800 168.4345 2017-11-01 169.87 169.94 165.61 166.89 33637800 166.2922 2017-11-02 166.60 168.50 165.28 168.11 41393400 167.5078 2017-11-03 174.00 174.26 171.12 172.50 59398600 171.8821 2017-11-06 172.37 174.99 171.72 174.25 35026300 173.6258 2017-11-07 173.91 175.25 173.60 174.81 24361500 174.1838 2017-11-08 174.66 176.24 174.33 176.24 24409500 175.6087 2017-11-09 175.11 176.10 173.14 175.88 29482600 175.2500 2017-11-10 175.11 175.38 174.27 174.67 25145500 174.6700 2017-11-13 173.50 174.50 173.40 173.97 16982100 173.9700 2017-11-14 173.04 173.48 171.18 171.34 24782500 171.3400 2017-11-15 169.97 170.32 168.38 169.08 29158100 169.0800 2017-11-16 171.18 171.87 170.30 171.10 23637500 171.1000 2017-11-17 171.04 171.39 169.64 170.15 21899500 170.1500 2017-11-20 170.29 170.56 169.56 169.98 16262400 169.9800 2017-11-21 170.78 173.70 170.78 173.14 25131300 173.1400 2017-11-22 173.36 175.00 173.05 174.96 25588900 174.9600 2017-11-24 175.10 175.50 174.65 174.97 14026700 174.9700 2017-11-27 175.05 175.08 173.34 174.09 20716800 174.0900 2017-11-28 174.30 174.87 171.86 173.07 26428800 173.0700 2017-11-29 172.63 172.92 167.16 169.48 41666400 169.4800
  • 26. 2017-11-30 170.43 172.14 168.44 171.85 41527200 171.8500 2017-12-01 169.95 171.67 168.50 171.05 39759300 171.0500 2017-12-04 172.48 172.62 169.63 169.80 32542400 169.8000 2017-12-05 169.06 171.52 168.40 169.64 27350200 169.6400 2017-12-06 167.50 170.20 166.46 169.01 28560000 169.0100 2017-12-07 169.03 170.44 168.91 169.32 25673300 169.3200 2017-12-08 170.49 171.00 168.82 169.37 23355200 169.3700 2017-12-11 169.20 172.89 168.79 172.67 35273800 172.6700 2017-12-12 172.15 172.39 171.46 171.70 19409200 171.7000 2017-12-13 172.50 173.54 172.00 172.27 23818400 172.2700 2017-12-14 172.40 173.13 171.65 172.22 20476500 172.2200 2017-12-15 173.63 174.17 172.46 173.97 40169300 173.9700 2017-12-18 174.88 177.20 174.86 176.42 29421100 176.4200 2017-12-19 175.03 175.39 174.09 174.54 27436400 174.5400 2017-12-20 174.87 175.42 173.25 174.35 23475600 174.3500 2017-12-21 174.17 176.02 174.10 175.01 20949900 175.0100 2017-12-22 174.68 175.42 174.50 175.01 16349400 175.0100 2017-12-26 170.80 171.47 169.68 170.57 33185500 170.5700 2017-12-27 170.10 170.78 169.71 170.60 21498200 170.6000 2017-12-28 171.00 171.85 170.48 171.08 16480200 171.0800 2017-12-29 170.52 170.59 169.22 169.23 25999900 169.2300 In [34]: plot(AAPL_c[,'AAPL.Close'], main ='AAPL_c')
  • 27. In [36]: candleChart(AAPL_c, up.col ='black', dn.col='red', theme='white')
  • 28.
  • 29. TRADING DESCISION¶ Black colour in the plot indicates a day where the closing price was # higher than the open = GAIN¶ red color in the plot indicates a day where the open was higher than the # close = LOSS¶ let do analysis with 2016¶ In [41]: AAPL_i <- AAPL['2016'] AAPL_i AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted 2016-06-28 92.90 93.66 92.14 93.59 40444900 91.14456 2016-06-29 93.97 94.55 93.63 94.40 36531000 91.93340 2016-06-30 94.44 95.77 94.30 95.60 35836400 93.10204 2016-07-01 95.49 96.47 95.33 95.89 26026500 93.38446 2016-07-05 95.39 95.40 94.46 94.99 27705200 92.50796 2016-07-06 94.60 95.66 94.37 95.53 30949100 93.03387 2016-07-07 95.70 96.50 95.62 95.94 25139600 93.43316 2016-07-08 96.49 96.89 96.05 96.68 28912100 94.15382 2016-07-11 96.75 97.65 96.73 96.98 23794900 94.44598 2016-07-12 97.17 97.70 97.12 97.42 24167500 94.87448 2016-07-13 97.41 97.67 96.84 96.87 25892200 94.33887 2016-07-14 97.39 98.99 97.32 98.79 38919000 96.20870 2016-07-15 98.92 99.30 98.50 98.78 30137000 96.19895 2016-07-18 98.70 100.13 98.60 99.83 36493900 97.22151 2016-07-19 99.56 100.00 99.34 99.87 23779900 97.26047 2016-07-20 100.00 100.46 99.74 99.96 26276000 97.34812 2016-07-21 99.83 101.00 99.13 99.43 32702000 96.83197 2016-07-22 99.26 99.30 98.31 98.66 28313700 96.08209 2016-07-25 98.25 98.84 96.92 97.34 40382900 94.79657 2016-07-26 96.82 97.97 96.42 96.67 56239800 94.14408 2016-07-27 104.27 104.35 102.75 102.95 92344800 100.26000 2016-07-28 102.83 104.45 102.82 104.34 39869800 101.61366 2016-07-29 104.19 104.55 103.68 104.21 27733700 101.48707 2016-08-01 104.41 106.15 104.41 106.05 38167900 103.27898 2016-08-02 106.05 106.07 104.00 104.48 33816600 101.75002 2016-08-03 104.81 105.84 104.77 105.79 30202600 103.02579 2016-08-04 105.58 106.00 105.28 105.87 27408700 103.66224 2016-08-05 106.27 107.65 106.18 107.48 40553400 105.23865 2016-08-08 107.52 108.37 107.16 108.37 28037200 106.11009 2016-08-09 108.23 108.94 108.01 108.81 26315200 106.54092
  • 30. 2016-08-10 108.71 108.90 107.76 108.00 24008500 105.74781 2016-08-11 108.52 108.93 107.85 107.93 27484500 105.67927 2016-08-12 107.78 108.44 107.78 108.18 18660400 105.92406 2016-08-15 108.14 109.54 108.08 109.48 25868200 107.19694 2016-08-16 109.63 110.23 109.21 109.38 33794400 107.09902 2016-08-17 109.10 109.37 108.34 109.22 25356000 106.94237 2016-08-18 109.23 109.60 109.02 109.08 21984700 106.80530 2016-08-19 108.77 109.69 108.36 109.36 25368100 107.07945 2016-08-22 108.86 109.10 107.85 108.51 25820200 106.24718 2016-08-23 108.59 109.32 108.53 108.85 21257700 106.58008 2016-08-24 108.57 108.75 107.68 108.03 23675100 105.77718 2016-08-25 107.39 107.88 106.68 107.57 25086200 105.32677 2016-08-26 107.41 107.95 106.31 106.94 27766300 104.70991 2016-08-29 106.62 107.44 106.29 106.82 24970300 104.59242 2016-08-30 105.80 106.50 105.50 106.00 24863900 103.78951 2016-08-31 105.66 106.57 105.64 106.10 29662400 103.88743 2016-09-01 106.14 106.80 105.62 106.73 26701500 104.50430 2016-09-02 107.70 108.00 106.82 107.73 26802500 105.48344 2016-09-06 107.90 108.30 107.51 107.70 26880400 105.45406 2016-09-07 107.83 108.76 107.07 108.36 42364300 106.10030 2016-09-08 107.25 107.27 105.24 105.52 53002000 103.31953 2016-09-09 104.64 105.72 103.13 103.13 46557000 100.97936 2016-09-12 102.65 105.72 102.53 105.44 45292800 103.24120 2016-09-13 107.51 108.79 107.24 107.95 62176200 105.69885 2016-09-14 108.73 113.03 108.60 111.77 110888700 109.43919 2016-09-15 113.86 115.73 113.49 115.57 89983600 113.15994 2016-09-16 115.12 116.13 114.04 114.92 79886900 112.52350 2016-09-19 115.19 116.18 113.25 113.58 47023000 111.21145 2016-09-20 113.05 114.12 112.51 113.57 34514300 111.20165 2016-09-21 113.85 113.99 112.44 113.55 36003200 111.18207 2016-09-22 114.35 114.94 114.00 114.62 31074000 112.22977 2016-09-23 114.42 114.79 111.55 112.71 52481200 110.35959 2016-09-26 111.64 113.39 111.55 112.88 29869400 110.52603 2016-09-27 113.00 113.18 112.34 113.09 24607400 110.73166 2016-09-28 113.69 114.64 113.43 113.95 29641100 111.57373 2016-09-29 113.16 113.80 111.80 112.18 35887000 109.84064 2016-09-30 112.46 113.37 111.80 113.05 36379100 110.69250 2016-10-03 112.71 113.05 112.28 112.52 21701800 110.17355 2016-10-04 113.06 114.31 112.63 113.00 29736800 110.64354 2016-10-05 113.40 113.66 112.69 113.05 21453100 110.69250 2016-10-06 113.70 114.34 113.13 113.89 28779300 111.51498 2016-10-07 114.31 114.56 113.51 114.06 24358400 111.68143 2016-10-10 115.02 116.75 114.72 116.05 36236000 113.62994 2016-10-11 117.70 118.69 116.20 116.30 64041000 113.87472 2016-10-12 117.35 117.98 116.75 117.34 37586800 114.89304 2016-10-13 116.79 117.44 115.72 116.98 35192400 114.54054 2016-10-14 117.88 118.17 117.13 117.63 35652200 115.17699 2016-10-17 117.33 117.84 116.78 117.55 23624900 115.09866 2016-10-18 118.18 118.21 117.45 117.47 24553500 115.02033 2016-10-19 117.25 117.76 113.80 117.12 20034600 114.67762
  • 31. 2016-10-20 116.86 117.38 116.33 117.06 24125800 114.61887 2016-10-21 116.81 116.91 116.28 116.60 23192700 114.16846 2016-10-24 117.10 117.74 117.00 117.65 23538700 115.19656 2016-10-25 117.95 118.36 117.31 118.25 48129000 115.78406 2016-10-26 114.31 115.70 113.31 115.59 66134200 113.17953 2016-10-27 115.39 115.86 114.10 114.48 34562000 112.09268 2016-10-28 113.87 115.21 113.45 113.72 37861700 111.34853 2016-10-31 113.65 114.23 113.20 113.54 26419400 111.17228 2016-11-01 113.46 113.77 110.53 111.49 43825800 109.16503 2016-11-02 111.40 112.35 111.23 111.59 28331700 109.26295 2016-11-03 110.98 111.46 109.55 109.83 26932600 108.09177 2016-11-04 108.53 110.25 108.11 108.84 30837000 107.11745 2016-11-07 110.08 110.51 109.46 110.41 32560000 108.66261 2016-11-08 110.31 111.72 109.70 111.06 24054500 109.30231 2016-11-09 109.88 111.32 108.05 110.88 59176400 109.12517 2016-11-10 111.09 111.09 105.83 107.79 57134500 106.08406 2016-11-11 107.12 108.87 106.55 108.43 34094100 106.71394 2016-11-14 107.71 107.81 104.08 105.71 51175500 104.03698 2016-11-15 106.57 107.68 106.16 107.11 32264500 105.41482 2016-11-16 106.70 110.23 106.60 109.99 58840500 108.24924 2016-11-17 109.81 110.35 108.83 109.95 27632000 108.20988 2016-11-18 109.72 110.54 109.66 110.06 28428900 108.31814 2016-11-21 110.12 111.99 110.01 111.73 29264600 109.96171 2016-11-22 111.95 112.42 111.40 111.80 25965500 110.03060 2016-11-23 111.36 111.51 110.33 111.23 27426400 109.46963 2016-11-25 111.13 111.87 110.95 111.79 11475900 110.02077 2016-11-28 111.43 112.47 111.39 111.57 27194000 109.80424 2016-11-29 110.78 112.03 110.07 111.46 28528800 109.69599 2016-11-30 111.60 112.20 110.27 110.52 36162300 108.77086 2016-12-01 110.37 110.94 109.03 109.49 37086900 107.75716 2016-12-02 109.17 110.09 108.85 109.90 26528000 108.16067 2016-12-05 110.00 110.03 108.25 109.11 34324500 107.38317 2016-12-06 109.50 110.36 109.19 109.95 26195500 108.20988 2016-12-07 109.26 111.19 109.16 111.03 29998700 109.27278 2016-12-08 110.86 112.43 110.60 112.12 27068300 110.34554 2016-12-09 112.31 114.70 112.31 113.95 34402600 112.14658 2016-12-12 113.29 115.00 112.49 113.30 26374400 111.50687 2016-12-13 113.84 115.92 113.75 115.19 43733800 113.36695 2016-12-14 115.04 116.20 114.98 115.19 34031800 113.36695 2016-12-15 115.38 116.73 115.23 115.82 46524500 113.98698 2016-12-16 116.47 116.50 115.65 115.97 44351100 114.13460 2016-12-19 115.80 117.38 115.75 116.64 27779400 114.79400 2016-12-20 116.74 117.50 116.68 116.95 21425000 115.09910 2016-12-21 116.80 117.40 116.78 117.06 23783200 115.20736 2016-12-22 116.35 116.51 115.64 116.29 26085900 114.44955 2016-12-23 115.59 116.52 115.59 116.52 14181200 114.67590 2016-12-27 116.52 117.80 116.49 117.26 18296900 115.40419 2016-12-28 117.52 118.02 116.20 116.76 20905900 114.91211 2016-12-29 116.45 117.11 116.40 116.73 15039500 114.88258 2016-12-30 116.65 117.20 115.43 115.82 30586300 113.98698
  • 32. In [42]: plot(AAPL_i[,'AAPL.Close'], main ='AAPL_i') In [43]: candleChart(AAPL_i, up.col ='black', dn.col='red', theme='white')