Intraday stock candestick X-axes problems

1 view (last 30 days)
gaia buratti
gaia buratti on 14 Oct 2012
Hi, as you can see from the title I would like to plot hourly stock prices as candlestick. The problem is the X-axes, I have no idea how to treat the dates.
If I use the basic formula:
% candle(H(end-100:end),L(end-100:end),LP(end-100:end),O(end-100:end));
I get a very nice candle chart but the X-ax is just a serial number (First subplot)
while if I use
% candle(H(end-100:end),L(end-100:end),LP(end-100:end),O(end-100:end), [],date(end-100:end,1));
where the variable date come from the following code
[filename,pathname]=uigetfile('*.xlsx');
[prices, textdata, raw]=xlsread(filename,1);
date=textdata(2:end,1);
it gives the error
*??? Error using ==> set Value must be numeric
Error in ==> candle at 138 set(hcdl_vl, 'XData', dateset(line_xdata));
Error in ==> TSprova at 96 candle(H(end-100:end),L(end-100:end),LP(end-100:end),O(end-100:end),[],date(end-100:end,1));*
So I tried trasformung the data in using datenum, but I get blank space for nontrading hours and WE.
Of course I'm not an expert of Matlab but I want to learn and try to use it in a trading system. I would apreciate any suggestion.

Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!