Data Science Posts and Resources

Articles on Data Science

Stock Price Technical Analysis

A case study on Stock Price Technical Analysis

Laxmi K Soni

17-Minute Read

1:Loading Stock data

1.1:Importing libraries and data

import investpy
from datetime import datetime
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix
from sklearn import metrics
from scipy import stats 
import numpy as np
import pandas as pd
import seaborn as sn
import matplotlib.pyplot as plt
import talib
import quandl
from sklearn.preprocessing import StandardScaler 
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import MinMaxScaler 
import math
from sklearn.metrics import mean_squared_error
import investpy

1.2:Fetching the data

To fetch the stock data we use investpy library. This library fetchs data from investing for example:

1.2.1: Determining position based on volume and close

##               Open     High      Low   Close    Volume    Pos
## Date                                                         
## 2021-06-11  1430.1  1451.60  1429.45  1446.9  6140.828   Long
## 2021-06-14  1471.0  1477.00  1453.45  1461.8  7132.294   Long
## 2021-06-15  1464.0  1476.00  1463.00  1473.9  5403.104  Short
## 2021-06-16  1472.7  1489.45  1467.50  1480.6  7661.710   Long
## 2021-06-17  1475.1  1502.65  1475.10  1495.3  7677.951   Long
##                Open     High      Low    Close     Volume    Pos   gain
## Date                                                                   
## 2020-11-26  1119.95  1119.95  1098.30  1113.20  10962.256  Short   6.75
## 2020-12-03  1147.00  1147.00  1122.70  1126.45  16212.632  Short  20.55
## 2020-12-24  1249.90  1249.90  1226.00  1236.05   7313.885  Short  13.85
## 2021-01-12  1378.00  1378.00  1360.00  1371.75   8309.868  Short   6.25
## 2021-03-18  1393.75  1393.75  1313.50  1337.10  10961.755  Short  56.65
## 2021-04-09  1455.00  1455.00  1430.05  1441.05   6052.712   Long  13.95
## 2021-04-20  1379.00  1379.00  1342.40  1351.35   8560.766  Short  27.65
## 2021-05-12  1330.00  1330.00  1314.50  1327.00   5241.898  Short   3.00
## 2021-05-14  1326.85  1326.85  1311.30  1316.40   4824.609  Short  10.45
## 2021-05-31  1401.50  1401.50  1383.00  1393.75   4429.904  Short   7.75
##                Open     High      Low    Close     Volume    Pos   gain
## Date                                                                   
## 2020-09-17   995.00  1021.00   995.00  1011.00  15628.308   Long  16.00
## 2020-10-05  1018.05  1054.90  1018.05  1048.70  14212.560   Long  30.65
## 2020-10-13  1135.55  1166.05  1135.55  1157.80  17524.136   Long  22.25
## 2020-12-01  1105.05  1140.25  1105.05  1137.85   8933.802  Short  32.80
## 2020-12-08  1145.00  1167.00  1145.00  1153.35  12308.330   Long   8.35
## 2020-12-29  1235.00  1254.45  1235.00  1250.30   6878.105   Long  15.30
## 2021-01-08  1278.25  1316.80  1278.25  1312.10  13186.251   Long  33.85
## 2021-01-20  1320.55  1348.40  1320.55  1339.45   8225.838   Long  18.90
## 2021-05-17  1320.30  1334.95  1320.30  1329.40   5017.129   Long   9.10
## 2021-06-17  1475.10  1502.65  1475.10  1495.30   7677.951   Long  20.20

1.2.2: Determining Average monthly closing prices

