Group Abstract Group Abstract

Message Boards Message Boards

0
|
11.4K Views
|
7 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Get historical PE-ratios with FinancialData?

Posted 7 years ago
POSTED BY: Laurens Wachters
7 Replies
Posted 7 years ago
POSTED BY: Rohit Namjoshi
POSTED BY: Laurens Wachters
Posted 7 years ago
Attachments:
POSTED BY: Rohit Namjoshi

Hi Rohit,

Thanks for your help. But how do I convert the result of a free form call for the P/E ratio in a form that one normally gets with FinancialData? In the accompanying notebook I ask in free form the P/E ratio and then, as you recommend, apply InputForm. Is this something that I can use for further calculations? I would prefer to get a list like I am used to get with for instance FinancialData["msft","Close", {{2018, 9, 1}, {2018, 11, 1}}], as shown in the accompanying notebook

Attachments:
POSTED BY: Laurens Wachters
Posted 7 years ago

Hi Laurens,

I can reproduce your results on "11.3.0 for Mac OS X x86 (64-bit) (March 7, 2018)".

It is possible to get the data using free-form input. On a Mac Control = (probably the same on Windows) and type in "msft p/e ratio 2000 to 2018". enter image description here

Evaluation returns a TimeSeries enter image description here

Converting the free-form cell to InputForm gives the following which you can modify and evaluate.

Entity["Financial", "NASDAQ:MSFT"][
   EntityProperty["Financial", 
     "PriceEarningsRatio", 
     {"Date" -> Interval[{DateObject[{2000}], DateObject[{2018}]}]}]]

There are several other financial properties that can be queried using the entity framework.

EntityProperties["Financial"] // CanonicalName

{"AdjustedClose", "AdjustedHigh", "AdjustedLow", "AdjustedOpen", 
"Ask", "AskSize", "Average200Day", "Average50Day", 
"AverageVolume3Month", "Bid", "BidSize", "Change", "Change200Day", 
"Change50Day", "ChangeHigh52Week", "ChangeLow52Week", "CIK", "Close", 
"Company", "CumulativeFractionalChange", "CumulativeReturn", 
"Currency", "Dividend", "DividendPerShare", "DividendYield", 
"EarningsPerShare", "EarningsYield", "EBITDA", "Exchange", 
"FloatShares", "ForeignListing", "FractionalChange", 
"FractionalChange200Day", "FractionalChange50Day", 
"FractionalChangeHigh52Week", "FractionalChangeLow52Week", 
"FundamentalCurrency", "FundFamily", "FundStyle", "High", 
"High52Week", "Image", "IPODate", "Issue", "Last", "LastTradeSize", 
"LatestTrade", "Low", "Low52Week", "MarketCap", "Name", 
"OfficialName", "Open", "OriginalSharePrice", "Price", 
"PriceEarningsRatio", "Range52Week", "RawClose", "RawHigh", "RawLow", 
"RawOpen", "RawVolume", "Return", "Sector", "ShareClassDescription", 
"ShortSymbol", "Symbol", "Type", "Volatility20Day", 
"Volatility250Day", "Volatility50Day", "Volume", "Website"}
POSTED BY: Rohit Namjoshi

Hi Jason,

This is really weird. With the calls FinancialData["MSFT","Close", {2000, 1, 1}] and FinancialData["MSFT","Volume", {2000, 1, 1}] I do get time series, but in the format of a regular list, i.e. not with the prefix TimeSeries, as in your case. With FinancialData["MSFT", "PERatio", {2000, 1, 1}] I only get the latest PE-Ratio. See the accompanying notebook.

I work with Mathematica 11 Home Edition on Windows 10 pro on a PC with Intel i5, . Do you maybe have a different edition of Mathematica? Or should I do something on the settings of the program?

Thanks a lot for your help.

Attachments:
POSTED BY: Laurens Wachters

I don't reproduce - for me the FinancialData call returns a TimeSeries:

enter image description here

The time series has many properties you can query:

In[10]:= msft["Properties"]

Out[10]= {"DatePath", "Dates", "FinancialProperty", "FirstDate", 
"FirstTime", "FirstValue", "LastDate", "LastTime", "LastValue", 
"Path", "PathFunction", "PathLength", "Times", "ValueDimensions", 
"Values"}

And you can visualize it as well:

enter image description here

POSTED BY: Jason Biggs
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard