Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set for the "Values" collection

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

    Set for the "Values" collection

    Hello

    I have created 12 plots on an indicator.
    I am trying to affect each of them a value in a loop but the following instruction is generating an error message at compiling

    Values[n+m][0].set(Values[n+m][1]+ L_Pas[n]);

    CS1061 'type' does not contain a definition for 'member' and no extension method 'name' accepting a first argument of type 'type' could be found (are you missing a using directive or an assembly reference?).

    I understand that where is nothing like a set method for the collection Values

    The reason for the loop is that I don't want to duplicate the code 12 times juste because the name of the final plot is different

    Can anyone see any workaround ?

    Lionel

    #2
    Lionel, have just replied to your email to support as well. Would you see the same issue with a capitalized .Set call?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Set and not Set

      Thanks for the fast reply, but replacing "set" by "Set" doesn't change anything, same error.

      Lionel

      Comment


        #4
        Lionel, are you sure this would resolve to a double value then as expected by the .Set?

        Values[n+m][1]+ L_Pas[n]

        Would you mind sending me a snippet I could give a run here on my end? You can contact me under the email ticket we had open, if you don't want to post it here.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I have send you a mail

          Lionel

          Comment


            #6
            Originally posted by Lionel92 View Post
            Hello

            I have created 12 plots on an indicator.
            I am trying to affect each of them a value in a loop but the following instruction is generating an error message at compiling

            Values[n+m][0].set(Values[n+m][1]+ L_Pas[n]);

            CS1061 'type' does not contain a definition for 'member' and no extension method 'name' accepting a first argument of type 'type' could be found (are you missing a using directive or an assembly reference?).

            I understand that where is nothing like a set method for the collection Values

            The reason for the loop is that I don't want to duplicate the code 12 times juste because the name of the final plot is different

            Can anyone see any workaround ?

            Lionel
            Values[n+m][0] is itself a double. You cannot set a double. Try:
            Code:
            [COLOR=red][B]Values[n+m].S[/B][/COLOR]et(Values[n+m][1]+ L_Pas[n]);
            That is, drop the indexer, and capitalize the Set directive.

            Comment


              #7
              many thanks for this reply .

              I am assuming that it will set the current value of the plot "series".

              I don't need it right now but just for my understanding. If we use Values (and not value) we cannot set a bar different from the current bar. Am i correct

              Lionel
              Last edited by Lionel92; 03-28-2013, 08:12 AM.

              Comment


                #8
                Originally posted by Lionel92 View Post
                many thanks for this reply .

                I am assuming that it will set the current value of the plot "series".

                I don't need it right know but just for my understanding. If we use Values (and not value) we cannot set a bar different from the current bar. Am i correct

                Lionel
                As far as I can tell, Values[] is just the DataSeries array that NT uses as the default backing store for Plots. I do not see any reason why you cannot treat the members like any other DataSeries when it comes to setting values.

                Comment


                  #9
                  if i can't use

                  "Values [2][1].Set(something)"

                  how can I access the second bar of the 3rd plot series?

                  Comment


                    #10
                    Originally posted by Lionel92 View Post
                    if i can't use

                    "Values [2][1].Set(something)"

                    how can I access the second bar of the 3rd plot series?
                    Code:
                    Values[2].Set(1, theValueToWhichItIsToBeSet);
                    Which is rather clearly explained when you look in the NT Help at the DataSeries entry.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by bortz, 11-06-2023, 08:04 AM
                    47 responses
                    1,606 views
                    0 likes
                    Last Post aligator  
                    Started by jaybedreamin, Today, 05:56 PM
                    0 responses
                    9 views
                    0 likes
                    Last Post jaybedreamin  
                    Started by DJ888, 04-16-2024, 06:09 PM
                    6 responses
                    19 views
                    0 likes
                    Last Post DJ888
                    by DJ888
                     
                    Started by Jon17, Today, 04:33 PM
                    0 responses
                    6 views
                    0 likes
                    Last Post Jon17
                    by Jon17
                     
                    Started by Javierw.ok, Today, 04:12 PM
                    0 responses
                    15 views
                    0 likes
                    Last Post Javierw.ok  
                    Working...
                    X