##                Open     High      Low    Close    Volume
## Date                                                    
## 2015-01-01   488.38   491.61   485.39   489.73  2002.764
## 2015-01-02   489.13   500.80   489.13   499.35  6778.320
## 2015-01-05   498.53   503.52   490.50   495.06  9937.024
## 2015-01-06   491.12   492.36   479.73   484.72  9667.316
## 2015-01-07   487.40   489.82   483.68   487.04  7249.916
## ...             ...      ...      ...      ...       ...
## 2021-06-11  1430.10  1451.60  1429.45  1446.90  6140.828
## 2021-06-14  1471.00  1477.00  1453.45  1461.80  7132.294
## 2021-06-15  1464.00  1476.00  1463.00  1473.90  5403.104
## 2021-06-16  1472.70  1489.45  1467.50  1480.60  7661.710
## 2021-06-17  1475.10  1502.65  1475.10  1495.30  7677.951
## 
## [1598 rows x 5 columns]
##                Open     High      Low    Close    Volume Currency  VolChange  \
## Date                                                                           
## 2015-01-01  0.48838  0.49161  0.48539  0.48973  2002.764      INR   0.158042   
## 2015-01-02  0.48913  0.50080  0.48913  0.49935  6778.320      INR   2.384483   
## 2015-01-05  0.49853  0.50352  0.49050  0.49506  9937.024      INR   0.466001   
## 2015-01-06  0.49112  0.49236  0.47973  0.48472  9667.316      INR  -0.027142   
## 2015-01-07  0.48740  0.48982  0.48368  0.48704  7249.916      INR  -0.250059   
## ...             ...      ...      ...      ...       ...      ...        ...   
## 2021-06-11  1.43010  1.45160  1.42945  1.44690  6140.828      INR   0.756241   
## 2021-06-14  1.47100  1.47700  1.45345  1.46180  7132.294      INR   0.161455   
## 2021-06-15  1.46400  1.47600  1.46300  1.47390  5403.104      INR  -0.242445   
## 2021-06-16  1.47270  1.48945  1.46750  1.48060  7661.710      INR   0.418020   
## 2021-06-17  1.47510  1.50265  1.47510  1.49530  7677.951      INR   0.002120   
## 
##             CloseChange  
## Date                     
## 2015-01-01     0.000853  
## 2015-01-02     0.019643  
## 2015-01-05    -0.008591  
## 2015-01-06    -0.020886  
## 2015-01-07     0.004786  
## ...                 ...  
## 2021-06-11     0.015867  
## 2021-06-14     0.010298  
## 2021-06-15     0.008277  
## 2021-06-16     0.004546  
## 2021-06-17     0.009928  
## 
## [1598 rows x 8 columns]
## Date
## 2015-01-31    0.518659
## 2015-02-28    0.559373
## 2015-03-31    0.552822
## 2015-04-30    0.526967
## 2015-05-31    0.493150
##                 ...   
## 2021-02-28    1.283755
## 2021-03-31    1.349143
## 2021-04-30    1.379589
## 2021-05-31    1.352943
## 2021-06-30    1.426296
## Freq: M, Name: Close, Length: 78, dtype: float64
## meanprice is  0.6835084355444305

1.2.3: Technical moving averages

##   period  sma_value sma_signal  ema_value ema_signal
## 0      5       9.60        buy       9.98        buy
## 1     10       8.72        buy       8.97        buy
## 2     20       7.44        buy       8.16        buy
## 3     50       7.67        buy       7.86        buy
## 4    100       8.38        buy       8.41        buy

1.2.4: Determining the z-scores

## Date
## 2021-06-11    3.181882
## 2021-06-14    3.243986
## 2021-06-15    3.294420
## 2021-06-16    3.322346
## 2021-06-17    3.383617
## Name: zscore, dtype: float64
## Date
## 2021-06-11   -0.346013
## 2021-06-14   -0.217202
## 2021-06-15   -0.441857
## 2021-06-16   -0.148421
## 2021-06-17   -0.146311
## Name: zscorevolume, dtype: float64

1.2.5: Determining the daily support and resistance levels

##                   PP        R1        S1        R2        S2        R3  \
## Date                                                                     
## 2021-06-11  1.442650  1.455850  1.433700  1.464800  1.420500  1.478000   
## 2021-06-14  1.464083  1.474717  1.451167  1.487633  1.440533  1.498267   
## 2021-06-15  1.470967  1.478933  1.465933  1.483967  1.457967  1.491933   
## 2021-06-16  1.479183  1.490867  1.468917  1.501133  1.457233  1.512817   
## 2021-06-17  1.491017  1.506933  1.479383  1.518567  1.463467  1.534483   
## 
##                   S3  
## Date                  
## 2021-06-11  1.411550  
## 2021-06-14  1.427617  
## 2021-06-15  1.452933  
## 2021-06-16  1.446967  
## 2021-06-17  1.451833

1.2.6: Fibonnacci retracement levels

