Days to Cover
Author: fairone99
Creation Date: 2/27/2017 4:19 AM
profile picture

fairone99

#1
Hi!

I am trying to write a small WLP C# code to test out the Days to Cover (Short Interest)...

First of all, I know that I need to download the Fidelity Security Sentiment Data Set which I did.

Than I have written the following code:

CODE:
Please log in to see this code.


Well, it is not working as expected and the print out for "Days to Cover" is always zero.

What could have gone wrong? Also, I did do some research on how to write a "Days to Cover" check based on Fidelity Security Sentiment Data Set, however, I could not find a good sample for it.

Any suggestion is greatly appreciated, thanks.


Alex
profile picture

Eugene

#2
Hi Alex,

1. Are you sure the item is called "days to cover" precisely (case sensitive)? I've no access to WLP so I cannot verify.
2. You say you have updated the Fidelity Security Sentiment data. Have you added the "days to cover" item to a chart to make sure it contains values?
3. If not, have you checked that you have an entitlement with Fidelity? A glitch in it leaves you without their fundamental data.
profile picture

fairone99

#3
Hi! Eugene,

CODE:
Please log in to see this code.


The above line of code should be correct as when I changed "days" to "Days" and "cover" to "Cover", I will encounter an error complaining about an object (name?). When I use "days to cover", that error goes away.

I have also follow your instruction on checking the data by adding the "days to cover" item to the chart and I do see all these data show up on the chart correctly and it dated back all the way to middle of 2007 (possibly ten years data?)

So now the problem must be hiding inside somewhere in my code, as I do not have any API dictionary for "days to cover"or code sample as good references to code on. Could you point me to find these useful references?

Thank you for your help.


Alex
profile picture

Eugene

#4
I mistakenly thought that the issue is that the fListIF is empty. I didn't put much attention to your empty DaysToCoverSeriesIF DataSeries, thinking that you just left a placeholder for future script development. I should've mentioned it right from the start.

QUOTE:
Well, it is not working as expected and the print out for "Days to Cover" is always zero.

This is correct. Since you did nothing with the series except to initialize it (with zeroes), what else is there to expect?

Here's the fix:
CODE:
Please log in to see this code.


Further reading:

+ QuickRef > FundamentalItem Object
+ QuickRef > Fundamental Data > FundamentalDataSeries

P.S.
QUOTE:
When I use "days to cover", that error goes away.

The easiest way to check is to open the Fundamentals dialog (Ctrl-U).
profile picture

fairone99

#5
Eugene,

You are correct and silly me about trying to get value out of an "empty" data series. ; )

As always, thank you for your help!


Alex

profile picture

Eugene

#6
You're welcome.
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).