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

dynamically change traded instrument list

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

    dynamically change traded instrument list

    Hello. I developed a strategy that applies to all stocks in Russell 3000 Index. However, on a particular day, only a small number of stocks are traded. The stock symbols traded on a particular day are pre-determined and can be imported daily from a file. In the Initialize() method, do I need to add all 3000 stocks, or is there a way to only add the stocks traded for a particular day and change that list dynamically? Thank you for your help!

    #2
    Hi Tony, welcome to our forums here - unfortunately dynamically adding symbols would not be something we can support - it's on our list for future consideration though (I've added a vote into this tracking item on your behalf). So one way would be adding in all stocks and then drive logic dynamically per your file for the day, or to amend the Initialize() as needed on changes, but this would mean code changes as well, as the # of instruments that would be traded each day (as I understand) could vary.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand. Thank you for your reply. You mentioned that I can amend the Initialize() method as needed to change the traded instrument list. My understanding is that this approach only works for live trading, where I can program to add the instruments traded for the given trading day. How do I do it for backtesting over multiple days? My understanding is that the Initialize() method only runs once when the backtest is started, therefore the instrument list cannot change over the backtest period. Is that correct? Thanks.

      Comment


        #4
        Hi Tony, yes that understanding is unfortunately correct - in the backtest you could not recall Initialize() to add another selection in on a per day basis. So here you would add in all you need and process logic as desired per BarsInProgress then.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand, I'm assuming this functionality that tonyz wants to do is not implemented yet. If that's correct, could you add a vote on my behalf with development? I'd like to do similar stuff to what tonyz's talking about. Thanks!

          Comment


            #6
            Hello upshot,

            Thanks for your reply.

            This would have to be coded into the BarsInProgress, it would not be possible to call Initialize() like this.
            Last edited by NinjaTrader_Brandon; 03-27-2014, 02:56 PM.
            BrandonNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jpeep, 08-16-2020, 08:31 AM
            17 responses
            502 views
            0 likes
            Last Post notenufftime  
            Started by ETFVoyageur, 05-07-2024, 07:05 PM
            15 responses
            124 views
            0 likes
            Last Post ETFVoyageur  
            Started by esmall, Today, 07:14 PM
            0 responses
            11 views
            0 likes
            Last Post esmall
            by esmall
             
            Started by Option Whisperer, 05-09-2024, 07:58 PM
            6 responses
            26 views
            0 likes
            Last Post Option Whisperer  
            Started by rayyyu12, Today, 05:38 PM
            0 responses
            13 views
            0 likes
            Last Post rayyyu12  
            Working...
            X