Skip to content

Commit 9bc1c6c

Browse files
Merge pull request #336 from DanielGoldfarb/master
synch up assorted scratch work into production repository
2 parents f81a205 + 1ea190d commit 9bc1c6c

9 files changed

+4952
-1
lines changed

examples/resample10years.ipynb

Lines changed: 364 additions & 0 deletions
Large diffs are not rendered by default.

examples/scratch_pad/external_axes_stacking.ipynb

Lines changed: 1859 additions & 0 deletions
Large diffs are not rendered by default.

examples/scratch_pad/issues/issue079_percent_change.ipynb

Lines changed: 405 additions & 0 deletions
Large diffs are not rendered by default.

examples/scratch_pad/issues/issue333_generic_plotting.ipynb

Lines changed: 1580 additions & 0 deletions
Large diffs are not rendered by default.

examples/scratch_pad/issues/major_ticks_issue074.ipynb

Lines changed: 503 additions & 0 deletions
Large diffs are not rendered by default.

examples/scratch_pad/multicursor.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import numpy as np
2+
import matplotlib.pyplot as plt
3+
from matplotlib.widgets import MultiCursor
4+
5+
print('1')
6+
t = np.arange(0.0, 2.0, 0.01)
7+
s1 = np.sin(2*np.pi*t)
8+
s2 = np.sin(4*np.pi*t)
9+
10+
print('2')
11+
fig, (ax1, ax2) = plt.subplots(2, sharex=True)
12+
ax1.plot(t, s1)
13+
ax2.plot(t, s2)
14+
15+
print('3')
16+
multi = MultiCursor(fig.canvas, (ax1, ax2), color='lime', lw=1, horizOn=True, vertOn=True)
17+
print('4')
18+
plt.show()
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import pandas as pd
2+
import mplfinance as mpf
3+
from matplotlib.widgets import MultiCursor
4+
5+
idf = pd.read_csv('../data/SPY_20110701_20120630_Bollinger.csv',index_col=0,parse_dates=True)
6+
df = idf.loc['2011-07-01':'2011-12-30',:]
7+
8+
9+
exp12 = df['Close'].ewm(span=12, adjust=False).mean()
10+
exp26 = df['Close'].ewm(span=26, adjust=False).mean()
11+
12+
macd = exp12 - exp26
13+
14+
signal = macd.ewm(span=9, adjust=False).mean()
15+
histogram = macd - signal
16+
17+
apds = [mpf.make_addplot(exp12,color='lime'),
18+
mpf.make_addplot(exp26,color='c'),
19+
mpf.make_addplot(histogram,type='bar',width=0.7,panel=1,
20+
color='dimgray',alpha=1,secondary_y=False),
21+
mpf.make_addplot(macd,panel=1,color='fuchsia',secondary_y=True),
22+
mpf.make_addplot(signal,panel=1,color='b',secondary_y=True),
23+
]
24+
25+
fig, axlist = mpf.plot(df,type='candle',addplot=apds,figscale=1.1,figratio=(8,5),title='\nMACD',
26+
style='blueskies',volume=True,volume_panel=2,panel_ratios=(6,3,2),returnfig=True)
27+
28+
multi = MultiCursor(fig.canvas, axlist, color='r',lw=1.2)
29+
mpf.show()

examples/scratch_pad/stackoverflow.65487952.ipynb

Lines changed: 193 additions & 0 deletions
Large diffs are not rendered by default.

src/mplfinance/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
version_info = (0, 12, 7, 'alpha', 6)
2+
version_info = (0, 12, 7, 'alpha', 7)
33

44
_specifier_ = {'alpha': 'a','beta': 'b','candidate': 'rc','final': ''}
55

0 commit comments

Comments
 (0)