## Retracement levels for rising price
##                                0
## 0  {'min': [1.4750999999999999]}
## 1  {'level5(61.8)': [1.4856241]}
## 2     {'level4(50)': [1.488875]}
## 3  {'level3(38.2)': [1.4921259]}
## 4  {'level2(23.6)': [1.4961482]}
## 5            {'zero': [1.50265]}
## Retracement levels for falling price
##                                0
## 0            {'zero': [1.50265]}
## 1  {'level2(23.6)': [1.4816018]}
## 2  {'level3(38.2)': [1.4856241]}
## 3     {'level4(50)': [1.488875]}
## 4  {'level5(61.8)': [1.4921259]}
## 5  {'min': [1.4750999999999999]}

As we can see, we now have a data frame with all the entries from start date to end date. We have multiple columns here and not only the closing stock price of the respective day. Let’s take a quick look at the individual columns and their meaning.

Open: That’s the share price the stock had when the markets opened that day.

Close: That’s the share price the stock had when the markets closed that day.

High: That’s the highest share price that the stock had that day.

Low: That’s the lowest share price that the stock had that day.

Volume: Amount of shares that changed hands that day.

1.3:Reading individual values

Since our data is stored in a Pandas data frame, we can use the indexing we already know, to get individual values. For example, we could only print the closing values using print (df[ 'Close' ])

Also, we can go ahead and print the closing value of a specific date that we are interested in. This is possible because the date is our index column.

#print (df[ 'Close' ][ '2020-07-14' ])

But we could also use simple indexing to access certain positions.

print (df[ 'Close' ][ 5 ])
## 0.48949000000000004

Here we printed the closing price of the fifth entry.

2:Graphical Visualization

Even though tables are nice and useful, we want to visualize our financial data, in order to get a better overview. We want to look at the development of the share price.

Actually plotting our share price curve with Pandas and Matplotlib is very simple. Since Pandas builds on top of Matplotlib, we can just select the column we are interested in and apply the plot method. The results are amazing. Since the date is the index of our data frame, Matplotlib uses it for the x-axis. The y-values are then our adjusted close values.

2.1:CandleStick Charts

The best way to visualize stock data is to use so-called candlestick charts . This type of chart gives us information about four different values at the same time, namely the high, the low, the open and the close value. In order to plot candlestick charts, we will need to import a function of the MPL-Finance library.

import mplfinance as fplt

We are importing the candlestick_ohlc function. Notice that there also exists a candlestick_ochl function that takes in the data in a different order. Also, for our candlestick chart, we will need a different date format provided by Matplotlib. Therefore, we need to import the respective module as well. We give it the alias mdates .

import matplotlib.dates as mdates

2.2: Preparing the data for CandleStick charts

Now in order to plot our stock data, we need to select the four columns in the right order.

df1 = df[[ 'Open' , 'High' , 'Low' , 'Close' ]]

Now, we have our columns in the right order but there is still a problem. Our date doesn’t have the right format and since it is the index, we cannot manipulate it. Therefore, we need to reset the index and then convert our datetime to a number.

df1.reset_index( inplace = True )
df1[ 'Date' ] = df1[ 'Date' ].map(mdates.date2num)
## C:/Users/slaxm/AppData/Local/r-miniconda/envs/r-reticulate/python.exe:1: SettingWithCopyWarning: 
## A value is trying to be set on a copy of a slice from a DataFrame.
## Try using .loc[row_indexer,col_indexer] = value instead
## 
## See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

For this, we use the reset_index function so that we can manipulate our Date column. Notice that we are using the inplace parameter to replace the data frame by the new one. After that, we map the date2num function of the matplotlib.dates module on all of our values. That converts our dates into numbers that we can work with.

2.3:Plotting the data

Now we can start plotting our graph. For this, we just define a subplot (because we need to pass one to our function) and call our candlestick_ohlc function.

One candlestick gives us the information about all four values of one specific day. The highest point of the stick is the high and the lowest point is the low of that day. The colored area is the difference between the open and the close price. If the stick is green, the close value is at the top and the open value at the bottom, since the close must be higher than the open. If it is red, it is the other way around.

***2.4:Analysis and Statistics ***

