Analyze stock price fluctuations using R language

Source: Internet
Author: User
Tags stock prices

Read the R language today. Take a note.

Use the R language to read Yahoo wealth data. Analysis of Microsoft Corporation (stock code: MSFT) in 2015 when the share price fluctuated more than 10% of the date.

Then by retrieving the news of the way to see what happened to Microsoft that day, causing the stock price fluctuations.

First, read the stock price information:

Getsymbols ("MSFT", src= "Yahoo", from= "2015-1-1", to= "2015-12-31")

Then use CL to read the closing price, using the Delt function to analyze the difference from the previous day.

Finally, the plot function plot is used to display the analysis results.

Finally, the resulting graph is:

Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity /center "/>

Depending on the graph and output, the stock prices of "2015-4-24" and "2015-10-23" are more than 10% fluctuations in the two days.

Find, Baidu History news, see what happened on the day of fluctuations.



Can see on April 24, Microsoft released the financial report.

It's just that. It looks a little strange. April How did you publish the three-quarter financial report?




Take a look down October 23, what happened to Microsoft.

Can see Microsoft Microsoft released 2016 first quarter of the financial report.

Oh, it seems to be their time-setting problem.




In fact. Microsoft will also announce other quarterly financial reports in 2015, and it looks like the stock price is not necessarily rising.


Analyze stock price fluctuations using R language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.