Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to add additional Data Series to chart?

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

    How to add additional Data Series to chart?

    Hello, I made this indicator that tracks the Open-Close-Median of the the 30 minute bar. I can see it on a 1-minute chart if I manually add the 30 minute data series. Is there a way to do it without manually adding the second data series?
    Attached Files

    #2
    Hello JohnS52,

    Thank you for your post.

    So I may better assist you, please answer the following questions:
    • When you say you are manually adding the 30 minute data series, do you mean adding that series to the chart visually?
    • When you configure the indicator, which series are you using as the input series?
    • Do you receive any errors on the Log tab of the Control Center? If so, what do the errors report?
    I look forward to your reply.

    Comment


      #3
      Hi Emily,

      By manually adding the 30 minute data series I mean Right Click on chart > Data Series > add the 30 minute on the same panel as the 1 minute.

      When I configuring the indicator I use the default input (e.g. 1 minute).

      Log error messages pertain to the OnBarUpdate trying to create the indicator before it has enough bars. Easy to fix I think.

      Thank you for any assistance.

      Attached Files

      Comment


        #4
        Hello JohnS52,

        Thank you for your reply.

        You are correct; it seems that OnBarUpdate() is trying to access a series before there are enough bars. We have a page about preventing this type of error in the help guide:


        In your script, you have a CurrentBars check of the primary series to see if it is less than 1. You may need to consider your logic and check if there are enough bars to satisfy the period in the added 30 minute series.

        This is what you currently have:
        Code:
        if (CurrentBars[0] < 1)
        return;

        This would check if the added series has enough bars for the SMA period selected:
        Code:
        if (CurrentBars[1] < SMA_period)
        return;
        Please let us know if we may be of further assistance.

        Comment


          #5
          Thank you so much!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          649 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          576 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X