Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

a very newbie question: "blank" ISeries<double>

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

    a very newbie question: "blank" ISeries<double>

    Very sorry for the newbie question: How do I create an ISeries<double> that matches the length of the current (main) series, but is filled with zeroes (const.)
    I think I tried something like:
    new ISeries<double>[Closes[0].Count] but that didn't work as (I guess) any new bar adds to Closes[] and the series is extended, right?

    I simply want to have an ISeries<double> series (think price) that is filled with same const number (say zero)... in order to pass it to an indicator that expects the series of prices...

    #2
    Hi momchi, thanks for posting. You can make it like this:

    Code:
    private Series<int> MyCustomSeries;
    
    else if (State == State.DataLoaded)
    {
      MyCustomSeries = new Series<int>(this);
    }
    
    OnBarUpdate()
    {
    
      MyCustomSeries[0] = 0;
    
    }
    You can also use AddLine() to draw a static line with less performance impact:


    Kind regards,
    -ChrisL

    Comment


      #3
      Thanks Chris, this was helpful!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      598 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      557 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      555 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X