Python Matplotlib Finance and Math Tutorials: Keltner Channels indicator Intro
Key Takeaways
Introduces the Keltner Channel indicator for measuring volatility in stocks
Full Transcript
hello everybody welcome to another python mathematics and finance indicators tutorial video uh in this video in the next few videos we're gonna be talking about these keltner channels so what are the kettler channels obviously uh oftentimes you're gonna see them denoted as k-e-l-t uh they're very similar to bollinger bands in their appearance and they're also just like bollinger bands volatility-based bands that are going to kind of operate above and below an exponential moving average line so there's going to be three lines to them so if you've ever seen a picture of them you would probably ask well what's the difference between these keltner channels and bull ninja bands so bollinger bands if you recall we did already have a tutorial on how to do those uh bollinger bands are using standard deviation to give uh the width basically whereas these keltner channels they're using uh atr or average true range and if you don't recall that we also had a tutorial on those and that is calculated like standard deviate like both of those would be um measure of variance but standard deviation is a little bit different or a lot of it different than average true range and if you don't recall average to range which is basically the largest price difference between bars so usually the high amount is low but it could also be like the high minus the previous closed price and so on anyway the keltner channels also make use of an ema so an exponential moving average rather than a simple moving average which the bollinger bands use uh that said uh you can of course instead of using an sma in your calculation of bollinger bands using ema it's not like the end of the world that you made that simple change plenty of people do it but anyway those are the differences and generally because of the standard deviation here you'll find one that if the stock has made massive changes over a period of time standard deviation won't really keep up whereas average true range will actually keep up a little bit better yet at the same time standard deviations a lot a little bit more volatile in its movements than eurofind atr is so with that how do we actually calculate these bad boys well as i said it comes in three lines the top line is going to be your time frame ema so whatever time frame you choose there um i forget which one what we're using at i want to say we're doing a 20 period ema and then it's gonna be plus two times the atr average true range uh and then you're using a secondary time frame there and i believe we're gonna use a 10. again it's up to your discretion however you want to do you could do 2020 or 10 10 or 50 50 or whatever the heck you want to do middle line is just a simple it's a simple exponential moving average uh it's just an exponential moving average for whatever that time frame is and then the bottom line is going to be that time frame minus two times the atr of tf2 so our atr of using the tf2 so that's the calculation now let's actually look at a couple examples and i'm also going to compare them uh with you guys to bollinger bands so the first one this is the keltner channels and we're gonna plot up uh let's do starbucks that's a good one to start with since that's what we usually use so this is our starbucks uh keltner channels so as you can see they do look very similar to um our bollinger bands so similar in fact let's go ahead and plot the bollinger bands so i've got a bollinger band plotting here so we'll plot up starbucks i'm gonna move it over here so i don't get lost so here's our bollinger bands so the way you'll tell them at least for now is these ones are white these ones are cyan so one um you know you can change up like your width that you wanted i'm trying to think of uh what stock looked good with our current settings under bollinger bands let's see probably yeah ebay was one that we used so let's plot up ebay and compare the two of them so that's ebay on that one for bollinger bands and then i don't know what i did with here we go put this up here and we'll pull out ebay now to get the keltner channel so here is ebay's keltner channel and then here is the bollinger bands so as you can see uh fairly similar at least with ebay if anything maybe the bollinger bands are doing a slightly better job even with ebay but then another one and this is what i mean with uh why i don't like bollinger bands so much is you saw how good it worked with ebay then say we want to do another company like maybe apple bollinger bands we'll move this over and you can see that the bollinger bands we almost don't even see them right they are there though like you know if we zoom in here here they are and then we'll go to apple on the actual keltner channel you know see that apple actually lines up quite right and i think this really brings home the point in why bollinger bands are not necessarily the best idea because they're going to be different with every stock it's almost like they're not normalized you know so so your settings would have to in theory change depending on what stock you're doing unless of course we did something horribly wrong in our calculation of bollinger bands which is totally possible if anybody you know sees what we maybe did wrong or why this would even occur feel free to let me know um so anyway um so that's a little bit of a comparison of uh a or ap bollinger bands in the keltner channels and some of their differences overall i mean they're fair at least when bollinger bands are working uh it's very similar but anyway i actually like held their channels better and i think at least with the calculation of them it makes a lot more sense to me in my mind why that why they're even a used indicator but notably uh bollinger bands are far more popular so interestingly enough now um so that's kind of like your introduction to these uh keltner channels what they do how they're used uh generally uh with bands like this you'll see um like with apple here like we're now looking at keltner channels and this is a great example of what i mean though see like apple went from you know just this tiny price of you know around 60 bucks or so and now is like way higher so it's standard deviation isn't necessarily the best use uh even though i think i believe that we were it was like a moving standard deviation but maybe it wasn't so it never actually got any thicker right so it's always using like the same kind of deviation width so maybe that was our problem in our our calculation of it or something um anyway so like when you get you know like a breakout like what happened here uh where price you know broke out here so that's kind of a very bullish signal and again it broke out really strong here very bullish signal broke continued breaking out and then it went ahead and broke out all the way down here very bearish signal and continued on so that's kind of a signal way that you can use them as like a signal for what's to come same thing there was a breakout down here as well where it went below the bands and a breakout again above the bands up there so anyway that's uh some of the signals so in the next video what we're going to be talking about is how to calculate this within python and then how to actually plot it up on the chart just like this uh you just won't have the macd indicator down here so that sounds interesting to you guys stay tuned in the next video as always thanks for watching thanks for the support and all the subscriptions until next time
Original Description
This tutorial introduces you to the Keltner Channel indicator. The KELT is used as a sort of volatility measure, and is plotted in the form of bands around price.
The purpose of this series is to teach mathematics within python. To do this, we will be working with a bunch of the more popular stock indicators used with technical analysis.
With most of the indicators, we will first discuss them, their purpose, then teach how to program them into python, then actually display them on a chart.
The basic charting application comes from a previous tutorial series, here: http://www.youtube.com/playlist?list=PLQVvvaa0QuDcR-u9O8LyLR7URiKuW-XZq
Required files:
Sample Code for the actual charting parts: http://sentdex.com/sentiment-analysisbig-data-and-python-tutorials-algorithmic-trading/python-matplotlib-sample-code-charting-stocks-python/
Python: http://python.org
Numpy: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
Matplotlib: http://matplotlib.org/downloads.html
Percent Change Video:
https://www.youtube.com/watch?v=7fIY_5m1yH0
Sentdex.com
Facebook.com/sentdex
Twitter.com/sentdex
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from sentdex · sentdex · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
Python Encryption Tutorial with PyCrypto
sentdex
Python's Logging Function
sentdex
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
wxPython Programming Tutorial 4: Panels
sentdex
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
wxPython Programming Tutorial 8: Custom Button Images
sentdex
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
Basic PHP Tutorial 12: Associative Array
sentdex
Basic PHP Tutorial 14: Foreach loop
sentdex
Basic PHP Tutorial 16: Include and Require
sentdex
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
Basic PHP Tutorial 4: Variables and Comments
sentdex
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
Basic PHP Tutorial 1: Intro to PHP
sentdex
Basic PHP Tutorial 3: HTML with PHP
sentdex
Basic PHP Tutorial 9: While Loop
sentdex
Basic PHP Tutorial 10: Switch Statement
sentdex
Basic PHP Tutorial 2: Print and Echo
sentdex
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
Basic PHP Tutorial 19: Finding words in strings
sentdex
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
Basic PHP Programming Tutorial 24: String similarity
sentdex
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
Sikuli Tutorial 1: Visually programming in python!
sentdex
Sikuli Tutorial 2: Program visually in python!
sentdex
Sikuli Tutorial 3: Program visually in python!
sentdex
3D Bar Charts in Python and Matplotlib
sentdex
3D Plane wire frame Graph Chart in Python
sentdex
Raspberry Pi Part 1 Introduction
sentdex
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
Raspberry Pi Part 11: Remote Desktop
sentdex
Twitter Analysis: How to rank a user's influence
sentdex
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex
🎓
Tutor Explanation
DeepCamp AI