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

Adding Series Dynamically

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

    Adding Series Dynamically

    Hi,

    I have a two part question:

    1. Is there a clean way to load and unload data series at run time? More specifically, suppose I want to load and unload all ES series between 100 and 500 ticks in increments of say 100 ticks.

    So I want to load
    Code:
    AddDataSeries("ES 09-16", BarsPeriodType.Tick, 100);
    then unload it, and load
    Code:
    AddDataSeries("ES 09-16", BarsPeriodType.Tick, 200);
    then unload it, and load
    Code:
    AddDataSeries("ES 09-16", BarsPeriodType.Tick, 300);
    and so on.

    2. Is there an "analyzer" type approach for scanning all charts if a given instrument in a certain range? For example, all tick charts in the range of 100 to 500 ticks, or all time charts in the range of 1 min to 30 min, etc?

    Any suggestions or insight would be greatly appreciated. Thank you.

    #2
    Hello Zeos6,

    There is no way to unload a series after its is constructed with AddDataSeries.

    If you need turn the data off, use a BarsRequest instead.

    Below is a public link to the help guide on BarsRequest.


    (Or just add logic to the script to not do anything when the other BarsInProgress are processing)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply ChelseaB.

      The BarsRequest is an interesting approach but it will not work for my situation because of item 4 in the Notes related to it:

      4.BarsRequest data CANNOT be used as input for a NinjaTrader indicator
      I need to be able to use the series to run a pattern recognition indicator on it. Can you suggest an approach that would not require me adding a whole bunch of series?

      Comment


        #4
        Hello Zeos6,

        I am not aware of any other way.

        To get data there is AddDataSeries() for indicators and strategies and there is BarsRequest.

        There is a feature request for the development to consider allowing BarsRequests as inputs for indicators. I am happy to add your vote to this if you would like.

        Typically, my advice is to add the code from the indicator you were planning to call to the script that does the bars request. It is more work, but it is achievable.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi ChelseaB,

          Yes, please add my vote as well. Thank you.

          Also, do you have any code snippet for the other approach you were suggesting? I'd be interested to look into this further. Thank you.

          Comment


            #6
            Hello Zeos6,

            I do have a few examples of barsRequests.


            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thanks ChelseaB. I will have a look. Appreciate it.

              Comment


                #8
                Hello Zeos6,

                I have received tracking ID #SFT-2517 for your request to be able to supply the bars object from a bars request as an input series to an indicator call.

                Please note it is up to the NinjaTrader Development to decide if or when any request will be implemented.

                Thank you for your input on this. (This one that has my own personal vote as well)
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks ChelseaB. Appreciate it.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by inanazsocial, Today, 01:15 AM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_Jason  
                  Started by rocketman7, Today, 02:12 AM
                  0 responses
                  10 views
                  0 likes
                  Last Post rocketman7  
                  Started by dustydbayer, Today, 01:59 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post dustydbayer  
                  Started by trilliantrader, 04-18-2024, 08:16 AM
                  5 responses
                  23 views
                  0 likes
                  Last Post trilliantrader  
                  Started by Davidtowleii, Today, 12:15 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post Davidtowleii  
                  Working...
                  X