Python math and stocks: Chande Momentum Oscillator

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

Key Takeaways

Introduces the Chande Momentum Oscillator (CMO) and its calculation using Python

Full Transcript

hello and welcome to another video mini series within the python stocks and mathematics tutorial video series this mini series is going to be concerning the shonde momentum oscillator so the shawnee momentum oscillator it's mainly used for finding overbought and oversold situations now it's going to be a little bit different from your rsi obviously overbought and oversold immediately we think of rsi the cmo differs because what it does is it actually looks at the the the force the push in each direction it looks at that push individually so upward pushes and downward pushes generally uh signals from the cmo here we've got if it's greater than 50 it's considered possibly overbought and if it's less than negative 50 then it's oversold so and obviously it fluctuates over the zero line and crossover over the zero line suggests obviously buy and sell points usually uh the shining momentum oscillator is going to be just one single line uh but a lot of people will also plot up the simple moving average of that cmo line and then you can kind of treat um treat it as like a signal right so what i'm going to go ahead and do now is show you guys an example uh both of just this the single line then also of the simple moving average line as well and actually i guess before that uh let me show you guys the calculations so the calculation of the shiny momentum oscillator is going to be the following here although i will just say sou equals the sum of up movements and then sod is the sum of down movements so the cmo is going to say what is the sum of all the up movements minus the sum of all the down movements divide that by the sum of all up movements plus the sum of all down movements and then multiply whatever that fraction is times 100. now movements right is kind of inherently just kind of means and brings along with it that there's some sort of time frame usually uh people are going to use a time frame of 10 so they're going to consider the last you know 10 10 open high low close prices looking at um and actually in our in our scenario we use just close prices so usually whenever there's like a single line and a single bit of data people just use the close price so sorry i misspoke um so close prices so a time frame of like the last 10 closed prices and then from price number one to number two did we go up or did we go down and if we went up that would be an up movement how much of an up movement was that and so on you continue adding them so now let me show you guys uh some of the examples from the cmo so this is that charting application that we made there's a whole series dedicated to this charting application if you want to know exactly how to make this charting application what we're going to be talking about in this video and this entire series is really all about uh each indicator since there are just tons of these indicators so this is the bottom one right here is our cmo and so at the 50 mark we drew a red line just to kind of denote hey this would be an over over uh overbought scenario possibly and then we drew a green line at the negative 50 mark to denote hey this is quite possibly oversold now it just so happens that we just left this top uh indicator slot uh in its natural state which was an rsi which is what we used we used rsi up here and macd down here so it just kind of worked out that we're uh we do have an rsi to compare to but as you can see uh it follows the rsi line pretty similarly i mean there's some stuff where you know like the peak the mountainous peak over here is a little different than this mountainous pekina but as far as directional movement they're very similar but their trajec trajectory does differ uh quite often so it's it's kind of interesting to compare the two where um you know they either they move up and down at similar times but how much they move up and down uh differs quite a bit um so anyway this is an example with just the line but now what we can do is we can also let me get out of this and the other thing that we can do is plot it up with a simple moving average so let me go ahead and make that change for us and now when we plot the same apple stock again let's say bring it over now you can see that we have the uh the simple moving average line is this like cyan line so each time there's a crossover it's a warning right so as the cmo crosses over our simple moving average it's kind of like that would be seen as kind of a warning like maybe get out um and then same thing as we continue on um you can see also when it crosses up words you know that okay well maybe this would be a time to to get into this stock and then obviously here you would be thinking about getting out but probably not really until like this point here you know um but anyway apple just kept going up anyways so this is our cmo indicator uh this is kind of the idea of it so in the next video what we're going to be doing is calculating this within python and then the video after that we'll actually be charting it in matplotlib so anyway stay tuned for those videos as always thanks for watching thanks for the support and subscriptions and until next time

Original Description

This tutorial video covers the introduction to the Chande Momentum Oscillator (CMO) 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 Reads

Up next
Clicky AI Telugu 🔥 Control Your Computer with Voice | Best Free AI Tool 2026
Withmesravani_
Watch →