How do we draw a red dot (to represent a deal) on a financial candlestick?

I draw a candlestick chart using this MATLAB function:

http://www.mathworks.com/help/toolbox/finance/candlefts.html

How do I draw a red dot on the chart to represent a trade at that point?

+5
source share
1 answer

For the point you want to add, you will need its position on the y axis yValueand the date it was placed on the x axis xValue(formatted as a single date serial number ). Then the following should work:

candle(...);  %# Make your candle plot
hold on;      %# Add to the existing plot
plot(xValue,yValue,'r.');  %# Plot a red dot

If you want to increase the red dot, you can replace the last line with one of the following:

plot(xValue,yValue,'r.','MarkerSize',20);
plot(xValue,yValue,'ro','MarkerFaceColor','r');
+14
source

All Articles