matlab 初学者如何看盘及k线图图中为什么画不上横线

【图文】金融MATLAB-第22章_百度文库
您的浏览器Javascript被禁用,需开启后体验完整功能,
享专业文档下载特权
&赠共享文档下载特权
&100W篇文档免费专享
&每天抽奖多种福利
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
金融MATLAB-第22章
阅读已结束,下载本文到电脑
定制HR最喜欢的简历
你可能喜欢只需一步,快速开始
扫一扫,访问微社区
请完成以下验证码
查看: 14004|回复: 14|关注: 0
Matlab关于绘制蜡烛图的问题
<h1 style="color:#9 麦片财富积分
入门, 积分 149, 距离下一级还需 351 积分
关注者: 41
关于绘制蜡烛图的问题
未命名.JPG (38 KB, 下载次数: 35)
17:14 上传
先输入命令:
%打开如图界面:金融时间序列分析工具
&在执行一些简单的操作,获取包钢稀土&的数据(不会,看help因为很简单)
1.JPG (73.54 KB, 下载次数: 357)
17:57 上传
2.JPG (130.66 KB, 下载次数: 9)
17:57 上传
&&open candle
如图:红圈处,
处:开盘价&收盘价(上涨):将color改为[255 0 102]./255
开盘价&收盘价(下跌):将back改为[51 204 0]./255
(251.43 KB, 下载次数: 50353)
17:11 上传
点击文件名下载附件
[ 本帖最后由 panlin 于
17:57 编辑 ]
<h1 style="color:# 麦片财富积分
谢谢!非常实用
<h1 style="color:# 麦片财富积分
关注者: 3
谢谢!非常实用:lol :lol :lol :lol
<h1 style="color:# 麦片财富积分
不能取得数据。为什么???
<h1 style="color:# 麦片财富积分
怎么下不了?
怎么下不了?怎么下不了?怎么下不了?
<h1 style="color:# 麦片财富积分
怎么下载不了?
<h1 style="color:# 麦片财富积分
谢谢!非常实用
<h1 style="color:# 麦片财富积分
正好用得到
<h1 style="color:# 麦片财富积分
回复 1# panlin 的帖子
open candle,修改candle.m源程序,主要是把'edgecolor'修改成'facecolor'
% If the opening price is less than the close
...color,'facecolor',[255 0 0]./255);
%阳线时K线实体显示红色
% If the opening price is greater than the close
...color,'facecolor',[0 255 0]./255);
%阴线时K线实体显示绿色
保存后再调用candle函数即可
<h1 style="color:# 麦片财富积分
学习一下。。。。。。。。。。。。。。。。。
站长推荐 /3
Simulink工具定制实现高效模型验证
MATLAB中文论坛是全球最大的 MATLAB & Simulink 中文社区。用户免费注册会员后,即可下载代码,讨论问题,请教资深用户及结识书籍作者。立即注册加入我们吧!
MATLAB官方社交平台
MATLAB中文论坛微社区Matlab画k线图
function KLine(varargin)
%% fun help
% function Kplot(O,H,L,C)
Kplot(O,H,L,C,date)
Kplot(O,H,L,C,date,colorUp,colorDown,colorLine)
Kplot(OHLC)
Kplot(OHLC,date)
Kplot(OHLC,date,colorUp,colorDown,colorLine)
KLine(OHLC, 0, 'r', 'g', 'w');
isMat = size(varargin{1}, 2); %返回第一个参数的值的列数
indexShift = 0; %参数索引位置
useDate = 0; %是否使用
if isMat == 4,
O = varargin{1}(:,1);
H = varargin{1}(:,2);
L = varargin{1}(:,3);
C = varargin{1}(:,4);
O = varargin{1};
H = varargin{2};
L = varargin{3};
C = varargin{4};
indexShift = 3;
%设置颜色的值
if nargin + isMat & 7
colorDown = 'g';
colorUp = 'r';
colorUp = varargin{3+indexShift};
colorDown = varargin{4+indexShift};
%设置Date值
if nargin + isMat & 6
date = (1:length(O))';
if varargin{2+indexShift} ~= 0
date = varargin{2+indexShift};
useDate = 1;
date = (1:length(O))';
w = .3 * min([(date(2)-date(1)) (date(3)-date(2))]);
d = C - O; %收盘价-开盘价
%画k线, 收盘价小于开盘价,跌
n = find(d & 0);
for i = 1:length(n)
line([date(n(i)) date(n(i))], [L(n(i)) H(n(i))], 'Color', colorDown) %x1, x2, y1, y2
x = [date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w date(n(i))-w];
y = [O(n(i))
fill(x, y, colorDown)
%画k线,收盘价大于开盘价,涨
n = find(d & 0);
for i = 1:length(n)
line([date(n(i)) date(n(i))], [L(n(i)) H(n(i))], 'Color', colorUp) %x1, x2, y1, y2
x=[date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w date(n(i))-w];
y=[O(n(i))
fill(x, y, colorUp)
%画k线,收盘价等于开盘价
n = find(d == 0);
for i = 1:length(n)
line([date(n(i)) date(n(i))], [L(n(i)) H(n(i))], 'Color', 'w') %x1, x2, y1, y2
x=[date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w date(n(i))-w];
y=[O(n(i))
fill(x, y, 'w')
function Volume(varargin)
%% fun help
% function Kplot(O,H,L,C)
Kplot(O,H,L,C,date)
Kplot(O,H,L,C,date,colorUp,colorDown,colorLine)
Kplot(OHLC)
Kplot(OHLC,date)
Kplot(OHLC,date,colorUp,colorDown,colorLine)
KLine(OHLC, 0, 'r', 'g', 'w');
isMat = size(varargin{1}, 2); %返回第一个参数的值的列数
indexShift = 0; %参数索引位置
useDate = 0; %是否使用
if isMat == 6,
O = varargin{1}(:,1);
H = varargin{1}(:,2);
L = varargin{1}(:,3);
C = varargin{1}(:,4);
V = varargin{1}(:,5);
O = varargin{1};
H = varargin{2};
L = varargin{3};
C = varargin{4};
indexShift = 3;
%设置颜色的值
if nargin + isMat & 7
colorDown = 'g';
colorUp = 'r';
colorUp = varargin{3+indexShift};
colorDown = varargin{4+indexShift};
%设置Date值
if nargin + isMat & 6
date = (1:length(O))';
if varargin{2+indexShift} ~= 0
date = varargin{2+indexShift};
useDate = 1;
date = (1:length(O))';
w = .3 * min([(date(2)-date(1)) (date(3)-date(2))]);
d = C - O; %收盘价-开盘价
%画k线, 收盘价小于开盘价,跌
n = find(d & 0);
for i = 1:length(n)
x = [date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w];
fill(x, y, colorDown)
%画k线,收盘价大于开盘价,涨
n = find(d & 0);
for i = 1:length(n)
x=[date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w];
fill(x, y, colorUp)
%画k线,收盘价等于开盘价
n = find(d == 0);
for i = 1:length(n)
x=[date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w];
fill(x, y, 'w')
KLineDemo.m
%加载数据,改为从网上直接获取或者从通达信客户端
F = F(1:100, :);
subplot(3, 1, [1,2]);
OHLC = F(:, 3:6);
KLine(OHLC, 0, 'r', 'g', 'w');
%xlim([1,length( OHLC )]);
%画坐标轴文本
XTick = [];
XTickLabel = [];
XTick = [XT 1];
str = [num2str(F(1,1)), '-', num2str(F(1,2))];
XTickLabel{numel(XTickLabel)+1, 1} =
ind = find(F(:,2) == 1000, 1);
if ~isempty(ind)
XTick = [XT ind ];
str = [num2str(F(ind, 1)),'-',num2str(F(ind, 2))];
XTickLabel{numel(XTickLabel)+1, 1} =
ind = find(F(:,2) == 1130, 1);
if ~isempty(ind)
XTick = [XT ind ];
str = [num2str(F(ind, 1)),'-',num2str(F(ind, 2))];
XTickLabel{numel(XTickLabel)+1, 1} =
ind = find(F(:,2) == 1400, 1);
if ~isempty(ind)
XTick = [XT ind ];
str = [num2str(F(ind, 1)),'-',num2str(F(ind, 2))];
XTickLabel{numel(XTickLabel)+1, 1} =
ind = length(F(:,1));
if XTick(end) ~= ind
XTick = [XT ind ];
str = [num2str(F(ind, 1)),'-',num2str(F(ind, 2))];
XTickLabel{numel(XTickLabel)+1, 1} =
set(gca,'XTick', XTick);
set(gca,'XTickLabel', XTickLabel);
title('IF分钟K线图', 'FontWeight','Bold', 'FontSize', 15);
subplot(3, 1, 3);
OHLCV = F(:, 3:8);
Volume(OHLCV, 0, 'r', 'g', 'w');
%title('成交量', 'FontWeight','Bold', 'FontSize', 15);
%xlim([1,length( OHLC )]);
%画坐标轴文本
set(gca,'XTick', XTick);
set(gca,'XTickLabel', XTickLabel);
要达到国内客户端软件的样式还有很多地方需要修改,会继续完善。
matlab candle横坐标日期显示不对
VUE 爬坑之旅 -- 在 VUE 项目中使用 ECharts 画 K 线图和面积图,并且可切换
如何用matlab和R语言画K线图
R语言绘制K线图
matlab 特殊k线做标示
matlab 外汇接口显示k线图以bid为准
使用matplotlib绘制K线图以及和成交量的组合图
没有更多推荐了,Matlab画k线图
function KLine(varargin)
%% fun help
% function Kplot(O,H,L,C)
Kplot(O,H,L,C,date)
Kplot(O,H,L,C,date,colorUp,colorDown,colorLine)
Kplot(OHLC)
Kplot(OHLC,date)
Kplot(OHLC,date,colorUp,colorDown,colorLine)
KLine(OHLC, 0, 'r', 'g', 'w');
isMat = size(varargin{1}, 2); %返回第一个参数的值的列数
indexShift = 0; %参数索引位置
useDate = 0; %是否使用
if isMat == 4,
O = varargin{1}(:,1);
H = varargin{1}(:,2);
L = varargin{1}(:,3);
C = varargin{1}(:,4);
O = varargin{1};
H = varargin{2};
L = varargin{3};
C = varargin{4};
indexShift = 3;
%设置颜色的值
if nargin + isMat & 7
colorDown = 'g';
colorUp = 'r';
colorUp = varargin{3+indexShift};
colorDown = varargin{4+indexShift};
%设置Date值
if nargin + isMat & 6
date = (1:length(O))';
if varargin{2+indexShift} ~= 0
date = varargin{2+indexShift};
useDate = 1;
date = (1:length(O))';
w = .3 * min([(date(2)-date(1)) (date(3)-date(2))]);
d = C - O; %收盘价-开盘价
%画k线, 收盘价小于开盘价,跌
n = find(d & 0);
for i = 1:length(n)
line([date(n(i)) date(n(i))], [L(n(i)) H(n(i))], 'Color', colorDown) %x1, x2, y1, y2
x = [date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w date(n(i))-w];
y = [O(n(i))
fill(x, y, colorDown)
%画k线,收盘价大于开盘价,涨
n = find(d & 0);
for i = 1:length(n)
line([date(n(i)) date(n(i))], [L(n(i)) H(n(i))], 'Color', colorUp) %x1, x2, y1, y2
x=[date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w date(n(i))-w];
y=[O(n(i))
fill(x, y, colorUp)
%画k线,收盘价等于开盘价
n = find(d == 0);
for i = 1:length(n)
line([date(n(i)) date(n(i))], [L(n(i)) H(n(i))], 'Color', 'w') %x1, x2, y1, y2
x=[date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w date(n(i))-w];
y=[O(n(i))
fill(x, y, 'w')
function Volume(varargin)
%% fun help
% function Kplot(O,H,L,C)
Kplot(O,H,L,C,date)
Kplot(O,H,L,C,date,colorUp,colorDown,colorLine)
Kplot(OHLC)
Kplot(OHLC,date)
Kplot(OHLC,date,colorUp,colorDown,colorLine)
KLine(OHLC, 0, 'r', 'g', 'w');
isMat = size(varargin{1}, 2); %返回第一个参数的值的列数
indexShift = 0; %参数索引位置
useDate = 0; %是否使用
if isMat == 6,
O = varargin{1}(:,1);
H = varargin{1}(:,2);
L = varargin{1}(:,3);
C = varargin{1}(:,4);
V = varargin{1}(:,5);
O = varargin{1};
H = varargin{2};
L = varargin{3};
C = varargin{4};
indexShift = 3;
%设置颜色的值
if nargin + isMat & 7
colorDown = 'g';
colorUp = 'r';
colorUp = varargin{3+indexShift};
colorDown = varargin{4+indexShift};
%设置Date值
if nargin + isMat & 6
date = (1:length(O))';
if varargin{2+indexShift} ~= 0
date = varargin{2+indexShift};
useDate = 1;
date = (1:length(O))';
w = .3 * min([(date(2)-date(1)) (date(3)-date(2))]);
d = C - O; %收盘价-开盘价
%画k线, 收盘价小于开盘价,跌
n = find(d & 0);
for i = 1:length(n)
x = [date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w];
fill(x, y, colorDown)
%画k线,收盘价大于开盘价,涨
n = find(d & 0);
for i = 1:length(n)
x=[date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w];
fill(x, y, colorUp)
%画k线,收盘价等于开盘价
n = find(d == 0);
for i = 1:length(n)
x=[date(n(i))-w date(n(i))-w date(n(i))+w date(n(i))+w];
fill(x, y, 'w')
KLineDemo.m
%加载数据,改为从网上直接获取或者从通达信客户端
F = F(1:100, :);
subplot(3, 1, [1,2]);
OHLC = F(:, 3:6);
KLine(OHLC, 0, 'r', 'g', 'w');
%xlim([1,length( OHLC )]);
%画坐标轴文本
XTick = [];
XTickLabel = [];
XTick = [XT 1];
str = [num2str(F(1,1)), '-', num2str(F(1,2))];
XTickLabel{numel(XTickLabel)+1, 1} =
ind = find(F(:,2) == 1000, 1);
if ~isempty(ind)
XTick = [XT ind ];
str = [num2str(F(ind, 1)),'-',num2str(F(ind, 2))];
XTickLabel{numel(XTickLabel)+1, 1} =
ind = find(F(:,2) == 1130, 1);
if ~isempty(ind)
XTick = [XT ind ];
str = [num2str(F(ind, 1)),'-',num2str(F(ind, 2))];
XTickLabel{numel(XTickLabel)+1, 1} =
ind = find(F(:,2) == 1400, 1);
if ~isempty(ind)
XTick = [XT ind ];
str = [num2str(F(ind, 1)),'-',num2str(F(ind, 2))];
XTickLabel{numel(XTickLabel)+1, 1} =
ind = length(F(:,1));
if XTick(end) ~= ind
XTick = [XT ind ];
str = [num2str(F(ind, 1)),'-',num2str(F(ind, 2))];
XTickLabel{numel(XTickLabel)+1, 1} =
set(gca,'XTick', XTick);
set(gca,'XTickLabel', XTickLabel);
title('IF分钟K线图', 'FontWeight','Bold', 'FontSize', 15);
subplot(3, 1, 3);
OHLCV = F(:, 3:8);
Volume(OHLCV, 0, 'r', 'g', 'w');
%title('成交量', 'FontWeight','Bold', 'FontSize', 15);
%xlim([1,length( OHLC )]);
%画坐标轴文本
set(gca,'XTick', XTick);
set(gca,'XTickLabel', XTickLabel);
要达到国内客户端软件的样式还有很多地方需要修改,会继续完善。
matlab candle横坐标日期显示不对
VUE 爬坑之旅 -- 在 VUE 项目中使用 ECharts 画 K 线图和面积图,并且可切换
如何用matlab和R语言画K线图
R语言绘制K线图
matlab 特殊k线做标示
matlab 外汇接口显示k线图以bid为准
使用matplotlib绘制K线图以及和成交量的组合图
没有更多推荐了,当前位置:
文件名称:Candle
所属分类:
标签属性:
上传时间:
文件大小:
提 供 者:
相关连接:
下载说明:
别用迅雷下载,失败请重下,重下不扣分!
用Matlab绘制股市中的蜡烛图(K线图),包含虚拟数据和具体步骤-draw K line in the stock market with Matlab
(系统自动生成,下载前可以参看下载内容)下载文件列表
压缩包 : Candle.rar 列表
Candle/DataForTest.xls
Candle/MapCandle.m
暂无评论内容.
*快速评论:
和说明不符
不是源码或资料
纯粹是垃圾
*内  容:
*验 证 码:
搜珍网是交换下载平台,下载的内容请自行研究使用或咨询上传人.
资源属性分别代表:系统平台,开发平台,开发语言,文件格式四部分.
本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用进行解压.
如果您发现此软件无法下载,请稍后再次尝试;或者.
本站提供下载的内容为网上收集或会员上传提供,若无意中侵犯了您的版权,.
如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
如下载后发现下载的内容跟说明不相乎,可以联系本站的客服,经确认可以退回消费了的积分.
联系我们网站
·电话:(0)
搜珍网 www.dssz.com
All Rights Reserved.

我要回帖

更多关于 怎样认识股票k线图 的文章

 

随机推荐