/* Draw high to close and low to open */
if close > open then do;
function='move'; xsys='2'; ysys='2'; x=date; y=close; output;
function='draw'; xsys='2'; ysys='2'; x=date; y=high; output;
/* Draw high to open and low to close */
if close le open then do;
function='move'; xsys='2'; ysys='2'; x=date; y=open; output;
function='draw'; xsys='2'; ysys='2'; x=date; y=high; output;
/* PROC GPLOT is used as a 'holding' area for the annotate. Plus, GPLOT */
/* generates the axes. An overlay plot is used so that the vertical */
/* axis has the complete range of the data, ie., high to low. */
proc gplot data=stocks;
plot high*date low*date / overlay haxis=axis1 vaxis=axis2
anno=candles;
format date date5.;
run;
quit;