Python math and stocks: Chande Momentum Oscillator
Skills:
ML Maths Basics80%
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
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
More on: ML Maths Basics
View skill →
🎓
Tutor Explanation
DeepCamp AI