Now let’s get a little bit deeper into the numbers here and away from the visual. From our data we can derive some statistical values that will help us to analyze it.

PERCENTAGE CHANGE

One value that we can calculate is the percentage change of that day. This means by how many percent the share price increased or decreased that day.

The calculation is quite simple. We create a new column with the name PCT_Change and the values are just the difference of the closing and opening values divided by the opening values. Since the open value is the beginning value of that day, we take it as a basis. We could also multiply the result by 100 to get the actual percentage.

##         PCT_Change
## count  1598.000000
## mean     -0.000268
## std       0.015032
## min      -0.098309
## 25%      -0.008014
## 50%      -0.000741
## 75%       0.007867
## max       0.129885
##              Close
## Date              
## 2021-06-17  1.4953

*** HIGH LOW PERCENTAGE ***

Another interesting statistic is the high low percentage. Here we just calculate the difference between the highest and the lowest value and divide it by the closing value.

By doing that we can get a feeling of how volatile the stock is.

##               Open     High      Low   Close    Volume  ... Open-Open  \
## Date                                                    ...             
## 2021-06-11  1.4301  1.45160  1.42945  1.4469  6140.828  ...    0.0061   
## 2021-06-14  1.4710  1.47700  1.45345  1.4618  7132.294  ...    0.0409   
## 2021-06-15  1.4640  1.47600  1.46300  1.4739  5403.104  ...   -0.0070   
## 2021-06-16  1.4727  1.48945  1.46750  1.4806  7661.710  ...    0.0087   
## 2021-06-17  1.4751  1.50265  1.47510  1.4953  7677.951  ...    0.0024   
## 
##               zscore  zscorevolume  PCT_Change    HL_PCT  
## Date                                                      
## 2021-06-11  3.181882     -0.346013    0.011747  0.015309  
## 2021-06-14  3.243986     -0.217202   -0.006254  0.016110  
## 2021-06-15  3.294420     -0.441857    0.006762  0.008820  
## 2021-06-16  3.322346     -0.148421    0.005364  0.014825  
## 2021-06-17  3.383617     -0.146311    0.013694  0.018424  
## 
## [5 rows x 14 columns]

These statistical values can be used with many others to get a lot of valuable information about specific stocks. This improves the decision making

*** MOVING AVERAGE ***

we are going to derive the different moving averages . It is the arithmetic mean of all the values of the past n days. Of course this is not the only key statistic that we can derive, but it is the one we are going to use now. We can play around with other functions as well.

What we are going to do with this value is to include it into our data frame and to compare it with the share price of that day.

For this, we will first need to create a new column. Pandas does this automatically when we assign values to a column name. This means that we don’t have to explicitly define that we are creating a new column.

##              Close  5d_ma  20d_ma  50d_ma  100d_ma  ...  5d_ema  20d_ema  \
## Date                                                ...                    
## 2021-06-09  1.4153   1.40    1.37    1.37     1.34  ...    1.40     1.38   
## 2021-06-10  1.4243   1.41    1.38    1.37     1.34  ...    1.41     1.38   
## 2021-06-11  1.4469   1.42    1.38    1.37     1.34  ...    1.42     1.39   
## 2021-06-14  1.4618   1.43    1.39    1.37     1.35  ...    1.44     1.40   
## 2021-06-15  1.4739   1.44    1.40    1.38     1.35  ...    1.45     1.40   
## 2021-06-16  1.4806   1.46    1.40    1.38     1.35  ...    1.46     1.41   
## 2021-06-17  1.4953   1.47    1.41    1.38     1.35  ...    1.47     1.42   
## 
##             50d_ema  100d_ema  200d_ema  
## Date                                     
## 2021-06-09     1.36      1.32      1.22  
## 2021-06-10     1.37      1.32      1.22  
## 2021-06-11     1.37      1.33      1.22  
## 2021-06-14     1.37      1.33      1.22  
## 2021-06-15     1.38      1.33      1.23  
## 2021-06-16     1.38      1.33      1.23  
## 2021-06-17     1.38      1.34      1.23  
## 
## [7 rows x 11 columns]

