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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        164 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        319 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        246 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        350 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X