필터 지우기
필터 지우기

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 CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by