Neste post, criei o objeto acoes com o símbolos de 6 empresas (CIELO,PETROBRAS,BRADESCO,CIA DE DISTRIBUIÇÃO,AMBEV, e BMFBOVESPA). Apresento o procedimento via Yahoo para a ação da Cia de Distribuição. Os dados das outras empresas que estão no objeto acoes podem ser obtidas com uma simples mudança do símbolo da ação desejada. É importante ressaltar que as informações são gratuitas, estão em inglês, mas não sei qual é o grau de confiabilidade.
O quantmod tem funções que permitem a execução de uma série de modelagens quantitativas em finanças. Assim, no fim do post apresento a série do preço de fechamento das ações da Cia de Distribuição.
#Instale e carregue o pacote Quantmod library(quantmod) #Faça o download das ações via Yahoo Finance acoes<-c("CIEL3F.SA","PETR4.SA","BBDC4F.SA","PCAR4F.SA","ABEV3.SA","BVMF3.SA") getSymbols(acoes, src="yahoo",from="2007-01-01", to="2014-01-01") #Vamos obter as seguintes demonstrações contábeis do Pão de Açúcar:1) Demonstrações de Resultados (Income Statements - IS). #2 Balanço (Balance Sheets - BS) 3) Demonstração dos Fluxos de Caixa. (Cash Flow Statements - CF) # AnuaL (Annual - A).# Trimestral. (Quarterly - Q). #Obtêm as informações financeiras(preço de abertura,fechamento,volume,fechamento ajustado etc) de PCAR4. getFin("PCAR4") #Dividendos PAO<-("PCAR4F.SA") getDividends(PAO,src="yahoo") #Visualize a Demonstração de Resultado Trimestral viewFin(PCAR4.f,"IS", "Q") #Obtenha o Balanço Anual para PCAR4 viewFin(PCAR4.f,"BS", "A") #Obtenha as Demonstração dos Fluxos de Caixa Anual viewFin(PCAR4.f,"CF", "A") #Gráfico do preço de fechamento de PCAR4 chart_Series(Cl(PCAR4F.SA)) #Preço de Fechamento das últimas 3 Semanas PCAR4F.SA<-last(PCAR4F.SA, "3 weeks") chart_Series(Cl(PCAR4F.SA))
#Os mesmos comandos podem ser usados para outras ações listadas no objeto acoes.
> getDividends(PAO,src="yahoo") [,1] 2010-04-30 0.393723 2010-05-18 0.080000 2010-08-04 0.080000 2010-11-18 0.800000 2011-08-02 0.090000 2011-11-16 0.090000 2012-04-30 0.410246 2012-06-12 0.110000 2012-08-01 0.110000 2012-11-13 0.110000 2013-04-18 0.653088 2013-05-06 0.130000 2013-08-01 0.130000 2013-10-28 0.130000 2014-04-17 0.588935 2014-05-06 0.140000
#Visualize a Demonstração de Resultado Trimestral > viewFin(PCAR4.f,"IS", "Q") Quarterly Income Statement for PCAR4 2014-09-30 2014-06-30 2014-03-31 2013-12-31 2013-09-30 Revenue 15648.67 15202.90 15008.64 16887.39 14106.85 Other Revenue, Total NA NA NA NA NA Total Revenue 15648.67 15202.90 15008.64 16887.39 14106.85 Cost of Revenue, Total 11621.47 11253.87 11249.82 12666.14 10417.26 Gross Profit 4027.20 3949.03 3758.82 4221.25 3689.59 Selling/General/Admin. Expenses, Total 2894.91 2846.23 2729.12 2655.82 2673.36 Research & Development NA NA NA NA NA Depreciation/Amortization 206.81 191.29 191.29 196.40 200.97 Interest Expense(Income) - Net Operating NA NA NA NA NA Unusual Expense (Income) 12.83 22.75 0.91 38.57 -7.50 Other Operating Expenses, Total 5.04 42.16 26.68 260.09 23.57 Total Operating Expense 14714.05 14328.84 14176.13 15798.06 13292.08 Operating Income 934.62 874.06 832.51 1089.33 814.77 Interest Income(Expense), Net Non-Operating NA NA NA NA NA Gain (Loss) on Sale of Assets NA NA NA NA NA Other, Net -562.25 -277.62 -283.31 -117.92 -431.80 Income Before Tax 557.12 512.92 493.49 761.46 503.21 Income After Tax 389.69 358.44 338.44 687.44 356.53 Minority Interest -113.51 -94.14 -94.48 -195.72 -74.42 Equity In Affiliates NA NA NA NA NA Net Income Before Extra. Items 276.18 264.30 243.96 491.72 282.11 Accounting Change NA NA NA NA NA Discontinued Operations NA NA NA NA NA Extraordinary Item NA NA NA NA NA Net Income 276.18 264.30 243.96 491.72 282.11 Preferred Dividends NA NA NA NA NA Income Available to Common Excl. Extra Items 276.18 264.30 243.96 491.72 282.11 Income Available to Common Incl. Extra Items 276.18 264.30 243.96 491.72 282.11 Basic Weighted Average Shares NA NA NA NA NA Basic EPS Excluding Extraordinary Items NA NA NA NA NA Basic EPS Including Extraordinary Items NA NA NA NA NA Dilution Adjustment 0.00 NA NA NA NA Diluted Weighted Average Shares 265.08 264.91 264.91 265.23 263.88 Diluted EPS Excluding Extraordinary Items 1.04 1.00 0.92 1.85 1.07 Diluted EPS Including Extraordinary Items NA NA NA NA NA Dividends per Share - Common Stock Primary Issue 0.00 0.00 0.00 NA 0.00 Gross Dividends - Common Stock NA NA NA NA NA Net Income after Stock Based Comp. Expense NA NA NA NA NA Basic EPS after Stock Based Comp. Expense NA NA NA NA NA Diluted EPS after Stock Based Comp. Expense NA NA NA NA NA Depreciation, Supplemental NA NA NA NA NA Total Special Items NA NA NA NA NA Normalized Income Before Taxes NA NA NA NA NA Effect of Special Items on Income Taxes NA NA NA NA NA Income Taxes Ex. Impact of Special Items NA NA NA NA NA Normalized Income After Taxes NA NA NA NA NA Normalized Income Avail to Common NA NA NA NA NA Basic Normalized EPS NA NA NA NA NA Diluted Normalized EPS 1.14 1.14 0.99 2.20 1.05 attr(,"col_desc") [1] "3 months ending 2014-09-30" "3 months ending 2014-06-30" "3 months ending 2014-03-31" "3 months ending 2013-12-31" [5] "3 months ending 2013-09-30"
> #Obtenha o Balanço Anual para PCAR4. > viewFin(PCAR4.f,"BS", "A") Annual Balance Sheet for PCAR4 2013-12-31 2012-12-31 2011-12-31 2010-12-31 Cash & Equivalents 8024.06 6595.64 4969.95 3400.43 Short Term Investments 24.45 0.00 0.00 600.61 Cash and Short Term Investments 8391.63 7086.25 4969.95 4418.61 Accounts Receivable - Trade, Net 2515.67 2646.08 5111.94 4047.23 Receivables - Other NA NA NA NA Total Receivables, Net 3651.02 3728.57 6299.27 5205.57 Total Inventory 6381.54 5759.65 5552.77 4823.77 Prepaid Expenses 92.28 66.79 105.79 225.12 Other Current Assets, Total 93.27 39.04 23.05 0.00 Total Current Assets 18609.74 16680.30 16950.83 14673.07 Property/Plant/Equipment, Total - Gross 14083.14 12580.84 341.55 10370.19 Accumulated Depreciation, Total -5029.54 -4466.34 NA -3575.85 Goodwill, Net 2653.10 2058.34 NA 1975.09 Intangibles, Net 3047.56 2917.22 4939.36 2940.89 Long Term Investments 309.53 362.43 340.12 239.93 Other Long Term Assets, Total 1988.14 2624.36 2342.61 2141.71 Total Assets 38008.35 34832.11 33443.45 29772.26 Accounts Payable 8547.54 6240.36 5953.20 5368.74 Accrued Expenses 907.55 864.75 867.26 628.18 Notes Payable/Short Term Debt 0.00 0.00 0.00 0.00 Current Port. of LT Debt/Capital Leases 5171.42 4211.15 4917.50 2915.12 Other Current liabilities, Total 2386.24 2075.01 1437.68 2011.40 Total Current Liabilities 17012.75 13391.27 13175.64 10923.44 Long Term Debt 4123.34 6118.57 6046.11 5490.69 Capital Lease Obligations 198.51 162.54 194.79 101.24 Total Long Term Debt 4321.85 6281.10 6240.90 5591.94 Total Debt 9493.27 10492.25 11158.40 8507.05 Deferred Income Tax 1060.85 1137.38 1114.87 1028.99 Minority Interest 3228.77 2573.23 2469.15 2477.27 Other Liabilities, Total 2900.93 2954.41 2817.60 2727.31 Total Liabilities 28525.16 26337.38 25818.17 22748.94 Redeemable Preferred Stock, Total NA NA NA NA Preferred Stock - Non Redeemable, Net NA NA NA NA Common Stock, Total 6764.30 6710.03 6129.40 5579.26 Additional Paid-In Capital NA NA NA NA Retained Earnings (Accumulated Deficit) 2756.22 1784.69 1495.87 1444.06 Treasury Stock - Common NA NA NA NA Other Equity, Total -37.33 NA NA NA Total Equity 9483.19 8494.73 7625.27 7023.32 Total Liabilities & Shareholders' Equity 38008.35 34832.11 33443.45 29772.26 Shares Outs - Common Stock Primary Issue NA NA NA NA Total Common Shares Outstanding 264.22 263.17 260.03 257.63 attr(,"col_desc") [1] "As of 2013-12-31" "As of 2012-12-31" "As of 2011-12-31" "As of 2010-12-31"
> #Obtenha as Demonstração dos Fluxos de Caixa Anual > viewFin(PCAR4.f,"CF", "A") Annual Cash Flow Statement for PCAR4 2013-12-31 2012-12-31 2011-12-31 2010-12-31 Net Income/Starting Line 1396.21 1156.44 719.66 585.93 Depreciation/Depletion 865.42 834.11 706.49 446.13 Amortization NA NA NA NA Deferred Taxes 89.09 193.35 -57.12 32.47 Non-Cash Items 1909.30 1033.15 1280.23 523.10 Changes in Working Capital 631.93 2082.21 -1521.19 -1226.24 Cash from Operating Activities 4891.95 5299.26 1128.06 361.38 Capital Expenditures -1849.61 -1393.39 -1454.28 -1480.26 Other Investing Cash Flow Items, Total -176.92 54.51 -171.22 52.27 Cash from Investing Activities -2026.53 -1338.88 -1625.50 -1427.99 Financing Cash Flow Items 5371.28 6297.69 6582.05 3863.34 Total Cash Dividends Paid -452.66 -186.39 -183.47 -151.41 Issuance (Retirement) of Stock, Net 16.24 21.31 22.97 35.12 Issuance (Retirement) of Debt, Net -6519.35 -7976.69 -4772.16 -1204.38 Cash from Financing Activities -1584.49 -1844.08 1649.39 2542.67 Foreign Exchange Effects NA NA NA NA Net Change in Cash 1280.92 2116.30 1151.96 1476.07 Cash Interest Paid, Supplemental 720.51 913.10 336.13 182.81 Cash Taxes Paid, Supplemental NA NA NA NA attr(,"col_desc") [1] "12 months ending 2013-12-31" "12 months ending 2012-12-31" "12 months ending 2011-12-31" "12 months ending 2010-12-31"
Preço de Fechamento nos últimos anos:
Preço de Fechamento nas últimas 3 semanas
Muito bom!
ResponderExcluir