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

Why DataSeries??

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

    Why DataSeries??

    Hey.

    I've created an indicator which calculates some values (duh...).

    Instead of plotting it using Add() and instantiate DataSeries class, I have created a List<int> and used DrawX() methods etc.

    Am I missing something? I mean, it works great so why going DS from the first place? Is my approach prone to errors?

    #2
    -> instead of a List<int> you can create an IntSeries
    -> I also use List<int>, if I have fewer values than bars on the chart to store
    -> if you have 1 datapoint per bar, it is convenient to use DataSeries, IntSeries or BoolSeries
    -> a DataSeries can be used as an input series for another indicator, your List<int> can certainly not be used for that purpose

    Comment


      #3
      I see.

      1. So if I want to expose some double values to a strategy what should I do?

      2. My indicator needs collections that have a controlled number of elements so using the Series type collections will be a problem cuz if I got it right - they always sync their length with the number of bars loaded on the chart.
      Last edited by savekad; 08-20-2012, 12:18 AM.

      Comment


        #4
        savekad,

        I am happy to assist you.

        Here is a reference sample on exposing values that are not plots : http://www.ninjatrader.com/support/f...ead.php?t=4991

        As far as your second question there, could you elaborate? Why do you need fixed size series here?
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          My indicator generates values and saves them to a List<double>. I need to know what index number each element carries so if I will use the Ninja alternative for a generic list (Series), the list length will keep changing by itself as it sync itself with the amount of bars on chart and the new ones.

          Comment


            #6
            savekad,

            Unfortunately that wouldn't be supported code, but Lists can be used in NinjaTrader as it uses the .NET framework.
            Adam P.NinjaTrader Customer Service

            Comment


              #7
              OK. It does sound a bit vague without a concrete example. I'll post again when I'll stumble across an actual problem.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by kaywai, 09-01-2023, 08:44 PM
              5 responses
              601 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              6 responses
              22 views
              0 likes
              Last Post xiinteractive  
              Started by Pattontje, Yesterday, 02:10 PM
              2 responses
              19 views
              0 likes
              Last Post Pattontje  
              Started by flybuzz, 04-21-2024, 04:07 PM
              17 responses
              230 views
              0 likes
              Last Post TradingLoss  
              Started by agclub, 04-21-2024, 08:57 PM
              3 responses
              17 views
              0 likes
              Last Post TradingLoss  
              Working...
              X