Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Thousands of DataSeries objects

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

    Thousands of DataSeries objects

    Is it possible to write an indicator that will perform the following tasks:
    1. Read a file containing all stock symbols that I wish to process ( yes I know I can read and parse a file with StreamReader )
    2. For each stock symbol:
    a. Add a PeriodType.Day Bars object
    b. Run the symbol loaded in step a through the Ninja bars analysis so that the OnBarUpdate is called for the symbol loaded in step a.
    c. Unload the stock loaded in step a in order to free memory for the next stock.
    I can’t figure a way to do this. I think the key to get it to work is to have the code that reads the file and loads the Bars object to be outside of the OnBarUpdate() of the primary symbol for which the indicator was loaded to evaluate. The Initialize() method won’t do because there’s no way to continuously run the indicator from there.
    The answer has to be that an indicator loads a Bars object and then somehow runs a secondary indicator, passing that DataSeries over to it for it to accept as the primary dataseries. Is this possible?
    My goal is to analyze the entire stock universe in one batch run.

    #2
    Sounds like you are using an indicator like it is a strategy?

    Are you attempting to test a trading approach on a group of instruments all at the same time? If so, you need to code a strategy not an indicator, and run the strategy analyzer using a backtest of the type NinjaTrader calls "Basket Test".
    I hope that answers your question...

    Comment


      #3
      You are correct that it is my objective to test strategies on lists of stocks. I was not aware of the basket test feature. I looked into it. That’s very useful and may prove to be what I need. I have some follow up questions about it.
      1. I want to be able to backtest on all the stocks of the NYSE, NASDAQ, AMEX. Nearly 8,000 stocks.
      2. The performance results shown in the Strategy Analyzer are useful, but I would like to analyze the results with an external program. Is it possible to export the results?
      I’m primarily interested in the daily time frame. I’m using Kinetick for the data. I have a few questions regarding the data that may be considered separately from this backtesting requirement:
      1. I would like to be able to keep the data for stocks that have become delisted. It’s useful for historical purposes to know what the strategy would have done given the stock universe that was available on the historical dates for which the strategy is running. Does Kinetick ( or another service ) offer stock lists from the major exchanges that contain stocks that have been delisted?
      2. If there’s no service available that meets the requirements in #1 then what I would like to do is begin archiving my own database going forward. If I continually record the OHLC of the currently available stock universe then over time I will have a database of stocks that represents what I want. The problem to solve here is how to load each stock symbol from the database into a bar series in Ninja. That was the objective of my 1st post.
      Finally, this basket test feature may be useful to me but what I would need to do is back test on every stock available on the Kinetick service. How can I create a stock list that has this? The instrument manager only lets the user select one stock at a time to add it to a custom list. Is there a file that I can edit that will allow me to easily create this large list all in one shot?

      Comment


        #4
        I like your style...

        What you are trying to do is extremely unconventional considering the complexity of the setup. The end result of my proejct using NinjaTrader involved very similar things and then some. If you would like further info, I am very generous with my time. But, if you need too much detail as to the implementation, you are turning this into a consultation arrangement. Sorry, time is money. I am getting older.
        Email me for further contact at: [email protected]

        Comment


          #5
          Hey Autotrader,
          I tried you there at [email protected] but the email bounced back to me as undeliverable. Do I have that address correct?

          Comment


            #6
            Sorry

            I was typing quickly and made a mistake. The correct address is [email protected] this email address is processed once nightly at 1:00AM, so you can expect the reply to be sometime in the early morning. Hope I can be of help, sounds like your approach will have a high probability of success.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by PaulMohn, Today, 05:00 AM
            0 responses
            8 views
            0 likes
            Last Post PaulMohn  
            Started by ZenCortexAuCost, Today, 04:24 AM
            0 responses
            6 views
            0 likes
            Last Post ZenCortexAuCost  
            Started by ZenCortexAuCost, Today, 04:22 AM
            0 responses
            3 views
            0 likes
            Last Post ZenCortexAuCost  
            Started by SantoshXX, Today, 03:09 AM
            0 responses
            16 views
            0 likes
            Last Post SantoshXX  
            Started by DanielTynera, Today, 01:14 AM
            0 responses
            5 views
            0 likes
            Last Post DanielTynera  
            Working...
            X