R ile Finansal Verileri İçe Aktarma ve Yönetme
Joshua Ulrich
Quantitative Analyst & quantmod Co-Author and Maintainer
getSymbols("MSFT", from = "2004-07-01", to = "2004-12-31")
"MSFT"
# Verileri bölünme ve temettülere göre ayarlayın
msft_adjusted <- adjustOHLC(MSFT)
# Nesne adı sembol değil
my_data <- MSFT
# symbol.name argümanını kullanın
my_data_adjusted <- adjustOHLC(my_data, symbol.name = "MSFT")

# Yahoo Finance'tan bölünme verilerini indirin
splits <- getSplits("GE")
head(splits, n = 4)
GE.spl
1971-06-08 0.5
1983-06-02 0.5
1987-05-26 0.5
1994-05-16 0.5
# Yahoo Finance'tan bölünme ayarlı temettü verilerini indirin
dividends <- getDividends("GE")
head(dividends, n = 4)
GE.div
1970-03-03 0.00677
1970-06-11 0.00677
1970-09-21 0.00677
1970-12-07 0.00677
# Yahoo Finance'tan ayarlanmamış temettü verilerini indirin
dividends_raw <- getDividends("GE", split.adjust = FALSE)
# Ayarlı ve ayarlanmamış temettüleri karşılaştırın
head(merge(dividends, dividends_raw))
GE.div GE.div.1
1970-03-03 0.00677 0.64992
1970-06-11 0.00677 0.64992
1970-09-21 0.00677 0.64992
1970-12-07 0.00677 0.64992
1971-03-03 0.00677 0.64992
1971-06-17 0.00729 0.34992
splitsdividendsclosexts nesnesi döndürür: Split ve DivgetSymbols("GE", from = "2000-01-01")
"GE"
close <- Cl(GE)
splits <- getSplits("GE")
dividends_raw <- getDividends("GE", split.adjust = FALSE)
# Bölünmeler, ayarlanmamış temettüler ve ayarlanmamış kapanış değerini geçirin
ratios <- adjRatios(splits = splits,
dividends = dividends_raw,
close = close)
# Ayarlanmamış kapanışı bölünme ve temettü oranlarıyla çarpın
close_adjusted <- close * ratios[, "Split"] * ratios[, "Div"]
head(merge(close, close_adjusted, Ad(GE)), n = 4)
GE.Close GE.Close.1 GE.Adjusted
2000-01-03 150.0000 29.50422 29.44630
2000-01-04 144.0000 28.32405 28.26845
2000-01-05 143.7500 28.27488 28.21937
2000-01-06 145.6718 28.65289 28.59664
R ile Finansal Verileri İçe Aktarma ve Yönetme