Tesla Stock Price Prediction

Author: Xiangyi Zhu

Course Project, UC Irvine, Math 10, S22

Introduction

Introduce your project here. Maybe 3 sentences.

The stock market is very volatila, but with a large amount of data, we are able to find some trend. In the project, I imported the data of the stock price of Tesla from 2011 to 2017. In the project, I aim to use linear regression and K_Neatest neighbor to predict the future stock price and see whether the methods work for the volatila market. Also, I aim to see whether we can use the prediction to make the correct decision on trading.

Main portion of the project

(You can either have all one section or divide into multiple sections)

Section1: Read and Organize the Dataset

import pandas as pd
df=pd.read_csv("Tesla.csv").dropna()
df.head()
Date Open High Low Close Volume Adj Close
0 6/29/2010 19.000000 25.00 17.540001 23.889999 18766300 23.889999
1 6/30/2010 25.790001 30.42 23.299999 23.830000 17187100 23.830000
2 7/1/2010 25.000000 25.92 20.270000 21.959999 8218800 21.959999
3 7/2/2010 23.000000 23.10 18.709999 19.200001 5139800 19.200001
4 7/6/2010 20.000000 20.00 15.830000 16.110001 6866900 16.110001
df["Date"]=pd.to_datetime(df["Date"])

Create new columns in the dataframe which will be used in the following section

# the column contain the difference between high price and open price
df["Diff_high"]=df["High"]-df["Open"]
# the column contain the difference between low price and open price
df["Diff_low"]=df["Open"]-df["Low"]
# if the stock is worthing trading, the value is 1, otherwise the value is 0
df["Trade"]=df["Close"]-df["Open"]

df["Worth"]=0
for n in df.index:
    if df.loc[n,"Trade"]>=0:
        df.loc[n,"Worth"]=1 
df.head()
Date Open High Low Close Volume Adj Close Diff_high Diff_low Trade Worth
0 2010-06-29 19.000000 25.00 17.540001 23.889999 18766300 23.889999 6.000000 1.459999 4.889999 1
1 2010-06-30 25.790001 30.42 23.299999 23.830000 17187100 23.830000 4.629999 2.490002 -1.960001 0
2 2010-07-01 25.000000 25.92 20.270000 21.959999 8218800 21.959999 0.920000 4.730000 -3.040001 0
3 2010-07-02 23.000000 23.10 18.709999 19.200001 5139800 19.200001 0.100000 4.290001 -3.799999 0
4 2010-07-06 20.000000 20.00 15.830000 16.110001 6866900 16.110001 0.000000 4.170000 -3.889999 0

In order to predict the stock price, we need to first analyze the original data. Close price is the last price at which a security traded during the regular trading day is the standard benchmark used by investors to track its performance over time. So, we will first use chart to see the change of close over time.

import altair as alt
type(df["Close"])
pandas.core.series.Series
interval = alt.selection_interval()

big = alt.Chart(df).mark_line().encode(
    x="Date",
    y="Close",
    tooltip=["Date","Close"]
).add_selection(
    interval
)

small = alt.Chart(df).mark_line().encode(
    x="Date",
    y="Close"
).transform_filter(
    interval
)

big|small

Section2: Linear Regression

I plan to use the data in 2013 and 2014 to be the train data to predict the stock price after 2014 using linear regression to check the accuracy.

from sklearn.linear_model import LinearRegression
reg = LinearRegression()
# get the rows that contain the stock price in 2013 and 2014
train_index=[x for x in df.index if df.loc[x,"Date"].year==2013 or df.loc[x,"Date"].year==2014]

# create the sub dataframe that only contain the stock price of 2013 and 2014
df_train=df.loc[train_index]

I plan to use the value of open price, the highest price, and the lowest price to predict the close price. So, I create the train data to contain the columns of “Open”, “High”, and “Low”.

# create the train data
X_train=df_train[["Open","High","Low"]]

# the true value of close price in 2013 and 2014
y_train=df_train["Close"]
# train the data
reg.fit(X_train, y_train)
LinearRegression()
df_train["Pred"]=reg.predict(X_train)

Then, I plan to compare the precited close value for the year of 2015 and the true close value of 2015

# get the rows that contain the stock price in 2015
test_index=[x for x in df.index if df.loc[x,"Date"].year==2015]

# create the sub dataframe that only contain the stock price in 2015
df_test=df.loc[test_index]
X_test=df_test[["Open","High","Low"]]
y_test=df_test["Close"]
df_test["Pred"]=reg.predict(X_test)
# visualize the close price for 2015
c_true=alt.Chart(df_test).mark_line().encode(
    x="Date",
    y=alt.Y("Close", scale=alt.Scale(domain = [150,300])),
    tooltip=["Date","Close"]
)
c_true.properties(title = "Close Price for 2015")
# visualize the predicted close price for 2015
c_pred=alt.Chart(df_test).mark_line().encode(
    x="Date",
    y=alt.Y("Pred", scale=alt.Scale(domain = [150,300])),
    tooltip=["Date","Pred"],
    color=alt.value("#FFAA00"),
)
c_pred.properties(title = "Predicted Close Price for 2015")
df_test["difference"]=abs(df_test["Close"]-df_test["Open"])

In the end, I put the two graphs together to make a more direct comparision between the true price and predicted price.

c_together=c_true+c_pred

c_together=c_together.add_selection(
    interval
)

difference = alt.Chart(df_test).mark_line().encode(
    x="Date",
    y="difference"
).transform_filter(
    interval
)

c_together|difference

We can see from the chart that the true value of the close price and the predicted close is vary close since the two lines overlap each other a lot. Also, most of the difference is below 14, which is small compared the true close price, which value is between 150-200. But we will then use mean value error to evaluate the performance.

from sklearn.metrics import mean_squared_error
mean_squared_error(df_test["Close"],df_test["Pred"])
3.5567349637513797
mean_squared_error(df_train["Close"],df_train["Pred"])
3.2347263243425592

The mean suqared error again shows that the well performance since the MSE for the train data is less than the MSE for the test data and they are very close.

Section3 K – Nearest Neighbor (KNN) Classification

In the section, I aim to use the difference between open price and high price, and the difference between open price and low price to classify stock into two categories: one is worth trading, which means the close price is higher than open price, and another is do not worth trade, which means the close price is lower than open price.

Similarly, I will use the data of 2013 and 2014 to predict the data of 2015

from sklearn.neighbors import KNeighborsClassifier
# create the train data
X_train2=df_train[["Diff_high","Diff_low"]]

# the true value of close price in 2013 and 2014
y_train2=df_train["Worth"]
classifier = KNeighborsClassifier(n_neighbors = 5, metric = 'minkowski', p = 2)

classifier.fit(X_train2, y_train2)
KNeighborsClassifier()
# the test data contains the stock price in 2015
X_test2=df_test[["Diff_high","Diff_low"]]

