Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              579 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X