Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator does not plot first 20 minutes

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

    Indicator does not plot first 20 minutes

    Hello,

    My indicator is not plotting the first 20 minutes of the session. Just to narrow things down, I removed Close[0] and put in just a plain number... same result. First 20 minutes are missing. the indicator is plotting data from a secondary dataseries. Here's pertinent code:
    (screenshot attached)

    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.ControlDarkDa rk), PlotStyle.Line, "Plot0"));

    Add(symbol, PeriodType.Minute, 1);

    }

    protected override void OnBarUpdate()
    {
    // only process secondary [1] bar series (SPY)
    if (BarsInProgress != 1)
    return;

    if (CurrentBar < 1)
    return;

    Values[0].Set( Close[0] );
    }
    Attached Files

    #2
    Did you some how put an "Displacement" value into the indicator entry screen?

    What happens on 10 minute charts? 2 bars missing, or 20?


    Originally posted by ntfred View Post
    Hello,

    My indicator is not plotting the first 20 minutes of the session. Just to narrow things down, I removed Close[0] and put in just a plain number... same result. First 20 minutes are missing. the indicator is plotting data from a secondary dataseries. Here's pertinent code:
    (screenshot attached)

    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.ControlDarkDa rk), PlotStyle.Line, "Plot0"));

    Add(symbol, PeriodType.Minute, 1);

    }

    protected override void OnBarUpdate()
    {
    // only process secondary [1] bar series (SPY)
    if (BarsInProgress != 1)
    return;

    if (CurrentBar < 1)
    return;

    Values[0].Set( Close[0] );
    }

    Comment


      #3
      Displacement = 0.

      Good idea to check other time frames. On a 10min chart there are 20 bars missing, so plotting begins at 10am.

      Comment


        #4
        Originally posted by ntfred View Post
        Displacement = 0.

        Good idea to check other time frames. On a 10min chart there are 20 bars missing, so plotting begins at 10am.
        That is the standard, default BarsRequired setting. You can choose a different value for BarsRequired if you want your plot to start earlier than 20 bars into the chart.

        ref: http://www.ninjatrader.com/support/h...rsrequired.htm

        Comment


          #5
          Thank You! That's the answer. I just found this post which was helpful...



          I couldn't find anything in the documentation about the default value for Indicator BarsRequired, but I changed the code and it worked.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          601 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          347 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
          559 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          558 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X