retrieve data from MarketWatch.com
Project description
MarketWatchData
Overview
MarketWathData retrieve datas from marketwatch.com.
- Documentation: 文档
Installation
General
pip install marketwatchdata --upgrade
China
pip install marketwatchdata -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com --upgrade
Test
import marketwatchdata as mw
print(mw.__version__)
Usage
Data
Code
import marketwatchdata as mw
df = mw.ohlc('STOCK/US/XNAS/AAPL', 'P1D', 'P1Y')
print(df)
Output
open high low close volume
date
2022-07-25 154.010 155.040 152.280 152.95 53623953.0
2022-07-26 152.265 153.085 150.800 151.60 55138688.0
2022-07-27 152.580 157.330 152.160 156.79 78620688.0
2022-07-28 156.980 157.640 154.410 157.35 81378727.0
2022-07-29 161.240 163.630 159.500 162.51 101786898.0
... ... ... ... ... ...
2023-07-17 191.900 194.320 191.810 193.99 50520160.0
2023-07-18 193.350 194.330 192.415 193.73 48353770.0
2023-07-19 193.100 198.230 192.650 195.10 80507320.0
2023-07-20 195.090 196.470 192.495 193.13 59581199.0
2023-07-21 194.100 194.970 191.230 191.94 71951683.0
[250 rows x 5 columns]
Plot
Code
import marketwatchdata as mw
import mplfinance as mpf # Please install mplfinance as follows: pip install mplfinance
df = mw.ohlc('STOCK/US/XNAS/AAPL', 'P1D', 'P1Y')
mpf.plot(df, type='candle', mav=(3, 6, 9), volume=True, show_nontrading=False)
Output
Acknowledgement
Thanks for the data provided by marketwatch;
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
marketwatchdata-0.0.14.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for marketwatchdata-0.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7179325a8f427c7c99f6f570995b3d6b5a0bc5f01b17d0e2b22afc7179fe18c |
|
MD5 | 22392d720ad9220c9cf83e1e65d23c34 |
|
BLAKE2b-256 | 687aeb95e8c3e055086a9db931d0660dac4efd4a2a101e2f7b4dec31fca3927a |