function='move'; xsys='2'; ysys='2'; x=date; y=clpr; output;
function='poly'; xsys='7'; ysys='2'; x=+1; y=clpr; output;
function='polycont'; y=oppr; output;
function='polycont'; x=-1; y=oppr; output;
function='polycont'; y=clpr; output;
function='polycont'; x=+0.5; y=clpr; output;
/*Draw high to close and low to open */
if clpr ge oppr then do;
function='move'; xsys='2'; ysys='2'; x=date; y=clpr; output;
function='draw'; xsys='2'; ysys='2'; x=date; y=hipr; output;
function='move'; xsys='2'; ysys='2'; x=date; y=oppr; output;
function='draw'; xsys='2'; ysys='2'; x=date; y=lopr; output;
end;
/* Draw high to open and low to close */
if clpr le oppr then do;
function='move'; xsys='2'; ysys='2'; x=date; y=oppr; output;
function='draw'; xsys='2'; ysys='2'; x=date; y=hipr; output;
function='move'; xsys='2'; ysys='2'; x=date; y=clpr; output;
function='draw'; xsys='2'; ysys='2'; x=date; y=lopr; output;
end;
run;
symbol1 i=none v=none r=2;
axis1 minor=none offset=(5,5)pct;
axis2 label=('Price') minor=none;
title1 '上证综合指数k线图';
/* PROC GPLOT is used as a 'holding' area for the annotate, plus,
gplot */
/* generates the axes. Had to do an overlay plot so that the vertical */
/* axis had the complete range of the data, ie., high to low. */
proc gplot data=Shangzhenzhishu;
plot hipr*date lopr*date / overlay haxis=axis1 vaxis=axis2 anno=candles;
run;
quit;