jiangcj-github/react-kline
This commit does not belong to any branch on this repository, and may belong to a fork outside of the 如何读懂日本K线图 repository.
Use Git or checkout with 如何读懂日本K线图 如何读懂日本K线图 如何读懂日本K线图 SVN using the web URL.
Work 如何读懂日本K线图 fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download 如何读懂日本K线图 GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit 如何读懂日本K线图 information.
README.md
参数名称 | 参数说明 | 默认值 | 如何读懂日本K线图
---|---|---|
width | 宽度 (px) | 600 |
height | 高度度 (px) | 400 |
theme | 主题 dark(暗色)/light(亮色) | dark |
language | 语言 zh-cn(简体中文)如何读懂日本K线图 /en-us(英文)/zh-tw(繁体中文) | zh-cn |
ranges | 聚合选项 1w/1d/12h/6h/4h/2h/1h/30m/15m/5m/3m/1m/line (w:周, d:天, h:小时, m:分钟, 如何读懂日本K线图 line:分时数据) | ["1w", "1d", "1h", "30m", "15m", "5m", "1m", "line"] |
symbol | 交易代号 | |
symbolName | 交易名称 | |
limit | 分页大小 | 1000 |
intervalTime | 请求间隔时间(ms) | 如何读懂日本K线图3000 |
debug | 是否开启调试模式 true/false | true |
depthWidth | 深度图宽度 | 最小50,小于50则取50,默认50 |
resize(int width, int height)如何读懂日本K线图
setSymbol(string symbol, string symbolName)
setIntervalTime: function (如何读懂日本K线图 intervalTime)
setDepthWidth: function (width)
事件函数 | 说明 |
---|---|
onResize: function(width, height) | 画布尺寸改变时触发 |
onLangChange: function(lang) | 语言改变时触发 |
onSymbolChange: function(symbol, symbolName) | 交易品种改变时触发 |
onThemeChange: function(theme) | 主题改变时触发 |
onRangeChange: function(range) | 聚合时间改变时触发 |
onRequestData: function(param,callback) | 请求数据时触发,触发时间间隔由 intervalTime 指定, param 请求参数, callback(res) 结果回调函数。无论请求是否成功,必须在 onRequestData 里调用 callback ,如何读懂日本K线图 否则会中断数据请求。 |
lines : K线图, 依次是: 时间(ms), 开盘价, 最高价, 最低价, 收盘价, 成交量
depths 深度图数据, asks : 一定比例的卖单列表, bids :一定比例的买单列表, 其中每项的值依次是 : 成交价, 成交量
About
Resources
Stars
Watchers
Forks
Releases
Packages 0 如何读懂日本K线图 如何读懂日本K线图
Languages
Footer
© 2022 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
liihuu/KLineChart
This commit does not belong to any branch on this repository, and may 如何读懂日本K线图 belong to a fork outside of the repository.
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download 如何读懂日本K线图 如何读懂日本K线图 GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
💹 📈 Lightweight k-line chart built with html5 canvas.
Execute command in root directory. Node.js is required.
The generated files are in the dist folder.
KLineChart is available under the Apache License V2.
❤️ Sponsor Author
- BTC: bc1qnwzukszzk5xfk0zs3sr8etzgctgnrtqts43jzp3khe6gm7xazprsp4y6n3
- ETH: 0xd2c3911654db861e0a2e17415e11a209c1fc3594
- USDT-ERC20: 0xd2c3911654db861e0a2e17415e11a209c1fc3594
- USDT-Omni: 3DSXSbTbMwXumaaqMySVPgedBP9rGhpnfQ
- USDT-TRC20: THJpTQmFGaVm12KE1Jzc5mLXiApP6qXMCi
About
📈 Lightweight k-line chart that can be highly customized. Zero dependencies. Support mobile.(可高度自定义的轻量级k线图,无第三方依赖,支持移动端)
Topics
Resources
License
Stars
Watchers
Forks
Releases 48
Packages 0
Used by 95
Contributors 9
Languages
Footer
© 2022 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
K线图分析法
本人编辑
©2022 Baidu 使用百度前必读 | 百科协议 | 隐私政策 | 百度百科合作平台 | 京ICP证030173号
基于python的股票数据的读取及可视化(K线图)
鹏鹏写代码 于 2020-11-21 20:50:48 发布 10640 收藏 232
1.读取数据
TuShare是一个免费、开源的python财经数据接口包。主要实现对股票等金融数据从数据采集、清洗加工 到 数据存储的过程,能够为金融分析人员提供快速、整洁、和多样的便于分析的数据,为他们在数据来源方面极大地减轻了工作 量,使他们更加专注于策略和模型的研究与实现上。考虑到Python pandas包在金融量化分析中体现出的优势,TuShare返回的绝大部分的数据格式都是pandas DataFrame类型,非常便于用pandas/NumPy/Matplotlib进行数据分析和可视化。当然,如果您习惯了用Excel或者关系型数 据库做分析,您也可以通过TuShare的数据存储功能,将数据全部保存到本地后进行分析。应一些用户的请求,从0.2.5版本开始,TuShare同时 兼容Python 2.x和Python 3.x,对部分代码进行了重构,并优化了一些算法,确保数据获取的高效和稳定。
python的强大之处就在于有一帮第三方库的兄弟,股票方面也是如此,今天给大家讲一下这个库,他就是tushare库(官方地址:http://tushare.org/),大家可以直接用pip安装,以Windows安装为例吧。
安装过程可以参考我以前的博客:点击查看python用命令安装第三方库教程
我下面以jupyter notebook安装为例,给大家展示一下:
安装完成以后接下来就是我们的获取股票数据。
获取数据结果展示:
我们后面案例通过万科A来进行的,所以我们先获取一下万科A的数据,通过get_k_data()函数获取上市公司万科从2009-01-01到2019-01-01这十年的股票日线级别的数据,参数“000002”为万科的股票代码。
结果展示:
‘’
注:open 开盘价,close 收盘价,high 最高价,low为最低价,volume为成交量,code为股票代码。
若想获取数据写入Excel工作簿中,我们可以按如下代码:
2.绘制股票走势图
结果展示:
上述使用的是plot()函数,我们也可以直接使用Matplotlib函数库的一些功能。
运行结果展示:
3.绘制K线图
1.安装绘制K线图的库
K线分为两种,如果当天收盘价高于开盘价,即当天价格上涨,称为阳线。通常绘为红线。
反之就是当天价格上涨,称为阴线,通常绘为绿线。
python在绘画K线的时候也用到一个库,mpl_finance库,参照以前推送安装教程,该库中的candlestick_ochl()函数绘制K线图,下面就用python编写的案例大家参考一下。
安装成功截图:(jupyter notebook安装方法)
2.获取数据
运行结果:
3.日期格式调整以及表格转换
运行结果展示:
添加均线图:以添加5日均线和10日均线为例、
运行结果:
我们在上面基础上再添加一个日成交量柱形图。代码如下:
运行结果:
本文主要就是介绍一下通过NumPy,pandas,Matplotlib三个数据分析利器画图,利用股票数据进行一些操作,大家也可以利用这个数据,做一些数据分析,练练手。