Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Array of Plots

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

    Array of Plots

    Hi,

    would it be possible, instead of declaring plots as

    public DataSeries MyPlot1
    {
    }

    public DataSeries MyPlot2
    {
    }

    etc... to use arrays instead? something like

    public DataSeries MyPlots[0]
    {
    }

    Then values in plots could be referred to as MyPlots[x][y]

    I'm not sure how you would add the plots since they are strings.

    Or possibly a dataseries array pointer?


    Thanks
    Will.

    #2
    Hello Will,

    Thank you for your post.

    Plots will need to be DataSeries to represent a value per bar. If you need multiple dimensions, why not use multiple plots instead?

    Comment


      #3
      Because, when referring to these plots from another indicator it makes it much easier to refer to an array of dataseries, rather than coding a switch statement to determine which plot to refer to.

      Comment


        #4
        Originally posted by dontpanic View Post
        Because, when referring to these plots from another indicator it makes it much easier to refer to an array of dataseries, rather than coding a switch statement to determine which plot to refer to.
        The Plots are already a collection. Maybe I misunderstand?

        Comment


          #5
          or maybe I'm misunderstanding...

          if I have 2 plots in my chart, say MyPlot0 and MyPlot1 I refer to their respective values as MyPlot0[x] and MyPlot1[y].

          I want to be able to refer to them as MyPlots[0][x] and MyPlots[1][y]

          Comment


            #6
            Originally posted by dontpanic View Post
            or maybe I'm misunderstanding...

            if I have 2 plots in my chart, say MyPlot0 and MyPlot1 I refer to their respective values as MyPlot0[x] and MyPlot1[y].
            Those are not Plots: they are indexed values of the Plots; doubles.

            I want to be able to refer to them as MyPlots[0][x] and MyPlots[1][y]
            Plots are already a collection.

            The first defined Plot is Plots[0];
            The second defined Plot is Plots[1] et.c.

            So refer to the Plots collection directly. That collection already exists. There is no MyPlots collection, so that syntax is wrong.

            Comment


              #7
              Perfect,

              I'll give that a go.

              Comment


                #8
                But can I access plot values from Plots[]?

                If I want to access the value of Plots[0] at 5 bars ago, how would I do that? I can't write Plots[0][5] and there are no other properties or methods that I can see to do it.

                hmmm.... would that be GetValue? something like Plots.GetValue(0,5)?
                Last edited by dontpanic; 05-26-2015, 08:50 PM.

                Comment


                  #9
                  Hello dontpanic,

                  Thank you for your response.

                  Use Values[0][x]. Please refer to the following link for information on Values: http://www.ninjatrader.com/support/h...nt7/values.htm

                  Comment


                    #10
                    Got it thanks.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Hwop38, 05-04-2026, 07:02 PM
                    0 responses
                    152 views
                    0 likes
                    Last Post Hwop38
                    by Hwop38
                     
                    Started by CaptainJack, 04-24-2026, 11:07 PM
                    0 responses
                    305 views
                    0 likes
                    Last Post CaptainJack  
                    Started by Mindset, 04-21-2026, 06:46 AM
                    0 responses
                    244 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by M4ndoo, 04-20-2026, 05:21 PM
                    0 responses
                    345 views
                    0 likes
                    Last Post M4ndoo
                    by M4ndoo
                     
                    Started by M4ndoo, 04-19-2026, 05:54 PM
                    0 responses
                    176 views
                    0 likes
                    Last Post M4ndoo
                    by M4ndoo
                     
                    Working...
                    X