library(quantmod) getSymbols("GS") candleChart(GS,multi.col=TRUE,theme=‘white‘) candleChart(GS,multi.col=FALSE,theme=‘white‘,subset=‘2016-01-01::2016-05-01‘) addMACD()
source(‘/r/qserver.R‘) h<-open_connection("127.0.0.1",5001,"testusername:testpassword") res<-execute(h,"select date,Open:o,High:h,Low:l,Close:c,volume:v from daily where sym=`601006,date >2016.01.01") resxts <-xts(res[,-1], order.by=res[,‘date‘]) candleChart(resxts,multi.col=FALSE,theme=‘white‘,up.col=‘red‘,dn.col=‘green‘,name=‘大秦铁路‘) addMACD() addRSI()
时间: 2024-11-11 22:28:05