开发者

How do we plot a red dot (to represent a trade) on a financial candlestick chart?

开发者 https://www.devze.com 2022-12-25 03:37 出处:网络
I am plotting a financial candlestick chart using this MATLAB function: http://www.mathworks.com/help/toolbox/finance/candlefts.html

I am plotting a financial candlestick chart using this MATLAB function:

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

How 开发者_开发百科do I plot a red dot on the chart, to represent a trade at that point?


For the point you want to add, you would need its position on the y-axis yValue and the date where it is to be placed on the x-axis xValue (formatted as a single serial date 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 a larger red dot, you can replace the last line with either of the following:

plot(xValue,yValue,'r.','MarkerSize',20);
plot(xValue,yValue,'ro','MarkerFaceColor','r');
0

精彩评论

暂无评论...
验证码 换一张
取 消