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 gentlebenthebear, Today, 01:30 AM
              2 responses
              13 views
              0 likes
              Last Post gentlebenthebear  
              Started by Kaledus, Today, 01:29 PM
              2 responses
              7 views
              0 likes
              Last Post Kaledus
              by Kaledus
               
              Started by frankthearm, Yesterday, 09:08 AM
              13 responses
              45 views
              0 likes
              Last Post frankthearm  
              Started by PaulMohn, Today, 12:36 PM
              2 responses
              16 views
              0 likes
              Last Post PaulMohn  
              Started by Conceptzx, 10-11-2022, 06:38 AM
              2 responses
              55 views
              0 likes
              Last Post PhillT
              by PhillT
               
              Working...
              X