Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Momentum Indicators - RSI, MACD ... (#120) #131

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6076d71
Momentum Indicators - RSI, MACD ... (#120)
pythonhacker Aug 5, 2023
cea6b31
Automated version changes
github-actions[bot] Aug 5, 2023
fe1b7fb
Updating README files
github-actions[bot] Aug 5, 2023
ba864a8
Automated formatting changes
github-actions[bot] Aug 5, 2023
afe4d60
momentum indicators (2nd PR) #132 (#132)
pythonhacker Aug 15, 2023
023c8dc
Merge branch 'master' into feature/rsi-indicator
fmilthaler Aug 15, 2023
e01f515
Automated formatting changes
github-actions[bot] Aug 15, 2023
370d0b2
levels should be >0 and <100
fmilthaler Sep 26, 2023
f3871d9
minor modifications to relative_strength_index
fmilthaler Sep 26, 2023
f214177
Merge branch 'master' into feature/rsi-indicator
fmilthaler Sep 26, 2023
3ac143b
some changes to the rsi plots
fmilthaler Sep 26, 2023
2c68404
minor change for macd
fmilthaler Sep 26, 2023
594d427
adding mplfinance package to requirements for MACD plot
fmilthaler Sep 27, 2023
8d8748f
Changing MACD to the example from mplfinance and adjusting functions …
fmilthaler Oct 1, 2023
137ce13
Adding utils module and adjusting type validation module
fmilthaler Oct 1, 2023
674e663
Adjusting Example-Analysis
fmilthaler Oct 1, 2023
44ba207
Auto formatting
fmilthaler Oct 1, 2023
15d6927
Return fig and axes for testing purposes
fmilthaler Oct 1, 2023
7fed1bf
fixing tests
fmilthaler Oct 1, 2023
1860dd8
Auto formatting
fmilthaler Oct 1, 2023
3bd40e1
Automated version changes
github-actions[bot] Oct 1, 2023
419dd02
Updating README files
github-actions[bot] Oct 1, 2023
88f07fe
Fixing MatplotlibDeprecationWarning
fmilthaler Oct 1, 2023
694621b
Merge branch 'feature/rsi-indicator' of github.com:fmilthaler/FinQuan…
fmilthaler Oct 1, 2023
05d701f
fixing pylint issues
fmilthaler Oct 1, 2023
0006823
Auto formatting and adding docstrings
fmilthaler Oct 1, 2023
d1cc80f
Some changes to momentum_indicators to satisfy mypy. More needed.
fmilthaler Oct 1, 2023
d359fad
Automated formatting changes
github-actions[bot] Oct 1, 2023
d967e23
renaming mpl_macd to plot_macd
fmilthaler Oct 2, 2023
889d62b
renaming rsi function to plot_rsi
fmilthaler Oct 2, 2023
8dace7a
refactoring momentum_indicators code
fmilthaler Oct 2, 2023
4ee796c
refactor
fmilthaler Oct 2, 2023
11e6890
autoformat
fmilthaler Oct 2, 2023
892d9d1
additional adjustments and adding tests for momentum indicators
fmilthaler Oct 2, 2023
53cd5f8
auto formatting
fmilthaler Oct 2, 2023
5e58a24
fixing pylint complaints
fmilthaler Oct 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<img src="https://img.shields.io/github/stars/fmilthaler/FinQuant.svg?style=social&label=Star" alt='pypi'>
</a>
<a href="https://pypi.org/project/FinQuant">
<img src="https://img.shields.io/badge/pypi-v0.7.0-brightgreen.svg?style=popout" alt='pypi'>
<img src="https://img.shields.io/badge/pypi-v0.8.0-brightgreen.svg?style=popout" alt='pypi'>
</a>
<a href="https://github.com/fmilthaler/FinQuant">
<img src="https://github.com/fmilthaler/finquant/actions/workflows/pytest.yml/badge.svg?branch=master" alt='GitHub Actions'>
Expand Down
2 changes: 1 addition & 1 deletion README.tex.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<img src="https://img.shields.io/github/stars/fmilthaler/FinQuant.svg?style=social&label=Star" alt='pypi'>
</a>
<a href="https://pypi.org/project/FinQuant">
<img src="https://img.shields.io/badge/pypi-v0.7.0-brightgreen.svg?style=popout" alt='pypi'>
<img src="https://img.shields.io/badge/pypi-v0.8.0-brightgreen.svg?style=popout" alt='pypi'>
</a>
<a href="https://github.com/fmilthaler/FinQuant">
<img src="https://github.com/fmilthaler/finquant/actions/workflows/pytest.yml/badge.svg?branch=master" alt='GitHub Actions'>
Expand Down
42 changes: 42 additions & 0 deletions example/Example-Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,45 @@
# <codecell>

print(pf.data.loc[pf.data.index.year == 2017].head(3))

# <markdowncell>

# ## Momentum Indicators
# `FinQuant` provides a module `finquant.momentum_indicators` to compute and
# visualize a number of momentum indicators. Currently RSI (Relative Strength Index)
# and MACD (Moving Average Convergence Divergence) indicators are available.
# See below.

# <codecell>
# plot the RSI (Relative Strength Index) for disney stock proces
from finquant.momentum_indicators import plot_relative_strength_index as rsi

# get stock data for disney
dis = pf.get_stock("WIKI/DIS").data.copy(deep=True)

# plot RSI - by default this plots RSI against the price in two graphs
rsi(dis)
plt.show()

# plot RSI with custom arguments
rsi(dis, oversold=20, overbought=80)
plt.show()

# plot RSI standalone graph
rsi(dis, oversold=20, overbought=80, standalone=True)
plt.show()

# <codecell>
# plot MACD for disney stock proces
from finquant.momentum_indicators import plot_macd

# using short time frame of data due to plot warnings from matplotlib/mplfinance
dis = dis[0:300]

# plot MACD - by default this plots RSI against the price in two graphs
plot_macd(dis)
plt.show()

# plot MACD using custom arguments
plot_macd(dis, longer_ema_window=30, shorter_ema_window=15, signal_ema_window=10)
plt.show()
Loading
Loading