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 halgo_boulder, 04-20-2024, 08:44 AM
          2 responses
          21 views
          0 likes
          Last Post halgo_boulder  
          Started by mishhh, 05-25-2010, 08:54 AM
          19 responses
          6,189 views
          0 likes
          Last Post rene69851  
          Started by gwenael, Today, 09:29 AM
          0 responses
          5 views
          0 likes
          Last Post gwenael
          by gwenael
           
          Started by Karado58, 11-26-2012, 02:57 PM
          8 responses
          14,830 views
          0 likes
          Last Post Option Whisperer  
          Started by Option Whisperer, Today, 09:05 AM
          0 responses
          2 views
          0 likes
          Last Post Option Whisperer  
          Working...
          X