Reader small image

You're reading from  Python Algorithmic Trading Cookbook

Product typeBook
Published inAug 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838989354
Edition1st Edition
Languages
Right arrow
Author (1)
Pushpak Dagade
Pushpak Dagade
author image
Pushpak Dagade

Pushpak Dagade is working in the area of algorithmic trading with Python for more than 3 years. He is a co-founder and CEO of AlgoBulls, an algorithmic trading platform.
Read more about Pushpak Dagade

Right arrow

Momentum indicators – stochastic oscillator

The stochastic oscillator is a leading momentum indicator. It is also called STOCH for short. STOCH compares the latest close with the recent trading range. Fast K is a ratio and has a value between 0 and 100. Fast K can have haphazard movement, and hence it is smoothed using a moving average, which is the slow K. Slow K is further smoothed using another moving average, which is the slow D. Values of slow K over 75 indicate an overbought condition, while values below 25 indicate an oversold condition. When slow K crosses above slow D, it is considered a buy signal. Similarly, when slow K crosses below slow D, it is considered a sell signal.

The formula for computing STOCH is as follows:

MA stands for moving average, and can be either SMA or EMA. For this recipe, we have used SMA. This formula needs three time periods: one of them is n and the other two are the time periods of the MAs. The range over which we analyze data is defined by...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Python Algorithmic Trading Cookbook
Published in: Aug 2020Publisher: PacktISBN-13: 9781838989354

Author (1)

author image
Pushpak Dagade

Pushpak Dagade is working in the area of algorithmic trading with Python for more than 3 years. He is a co-founder and CEO of AlgoBulls, an algorithmic trading platform.
Read more about Pushpak Dagade