Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 trilliantrader, 04-10-2024, 09:33 PM
          6 responses
          25 views
          0 likes
          Last Post trilliantrader  
          Started by traderqz, Today, 12:06 AM
          5 responses
          10 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Mongo, Today, 11:05 AM
          2 responses
          9 views
          0 likes
          Last Post Mongo
          by Mongo
           
          Started by guillembm, Today, 11:25 AM
          0 responses
          3 views
          0 likes
          Last Post guillembm  
          Started by Tim-c, Today, 10:58 AM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X