Skip to content

Commit e9333aa

Browse files
Merge pull request #5 from DanielGoldfarb/master
ready for upload to PyPI
2 parents b836127 + cb39c23 commit e9333aa

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

README.md

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
[![Build Status](https://travis-ci.org/matplotlib/mplfinance.svg?branch=master)](https://travis-ci.org/matplotlib/mplfinance)
22

33
# mplfinance
4-
(to replace mpl-finance sometime in 2020).
4+
## matplotlib utilities for the visualization, and visual analysis, of financial data
55

66
---
77

8-
## The `mplfinance` package provides utilities for the visualization, and visual analysis, of financial data
9-
10-
## Installation
11-
###    `pip install mplfinance`
8+
# Installation
9+
##    `pip install mplfinance`
1210
- mplfinance requires [matplotlib](https://pypi.org/project/matplotlib/) and [pandas](https://pypi.org/project/pandas/)
1311

12+
---
1413

15-
## Usage
14+
# Usage
1615
Start with a Pandas DataFrame containing OHLC data. For example,
1716

1817
```python
@@ -121,51 +120,60 @@ daily.tail(3)
121120
</tbody>
122121
</table>
123122

123+
<br>
124+
124125
---
125-
After importing mplfinance, plotting open,high,low,close data is as simple as calling `mpf.plot()` on the dataframe
126+
127+
<br>
128+
129+
After importing mplfinance, plotting OHLC data is as simple as calling `mpf.plot()` on the dataframe
126130

127131
```python
128132
import mplfinance as mpf
129133
mpf.plot(daily)
130134
```
131135

132-
![png](https://raw.githubusercontent.com/DanielGoldfarb/mplfinance/master/readme_files/readme_4_0.png)
136+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_4_0.png)
133137

134138
---
139+
<br>
140+
135141
The default plot type, as you can see above, is `'ohlc'`. Other plot types can be specified with the keyword argument `type`, for example, `type='candle'` or `type='line'`
136142

137143

138144
```python
139145
mpf.plot(daily,type='candle')
140146
```
141147

142-
![png](readme_files/readme_6_0.png)
148+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_6_0.png)
143149

144150

145151
```python
146152
mpf.plot(daily,type='line')
147153
```
148154

149-
![png](readme_files/readme_7_0.png)
155+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_7_0.png)
150156

151157
---
158+
<br>
159+
152160
We can also plot moving averages with the `mav` keyword
153-
- use an scaler for a single moving average
161+
- use a scaler for a single moving average
154162
- use a tuple or list of integers for multiple moving averages
155163

156164

157165
```python
158166
mpf.plot(daily,type='ohlc',mav=4)
159167
```
160168

161-
![png](readme_files/readme_9_0.png)
169+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_9_0.png)
162170

163171

164172
```python
165173
mpf.plot(daily,type='candle',mav=(3,6,9))
166174
```
167175

168-
![png](readme_files/readme_10_0.png)
176+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_10_0.png)
169177

170178
---
171179
We can also display `Volume`
@@ -176,7 +184,7 @@ mpf.plot(daily,type='candle',mav=(3,6,9),volume=True)
176184
```
177185

178186

179-
![png](readme_files/readme_12_0.png)
187+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_12_0.png)
180188

181189
Notice, in the above chart, there are gaps along the x-coordinate corresponding to days on which there was no trading.
182190
- Many people like to see these gaps so that they can tell, with a quick glance, where the weekends and holidays fall.
@@ -189,7 +197,7 @@ mpf.plot(daily,type='candle',mav=(3,6,9),volume=True,no_xgaps=True)
189197
```
190198

191199

192-
![png](readme_files/readme_14_0.png)
200+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_14_0.png)
193201

194202

195203
---
@@ -302,7 +310,7 @@ iday = intraday.loc['2019-11-06 15:00':'2019-11-06 16:00',:]
302310
mpf.plot(iday,type='candle',mav=(7,12))
303311
```
304312

305-
![png](readme_files/readme_18_0.png)
313+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_18_0.png)
306314

307315

308316
The "time-interpretation" of the `mav` integers depends on the frequency of the data, because the mav integers are number of data points used in the Moving Average. Notice above that for intraday data the x-axis automatically displays TIME *instead of* date. Below we see that if the intraday data spans two (or more) trading days then two things happen:
@@ -316,7 +324,7 @@ mpf.plot(iday,type='candle')
316324
```
317325

318326

319-
![png](readme_files/readme_20_0.png)
327+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_20_0.png)
320328

321329

322330
---
@@ -328,7 +336,7 @@ mpf.plot(iday,type='candle',no_xgaps=False)
328336
```
329337

330338

331-
![png](readme_files/readme_22_0.png)
339+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_22_0.png)
332340

333341

334342
---
@@ -340,7 +348,7 @@ mpf.plot(intraday,type='ohlc',no_xgaps=False) # 4 day of intraday with no_xgaps
340348
```
341349

342350

343-
![png](readme_files/readme_24_0.png)
351+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_24_0.png)
344352

345353

346354
---
@@ -352,7 +360,7 @@ mpf.plot(intraday,type='line') # intraday spanning more than one day defaults t
352360
```
353361

354362

355-
![png](readme_files/readme_26_0.png)
363+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_26_0.png)
356364

357365

358366
---
@@ -478,7 +486,7 @@ df.tail(3)
478486
mpf.plot(df[700:850],type='bars',volume=True,no_xgaps=True,mav=(20,40))
479487
```
480488

481-
![png](readme_files/readme_29_0.png)
489+
![png](https://raw.githubusercontent.com/matplotlib/mplfinance/master/readme_files/readme_29_0.png)
482490

483491

484492
For more examples of using mplfinance, please see the jupyter notebooks in the `examples` directory.

src/mplfinance/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version_info = (0, 11, 0, 'alpha', 0)
1+
version_info = (0, 11, 1, 'alpha', 0)
22

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

0 commit comments

Comments
 (0)