davil2000 发表于 2012-11-9 13:27
这种观点从何而来?存在技术上的困难吗?
C++、JAVA之类代码,SAS程序员可以轻松翻译。
技术上存在很大的困难啊,我摸索了好久也没有搞定,所以就放弃了。
比如下面的这段画K线图的代码,也是本论坛中贴过的代码,画出来的效果跟看盘软件确实没法比。
希望你能解决我的困惑啊,非常感谢。
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
data stocks;
input Date date7. High Low Close Open;
datalines;
01mar99 120 110 115 113
02mar99 118 114 115 115
03mar99 120 112 113 115
04mar99 119 110 111 119
05mar99 115 113 115 115
;
run;
/* Create the Annotate data set */
data candles;
length color function style $8;
retain xsys ysys '2' color 'vibg' size 1;
set stocks;
if close > open then style='empty';
else style ='solid';
/* Draw the open/close box */
function='move'; xsys='2'; ysys='2'; x=date; y=close; output;
function='poly'; xsys='7'; ysys='2'; x=+1; y=close; output;
function='polycont'; y=open; output;
function='polycont'; x=-1; y=open; output;
function='polycont'; y=close; output;
function='polycont'; x=+.5; y=close; output;
/* 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;
function='move'; xsys='2'; ysys='2'; x=date; y=open; output;
function='draw'; xsys='2'; ysys='2'; x=date; y=low; output;
end;
/* 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;
function='move'; xsys='2'; ysys='2'; x=date; y=close; output;
function='draw'; xsys='2'; ysys='2'; x=date; y=low; output;
end;
run;
symbol1 interpol=none value=none repeat=2;
axis1 minor=none offset=(5,5)pct;
axis2 label=('Price') minor=none;
title1 'Candle Stick Plots';
/* 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;