Examining Fundamental Data
Author: LenMoz
Creation Date: 8/16/2019 5:32 PM
profile picture

LenMoz

#1
If you use fundamentals in your strategies, this may be of interest. It's a short script to show the fundamental items for a symbol. It shows the count of data points for each fundamental and the date and value of the latest.

Meant to be run in Single Symbol Backtest (SSB) mode (or comment the "ClearDebug")
CODE:
Please log in to see this code.
Feel free to recommend improvements to this script.
profile picture

Eugene

#2
Thanks for sharing.

A note to the users: GetFundamentalNames in the script requires installed Community Components library.
profile picture

superticker

#3
Thanks for sharing too.

Apparently, you can make the GetFundamentalNames extension method work without explicitly including the "new" operator. (I didn't know that.) So these two lines become one:
CODE:
Please log in to see this code.

And fName.ToString() can be written as fName by itself since it's already a string. There are two instances of that.

I'm attempted to display it in HTML tabular form and post it to the CommentaryWindow() instead of using PrintDebug(). :-)
profile picture

Cone

#4
Output in columns for better readability ...

CODE:
Please log in to see this code.
profile picture

LenMoz

#5
Thanks, Robert!
1. Changed 2nd column width to 46 to accommodate Fidelity's "common shares used to calculate eps diluted". Is there an easy way to right justify the column?
2. You copied my mistake-"Bars.Date[1].ToShortDateString()" should be [0]. (I write in VBA, too)

Update to my question in 1. I'm using...
CODE:
Please log in to see this code.
My self-taught C# doesn't know the fine points. I'm learning.
profile picture

LenMoz

#6
Adding a sort() gives...
CODE:
Please log in to see this code.
profile picture

superticker

#7
This right justifies the numbers. If you're placing an i++ statement by itself, then change i++ to i inside the the String.Format() call. The example below does not use an i++ statement by itself.
CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).