フィルターのクリア

Need help understanding candle plots

2 ビュー (過去 30 日間)
Daniel
Daniel 2015 年 11 月 18 日
編集済み: Daniel 2015 年 11 月 18 日
I got the allords data from here Yahoo Finance for daily share data.
I save it as an XLSX and then load it up with:
%%Load Excel file
[num,txt,raw] = xlsread('Aords.xlsx');
%%Obtain data from arrays
Open=num(:,1); High=num(:,2); Low=num(:,3); Close=num(:,4); Volume=num(:,5); Date=txt(2:end,1);
%%inverse arrays if they are back to front (comment out if not so)
Open=flipud(Open); High=flipud(High); Low=flipud(Low); Close=flipud(Close); Volume=flipud(Volume); Date=flipud(Date);
%%convert date string into num
% datetime.setDefaultFormats('default','yyyy-MM-dd')
% Date=datenum(Date);
% Date = datetime(Date,'ConvertFrom','datenum');
%%Plot data highlow(High, Low, Close, Open,'b', Date) *LINE 34*
but I get this error:
Conversion to cell from double is not possible.
Error in highlow (line 96) dateset2(3:3:end) = NaN * ones(size(3:3:length(dateset1)));
Error in chart (line 34) highlow(High, Low, Close, Open,'b', Date)
If I uncomment the datenum conversion to datetime I get this error:
Error using highlow (line 96) You can not assign numeric values to a datetime array. Assign to the array's Year, Month, Day, Hour, Minute, or Second properties, or use datetime(x,'ConvertFrom',...) to create datetime values for assignment.
Error in chart (line 34) highlow(High, Low, Close, Open,'b', Date)
I assume I have a formatting error in the Date some how

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by