Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instrument List Tools for Yahoo Account

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Instrument List Tools for Yahoo Account

    Since there is still well let's say "room for improvement" in the Instrument Manger, I've written two tools to help me create instrument lists using the Yahoo account. I'm posting them here because maybe they might also help someone else.

    I'm posting this in this section because the current rules don't allow posting anything else than NinjaScript indicators in the file sharing section.

    You can download the tools (including the source for those who do not trust me) from my webspace at:



    The first tool allows to extract stock symbols from an index. The usage is:

    Code:
    StockSymbolsFromIndex <Output file> <Index symbol> <Components> <Server>
     
    e.g.: StockSymbolsFromIndex "Dow Jones Composite Average" DJA 65 download.finance.yahoo.com
    The first parameter specifies the file in which you want the result to be saved (".txt" will be appended automatically so in the example a file called "Dow Jones Composite Average.txt" will be created).

    The output files contains a list of the symbols in the index in this format:

    Code:
    AA;AEP;AES;ALEX;AMR;AXP;BA;BAC;BNI;C;CAL;CAT;CHRW;CNP;CNW;CSX;CVX;D;DD;DIS;DUK;ED;EIX;EXC;EXPD;FDX;FE;FPL;GE;GM;GMT;HD;HPQ;IBM;INTC;JBHT;JBLU;JNJ;JPM;KFT;KO;LSTR;LUV;MCD;MMM;MRK;MSFT;NI;NSC;OSG;PCG;PEG;PFE;PG;R;SO;T;UNP;UPS;UTX;VZ;WMB;WMT;XOM;YRCW;
    You can use this file in the Import Stock Symbols feature of NinjaTrader or copy its contents into the stock symbol import window.

    Note that in the output file there is a new line after every 200 symbols. This is because of a bug in the Market Analyzer (see http://www.ninjatrader-support.com/v...ead.php?t=9630) which cannot load data for more than 200 items at once (with the Yahoo account). By having the data grouped in groups of 200 symbols, you can create instrument lists that do not exceed the supported size (you still have to manually create separate lists of up to 200 symbols each but the grouping in the output file helps you to do so).

    The second parameter is the (Yahoo) ticker symbol of the index whose components you wish to extract. Note that the tool requires the symbol not to start with "^" (this will be automatically added). You can also combine the symbols of multiple indices into one output file (duplicates are automatically discarded) by combining mutliple index symbols with a "+":

    Code:
    StockSymbolsFromIndex "US Stocks" DJA+NDX+GSPC 665 download.finance.yahoo.com
    The statement above will combine all stocks from the DJ Composite Average, the Nasdaq 100 and the S&P 500 into one list.

    You can find the ticker symbols of the indices on the Yahoo Finance websites (http://finance.yahoo.com/, http://de.finance.yahoo.com/, etc.).

    The third parameter is the number of stocks in the index.

    The fourth parameter is the server from which to download the data. Normally this will be "download.finance.yahoo.com". However, some data is only available from some localized versions of the Yahoo Finance website. In this case the respective server must be specified, for example:

    Code:
    StockSymbolsFromIndex "DAX 30" GDAXI 30 de.old.finance.yahoo.com
    Since the Import Stock Symbols feature of NinjaTrader will only import the ticker symbols but not the description for each stock, I've written a second tool which will download and set the description for each stock. The usage is:

    Code:
    UpdateStockNames <Database file>
    e.g.: UpdateStockNames "C:\Users\YourName\Documents\NinjaTrader 6.5\db\NinjaTrader.mdb"
    The parameter of this tool is the location of the NinjaTrader database file.

    Note: This tool messes with the NinjaTrader database so use it at you own risk! I'm not taking responsibility for any damage caused by this tool.

    This tool will only update the description of instruments whose description is empty. Instruments with an existing description will not be modified.

    #2
    Thanks!

    That's an awesome tool, thanks for coding this up! I've tried it and it works perfectly for NDX on download.yahoo.com. But if I try something like RUI or KS200 I don't get any results. Have you tried these indices before?
    Last edited by billitin; 12-18-2008, 10:07 PM.

    Comment


      #3
      This is actually a Yahoo! issue, they just don't offer components for every index. Just go to the page of the symbol you're interested in (e.g. http://finance.yahoo.com/q?s=^RUI or use the search function) and check if "Components" on the left is grayed out or not.

      The components of some inidices (e.g. ^GDAXI) are only available at a localized version (e.g. de.finance.yahoo.com) of Yahoo! Finance. That's why you can specify the server from which to download the data.

      Comment


        #4
        Here's my hack around this:

        (i) Install ActivePerl if you're on Windows which of course you are

        (ii) Find a web page that's listing down all the symbols you want. Grab source HTML code of table from page source and paste it into a file (it'll be input file for the script)

        (iii) Type in command line
        %> perl <this_file_name> <input_file_name> <output_file_name> <column_index>

        (iv) You may want to delete the first few entries representing table header

        This script basically extracts any alphanumeric data from a table column. If it does not work for some particular tables, then just modify the regExp used in the code. Note that some tables may have hidden columns. If it's dynamic content web page you may need to view page generated source.

        The attachment contains an example of ripping tickers off a table at http://online.barrons.com/public/pag...newstox-D.html. Table source code is in file in.txt, output code in out.txt, and the command goes "perl tickerExtractor.pl in.txt out.txt 7". Voila!
        Attached Files
        Last edited by billitin; 12-19-2008, 03:52 AM.

        Comment


          #5
          Looks good.

          Comment


            #6
            The data for futures it seem's that are not avaible from yahoo.

            i find a post on furum about open program.


            the links:

            ***** Backfill Downloader hi folks, Yah00 is planning to provide data at rock bottom price. but the data quality has always been a point of discussion. in order fellow members could feel the quality of the same i made a small application which downloads backfill data from Yah00. feedback for...


            Truedata is the best real-time data vendor in India. Get historical data for NSE, MCX, and tick data for Amibroker and Ninja Trader. Best Indian Real-time NSE Authorized Data Provider.


            Dear fellow traders, I learned a lot from this forum, especially Saint's threads. Inspired by the works/contributions of jdm, cooltetra, pkjha30, satya, ....to name a few, also soumya_b's FiboTrader, I started developing yStock. Of course this is a freeware, and source-code will be given to...




            MY Excel stock tracker - UPDATED 1.3 :) Hil, Still a noobie as far as trading is concerned so cant help much on that ground.. Am a techie so helping in a way I can ... I coded an excel sheet capable of downloading quotes ... So wanted to share it with all you friends.. If you have...


            Hey Guys .. RealTime Data To Metastock, Tradestation Or AdvancedGet can be obtained using a software called HyperServer Lite. HyperServer Lite : HyperServer allows to use TradeStation 2000i with datafeeds that are not supported originally. HyperServer support also...

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Kensonprib, 04-28-2021, 10:11 AM
            5 responses
            191 views
            0 likes
            Last Post Hasadafa  
            Started by GussJ, 03-04-2020, 03:11 PM
            11 responses
            3,229 views
            0 likes
            Last Post xiinteractive  
            Started by andrewtrades, Today, 04:57 PM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            7 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            441 views
            0 likes
            Last Post Delerium  
            Working...
            X