y_test2=df_test["Worth"]
df_test.head()
Date Open High Low Close Volume Adj Close Diff_high Diff_low Trade Worth Pred difference
1136 2015-01-02 222.869995 223.250000 213.259995 219.309998 4764400 219.309998 0.380005 9.610000 -3.559997 0 215.748410 3.559997
1137 2015-01-05 214.550003 216.500000 207.160004 210.089996 5368500 210.089996 1.949997 7.389999 -4.460007 0 210.402004 4.460007
1138 2015-01-06 210.059998 214.199997 204.210007 211.279999 6261900 211.279999 4.139999 5.849991 1.220001 1 208.881669 1.220001
1139 2015-01-07 213.350006 214.779999 209.779999 210.949997 2968400 210.949997 1.429993 3.570007 -2.400009 0 211.647192 2.400009
1140 2015-01-08 212.809998 213.800003 210.009995 210.619995 3442500 210.619995 0.990005 2.800003 -2.190003 0 211.323862 2.190003
df_test["Pred2"] = classifier.predict(X_test2)

In order to better visualize whether the stock is worth trading, I hightlight the value that is 1, which means worth trading.

df_test.style.highlight_max(color = 'lightgreen', axis = 0)
Date Open High Low Close Volume Adj Close Diff_high Diff_low Trade Worth Pred difference Pred2
1136 2015-01-02 00:00:00 222.869995 223.250000 213.259995 219.309998 4764400 219.309998 0.380005 9.610000 -3.559997 0 215.748410 3.559997 0
1137 2015-01-05 00:00:00 214.550003 216.500000 207.160004 210.089996 5368500 210.089996 1.949997 7.389999 -4.460007 0 210.402004 4.460007 0
1138 2015-01-06 00:00:00 210.059998 214.199997 204.210007 211.279999 6261900 211.279999 4.139999 5.849991 1.220001 1 208.881669 1.220001 0
1139 2015-01-07 00:00:00 213.350006 214.779999 209.779999 210.949997 2968400 210.949997 1.429993 3.570007 -2.400009 0 211.647192 2.400009 0
1140 2015-01-08 00:00:00 212.809998 213.800003 210.009995 210.619995 3442500 210.619995 0.990005 2.800003 -2.190003 0 211.323862 2.190003 0
1141 2015-01-09 00:00:00 208.919998 209.979996 204.960007 206.660004 4668300 206.660004 1.059998 3.959991 -2.259994 0 206.623287 2.259994 0
1142 2015-01-12 00:00:00 203.050003 204.470001 199.250000 202.210007 5950300 202.210007 1.419998 3.800003 -0.839996 0 201.176774 0.839996 0
1143 2015-01-13 00:00:00 203.320007 207.610001 200.910004 204.250000 4477300 204.250000 4.289994 2.410003 0.929993 1 204.859632 0.929993 0
1144 2015-01-14 00:00:00 185.830002 195.199997 185.000000 192.690002 11513900 192.690002 9.369995 0.830002 6.860000 1 192.767266 6.860000 1
1145 2015-01-15 00:00:00 194.490005 195.750000 190.000000 191.869995 5216500 191.869995 1.259995 4.490005 -2.620010 0 191.974819 2.620010 0
1146 2015-01-16 00:00:00 190.699997 194.490005 189.649994 193.070007 3603200 193.070007 3.790008 1.050003 2.370010 1 192.863198 2.370010 1
1147 2015-01-20 00:00:00 193.869995 194.119995 187.039993 191.929993 4503200 191.929993 0.250000 6.830002 -1.940002 0 188.762353 1.940002 0
1148 2015-01-21 00:00:00 189.550003 198.679993 189.509995 196.570007 4153000 196.570007 9.129990 0.040008 7.020004 1 196.879497 7.020004 1
1149 2015-01-22 00:00:00 197.000000 203.240005 195.199997 201.619995 4116900 201.619995 6.240005 1.800003 4.619995 1 200.613784 4.619995 1
1150 2015-01-23 00:00:00 200.289993 203.500000 198.330002 201.289993 3438600 201.289993 3.210007 1.959991 1.000000 1 201.280250 1.000000 1
1151 2015-01-26 00:00:00 201.830002 208.619995 201.050003 206.550003 3234500 206.550003 6.789993 0.779999 4.720001 1 206.659582 4.720001 1
1152 2015-01-27 00:00:00 204.419998 208.029999 203.300003 205.979996 2781000 205.979996 3.610001 1.119995 1.559998 1 206.367660 1.559998 1
1153 2015-01-28 00:00:00 206.110001 206.369995 198.419998 199.369995 3149600 199.369995 0.259994 7.690003 -6.740006 0 200.350976 6.740006 0
1154 2015-01-29 00:00:00 201.070007 205.979996 196.500000 205.199997 3548100 205.199997 4.909989 4.570007 4.129990 1 201.498999 4.129990 1
1155 2015-01-30 00:00:00 203.960007 207.470001 203.000000 203.600006 3007000 203.600006 3.509994 0.960007 -0.360001 0 205.945969 0.360001 1
1156 2015-02-02 00:00:00 203.970001 211.949997 203.300003 210.940002 4149200 210.940002 7.979996 0.669998 6.970001 1 209.861819 6.970001 1
1157 2015-02-03 00:00:00 213.220001 220.369995 211.270004 218.360001 4826200 218.360001 7.149994 1.949997 5.140000 1 217.454704 5.140000 1
1158 2015-02-04 00:00:00 218.289993 221.479996 216.800003 218.550003 3305400 218.550003 3.190003 1.489990 0.260010 1 219.598340 0.260010 1
1159 2015-02-05 00:00:00 219.880005 225.479996 219.639999 220.990005 3522900 220.990005 5.599991 0.240006 1.110000 1 224.115012 1.110000 1
1160 2015-02-06 00:00:00 222.000000 223.399994 216.500000 217.360001 3243900 217.360001 1.399994 5.500000 -4.639999 0 218.811858 4.639999 0
1161 2015-02-09 00:00:00 215.380005 217.929993 211.990005 217.479996 3472400 217.479996 2.549988 3.390000 2.099991 1 214.734437 2.099991 1
1162 2015-02-10 00:00:00 217.550003 220.500000 215.000000 216.289993 5390500 216.289993 2.949997 2.550003 -1.260010 0 217.863910 1.260010 1
1163 2015-02-11 00:00:00 212.210007 214.740005 207.279999 212.800003 9769100 212.800003 2.529998 4.930008 0.589996 1 210.393068 0.589996 1
1164 2015-02-12 00:00:00 193.570007 203.089996 193.279999 202.880005 15649600 202.880005 9.519989 0.290008 9.309998 1 201.029014 9.309998 1
1165 2015-02-13 00:00:00 202.899994 205.990005 200.910004 203.770004 6191000 203.770004 3.090011 1.989990 0.870010 1 203.765955 0.870010 1
1166 2015-02-17 00:00:00 205.699997 205.699997 201.500000 204.350006 3979600 204.350006 0.000000 4.199997 -1.349991 0 202.351661 1.349991 0
1167 2015-02-18 00:00:00 204.169998 206.169998 202.600006 204.460007 2713600 204.460007 2.000000 1.569992 0.290009 1 204.451237 0.290009 0
1168 2015-02-19 00:00:00 205.000000 212.440002 203.750000 211.710007 5154100 211.710007 7.440002 1.250000 6.710007 1 210.009035 6.710007 1
1169 2015-02-20 00:00:00 210.779999 217.600006 209.809998 217.110001 5982100 217.110001 6.820007 0.970001 6.330002 1 215.482055 6.330002 1
1170 2015-02-23 00:00:00 215.660004 218.199997 206.330002 207.339996 8499800 207.339996 2.539993 9.330002 -8.320008 0 210.538556 8.320008 0
1171 2015-02-24 00:00:00 207.289993 207.289993 201.699997 204.110001 6603600 204.110001 0.000000 5.589996 -3.179992 0 202.894602 3.179992 0
1172 2015-02-25 00:00:00 204.940002 207.139999 202.580002 203.759995 3909500 203.759995 2.199997 2.360000 -1.180007 0 204.791284 1.180007 0
1173 2015-02-26 00:00:00 204.000000 211.089996 202.220001 207.190002 6472900 207.190002 7.089996 1.779999 3.190002 1 208.322729 3.190002 1
1174 2015-02-27 00:00:00 206.899994 208.550003 202.800003 203.339996 3882100 203.339996 1.650009 4.099991 -3.559998 0 204.986871 3.559998 0
1175 2015-03-02 00:00:00 202.699997 203.339996 195.830002 197.330002 7922100 197.330002 0.639999 6.869995 -5.369995 0 197.874763 5.369995 0
1176 2015-03-03 00:00:00 196.809998 200.240005 195.320007 199.559998 4432300 199.559998 3.430007 1.489991 2.750000 1 198.338883 2.750000 1
1177 2015-03-04 00:00:00 199.250000 202.520004 197.210007 202.440002 4222000 202.440002 3.270004 2.039993 3.190002 1 200.230678 3.190002 1
1178 2015-03-05 00:00:00 202.850006 206.190002 200.149994 200.630005 4877000 200.630005 3.339996 2.700012 -2.220001 0 203.388266 2.220001 0
1179 2015-03-06 00:00:00 199.210007 200.750000 192.149994 193.880005 6712400 193.880005 1.539993 7.060013 -5.330002 0 194.988023 5.330002 0
1180 2015-03-09 00:00:00 194.389999 194.490005 188.250000 190.880005 6736700 190.880005 0.100006 6.139999 -3.509994 0 189.677002 3.509994 0
1181 2015-03-10 00:00:00 188.460007 193.500000 187.600006 190.320007 5579700 190.320007 5.039993 0.860001 1.860000 1 191.799694 1.860000 1
1182 2015-03-11 00:00:00 191.149994 196.179993 191.009995 193.740005 4974900 193.740005 5.029999 0.139999 2.590011 1 195.020111 2.590011 1
1183 2015-03-12 00:00:00 193.750000 194.449997 189.750000 191.070007 4149300 191.070007 0.699997 4.000000 -2.679993 0 191.142113 2.679993 0
1184 2015-03-13 00:00:00 188.949997 191.750000 187.320007 188.679993 5434300 188.679993 2.800003 1.629990 -0.270004 0 189.862084 0.270004 1
1185 2015-03-16 00:00:00 192.000000 195.910004 189.800003 195.699997 5628800 195.699997 3.910004 2.199997 3.699997 1 193.395950 3.699997 0
1186 2015-03-17 00:00:00 195.429993 198.710007 193.940002 194.729996 4894100 194.729996 3.280014 1.489991 -0.699997 0 196.836581 0.699997 1
1187 2015-03-18 00:00:00 194.960007 200.880005 193.110001 200.710007 4820900 200.710007 5.919998 1.850006 5.750000 1 198.274319 5.750000 1
1188 2015-03-19 00:00:00 202.000000 204.589996 194.529999 195.649994 8475200 195.649994 2.589996 7.470001 -6.350006 0 198.333000 6.350006 0
1189 2015-03-20 00:00:00 197.449997 198.990005 195.619995 198.080002 4269500 198.080002 1.540008 1.830002 0.630005 1 197.163245 0.630005 0
1190 2015-03-23 00:00:00 198.500000 200.500000 197.470001 199.630005 2631600 199.630005 2.000000 1.029999 1.130005 1 199.193304 1.130005 1
1191 2015-03-24 00:00:00 201.580002 203.789993 199.750000 201.720001 3649900 201.720001 2.209991 1.830002 0.139999 1 201.841653 0.139999 1
1192 2015-03-25 00:00:00 198.270004 198.589996 192.699997 194.300003 5730400 194.300003 0.319992 5.570007 -3.970001 0 194.163103 3.970001 0
1193 2015-03-26 00:00:00 193.919998 194.789993 189.699997 190.410004 4128000 190.410004 0.869995 4.220001 -3.509994 0 191.286723 3.509994 0
1194 2015-03-27 00:00:00 189.070007 189.289993 181.399994 185.000000 8604900 185.000000 0.219986 7.670013 -4.070007 0 183.310886 4.070007 0
1195 2015-03-30 00:00:00 185.850006 192.250000 181.800003 190.570007 10089500 190.570007 6.399994 4.050003 4.720001 1 187.915305 4.720001 1
1196 2015-03-31 00:00:00 193.529999 193.759995 188.410004 188.770004 5026600 188.770004 0.229996 5.119995 -4.759995 0 189.692268 4.759995 0
1197 2015-04-01 00:00:00 188.699997 192.300003 186.050003 187.589996 3794600 187.589996 3.600006 2.649994 -1.110001 0 189.505228 1.110001 0
1198 2015-04-02 00:00:00 190.229996 193.229996 190.000000 191.000000 5010400 191.000000 3.000000 0.229996 0.770004 1 192.358642 0.770004 1
1199 2015-04-06 00:00:00 198.000000 207.750000 197.500000 203.100006 12455800 203.100006 9.750000 0.500000 5.100006 1 205.486188 5.100006 1
1200 2015-04-07 00:00:00 202.509995 205.059998 201.139999 203.250000 4347900 203.250000 2.550003 1.369996 0.740005 1 203.397141 0.740005 1
1201 2015-04-08 00:00:00 208.199997 210.899994 205.869995 207.669998 6303100 207.669998 2.699997 2.330002 -0.529999 0 208.482920 0.529999 1
1202 2015-04-09 00:00:00 208.429993 210.369995 206.119995 210.089996 3800200 210.089996 1.940002 2.309998 1.660003 1 208.100723 1.660003 0
1203 2015-04-10 00:00:00 209.850006 211.649994 209.000000 210.899994 4067700 210.899994 1.799988 0.850006 1.049988 1 210.501761 1.049988 1
1204 2015-04-13 00:00:00 210.440002 213.000000 209.050003 209.779999 3758200 209.779999 2.559998 1.389999 -0.660003 0 211.312031 0.660003 1
1205 2015-04-14 00:00:00 208.570007 209.490005 205.500000 207.460007 3026000 207.460007 0.919998 3.070007 -1.110000 0 206.827500 1.110000 0
1206 2015-04-15 00:00:00 207.460007 209.589996 206.600006 207.830002 1952400 207.830002 2.129989 0.860001 0.369995 1 208.379004 0.369995 1
1207 2015-04-16 00:00:00 207.699997 209.169998 206.289993 206.699997 1659100 206.699997 1.470001 1.410004 -1.000000 0 207.660606 1.000000 0
1208 2015-04-17 00:00:00 204.990005 206.880005 203.500000 206.789993 2469900 206.789993 1.890000 1.490005 1.799988 1 205.239790 1.799988 0
1209 2015-04-20 00:00:00 206.779999 207.850006 203.850006 205.270004 2559300 205.270004 1.070007 2.929993 -1.509995 0 205.268429 1.509995 0
1210 2015-04-21 00:00:00 205.800003 210.750000 204.309998 209.410004 3432500 209.410004 4.949997 1.490005 3.610001 1 208.573440 3.610001 1
1211 2015-04-22 00:00:00 212.500000 221.880005 211.690002 219.440002 7863000 219.440002 9.380005 0.809998 6.940002 1 219.432587 6.940002 1
1212 2015-04-23 00:00:00 218.270004 221.479996 217.149994 218.600006 4411200 218.600006 3.209992 1.120010 0.330002 1 219.873117 0.330002 1
1213 2015-04-24 00:00:00 220.500000 220.800003 218.009995 218.429993 2427800 218.429993 0.300003 2.490005 -2.070007 0 218.669687 2.070007 0
1214 2015-04-27 00:00:00 222.559998 238.750000 222.000000 231.550003 11672600 231.550003 16.190002 0.559998 8.990005 1 235.288306 8.990005 1
1215 2015-04-28 00:00:00 234.750000 235.500000 228.029999 230.479996 6085400 230.479996 0.750000 6.720001 -4.270004 0 230.094700 4.270004 0
1216 2015-04-29 00:00:00 230.050003 234.970001 227.630005 232.449997 3936100 232.449997 4.919998 2.419998 2.399994 1 232.073823 2.399994 1
1217 2015-04-30 00:00:00 230.389999 232.889999 225.169998 226.050003 3911900 226.050003 2.500000 5.220001 -4.339996 0 228.311142 4.339996 0
1218 2015-05-01 00:00:00 229.940002 231.770004 220.410004 226.029999 5281700 226.029999 1.830002 9.529998 -3.910003 0 224.067416 3.910003 0
1219 2015-05-04 00:00:00 228.179993 234.729996 227.110001 230.509995 4434600 230.509995 6.550003 1.069992 2.330002 1 232.565839 2.330002 1
1220 2015-05-05 00:00:00 237.759995 239.500000 229.130005 232.949997 5796900 232.949997 1.740005 8.629990 -4.809998 0 232.481833 4.809998 0
1221 2015-05-06 00:00:00 234.100006 234.470001 228.199997 230.429993 5270900 230.429993 0.369995 5.900009 -3.670013 0 229.748581 3.670013 0
1222 2015-05-07 00:00:00 221.000000 237.479996 220.250000 236.800003 9455900 236.800003 16.479996 0.750000 15.800003 1 233.826294 15.800003 1
1223 2015-05-08 00:00:00 235.990005 238.410004 233.699997 236.610001 4668200 236.610001 2.419999 2.290008 0.619996 1 236.042853 0.619996 0
1224 2015-05-11 00:00:00 236.289993 242.880005 235.309998 239.490005 5672300 239.490005 6.590012 0.979995 3.200012 1 240.768023 3.200012 1
1225 2015-05-12 00:00:00 240.110001 246.350006 238.190002 244.740005 6363400 244.740005 6.240005 1.919999 4.630004 1 243.588312 4.630004 1
1226 2015-05-13 00:00:00 247.610001 248.300003 242.250000 243.179993 5440200 243.179993 0.690002 5.360001 -4.430008 0 243.914537 4.430008 0
1227 2015-05-14 00:00:00 244.820007 244.889999 241.250000 244.100006 2895900 244.100006 0.069992 3.570007 -0.720001 0 241.962175 0.720001 0
1228 2015-05-15 00:00:00 243.929993 249.399994 242.500000 248.839996 4527600 248.839996 5.470001 1.429993 4.910003 1 247.137564 4.910003 1
1229 2015-05-18 00:00:00 247.000000 249.899994 246.000000 248.750000 3353200 248.750000 2.899994 1.000000 1.750000 1 248.407480 1.750000 1
1230 2015-05-19 00:00:00 248.429993 251.000000 246.149994 247.139999 3674200 247.139999 2.570007 2.279999 -1.289994 0 248.601075 1.289994 1
1231 2015-05-20 00:00:00 247.130005 247.740005 241.369995 244.350006 3755600 244.350006 0.610000 5.760010 -2.779999 0 243.068205 2.779999 0
1232 2015-05-21 00:00:00 243.029999 246.619995 242.360001 245.619995 1970600 245.619995 3.589996 0.669998 2.589996 1 245.259083 2.589996 1
1233 2015-05-22 00:00:00 245.380005 248.600006 245.009995 247.729996 2223100 247.729996 3.220001 0.370010 2.349991 1 247.526992 2.349991 1
1234 2015-05-26 00:00:00 247.679993 252.000000 246.500000 247.460007 3498700 247.460007 4.320007 1.179993 -0.219986 0 250.122903 0.219986 1
1235 2015-05-27 00:00:00 248.509995 249.500000 245.550003 247.429993 3408200 247.429993 0.990005 2.959992 -1.080002 0 246.866082 1.080002 0
1236 2015-05-28 00:00:00 247.029999 251.800003 245.050003 251.449997 3647300 251.449997 4.770004 1.979996 4.419998 1 249.243175 4.419998 1
1237 2015-05-29 00:00:00 251.000000 252.869995 249.429993 250.800003 3789300 250.800003 1.869995 1.570007 -0.199997 0 251.124844 0.199997 0
1238 2015-06-01 00:00:00 251.410004 251.600006 247.470001 249.449997 2505100 249.449997 0.190002 3.940003 -1.960007 0 248.366001 1.960007 0
1239 2015-06-02 00:00:00 248.919998 249.399994 246.300003 248.350006 2134800 248.350006 0.479996 2.619995 -0.569992 0 247.110601 0.569992 0
1240 2015-06-03 00:00:00 248.199997 250.720001 247.009995 248.990005 1775500 248.990005 2.520004 1.190002 0.790008 1 249.149829 0.790008 1
1241 2015-06-04 00:00:00 247.500000 249.300003 245.710007 245.919998 2453600 245.919998 1.800003 1.789993 -1.580002 0 247.405325 1.580002 0
1242 2015-06-05 00:00:00 246.000000 249.699997 245.679993 249.139999 3022000 249.139999 3.699997 0.320007 3.139999 1 248.579940 3.139999 1
1243 2015-06-08 00:00:00 250.850006 258.750000 250.309998 256.290009 5017000 256.290009 7.899994 0.540008 5.440003 1 256.724402 5.440003 1
1244 2015-06-09 00:00:00 255.399994 257.739990 254.139999 256.000000 2611100 256.000000 2.339996 1.259995 0.600006 1 256.141126 0.600006 1
1245 2015-06-10 00:00:00 251.899994 254.000000 248.500000 250.699997 3454500 250.699997 2.100006 3.399994 -1.199997 0 250.837361 1.199997 0
1246 2015-06-11 00:00:00 253.259995 254.369995 250.429993 251.410004 2044100 251.410004 1.110000 2.830002 -1.849991 0 251.807857 1.849991 0
1247 2015-06-12 00:00:00 250.210007 253.460007 250.210007 250.690002 1422300 250.690002 3.250000 0.000000 0.479995 1 252.654952 0.479995 1
1248 2015-06-15 00:00:00 249.699997 251.279999 246.009995 250.380005 2186200 250.380005 1.580002 3.690002 0.680008 1 247.992560 0.680008 0
1249 2015-06-16 00:00:00 250.130005 253.440002 249.100006 253.119995 1984700 253.119995 3.309997 1.029999 2.989990 1 251.849892 2.989990 1
1250 2015-06-17 00:00:00 252.169998 264.359985 252.020004 260.410004 5512900 260.410004 12.189987 0.149994 8.240006 1 261.875579 8.240006 1
1251 2015-06-18 00:00:00 262.000000 263.459991 260.019989 261.890015 2782700 261.890015 1.459991 1.980011 -0.109985 0 261.466695 0.109985 0
1252 2015-06-19 00:00:00 262.399994 263.799988 260.100006 262.510010 2463000 262.510010 1.399994 2.299988 0.110016 1 261.576124 0.110016 0
1253 2015-06-22 00:00:00 262.149994 264.399994 255.690002 259.790009 4561100 259.790009 2.250000 6.459992 -2.359985 0 258.898997 2.359985 0
1254 2015-06-23 00:00:00 260.320007 268.000000 258.570007 267.670013 3870800 267.670013 7.679993 1.750000 7.350006 1 265.092959 7.350006 1
1255 2015-06-24 00:00:00 266.980011 267.350006 263.720001 265.170013 2412300 265.170013 0.369995 3.260010 -1.809998 0 264.579575 1.809998 0
1256 2015-06-25 00:00:00 266.450012 271.410004 265.250000 268.790009 2849200 268.790009 4.959992 1.200012 2.339997 1 269.386163 2.339997 1
1257 2015-06-26 00:00:00 268.890015 269.109985 266.000000 267.089996 3838400 267.089996 0.219970 2.890015 -1.800019 0 266.642069 1.800019 0
1258 2015-06-29 00:00:00 261.950012 265.950012 260.700012 262.019989 3478900 262.019989 4.000000 1.250000 0.069977 1 264.061294 0.069977 1
1259 2015-06-30 00:00:00 264.799988 270.920013 264.000000 268.260010 3086900 268.260010 6.120025 0.799988 3.460022 1 268.995747 3.460022 1
1260 2015-07-01 00:00:00 271.109985 272.619995 267.850006 269.149994 2101200 269.149994 1.510010 3.259979 -1.959991 0 269.645753 1.959991 0
1261 2015-07-02 00:00:00 280.200012 282.450012 273.309998 280.019989 7163900 280.019989 2.250000 6.890014 -0.180023 0 276.606669 0.180023 0
1262 2015-07-06 00:00:00 278.880005 281.690002 276.299988 279.720001 4121900 279.720001 2.809997 2.580017 0.839996 1 278.991496 0.839996 1
1263 2015-07-07 00:00:00 275.000000 275.200012 260.769989 267.880005 6105100 267.880005 0.200012 14.230011 -7.119995 0 264.200624 7.119995 0
1264 2015-07-08 00:00:00 259.320007 260.799988 254.309998 254.960007 6221100 254.960007 1.479981 5.010009 -4.360000 0 256.527212 4.360000 0
1265 2015-07-09 00:00:00 259.079987 262.950012 256.790009 257.920013 3325100 257.920013 3.870025 2.289978 -1.159974 0 260.304907 1.159974 0
1266 2015-07-10 00:00:00 262.220001 263.000000 257.820007 259.149994 2610900 259.149994 0.779999 4.399994 -3.070007 0 259.305456 3.070007 0
1267 2015-07-13 00:00:00 262.250000 262.549988 256.049988 262.160004 2960300 262.160004 0.299988 6.200012 -0.089996 0 257.585661 0.089996 0
1268 2015-07-14 00:00:00 262.100006 265.989990 260.510010 265.649994 1907600 265.649994 3.889984 1.589996 3.549988 1 263.864664 3.549988 1
1269 2015-07-15 00:00:00 266.739990 267.489990 262.079987 263.140015 2021600 263.140015 0.750000 4.660003 -3.599975 0 263.600407 3.599975 0
1270 2015-07-16 00:00:00 264.220001 267.200012 263.160004 266.679993 1616000 266.679993 2.980011 1.059997 2.459992 1 265.630307 2.459992 1
1271 2015-07-17 00:00:00 272.500000 275.540009 268.250000 274.660004 5004100 274.660004 3.040009 4.250000 2.160004 1 271.551988 2.160004 0
1272 2015-07-20 00:00:00 275.000000 286.649994 272.540009 282.260010 4978500 282.260010 11.649994 2.459991 7.260010 1 282.498839 7.260010 1
1273 2015-07-21 00:00:00 270.049988 273.500000 266.549988 266.769989 6108700 266.769989 3.450012 3.500000 -3.279999 0 270.006858 3.279999 1
1274 2015-07-22 00:00:00 261.269989 269.440002 260.859985 267.869995 3105000 267.869995 8.170013 0.410004 6.600006 1 267.453993 6.600006 1
1275 2015-07-23 00:00:00 269.649994 269.899994 265.269989 267.200012 2227200 267.200012 0.250000 4.380005 -2.449982 0 266.305438 2.449982 0
1276 2015-07-24 00:00:00 267.380005 271.089996 263.920013 265.410004 2836500 265.410004 3.709991 3.459992 -1.970001 0 267.584248 1.970001 0
1277 2015-07-27 00:00:00 262.429993 264.429993 250.789993 253.009995 4694200 253.009995 2.000000 11.640000 -9.419998 0 255.076685 9.419998 0
1278 2015-07-28 00:00:00 255.750000 265.399994 251.839996 264.820007 3895800 264.820007 9.649994 3.910004 9.070007 1 260.528510 9.070007 1
1279 2015-07-29 00:00:00 264.269989 267.890015 262.000000 263.820007 2790100 263.820007 3.620026 2.269989 -0.449982 0 265.298248 0.449982 0
1280 2015-07-30 00:00:00 262.690002 266.940002 262.109985 266.790009 2034600 266.790009 4.250000 0.580017 4.100007 1 265.510637 4.100007 1
1281 2015-07-31 00:00:00 267.600006 269.359985 265.119995 266.149994 2222600 266.149994 1.759979 2.480011 -1.450012 0 266.932277 1.450012 0
1282 2015-08-03 00:00:00 266.290009 266.709991 257.070007 259.989990 2553500 259.989990 0.419982 9.220002 -6.300019 0 259.449161 6.300019 0
1283 2015-08-04 00:00:00 260.010010 266.720001 258.339996 266.279999 2352500 266.279999 6.709991 1.670014 6.269989 1 264.043190 6.269989 1
1284 2015-08-05 00:00:00 263.579987 271.000000 260.399994 270.130005 6214300 270.130005 7.420013 3.179993 6.550018 1 267.059570 6.550018 1
1285 2015-08-06 00:00:00 249.539993 255.000000 236.119995 246.130005 14623800 246.130005 5.460007 13.419998 -3.409988 0 243.716022 3.409988 0
1286 2015-08-07 00:00:00 243.580002 243.729996 238.389999 242.509995 5073400 242.509995 0.149994 5.190003 -1.070007 0 239.571110 1.070007 0
1287 2015-08-10 00:00:00 238.149994 242.970001 236.050003 241.139999 4185900 241.139999 4.820007 2.099991 2.990005 1 240.323493 2.990005 1
1288 2015-08-11 00:00:00 237.149994 239.300003 234.440002 237.369995 4264900 237.369995 2.150009 2.709992 0.220001 1 236.663023 0.220001 0
1289 2015-08-12 00:00:00 235.000000 239.770004 232.740005 238.169998 3728000 238.169998 4.770004 2.259995 3.169998 1 237.015216 3.169998 1
1290 2015-08-13 00:00:00 239.860001 246.479996 239.119995 242.509995 4689200 242.509995 6.619995 0.740006 2.649994 1 244.539512 2.649994 1
1291 2015-08-14 00:00:00 247.240005 247.929993 241.770004 243.149994 4364800 243.149994 0.689988 5.470001 -4.090011 0 243.462189 4.090011 0
1292 2015-08-17 00:00:00 255.559998 256.589996 250.509995 254.990005 7176700 254.990005 1.029998 5.050003 -0.569993 0 252.369833 0.569993 0
1293 2015-08-18 00:00:00 255.380005 260.950012 253.559998 260.720001 4195000 260.720001 5.570007 1.820007 5.339996 1 258.364748 5.339996 1
1294 2015-08-19 00:00:00 260.329987 260.649994 255.020004 255.250000 3596200 255.250000 0.320007 5.309983 -5.079987 0 256.353549 5.079987 0
1295 2015-08-20 00:00:00 252.059998 254.559998 241.899994 242.179993 4905800 242.179993 2.500000 10.160004 -9.880005 0 246.243142 9.880005 0
1296 2015-08-21 00:00:00 236.000000 243.800003 230.509995 230.770004 6590200 230.770004 7.800003 5.490005 -5.229996 0 238.084702 5.229996 1
1297 2015-08-24 00:00:00 202.789993 231.399994 195.000000 218.869995 9581600 218.869995 28.610001 7.789993 16.080002 1 220.348040 16.080002 1
1298 2015-08-25 00:00:00 230.520004 230.899994 219.119995 220.029999 4327300 220.029999 0.379990 11.400009 -10.490005 0 222.044155 10.490005 0
1299 2015-08-26 00:00:00 227.929993 228.000000 215.509995 224.839996 4963000 224.839996 0.070007 12.419998 -3.089997 0 218.434014 3.089997 0
1300 2015-08-27 00:00:00 231.000000 244.750000 230.809998 242.990005 7656000 242.990005 13.750000 0.190002 11.990005 1 241.984715 11.990005 1
1301 2015-08-28 00:00:00 241.860001 251.449997 241.570007 248.479996 5513700 248.479996 9.589996 0.289994 6.619995 1 249.326112 6.619995 1
1302 2015-08-31 00:00:00 245.619995 254.949997 245.509995 249.059998 4700200 249.059998 9.330002 0.110000 3.440003 1 253.003036 3.440003 1
1303 2015-09-01 00:00:00 240.339996 246.000000 236.970001 238.630005 5454800 238.630005 5.660004 3.369995 -1.709991 0 242.249055 1.709991 1
1304 2015-09-02 00:00:00 245.300003 247.880005 239.779999 247.690002 4629200 247.690002 2.580002 5.520004 2.389999 1 243.045880 2.389999 0
1305 2015-09-03 00:00:00 252.059998 252.080002 245.000000 245.570007 4194800 245.570007 0.020004 7.059998 -6.489991 0 246.528587 6.489991 0
1306 2015-09-04 00:00:00 240.889999 244.089996 238.199997 241.929993 3689200 241.929993 3.199997 2.690002 1.039994 1 241.280379 1.039994 0
1307 2015-09-08 00:00:00 245.050003 249.160004 244.050003 248.169998 3138200 248.169998 4.110001 1.000000 3.119995 1 247.457786 3.119995 1
1308 2015-09-09 00:00:00 252.050003 254.250000 248.300003 248.910004 3390800 248.910004 2.199997 3.750000 -3.139999 0 250.806474 3.139999 0
1309 2015-09-10 00:00:00 247.229996 250.720001 245.330002 248.479996 2709000 248.479996 3.490005 1.899994 1.250000 1 248.447129 1.250000 1
1310 2015-09-11 00:00:00 247.639999 250.240005 244.729996 250.240005 2350800 250.240005 2.600006 2.910003 2.600006 1 247.362847 2.600006 1
1311 2015-09-14 00:00:00 251.100006 254.250000 249.669998 253.190002 2890900 253.190002 3.149994 1.430008 2.089996 1 252.386035 2.089996 1
1312 2015-09-15 00:00:00 252.750000 254.600006 249.500000 253.570007 2933500 253.570007 1.850006 3.250000 0.820007 1 251.593032 0.820007 0
1313 2015-09-16 00:00:00 253.039993 262.880005 252.880005 262.250000 4417100 262.250000 9.840012 0.159988 9.210007 1 260.798413 9.210007 1
1314 2015-09-17 00:00:00 263.959991 265.500000 260.690002 262.070007 3585800 262.070007 1.540009 3.269989 -1.889984 0 262.520481 1.889984 0
1315 2015-09-18 00:00:00 257.959991 263.820007 257.500000 260.619995 3763100 260.619995 5.860016 0.459991 2.660004 1 262.204123 2.660004 1
1316 2015-09-21 00:00:00 263.980011 271.570007 255.800003 264.200012 6120200 264.200012 7.589996 8.180008 0.220001 1 263.839012 0.220001 0
1317 2015-09-22 00:00:00 259.029999 262.649994 255.869995 260.940002 3664400 260.940002 3.619995 3.160004 1.910003 1 259.394369 1.910003 0
1318 2015-09-23 00:00:00 261.950012 262.079987 257.579987 261.059998 2600800 261.059998 0.129975 4.370025 -0.890014 0 258.522019 0.890014 0
1319 2015-09-24 00:00:00 259.529999 263.450012 256.209991 263.119995 3448200 263.119995 3.920013 3.320008 3.589996 1 260.021025 3.589996 0
1320 2015-09-25 00:00:00 266.609985 266.910004 256.149994 256.910004 3773400 256.910004 0.300019 10.459991 -9.699981 0 258.737264 9.699981 0
1321 2015-09-28 00:00:00 257.350006 259.790009 246.610001 248.429993 4901100 248.429993 2.440003 10.740005 -8.920013 0 251.041897 8.920013 0
1322 2015-09-29 00:00:00 250.460007 254.729996 245.460007 246.649994 3703200 246.649994 4.269989 5.000000 -3.810013 0 249.985795 3.810013 0
1323 2015-09-30 00:00:00 252.000000 252.399994 242.339996 248.399994 4929600 248.399994 0.399994 9.660004 -3.600006 0 244.826738 3.600006 0
1324 2015-10-01 00:00:00 247.509995 248.500000 237.130005 239.880005 4573000 239.880005 0.990005 10.379990 -7.629990 0 240.286718 7.629990 0
1325 2015-10-02 00:00:00 235.600006 247.699997 234.929993 247.570007 4424000 247.570007 12.099991 0.670013 11.970001 1 244.857630 11.970001 1
1326 2015-10-05 00:00:00 248.839996 249.839996 244.130005 246.149994 3689900 246.149994 1.000000 4.709991 -2.690002 0 245.887848 2.690002 0
1327 2015-10-06 00:00:00 240.000000 243.029999 235.580002 241.460007 5225200 241.460007 3.029999 4.419998 1.460007 1 238.949975 1.460007 0
1328 2015-10-07 00:00:00 236.630005 237.699997 229.119995 231.960007 6814000 231.960007 1.069992 7.510010 -4.669998 0 231.642579 4.669998 0
1329 2015-10-08 00:00:00 230.080002 230.720001 221.309998 226.720001 6133200 226.720001 0.639999 8.770004 -3.360001 0 223.797090 3.360001 0
1330 2015-10-09 00:00:00 220.929993 224.369995 218.360001 220.690002 6158400 220.690002 3.440002 2.569992 -0.239991 0 221.629575 0.239991 1
1331 2015-10-12 00:00:00 222.990005 223.000000 215.270004 215.580002 3836300 215.580002 0.009995 7.720001 -7.410003 0 216.984461 7.410003 0
1332 2015-10-13 00:00:00 213.279999 222.520004 211.130005 219.250000 5171500 219.250000 9.240005 2.149994 5.970001 1 219.088487 5.970001 1
1333 2015-10-14 00:00:00 220.669998 220.949997 215.429993 216.880005 3104400 216.880005 0.279999 5.240005 -3.789993 0 216.754790 3.789993 0
1334 2015-10-15 00:00:00 216.429993 221.729996 213.699997 221.309998 2844200 221.309998 5.300003 2.729996 4.880005 1 218.548464 4.880005 1
1335 2015-10-16 00:00:00 223.039993 230.479996 222.869995 227.009995 4334500 227.009995 7.440003 0.169998 3.970002 1 228.842348 3.970002 1
1336 2015-10-19 00:00:00 226.500000 231.149994 224.940002 228.100006 2507900 228.100006 4.649994 1.559998 1.600006 1 228.951577 1.600006 1
1337 2015-10-20 00:00:00 227.720001 228.600006 202.000000 213.029999 14863300 213.029999 0.880005 25.720001 -14.690002 0 208.889861 14.690002 0
1338 2015-10-21 00:00:00 211.990005 214.809998 208.800003 210.089996 4151500 210.089996 2.819993 3.190002 -1.900009 0 211.721162 1.900009 1
1339 2015-10-22 00:00:00 211.559998 215.750000 209.399994 211.720001 2825200 211.720001 4.190002 2.160004 0.160003 1 213.196504 0.160003 1
1340 2015-10-23 00:00:00 215.000000 215.350006 207.690002 209.089996 4235500 209.089996 0.350006 7.309998 -5.910004 0 209.591701 5.910004 0
1341 2015-10-26 00:00:00 211.380005 215.880005 210.000000 215.259995 3391400 215.259995 4.500000 1.380005 3.879990 1 213.859068 3.879990 1
1342 2015-10-27 00:00:00 214.839996 217.100006 207.509995 210.350006 3519400 210.350006 2.260010 7.330001 -4.489990 0 210.992577 4.489990 0
1343 2015-10-28 00:00:00 211.309998 213.449997 208.300003 212.960007 2728600 212.960007 2.139999 3.009995 1.650009 1 210.616252 1.650009 0
1344 2015-10-29 00:00:00 211.750000 213.750000 210.639999 211.630005 1805000 211.630005 2.000000 1.110001 -0.119995 0 212.369236 0.119995 1
1345 2015-10-30 00:00:00 210.399994 211.630005 203.889999 206.929993 4438900 206.929993 1.230011 6.509995 -3.470001 0 206.324191 3.470001 0
1346 2015-11-02 00:00:00 208.919998 215.800003 207.220001 213.789993 3927900 213.789993 6.880005 1.699997 4.869995 1 213.124490 4.869995 1
1347 2015-11-03 00:00:00 213.850006 214.440002 207.750000 208.350006 8332500 208.350006 0.589996 6.100006 -5.500000 0 209.550914 5.500000 0
1348 2015-11-04 00:00:00 227.000000 232.740005 225.199997 231.630005 12726400 231.630005 5.740005 1.800003 4.630005 1 230.169810 4.630005 1
1349 2015-11-05 00:00:00 230.580002 234.580002 229.190002 231.770004 4496800 231.770004 4.000000 1.390000 1.190002 1 232.618904 1.190002 1
1350 2015-11-06 00:00:00 230.699997 233.360001 229.500000 232.360001 2445300 232.360001 2.660004 1.199997 1.660004 1 231.776172 1.660004 1
1351 2015-11-09 00:00:00 232.990005 232.990005 224.309998 225.330002 3850900 225.330002 0.000000 8.680007 -7.660003 0 226.243725 7.660003 0
1352 2015-11-10 00:00:00 223.479996 223.699997 216.080002 216.500000 4617000 216.500000 0.220001 7.399994 -6.979996 0 217.887863 6.979996 0
1353 2015-11-11 00:00:00 217.770004 219.479996 213.630005 219.080002 3347800 219.080002 1.709992 4.139999 1.309998 1 215.864874 1.309998 0
1354 2015-11-12 00:00:00 217.850006 219.000000 212.660004 212.940002 2915900 212.940002 1.149994 5.190002 -4.910004 0 214.693110 4.910004 0
1355 2015-11-13 00:00:00 212.949997 212.990005 206.520004 207.190002 3430300 207.190002 0.040008 6.429993 -5.759995 0 207.949932 5.759995 0
1356 2015-11-16 00:00:00 206.089996 214.979996 205.800003 214.309998 2925400 214.309998 8.890000 0.289993 8.220002 1 213.016137 8.220002 1
1357 2015-11-17 00:00:00 215.199997 216.000000 211.399994 214.000000 2148700 214.000000 0.800003 3.800003 -1.199997 0 212.802525 1.199997 0
1358 2015-11-18 00:00:00 214.500000 221.380005 212.520004 221.070007 2811900 221.070007 6.880005 1.979996 6.570007 1 218.488057 6.570007 1
1359 2015-11-19 00:00:00 220.539993 226.190002 220.300003 221.800003 2504400 221.800003 5.650009 0.239990 1.260010 1 224.815584 1.260010 1
1360 2015-11-20 00:00:00 223.490005 225.000000 213.580002 220.009995 4400700 220.009995 1.509995 9.910003 -3.480010 0 217.074387 3.480010 0
1361 2015-11-23 00:00:00 217.350006 219.179993 214.679993 217.750000 2526200 217.750000 1.829987 2.670013 0.399994 1 216.649856 0.399994 0
1362 2015-11-24 00:00:00 215.369995 221.000000 215.000000 218.250000 2480300 218.250000 5.630005 0.369995 2.880005 1 219.536733 2.880005 1
1363 2015-11-25 00:00:00 221.339996 230.830002 220.380005 229.639999 3990800 229.639999 9.490006 0.959991 8.300003 1 228.241254 8.300003 1
1364 2015-11-27 00:00:00 231.059998 232.250000 227.009995 231.610001 1949400 231.610001 1.190002 4.050003 0.550003 1 228.779617 0.550003 0
1365 2015-11-30 00:00:00 231.789993 234.279999 229.080002 230.259995 2659800 230.259995 2.490006 2.709991 -1.529998 0 231.589144 1.529998 0
1366 2015-12-01 00:00:00 231.059998 238.000000 231.050003 237.190002 3734000 237.190002 6.940002 0.009995 6.130004 1 236.561772 6.130004 1
1367 2015-12-02 00:00:00 237.000000 238.600006 231.229996 231.990005 2981500 231.990005 1.600006 5.770004 -5.009995 0 233.758067 5.009995 0
1368 2015-12-03 00:00:00 235.479996 237.449997 230.000000 232.710007 2939600 232.710007 1.970001 5.479996 -2.769989 0 232.763013 2.769989 0
1369 2015-12-04 00:00:00 232.460007 233.270004 227.660004 230.380005 2573600 230.380005 0.809997 4.800003 -2.080002 0 229.300595 2.080002 0
1370 2015-12-07 00:00:00 227.699997 235.630005 226.149994 231.130005 3144200 231.130005 7.930008 1.550003 3.430008 1 232.863847 3.430008 1
1371 2015-12-08 00:00:00 227.520004 228.800003 224.199997 226.720001 2687600 226.720001 1.279999 3.320007 -0.800003 0 225.866598 0.800003 0
1372 2015-12-09 00:00:00 226.699997 227.500000 220.720001 224.520004 3057800 224.520004 0.800003 5.979996 -2.179993 0 222.650936 2.179993 0
1373 2015-12-10 00:00:00 224.710007 228.490005 223.639999 227.070007 2067000 227.070007 3.779998 1.070008 2.360000 1 226.814224 2.360000 1
1374 2015-12-11 00:00:00 225.240005 225.750000 216.639999 217.020004 3268700 217.020004 0.509995 8.600006 -8.220001 0 218.982769 8.220001 0
1375 2015-12-14 00:00:00 217.509995 220.919998 214.869995 218.580002 2827100 218.580002 3.410003 2.640000 1.070007 1 218.135764 1.070007 0
1376 2015-12-15 00:00:00 221.820007 222.220001 218.000000 221.089996 2244400 221.089996 0.399994 3.820007 -0.730011 0 219.070537 0.730011 0
1377 2015-12-16 00:00:00 222.100006 234.880005 220.729996 234.509995 5104300 234.509995 12.779999 1.370010 12.409989 1 231.406348 12.409989 1
1378 2015-12-17 00:00:00 233.940002 237.759995 229.809998 233.389999 3298600 233.389999 3.819993 4.130004 -0.550003 0 233.766178 0.550003 1
1379 2015-12-18 00:00:00 232.889999 235.899994 229.289993 230.460007 3014200 230.460007 3.009995 3.600006 -2.429992 0 232.447627 2.429992 1
1380 2015-12-21 00:00:00 231.690002 235.830002 231.080002 232.559998 1953200 232.559998 4.140000 0.610000 0.869996 1 234.429860 0.869996 1
1381 2015-12-22 00:00:00 234.990005 236.550003 229.630005 229.949997 1961500 229.949997 1.559998 5.360000 -5.040008 0 232.025529 5.040008 0
1382 2015-12-23 00:00:00 232.179993 233.449997 228.130005 229.699997 1555000 229.699997 1.270004 4.049988 -2.479996 0 229.964450 2.479996 0
1383 2015-12-24 00:00:00 230.559998 231.880005 228.279999 230.570007 708000 230.570007 1.320007 2.279999 0.010009 1 229.718576 0.010009 0
1384 2015-12-28 00:00:00 231.490005 231.979996 225.539993 228.949997 1901300 228.949997 0.489991 5.950012 -2.540008 0 227.202709 2.540008 0
1385 2015-12-29 00:00:00 230.059998 237.720001 229.550003 237.190002 2406300 237.190002 7.660003 0.509995 7.130004 1 235.780785 7.130004 1
1386 2015-12-30 00:00:00 236.600006 243.630005 235.669998 238.089996 3697900 238.089996 7.029999 0.930008 1.489990 1 241.478295 1.489990 1
1387 2015-12-31 00:00:00 238.509995 243.449997 238.369995 240.009995 2683200 240.009995 4.940002 0.140000 1.500000 1 242.256177 1.500000 1
from sklearn.metrics import confusion_matrix,accuracy_score
ac = accuracy_score(y_test2,classifier.predict(X_test2))
ac
0.8373015873015873

We can see from above that the accuracy is 0.837, which is high.

Summary

Either summarize what you did, or summarize the results. Maybe 3 sentences.

So, in the project, I use linear regression to predict the future close price for Tesla and find the prediction is very close to the true price. Also, I use K-Nearest Neighbor to classify the data into worthing trading, where the close price is higher than the open price and not worth trading, where the close price is lower than the open price. The K-Nearest Neighbor also has high accuracy. Therefore, we can see although the stock market is volatile, we can still use some methods from Python to figure out the trend and the relationships between different prices.

References

  • What is the source of your dataset(s)?

https://www.kaggle.com/datasets/rpaguirre/tesla-stock-price Tesla Stock Price Dataset

  • Were any portions of the code or ideas taken from another source? List those sources here and say how they were used.

https://www.analyticsvidhya.com/blog/2021/01/a-quick-introduction-to-k-nearest-neighbor-knn-classification-using-python/ I learned how to use K-Nearest Neighbor Classification from the website.

Created in deepnote.com Created in Deepnote