Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

N/A Values

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

    N/A Values

    Consider a custom indicator that exposes a data series thru property the same thing also plots a shape (a dot or triangle) at few important candles. Databox confirms that value exists in data series whenever a shape is plotted on chart.

    What is the best way to detect whenever that indicator has value? Following function based on IsNan does not work.

    Code:
    Dummy  customIndicator = Dummy();
    if (Double.IsNaN(customIndicator.dataSeriesProperty[1]) &&
       !Double.IsNaN(customIndicator.dataSeriesProperty[0]) )
    Indicator code looks like this

    Code:
    namespace NinjaTrader.Indicator
    {
      public class Dummy : Indicator
      { ...
    
        [XmlIgnore]
        [Browsable(false)]
        public DataSeries dataSeriesProperty
        {
          get
          {
            ....
          }
        }
        .....
      } 
    }
    Last edited by cdjindia; 01-11-2014, 10:28 AM.

    #2
    140 Views and no reply? Is it really that complicated?

    Comment


      #3
      From the NinjaTrader Help File for "Data Series Class":

      Checking for Valid Values

      It is possible that you may use a DataSeries object but decide not to set a value for a specific bar. However, you should not try to access a DataSeries value that has not been set. Internally, a dummy value does exist, but you want to check to see if it was a valid value that you set before trying to access it for use in your calculations.


      DataSeries.ContainsValue(int barsAgo)
      Returns a true or false value.

      Comment


        #4
        Hello cdjindia,

        Thank you for your post.

        Harry's post is correct. You will need to use DataSeries.ContainsValue(int barsAgo) to check the value first. For information on the DataSeries Class please visit the following link: http://www.ninjatrader.com/support/h...ries_class.htm

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        602 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        347 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        559 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        558 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X