*! 绘制K线图 *! 程振兴 2018年7月13日 *! kline2 2, sch(vintage) cap prog drop kline2 prog def kline2 version 14.0 syntax anything(name = code), [Start(string) End(string) Stock Index SCHeme(string)] qui{ cap preserve clear all if "`end'" == "" local end: disp %dCYND date("`c(current_date)'","DMY") if "`start'" == "" local start: disp %dCYND (date("`end'","YMD")-60) if "`scheme'" == "" local scheme = "vintage" qui cntrade2 `code', s(`start') e(`end') `stock' `index' replace name = subinstr(name, " ", "", .) cap file close myfile jscopy fw, s h(`=name[`=_N']') fw `""' fw `""' fw `" "' fw `" "' fw `" "' fw `" "' fw `"
"' fw `" "' fw `" "' fw `" "' fw `" "' fw `" "' fw `" "' fw `" "' fw `""' fw `" "' fw `""' file close myfile drop open1-date1 } local name = "`=name[`=_N']'" di "点击打开:" "{browse `name'.html:`name'.html}" noi di in yellow "数据来源:网易财经" if "`c(os)'" == "MacOSX"{ cap qui drm __MACOSX } copen `name'.html end