Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

valid value in dataseries

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

    valid value in dataseries

    The invalid values were set into the DataSeries, is this normal? how to avoid that ... only want the if condition to set value.

    if (BarsInProgress == 1){

    if(CurrentBar < 20) return;
    if ( Trend !=1 )// if down trend then conditions to change trend
    {
    if(Closes[1][0] > Highs[2][1]+ TickSize){

    highDataSeries.Set(Highs[
    1][0]);
    lowDataSeries.Set(Lows[
    1][0]);
    Trend =
    1;
    //Print(highDataSeries[0]);
    //Print(lowDataSeries[
    0]);
    }
    }


    Print(highDataSeries[0]);
    Print(lowDataSeries[
    0]);


    ......
    Last edited by solvmatic; 01-26-2012, 10:57 AM.

    #2
    Hello solvmatic,
    Thanks for your post and I am happy to assist you.

    Yes it is normal to have dataseries with null value. You can use Containvalues() method to check whether the dataseries contains the value or not. Please go through this tutorial on data series http://www.ninjatrader.com/support/h...ries_class.htm

    Please refer to this sample code for further reference http://www.ninjatrader.com/support/f...ad.php?t=33061

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thanks
      i fixed it by filling the null value with previous High or Low values
      if(!highDataSeries.ContainsValue(0))
      highDataSeries[
      0]=Highs[1][0];//highDataSeries[1];
      if(!lowDataSeries.ContainsValue(0))
      lowDataSeries[
      0]=Lows[1][0];//lowDataSeries[1];

      Comment


        #4
        Hello,
        Glad you could fix the issue.

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        672 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        577 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X