Borrar filtros
Borrar filtros

Make Candle chart more Readable.

9 visualizaciones (últimos 30 días)
Dima
Dima el 20 de Sept. de 2011
Editada: Anton el 18 de Mzo. de 2024
Hello!
I wonder if it is possible to modify the default candle plot parameters in such a way (or to assign the property to the chart object) so that the candles are plotted in the following format:
Down candles are red And up candles are green.
Example of the stock chart can be found here:
I modified the default Black candle stick chart in the chart editor by changing the patch face colors. I wonder if this can be done from the scrip???
Thanks!
D

Respuesta aceptada

Grzegorz Knor
Grzegorz Knor el 20 de Sept. de 2011
Something like that:
load disney.mat
candle(dis('3/31/98::4/30/98'))
title('Disney 3/31/98 to 4/30/98')
ch = get(gca,'children');
set(ch(1),'FaceColor','r')
set(ch(2),'FaceColor','g')
  1 comentario
Dima
Dima el 20 de Sept. de 2011
AMAZING!!))) IT WORKS!!! thanks so much...I am really getting the feel of the power of this platform...too bad I have only 3 days worth of programming experience))) still a pleasure to learn from such generously helpful people like you...have a nice day!)
D

Iniciar sesión para comentar.

Más respuestas (1)

Sonima
Sonima el 1 de Feb. de 2019
Hi!
This does not work anylonger.
Is it possible to define colors for Bullish/Bearish candles?
In addition, is it possible to conditionally change the candlestick face colors?
  1 comentario
Anton
Anton el 18 de Mzo. de 2024
Editada: Anton el 18 de Mzo. de 2024
Try seprating bullish and bearish candles into two sets. Then plot each with diffrent colours. Here is quick and dirty example.
bullishColor = [0.4660 0.6740 0.1880]; bearishColor = [0.8500 0.3250 0.0980]; % Candle Colors
ii=0; iii=0;
for i = 1:size(CurrentChart,1)
if CurrentChart{i,"Close"} >= CurrentChart{i,"Open"}
ii=ii+1; IndxBull (ii) = i;
else
iii=iii+1; IndxBear (iii) = i;
end
end
if ~exist('IndxBear', 'var') || ~exist('IndxBull', 'var')
continue
end
bullishCandles = CurrentChart (IndxBull,:);
bearishCandles = CurrentChart (IndxBear,:);
candle (bullishCandles, bullishColor);
hold on
candle (bearishCandles, bearishColor);
hold off

Iniciar sesión para comentar.

Categorías

Más información sobre Geographic Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by