Heading1

Heading2

Heading3

item

  • list1
  • list2
  • list3
    1. qoo
    2. oop
    3. ooc
this is a code block
a = 3
b = 2
a + b
## [1] 5
## [1] 5
#eval =FALSE
a + b

TW2330 Analysis

tw2330 = read.csv("2330.csv", header=TRUE)
max(tw2330$Close)
## [1] 155
min(tw2330$Close)
## [1] 32.754
summary(tw2330$Close)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   32.75   55.00   63.40   74.26   85.88  155.00
hist(tw2330$Close)

boxplot(tw2330$Close)

lower_bound = max(min(tw2330$Close), median(tw2330$Close) - 1.5 * IQR(tw2330$Close))
upper_bound = min(max(tw2330$Close), median(tw2330$Close) + 1.5 * IQR(tw2330$Close))

class(tw2330)
## [1] "data.frame"
str(tw2330)
## 'data.frame':    4069 obs. of  7 variables:
##  $ Date     : Factor w/ 4069 levels "2000-01-04","2000-01-05",..: 4069 4068 4067 4066 4065 4064 4063 4062 4061 4060 ...
##  $ Open     : num  154 153 152 151 152 ...
##  $ High     : num  155 154 153 152 154 ...
##  $ Low      : num  153 152 150 150 151 ...
##  $ Close    : num  155 154 153 152 152 ...
##  $ Volume   : num  29566000 28302000 24004000 35683000 23906000 ...
##  $ Adj.Close: num  155 154 153 152 152 ...
tw2330$Date = as.Date(tw2330$Date)
str(tw2330)
## 'data.frame':    4069 obs. of  7 variables:
##  $ Date     : Date, format: "2016-03-11" "2016-03-10" ...
##  $ Open     : num  154 153 152 151 152 ...
##  $ High     : num  155 154 153 152 154 ...
##  $ Low      : num  153 152 150 150 151 ...
##  $ Close    : num  155 154 153 152 152 ...
##  $ Volume   : num  29566000 28302000 24004000 35683000 23906000 ...
##  $ Adj.Close: num  155 154 153 152 152 ...
plot(tw2330$Date, tw2330$Close)

tw2330$tf = tw2330$Close - tw2330$Open > 0
table(tw2330$tf)
## 
## FALSE  TRUE 
##  2328  1741