My company name from file?
Author: jeffisw
Creation Date: 3/30/2013 6:49 PM
profile picture

jeffisw

#1
I use a strategy as a stock screener to generate a list of stocks in the debug log window. I would like to list the company name. I want to use my company name instead of the long company name from Fidelity. In the past I use excel VLOOKUP function to search from an excel file. Is there a better way to search the company name by creating an external text file? How can I create the external text file?
profile picture

Eugene

#2
Assuming there's a custom crafted comma- or tab-separated text file at "c:\Users\jeffisw\Documents\MyCompanyName.txt" that looks like this:

QUOTE:
AAPL Apple
BA Boeing


1. We can create the following extension method:

CODE:
Please log in to see this code.


As can be seen, the method can be applied to any string (here: to Bars.Symbol).

P.S. The ugly ExtensionAttribute class goes away only when Fidelity upgrades the built-in Editor.

But should it happen that you don't like the uber-convenient extension method syntax as much as I do, you can extract the MyCompanyName routine (removing the "this" keyword prefacing "string ticker", of course), place it in your strategy and treat it like any other method:

2. Traditional way:

CODE:
Please log in to see this code.

profile picture

jeffisw

#3
Thanks. I am impressed with your level of support.
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).