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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          169 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          326 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          252 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          353 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          180 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X