matlab 股票分时图_matlab画股票走势图 急急急!

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 18:24   661   0

在MATLAB命令行窗口输入help candle,查看该函数的使用格式,具体如下:

>> help candle

candle Candlestick chart.

candle(HI, LO, CL, OP)

candle(HI, LO, CL, OP, COLOR, DATES, DATEFORM)

Optional Inputs: COLOR, DATES, DATEFORM

Inputs:

HI - Column vector of high prices of a security.

LO - Column vector of low prices of a security.

CL - Column vector of closing prices of a security.

OP - Column vector of opening prices of a security.

Optional Inputs:

COLOR - Three element color vector, [R G B], or a string specifying the

color name. MATLAB supplies a default color if none is specified

or if it is empty. The default color differs depending on the

background color of the figure window. See COLORSPEC in the

MATLAB Reference Guide for color names.

DATES - Column vector of dates for user specified X-axis tick

labels.

DATEFORM - A scalar dictating the format of the date string tick labels.

See DATEAXIS for details on the date string formats.

See also bolling, highlow, movavg, pointfig.

candle 的参考页

名为 candle 的其他函数

candle函数使用有两种形式,具体如下:

(1)candle(HighPrices, LowPrices, ClosePrices, OpenPrices)

(2)candle(HighPrices, LowPrices, ClosePrices, OpenPrices,Color, Dates, Dateform)

candle函数使用主要输入介绍:第一个参数为输入数据的最高价;第二个参数为输入数据的最低价;第三个参数输入数据的收盘价;第四个参数输入数据的开盘价;第五个参数为绘图的颜色设置;第六个输入参数为绘图x轴的日期,第七个输入参数为输入日期的形式设置。

具体的candle函数使用如下:

clc,clear,close all % 清理命令区、清理工作区、关闭显示图形

warning off % 消除警告

feature jit off % 加速代码运行

load('data000001.mat')

openprice = data000001(1:40,1); % 开盘价

highprice = data000001(1:40,2); % 最高价

lowprice = data000001(1:40,3); % 最低价

closeprice = data000001(1:40,4); % 收盘价

Color = 'blue'; % 颜色

figure(1)

candle(highprice, lowprice, closeprice, openprice, Color);

grid on

axis tight

运行程序输出结果如图1-12所示。

sfd .jpg

(23.3 KB, 下载次数: 1)

2016-9-10 20:14 上传

442a53943febe9465fc072b4fbe10813.gif

b2a5a3e0dcc7d508e00275fe42fce1b5.gif

d248b81fcc831750bf92a96157b1eef6.png

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP