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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        57 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X