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.
    Emily C.NinjaTrader Customer Service

    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.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Thank you so much!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,967 views
          3 likes
          Last Post jhudas88  
          Started by rbeckmann05, Today, 06:48 PM
          0 responses
          4 views
          0 likes
          Last Post rbeckmann05  
          Started by rhyminkevin, Today, 04:58 PM
          4 responses
          55 views
          0 likes
          Last Post dp8282
          by dp8282
           
          Started by iceman2018, Today, 05:07 PM
          0 responses
          6 views
          0 likes
          Last Post iceman2018  
          Started by lightsun47, Today, 03:51 PM
          0 responses
          8 views
          0 likes
          Last Post lightsun47  
          Working...
          X