Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetMinMaxvalues and Infinite

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

    GetMinMaxvalues and Infinite

    When looking for values in a dataseries that is set to infinite, there appears to be no index value to search on.

    Is there a work around on this? Or can I set the size to a different value the 256?

    Highbanddata = new DataSeries(this,maximumBarsLookBack.TwoHundredFift ySix);

    Highbanddata = new DataSeries(this, maximumBarsLookBack.Infinite);

    Code:
            public override void GetMinMaxValues(ChartControl chartControl, ref double min, ref double max)
            {    
                if (Bars==null)    return;
    
                int lastBar        = Math.Min(this.LastBarIndexPainted, Bars.Count - 1);
                int firstBar    = this.FirstBarIndexPainted;
            
                min=Double.MaxValue;
                max=Double.MinValue;
                                                            
                for(int index=firstBar;index<=lastBar;index++)
                    {        
                    if ((index<=lastcalcbar) && (index >=Math.Max(1,startbar)))
                    {   
                    min=Math.Min(min,Lowbanddata.Get(index));
                    max=Math.Max(max,Highbanddata.Get(index));
                    }
                    }
            }

    #2
    tinkerz, unfortunately we do not support custom dataseries sizes, it will either need to be infinite or the 256 setting.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    78 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X