How to get market cap?
Author: cheers32
Creation Date: 11/28/2017 3:39 AM
profile picture


Hi, I was trying to read market cap value for any given stock symbol, but it looks like this information is not directly from Fidelity Fundamentals. I think outstanding shares * price maybe an alternative. What is the recommended way to get market cap?

Secondly, could you recommend any past post that contains code sample for retrieving Fidelity Fundamentals? I searched and tried a few using FundamentalDataItems and FundamentalDataSeries but not sure if I used them correctly.

profile picture



The correct name string for market cap can be found in the WealthScript Programming Guide.

Please activate the Fidelity fundamental provider checkbox and update the data before using. For an example of FundamentalDataItems and FundamentalDataSeries usage check out the QuickRef.
profile picture


Actually, market cap is computed as you indicated. Like Eugene said, make sure to select and update Fidelity Fundamental Data for Securities in a Data Manager update. Then the easiest way to get market cap is search for a drag drop condition for it using the Strategy Builder - New Strategy from Rules.
profile picture


Once you're in the Strategy Builder >> Strategy from Rules window, you need to select the Fundamental Ratios folder in the Conditions tab. After dragging and dropping the "Market Capitalization (ttm)" selection from the Fundamental Ratios folder, you can ask the Builder to show you the code generated. This is the first time I've done this, so it took me a while to figure it out. The Market Cap DataSeries is shown as dsRatio below.

If you're targeting Fundamental Ratios, using the Strategy Builder to generate the code is probably the easiest option.
Please log in to see this code.
profile picture


Just in case non-WLP users stumble onto this thread who don't have the "Fundamental Ratios" group in WLD, here's how to get (or calculate) market cap using non-Fidelity data:

* YCharts: multiply the Bars.Close by "[yc] shares_outstanding"

* Morningstar: multiply the Bars.Close by "[mc] Shares Mil"

* StockPup: multiply the Bars.Close by "[sp] Shares" or "[sp] Shares split adjusted"

* Zacks: multiply the Bars.Close by "[z] COMM_SHARES_OUT"

Make sure to adjust for splits using "Split (Yahoo! Finance)" or "Split (Wealth-Data)" item as shown here: "Market Capitalization (ttm)" and index out of range