Here we define a three new columns with the name 20d_ma, 50d_ma, 100d_ma,200d_ma . We now fill this column with the mean values of every n entries. The rolling function stacks a specific amount of entries, in order to make a statistical calculation possible. The window parameter is the one which defines how many entries we are going to stack. But there is also the min_periods parameter. This one defines how many entries we need to have as a minimum in order to perform the calculation. This is relevant because the first entries of our data frame won’t have a n entries previous to them. By setting this value to zero we start the calculations already with the first number, even if there is not a single previous value. This has the effect that the first value will be just the first number, the second one will be the mean of the first two numbers and so on, until we get to a b values.

By using the mean function, we are obviously calculating the arithmetic mean. However, we can use a bunch of other functions like max, min or median if we like to.

*** Standard Deviation ***

The variability of the closing stock prices determinies how vo widely prices are dispersed from the average price. If the prices are trading in narrow trading range the standard deviation will return a low value that indicates low volatility. If the prices are trading in wide trading range the standard deviation will return high value that indicates high volatility.

## Date
## 2021-06-09    0.014154
## 2021-06-10    0.017636
## 2021-06-11    0.022434
## 2021-06-14    0.027870
## 2021-06-15    0.029889
## 2021-06-16    0.028066
## 2021-06-17    0.029559
## Name: Std_dev, dtype: float64

*** Relative Strength Index ***

The relative strength index is a indicator of mementum used in technical analysis that measures the magnitude of current price changes to know overbought or oversold conditions in the price of a stock or other asset. If RSI is above 70 then it is overbought. If RSI is below 30 then it is oversold condition.

##                   RSI
## Date                 
## 2021-06-11  79.730449
## 2021-06-14  82.659552
## 2021-06-15  84.681863
## 2021-06-16  85.719339
## 2021-06-17  87.764747

*** Average True range ***

##                  ATR  20dayEMA   ATRdiff
## Date                                    
## 2021-06-11  0.022708  0.024154 -0.001446
## 2021-06-14  0.023236  0.024067 -0.000831
## 2021-06-15  0.022590  0.023926 -0.001336
## 2021-06-16  0.022545  0.023794 -0.001250
## 2021-06-17  0.022902  0.023709 -0.000807

*** Wiliams %R ***

Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low of the past N days.The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest). A value of −100 means the close today was the lowest low of the past N days, and 0 means today’s close was the highest high of the past N days.

##             Williams %R
## Date                   
## 2021-06-09   -16.166667
## 2021-06-10    -7.343750
## 2021-06-11    -6.304494
## 2021-06-14   -15.245737
## 2021-06-15    -3.109328
## 2021-06-16    -9.424920
## 2021-06-17    -7.496175

Readings below -80 represent oversold territory and readings above -20 represent overbought.

*** ADX ***

ADX is used to quantify trend strength. ADX calculations are based on a moving average of price range expansion over a given period of time. The average directional index (ADX) is used to determine when the price is trending strongly.

0-25: Absent or Weak Trend

25-50: Strong Trend

50-75: Very Strong Trend

75-100: Extremely Strong Trend

##                   ADX
## Date                 
## 2021-06-09  35.040060
## 2021-06-10  38.007955
## 2021-06-11  42.466301
## 2021-06-14  47.539012
## 2021-06-15  51.887051
## 2021-06-16  56.149380
## 2021-06-17  60.228583
##                    CCI
## Date                  
## 2021-06-09  133.300138
## 2021-06-10  149.585627
## 2021-06-11  184.762726
## 2021-06-14  211.506362
## 2021-06-15  173.550518
## 2021-06-16  147.567401
## 2021-06-17  135.319074

*** MACD ***

Moving Average Convergence Divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period Exponential Moving Average (EMA) from the 12-period EMA.

##             MACD_IND
## Date                
## 2021-06-11  0.006207
## 2021-06-14  0.007615
## 2021-06-15  0.008741
## 2021-06-16  0.009266
## 2021-06-17  0.009876

*** Bollinger Bands ***

Bollinger Bands are a type of statistical chart characterizing the prices and volatility over time of a financial instrument or commodity.

## 15.0 14.67 14.34

In case we choose another value than zero for our min_periods parameter, we will end up with a couple of NaN-Values . These are not a number values and they are useless. Therefore, we would want to delete the entries that have such values.

We do this by using the dropna function. If we would have had any entries with NaN values in any column, they would now have been deleted

3: Predicting the movement of stock

To predict the movement of the stock we use 5 lag returns as the dependent variables. The first leg is return yesterday, leg2 is return day before yesterday and so on. The dependent variable is whether the prices went up or down on that day. Other variables include the technical indicators which along with 5 lag returns are used to predict the movement of stock using logistic regression.

3.1: Creating lag returns

3.2: Creating returns dataframe

3.2: create the lagged percentage returns columns

##                Today      Lag1      Lag2      Lag3      Lag4      Lag5  \
## Date                                                                     
## 2021-06-04 -0.287842  0.797882 -0.616349 -0.469955 -0.804242  0.199679   
## 2021-06-07  0.288673 -0.287842  0.797882 -0.616349 -0.469955 -0.804242   
## 2021-06-08  1.676681  0.288673 -0.287842  0.797882 -0.616349 -0.469955   
## 2021-06-09  0.166319  1.676681  0.288673 -0.287842  0.797882 -0.616349   
## 2021-06-10  0.635908  0.166319  1.676681  0.288673 -0.287842  0.797882   
## 2021-06-11  1.586744  0.635908  0.166319  1.676681  0.288673 -0.287842   
## 2021-06-14  1.029788  1.586744  0.635908  0.166319  1.676681  0.288673   
## 2021-06-15  0.827747  1.029788  1.586744  0.635908  0.166319  1.676681   
## 2021-06-16  0.454576  0.827747  1.029788  1.586744  0.635908  0.166319   
## 2021-06-17  0.992841  0.454576  0.827747  1.029788  1.586744  0.635908   
## 
##                 Lag6  
## Date                  
## 2021-06-04  0.357846  
## 2021-06-07  0.199679  
## 2021-06-08 -0.804242  
## 2021-06-09 -0.469955  
## 2021-06-10 -0.616349  
## 2021-06-11  0.797882  
## 2021-06-14 -0.287842  
## 2021-06-15  0.288673  
## 2021-06-16  1.676681  
## 2021-06-17  0.166319

3.3: “Direction” column (+1 or -1) indicating an up/down day

***3.4: Create the dependent and independent variables ***

## C:/Users/slaxm/AppData/Local/r-miniconda/envs/r-reticulate/python.exe:1: SettingWithCopyWarning: 
## A value is trying to be set on a copy of a slice from a DataFrame.
## Try using .loc[row_indexer,col_indexer] = value instead
## 
## See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
##                 Lag1      Lag2      Lag3      Lag4      Lag5  ...         CCI  \
## Date                                                          ...               
## 2021-06-11  0.635908  0.166319  1.676681  0.288673 -0.287842  ...  184.762726   
## 2021-06-14  1.586744  0.635908  0.166319  1.676681  0.288673  ...  211.506362   
## 2021-06-15  1.029788  1.586744  0.635908  0.166319  1.676681  ...  173.550518   
## 2021-06-16  0.827747  1.029788  1.586744  0.635908  0.166319  ...  147.567401   
## 2021-06-17  0.454576  0.827747  1.029788  1.586744  0.635908  ...  135.319074   
## 
##                  ROC         DX  Open-Close  Open-Open  
## Date                                                    
## 2021-06-11  2.978542  46.292069      0.0058     0.0061  
## 2021-06-14  4.882511  54.768897      0.0241     0.0409  
## 2021-06-15  6.250000  54.768897      0.0022    -0.0070  
## 2021-06-16  7.394915  58.765690     -0.0012     0.0087  
## 2021-06-17  7.602634  62.287724     -0.0055     0.0024  
## 
## [5 rows x 29 columns]

3.5: Create training and test sets

***3.6: Create model ***

3.7: train the model on the training set

## LogisticRegression()

3.8: make an array of predictions on the test set

3.9: output the hit-rate and the confusion matrix for the model

## 
## Train Accuracy: 98.43%
## Test Accuracy: 96.46%
## [[47  3]
##  [ 1 62]]

***3.10: Predict movement of stock for tomorrow. ***

##             y_test  y_pred
## Date                      
## 2021-06-11       1       1
## 2021-06-14       1       1
## 2021-06-15       1       1
## 2021-06-16       1       1
## 2021-06-17       1       1
## [1]

Say Something

Comments

Nothing yet.

Recent Posts

Categories

About

about