Python Matplotlib Finance and Math Tutorials: Keltner Channels indicator Intro

sentdex · Beginner ·🛠️ AI Tools & Apps ·12y ago

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 Matplotlib Python Tutorial Part 1: Basics and your first Graph!
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
2 Python Encryption Tutorial with PyCrypto
Python Encryption Tutorial with PyCrypto
sentdex
3 Python's Logging Function
Python's Logging Function
sentdex
4 wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
5 wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
6 wxPython Programming Tutorial 3: Menu Bar and Menu Button
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
7 wxPython Programming Tutorial 4: Panels
wxPython Programming Tutorial 4: Panels
sentdex
8 wxPython Programming Tutorial 5: User Input Saved To Variables
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
9 wxPython Programming Tutorial 6: Multiple Choice Input
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
10 wxPython Programming Tutorial 7: Adding Static Text and Colors
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
11 wxPython Programming Tutorial 8: Custom Button Images
wxPython Programming Tutorial 8: Custom Button Images
sentdex
12 wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
13 Basic PHP Tutorial 13: Multi-dimensional Array
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
14 Basic PHP Tutorial 15: Functions and Global Variables
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
15 Basic PHP Tutorial 12: Associative Array
Basic PHP Tutorial 12: Associative Array
sentdex
16 Basic PHP Tutorial 14: Foreach loop
Basic PHP Tutorial 14: Foreach loop
sentdex
17 Basic PHP Tutorial 16: Include and Require
Basic PHP Tutorial 16: Include and Require
sentdex
18 Basic PHP Tutorial 7: Assignment, comparison and Logical operators
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
19 Basic PHP Tutorial 4: Variables and Comments
Basic PHP Tutorial 4: Variables and Comments
sentdex
20 Basic PHP Tutorial 11: Arrays part 1, basic array
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
21 Basic PHP Tutorial 6: If else and else if conditionals cont'd
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
22 Basic PHP Tutorial 1: Intro to PHP
Basic PHP Tutorial 1: Intro to PHP
sentdex
23 Basic PHP Tutorial 3: HTML with PHP
Basic PHP Tutorial 3: HTML with PHP
sentdex
24 Basic PHP Tutorial 9: While Loop
Basic PHP Tutorial 9: While Loop
sentdex
25 Basic PHP Tutorial 10: Switch Statement
Basic PHP Tutorial 10: Switch Statement
sentdex
26 Basic PHP Tutorial 2: Print and Echo
Basic PHP Tutorial 2: Print and Echo
sentdex
27 Basic PHP Tutorial 5: If else and else if conditional statements
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
28 Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
29 Basic PHP Tutorial 17: User Input Form Example / String Manipulation
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
30 Basic PHP Tutorial 18: HTML Entities and forms cont'd
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
31 Basic PHP Tutorial 19: Finding words in strings
Basic PHP Tutorial 19: Finding words in strings
sentdex
32 Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
33 Basic PHP Programming Tutorial 22: Hashing part 2: salting
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
34 Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
35 Basic PHP Programming Tutorial 21: MD5 Hashing For Security
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
36 Basic PHP Programming Tutorial 24: String similarity
Basic PHP Programming Tutorial 24: String similarity
sentdex
37 Basic PHP Programming Tutorial 25: Time and Time stamps
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
38 Basic PHP Programming Tutorial 26: Die and Exit
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
39 Basic PHP Programming Tutorial 27: MySQL Databases Part 1
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
40 Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
41 Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
42 Basic PHP Programming Tutorial 30: MySQL database in Use
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
43 Django Tutorial Web Development with Python Part 1: Installing Django
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
44 Python Tutorial: File Deletion and Folder Deletion / directory deletion
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
45 Python Tutorial: How to Rename Files and Move Files with Python
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
46 3D Graphs in Matplotlib for Python: Basic 3D Line
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
47 3D Plotting in Matplotlib for Python: 3D Scatter Plot
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
48 3D Charts in Matplotlib for Python: Multiple datasets scatter plot
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
49 Sikuli Tutorial 1: Visually programming in python!
Sikuli Tutorial 1: Visually programming in python!
sentdex
50 Sikuli Tutorial 2: Program visually in python!
Sikuli Tutorial 2: Program visually in python!
sentdex
51 Sikuli Tutorial 3: Program visually in python!
Sikuli Tutorial 3: Program visually in python!
sentdex
52 3D Bar Charts in Python and Matplotlib
3D Bar Charts in Python and Matplotlib
sentdex
53 3D Plane wire frame Graph Chart in Python
3D Plane wire frame Graph Chart in Python
sentdex
54 Raspberry Pi Part 1 Introduction
Raspberry Pi Part 1 Introduction
sentdex
55 Raspberry Pi Part 8: First Download and Update! (Firmware)
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
56 Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
57 Raspberry Pi Part 11: Remote Desktop
Raspberry Pi Part 11: Remote Desktop
sentdex
58 Twitter Analysis: How to rank a user's influence
Twitter Analysis: How to rank a user's influence
sentdex
59 GPIO Tutorial for Pi Part 2 - Programming the GPIO
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
60 GPIO Tutorial for Raspberry Pi Part 1 - Setting up
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex

Related AI Lessons

Up next
I Asked ChatGPT to Apply to 500 Jobs (8 Interviews in 48 Hours)
Sabrina Ramonov 🍄
Watch →