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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        45 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        14 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        20 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X