Hello everyone and welcome to the optional final part of the finance project solutions lecture series
.
In this final part which is optional we're going to go over some of the plotlines and cufflinks visualizations
specifically designed for financial data.
Let's go out and jump to the Jupiter notebook to get started.
OK here I am at the Jupiter notebook.
Last time we left off at creating a cluster map using seaborne and I wanted to show you how you can
create a heat map using Clottey.
You can actually just go out and grab this data rate here.
Correlation data frame to this cell and let's go out and save this as close underscore core.
And then we're going to go in and do take a look at closing or square core.
Make sure we have the correct data frame.
Looks like we do it in the matrix form and then we can just call I plot off of this and specify the
kinds to be heat map and you will get a heat map that looks like this.
Now this color scale actually isn't very useful.
So you can go ahead and put in a another color scale with the color scale arguments and probably the
one that's most useful is the red for R D yellow y l blue.
B you and you can reference the plotted documentation if you want more color scale options.
You can check out the color scale it's a little better it goes from 0 to 1 as far as the correlation
.
This is interactive now.
Now I still prefer see Bourne's own visualization to this but I wanted you to be aware of the plot options
using the cufflinks library.
All right moving along.
Let's go ahead and get to the specific financial capabilities of cufflinks and plotline.
So you can go ahead and create a candle plots of stock using plot line and let me go in and show you
hey we can do this.
First thing we need is to grab Bank of America stock.
I'll just do that with the b c if we take a look at the state of frame remember we have open high low
close and we need it in a specific order to use I plot in the fashion we're going to use it in.
So I'm going to just grab open
high low and then the close call.
We don't want the actual volume.
And then I just want the values for 2015.
I mean is of any use I-X 2015 January 1st to 2016 looks as a string 2016.
And let's go to and say January 1st.
So all the values for 2015 I'll save this as BAC 15.
And then the next line I'm going to go ahead and say c 15 thought I plot and I'm actually going to specify
something in this.
I plot arguments I'm going to say kind is equal to Kandel.
And then you'll actually be able to create a candlestick plot using a plot.
Now if you're not aware of what a candlestick plot is it's for financial analysis.
It basically tells you whether or not the stock went up or down that day based off the color so green
is increasing red is decreasing and then it kind of tells you the opening high and the closing price
here.
This information you can go ahead and look up on Wikipedia.
Candlestick plots in if you want more information.
I to actually read these but this is more just for financial analysis so basically tells you the open
high low close and whether the stock went up or down that day.
All right.
Let's go ahead and check out the next plot which is SMK and it's basically just a simple moving averages
plot.
The plot can also create kind of automatically for you.
We're going to go ahead and do this for the Morgan Stanley stock.
So I'm going to go ahead and grab the close column of the Morgan Stanley stock.
I just want to do this for the year 2015 so I'll specify same dates.
I did up here.
Let's go and grab those
come down here take the slice chips from 2015 and then I will call a t a underscore plot.
And this is the technical analysis plot capabilities of cufflinks and then I'm going to go to say study
is SMK unspecified periods to be a couple of periods we'll go in and say 13 21 and 55 which are kind
of some common technical analysis periods.
And here we can see the simple moving averages and I plot kind of reports them as you move along which
is quite nice and you can zoom in and see some more information if you want.
All right.
Let's go ahead and move on to this one more right here.
Last one which is the Bollinger Band plot for Bank of America.
And again this is just another technical analysis you can do which kind of shows the standard deviation
of the stock price as it moves out through time.
But again I just want this for the year 2015.
Go ahead and copy and paste same slice and do t.a underscore plot for technical analysis plot and the
study we're going to do is equal to the string B O L L.
Now we look at this we can see the upper and lower bands as we move along as well as a simple moving
average and then the actual closing price which is in orange.
OK.
There's definitely a lot more specific finance topics out here.
So don't worry if you don't understand everything we just went over.
The only thing you should be really concerned about is what I did with panderers and some of the basic
visualization operations throughout the lecture.
So don't worry if you don't understand all these specific technical analysis plots these are only really
references for people that are already familiar with this topic since this isn't a financial analysis
class.
This is just basically a data science class and financial analysis is its own field of study.
All right.
Hope you found this interesting if you're into this sort of analysis and I will see you at the next
lecture.
Thanks everyone.