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 Data Series Dynamically

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

    Adding Data Series Dynamically

    Nowadays, 26% of the S&P (i.e., my ES trade), is made up of just 6-8 stocks. Often times, I add these stocks with AddDataSeries and create studies and signals based on their movement, volume and divergence with my ES trade. When reading the AddDataSeries() documentation, I notice this comment:

    Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddDataSeries() calls as those hosted scripts would.

    Here are some issues I am having with this. I'm wondering if I am doing something wrong:
    1. When adding data series to both a host and guest script, it takes an abnormally much longer time to load in the chart. If you have five different hosts that need the data to draw or add plots in multiple panes, this becomes impossible to use. Memory usage also seems to climb exponentially.
    2. If you want to modify the list of stocks, you have to do it in every host script that calls the guest script.
    The data from AddDataSeries could really be leveraged if it only needed to be added to a single guest script. This guest could then expose any data the developer wants with public properties. Then various hosts could access those values when the main instrument in the host script is updated (or at any other interval the developer designs) without having the overhead of loading the data.

    The other possible solution is giving the developer the ability to draw in the main pane and add plots to multiple (other) panes from one script which adds the data series once. This would do away with the need for multiple hosts to begin with since those are (mainly) needed to get plots into multiple panes.
    Last edited by swcooke; 09-09-2020, 08:13 AM.

    #2
    Hello swooke,

    Thanks for your feedback.

    Data Series must be added to the host script if it is needed in the guest script. This is a simply a matter of design. What you are interested in is having data series decentralized. For example, if we have one instance of a data series used in a few different places in our workspace, why not use one data series? We have received some feedback here and are tracking under the internal ticket ID SFT-2374. I have added your vote.

    Dynamically adding data series is not currently supported, and we have received a lot of feedback to support it. Much does work already, but anytime data is added dynamically, it should be reverted to hard coded data series if you want to inquiry with us for support. Our internal ticket ID for dynamically adding data series is being tracked under SFT-882. I have added your vote.

    Feature Request Disclaimer.

    We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.

    When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm


    Thanks again for sharing your input.

    JimNinjaTrader Customer Service

    Comment


      #3
      You could use a BarsRequest instead of AddDataSeries. There is more to manage on your own in this case, but it is possible.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment


        #4
        Hello Ralf Pi,

        I have an example of using a BarsRequest.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by James650, 05-07-2024, 08:25 AM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by xepher101, 05-10-2024, 12:19 PM
        5 responses
        66 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Vitamite, Yesterday, 12:48 PM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by aligator, Today, 02:17 PM
        0 responses
        16 views
        0 likes
        Last Post aligator  
        Started by lorem, 04-25-2024, 09:18 AM
        22 responses
        96 views
        0 likes
        Last Post lorem
        by lorem
         
        Working...
        X