• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ContainsValue

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

    ContainsValue

    Hello,Support!

    Is there a way to have ContainsValue for the maximum bars,sort of like ContainsValue(infinite)?So it would keep the value for the infinite lookback period.So far i just have to store values via comma,like ContainsValue(0) || ContainsValue(1) || (2).......etc....Is there any workaroud?

    Thanks!

    #2
    Hello outsource,

    Thank you for your post.

    There is no option such as what you described. However, what are you attempting here? To verify that all points are valid in the entire data set? I would say a loop could do this but I assuming you plan to run this on every bar update in OnBarUpdate(), is this correct?
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello outsource,

      Thank you for your post.

      To verify that all points are valid in the entire data set? I would say a loop could do this but I assuming you plan to run this on every bar update in OnBarUpdate(), is this correct?
      Hi,Patrick,

      Yes and Yes.I want to keep signal for the entire data set and run it on OnBarUpdate.

      Comment


        #4
        Hello outsource,

        Thank you for your response.

        Looping through the entire data set on every bar update would not be advisable as it is likely to cause a performance issue. I would recommend just checking ContainsValue on the current bars ago value (0/zero). This would verify the value on each bar that updates.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello outsource,

          Thank you for your response.

          Looping through the entire data set on every bar update would not be advisable as it is likely to cause a performance issue. I would recommend just checking ContainsValue on the current bars ago value (0/zero). This would verify the value on each bar that updates.
          Thanks,Patrick,can you please clarify value(0/zero)?Zero should be devided by zero?

          Comment


            #6
            I meant to clarify as zero, not divide by zero. So barsAgo value 0 (zero).
            Patrick H.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_PatrickH View Post
              I meant to clarify as zero, not divide by zero. So barsAgo value 0 (zero).
              It doesnt update with every new bar like you said if i set value to zero.

              Comment


                #8
                Originally posted by outsource View Post
                It doesnt update with every new bar like you said if i set value to zero.
                Can you describe the behavior you are seeing? What is not working? What is occurring?
                Patrick H.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_PatrickH View Post
                  Can you describe the behavior you are seeing? What is not working? What is occurring?
                  When i set ContainsValue(0),it just opens a position at a bar[0].It doesn`t update the signal with ech new bar.

                  Comment


                    #10
                    Originally posted by outsource View Post
                    When i set ContainsValue(0),it just opens a position at a bar[0].It doesn`t update the signal with ech new bar.
                    You should really post some sample code with your issue.

                    Maybe Koganam has an idea of what you are doing, but I can't make sense of it. Which probably means there is an easier way to do it than what you are trying to do.

                    http://www.dotnetperls.com/containsvalue

                    Comment


                      #11
                      Hello outsource,

                      Thank you for your response.

                      Would you be able to provide some sample code that demonstrates what you are trying to detail?
                      Patrick H.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by iq200, Today, 10:21 AM
                      1 response
                      4 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by lunardiplomacy, Today, 07:52 AM
                      1 response
                      18 views
                      0 likes
                      Last Post caveat_lector  
                      Started by rayko, Today, 10:20 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post rayko
                      by rayko
                       
                      Started by derivtrader, Today, 10:14 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post derivtrader  
                      Started by Mindset, Today, 10:06 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Working...
                      X