COT (トレーダーのコミットメント レポート) を xts オブジェクトにロードしようとしているので、さまざまなシンボルを使用してグラフにプロットできます。
私はこのデータを持っています:
OI Smart_Long Smart_Short Comm_Long Comm_Short
2013-01-08 227030 67302 75623 88628 77408
2013-01-15 255620 79789 73214 89670 100277
2013-01-22 260817 83253 62843 92014 115104
2013-01-29 294272 91088 67119 105281 130716
2013-02-05 325352 91454 60687 122242 151926
2013-02-12 286854 85577 61319 108681 139583
2013-02-19 282781 79810 59322 107203 133294
( http://pastebin.com/raw.php?i=5Y9nV0Us )
そして、このRコード:
########################################
#Get the data
setInternet2(TRUE)
con = gzcon(url('http://www.systematicportfolio.com/sit.gz', 'rb'))
source(con)
close(con)
library(quantmod)
EURUSD = getSymbols.fxhistoricaldata('EURUSD', 'hour', auto.assign = F, download=T)
EURO_cot <- read.table("http://pastebin.com/raw.php?i=5Y9nV0Us",header=F,sep=",")
###########################################
#Format the data
EURO_dates <- as.POSIXlt(EURO_cot[,3])
EURO_cot <- EURO_cot[,c(8,9,10,12,13)]
headers2<- c("OI",
"Smart_Long", "Smart_Short",
"Comm_Long", "Comm_Short")
colnames(EURO_cot) <- headers2
EURO_xts <- as.xts(EURO_cot, EURO_dates)
###########################################
#Plot the data
chartSeries(to.weekly(EURUSD[,1]['2013-01-01::2013-02-16']))
addTA(EURO_xts[,1]['2013-01-01::2013-02-16'])
Error in plot.window(...) : need finite 'ylim' values
In addition: Warning messages:
1: In min(tav * 0.975, na.rm = TRUE) :
no non-missing arguments to min; returning Inf
2: In max(tav * 1.05, na.rm = TRUE) :
no non-missing arguments to max; returning -Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
あなたが提供できるすべての助けに感謝します!
PS。ベビーベッドの生データは、 http://www.cftc.gov/MarketReports/CommitmentsofTraders/HistoricalCompressed/index.htmからダウンロードできます 。
先物とオプションの複合レポート:セクションの下