Need help understanding candle plots
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!