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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 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
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X